summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/archive/archive_gis.result4
-rw-r--r--mysql-test/suite/binlog/include/binlog.test411
-rw-r--r--mysql-test/suite/binlog/include/binlog_cache_stat.test258
-rw-r--r--mysql-test/suite/binlog/include/binlog_incident-master.opt1
-rw-r--r--mysql-test/suite/binlog/include/binlog_incident.inc68
-rw-r--r--mysql-test/suite/binlog/include/binlog_index.inc278
-rw-r--r--mysql-test/suite/binlog/include/binlog_insert_delayed.test71
-rw-r--r--mysql-test/suite/binlog/include/binlog_ioerr.inc37
-rw-r--r--mysql-test/suite/binlog/include/binlog_mysqlbinlog-cp932.inc50
-rw-r--r--mysql-test/suite/binlog/include/binlog_row_annotate.inc193
-rw-r--r--mysql-test/suite/binlog/include/binlog_truncate.test63
-rw-r--r--mysql-test/suite/binlog/include/binlog_write_error.inc108
-rw-r--r--mysql-test/suite/binlog/include/binlog_xa_recover.inc281
-rw-r--r--mysql-test/suite/binlog/include/blackhole.test208
-rw-r--r--mysql-test/suite/binlog/include/ctype_cp932.test468
-rw-r--r--mysql-test/suite/binlog/include/ctype_cp932_binlog.test35
-rw-r--r--mysql-test/suite/binlog/include/ctype_ucs_binlog.result212
-rw-r--r--mysql-test/suite/binlog/include/ctype_ucs_binlog.test64
-rw-r--r--mysql-test/suite/binlog/include/database.test94
-rw-r--r--mysql-test/suite/binlog/include/drop_table.test34
-rw-r--r--mysql-test/suite/binlog/include/drop_temp_table.test176
-rw-r--r--mysql-test/suite/binlog/include/implicit.test28
-rw-r--r--mysql-test/suite/binlog/include/insert_select-binlog.test38
-rw-r--r--mysql-test/suite/binlog/include/mix_innodb_myisam_binlog.test654
-rw-r--r--mysql-test/suite/binlog/include/mix_innodb_myisam_side_effects.test295
-rw-r--r--mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc1923
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result16
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_killed.result89
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result206
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result625
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result60
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result60
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result28
-rw-r--r--mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result98
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result22
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result42
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result14
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ps.result43
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_sp.result174
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_sp_type_row.result227
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result35
-rw-r--r--mysql-test/suite/binlog/r/flashback.result30
-rw-r--r--mysql-test/suite/binlog/r/load_data_stm_view.result1
-rw-r--r--mysql-test/suite/binlog/r/read_only.result128
-rw-r--r--mysql-test/suite/binlog/r/read_only_statement.result128
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test9
-rw-r--r--mysql-test/suite/binlog/t/binlog_database.test6
-rw-r--r--mysql-test/suite/binlog/t/binlog_implicit_commit.test16
-rw-r--r--mysql-test/suite/binlog/t/binlog_incident.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_ioerr.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test95
-rw-r--r--mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test20
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_no_uniqfile_crash.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_annotate.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_binlog.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_cache_stat.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_drop_tbl.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_insert_select.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_blackhole.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_cache_stat.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_insert_select.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ps.test16
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_sp.test82
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_sp_type_row.test108
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_innodb.test16
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_myisam.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test6
-rw-r--r--mysql-test/suite/binlog/t/binlog_write_error.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_xa_recover.test2
-rw-r--r--mysql-test/suite/binlog/t/load_data_stm_view.test4
-rw-r--r--mysql-test/suite/binlog/t/read_only.inc79
-rw-r--r--mysql-test/suite/binlog/t/read_only.test2
-rw-r--r--mysql-test/suite/binlog/t/read_only_statement.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_incident.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index.result2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_ioerr.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.result49
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_write_error.test2
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_xa_recover.test2
-rw-r--r--mysql-test/suite/binlog_encryption/multisource.result2
-rw-r--r--mysql-test/suite/binlog_encryption/multisource.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_binlog_errors.result4
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_binlog_errors.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum_cache.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_corruption.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_gtid_basic.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_incident.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loaddata_local.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loadfile.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_packet.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_relayrotate.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_semi_sync.result6
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_semi_sync.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_skip_replication.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_special_charset.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sporadic_master.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_ssl.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync-slave.opt2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_typeconv.result96
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_typeconv.test2
-rw-r--r--mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result65
-rw-r--r--mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test34
-rw-r--r--mysql-test/suite/compat/maxdb/type_timestamp.result53
-rw-r--r--mysql-test/suite/compat/maxdb/type_timestamp.test29
-rw-r--r--mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result100
-rw-r--r--mysql-test/suite/compat/oracle/r/binlog_stm_ps.result98
-rw-r--r--mysql-test/suite/compat/oracle/r/binlog_stm_sp.result510
-rw-r--r--mysql-test/suite/compat/oracle/r/binlog_stm_sp_package.result268
-rw-r--r--mysql-test/suite/compat/oracle/r/column_compression.result1333
-rw-r--r--mysql-test/suite/compat/oracle/r/empty_string_literal.result181
-rw-r--r--mysql-test/suite/compat/oracle/r/events.result18
-rw-r--r--mysql-test/suite/compat/oracle/r/exception.result409
-rw-r--r--mysql-test/suite/compat/oracle/r/func_case.result7
-rw-r--r--mysql-test/suite/compat/oracle/r/func_concat.result393
-rw-r--r--mysql-test/suite/compat/oracle/r/func_decode.result177
-rw-r--r--mysql-test/suite/compat/oracle/r/func_length.result21
-rw-r--r--mysql-test/suite/compat/oracle/r/func_misc.result319
-rw-r--r--mysql-test/suite/compat/oracle/r/func_pad.result71
-rw-r--r--mysql-test/suite/compat/oracle/r/func_replace.result32
-rw-r--r--mysql-test/suite/compat/oracle/r/func_substr.result87
-rw-r--r--mysql-test/suite/compat/oracle/r/func_time.result31
-rw-r--r--mysql-test/suite/compat/oracle/r/func_trim.result170
-rw-r--r--mysql-test/suite/compat/oracle/r/gis.result6
-rw-r--r--mysql-test/suite/compat/oracle/r/information_schema_parameters.result854
-rw-r--r--mysql-test/suite/compat/oracle/r/keywords.result26
-rw-r--r--mysql-test/suite/compat/oracle/r/misc.result12
-rw-r--r--mysql-test/suite/compat/oracle/r/mysqldump_restore.result38
-rw-r--r--mysql-test/suite/compat/oracle/r/parser.result645
-rw-r--r--mysql-test/suite/compat/oracle/r/ps.result264
-rw-r--r--mysql-test/suite/compat/oracle/r/rpl_mariadb_date.result86
-rw-r--r--mysql-test/suite/compat/oracle/r/rpl_sp_package.result183
-rw-r--r--mysql-test/suite/compat/oracle/r/rpl_sp_package_variables.result38
-rw-r--r--mysql-test/suite/compat/oracle/r/sequence.result77
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result131
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-anonymous.result220
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-code.result1489
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor-decl.result290
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result1506
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor.result979
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-expr.result158
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-goto-debug.result236
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-goto.result913
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-code.result245
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-db.result43
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-package.result96
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-trigger.result44
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-view.result42
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-innodb.result75
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-mdl.result80
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result261
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-security.result322
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package.result2919
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-param.result423
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-row.result3109
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-security.result288
-rw-r--r--mysql-test/suite/compat/oracle/r/sp.result2562
-rw-r--r--mysql-test/suite/compat/oracle/r/statement-expr.result69
-rw-r--r--mysql-test/suite/compat/oracle/r/table_value_constr.result2506
-rw-r--r--mysql-test/suite/compat/oracle/r/trigger.result100
-rw-r--r--mysql-test/suite/compat/oracle/r/truncate.result10
-rw-r--r--mysql-test/suite/compat/oracle/r/type_blob.result26
-rw-r--r--mysql-test/suite/compat/oracle/r/type_clob.result15
-rw-r--r--mysql-test/suite/compat/oracle/r/type_date.result158
-rw-r--r--mysql-test/suite/compat/oracle/r/type_number.result15
-rw-r--r--mysql-test/suite/compat/oracle/r/type_raw.result15
-rw-r--r--mysql-test/suite/compat/oracle/r/type_varchar.result9
-rw-r--r--mysql-test/suite/compat/oracle/r/type_varchar2.result23
-rw-r--r--mysql-test/suite/compat/oracle/r/variables.result39
-rw-r--r--mysql-test/suite/compat/oracle/r/vcol.result23
-rw-r--r--mysql-test/suite/compat/oracle/r/versioning.result16
-rw-r--r--mysql-test/suite/compat/oracle/r/win.result17
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt1
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test117
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_stm_ps.test57
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_stm_sp.test219
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_stm_sp_package.test158
-rw-r--r--mysql-test/suite/compat/oracle/t/column_compression.test84
-rw-r--r--mysql-test/suite/compat/oracle/t/empty_string_literal.test8
-rw-r--r--mysql-test/suite/compat/oracle/t/events.test29
-rw-r--r--mysql-test/suite/compat/oracle/t/exception.test457
-rw-r--r--mysql-test/suite/compat/oracle/t/func_case.test9
-rw-r--r--mysql-test/suite/compat/oracle/t/func_concat.test184
-rw-r--r--mysql-test/suite/compat/oracle/t/func_decode.test98
-rw-r--r--mysql-test/suite/compat/oracle/t/func_length.test18
-rw-r--r--mysql-test/suite/compat/oracle/t/func_misc.test346
-rw-r--r--mysql-test/suite/compat/oracle/t/func_pad.test31
-rw-r--r--mysql-test/suite/compat/oracle/t/func_replace.test22
-rw-r--r--mysql-test/suite/compat/oracle/t/func_substr.test47
-rw-r--r--mysql-test/suite/compat/oracle/t/func_time.test25
-rw-r--r--mysql-test/suite/compat/oracle/t/func_trim.test77
-rw-r--r--mysql-test/suite/compat/oracle/t/gis.test4
-rw-r--r--mysql-test/suite/compat/oracle/t/information_schema_parameters.test127
-rw-r--r--mysql-test/suite/compat/oracle/t/keywords.test29
-rw-r--r--mysql-test/suite/compat/oracle/t/misc.test10
-rw-r--r--mysql-test/suite/compat/oracle/t/mysqldump_restore.test30
-rw-r--r--mysql-test/suite/compat/oracle/t/parser.test461
-rw-r--r--mysql-test/suite/compat/oracle/t/ps.test290
-rw-r--r--mysql-test/suite/compat/oracle/t/rpl_mariadb_date.test38
-rw-r--r--mysql-test/suite/compat/oracle/t/rpl_sp_package.test134
-rw-r--r--mysql-test/suite/compat/oracle/t/rpl_sp_package_variables.test36
-rw-r--r--mysql-test/suite/compat/oracle/t/sequence.test43
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-anchor-row-type-table.test124
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-anonymous.test244
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-cache-invalidate.inc11
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-code.test1057
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-cursor-decl.test295
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test1597
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-cursor.test989
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-expr.test165
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-goto-debug.test178
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-goto.test968
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-code.test182
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-db.test6
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-package.test10
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-trigger.test6
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-view.test6
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml.inc107
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-innodb.test62
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-mdl.test110
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-mysqldump.test94
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package-security.test332
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package.test2684
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-param.inc9
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-param.test363
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-row-vs-var.inc6
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-row.test2411
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-security.test345
-rw-r--r--mysql-test/suite/compat/oracle/t/sp.test2399
-rw-r--r--mysql-test/suite/compat/oracle/t/statement-expr.test86
-rw-r--r--mysql-test/suite/compat/oracle/t/table_value_constr.test1278
-rw-r--r--mysql-test/suite/compat/oracle/t/trigger.test106
-rw-r--r--mysql-test/suite/compat/oracle/t/truncate.test16
-rw-r--r--mysql-test/suite/compat/oracle/t/type_blob.test17
-rw-r--r--mysql-test/suite/compat/oracle/t/type_clob.test10
-rw-r--r--mysql-test/suite/compat/oracle/t/type_date.test103
-rw-r--r--mysql-test/suite/compat/oracle/t/type_number.test9
-rw-r--r--mysql-test/suite/compat/oracle/t/type_raw.test10
-rw-r--r--mysql-test/suite/compat/oracle/t/type_varchar.test9
-rw-r--r--mysql-test/suite/compat/oracle/t/type_varchar2.test19
-rw-r--r--mysql-test/suite/compat/oracle/t/variables.test38
-rw-r--r--mysql-test/suite/compat/oracle/t/vcol.test16
-rw-r--r--mysql-test/suite/compat/oracle/t/versioning.test13
-rw-r--r--mysql-test/suite/compat/oracle/t/win.test22
-rw-r--r--mysql-test/suite/csv/read_only.result2
-rw-r--r--mysql-test/suite/csv/read_only.test1
-rw-r--r--mysql-test/suite/encryption/r/encrypt_and_grep.result4
-rw-r--r--mysql-test/suite/encryption/r/innochecksum.result9
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result10
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-disable.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-first-page-read.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-key-rotation-disable.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-missing-key.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-badkey.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-remove-encryption.result3
-rw-r--r--mysql-test/suite/encryption/r/innodb-spatial-index.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age.result5
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result19
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption.result20
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_discard_import.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result1
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.test3
-rw-r--r--mysql-test/suite/encryption/t/innochecksum.test22
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test18
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.opt4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test11
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.combinations8
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.opt6
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.test1
-rw-r--r--mysql-test/suite/encryption/t/innodb-first-page-read.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb-force-corrupt.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb-key-rotation-disable.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.opt3
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test1
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.opt2
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb-scrub-log.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption-page-compression.test4
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption.test20
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_discard_import.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test3
-rw-r--r--mysql-test/suite/engines/funcs/r/sq_error.result8
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_reset_slave.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_stm_max_relay_size.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_stm_reset_slave.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/sq_error.test8
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_decimal.result4
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_number.result16
-rw-r--r--mysql-test/suite/engines/iuds/r/update_delete_number.result1
-rw-r--r--mysql-test/suite/engines/iuds/t/update_delete_number.test1
-rw-r--r--mysql-test/suite/federated/federated_bug_585688.result8
-rw-r--r--mysql-test/suite/federated/federated_partition.result5
-rw-r--r--mysql-test/suite/federated/federated_partition.test1
-rw-r--r--mysql-test/suite/federated/federatedx.result16
-rw-r--r--mysql-test/suite/federated/federatedx.test21
-rw-r--r--mysql-test/suite/federated/federatedx_versioning.result100
-rw-r--r--mysql-test/suite/federated/federatedx_versioning.test78
-rw-r--r--mysql-test/suite/federated/timestamps.result64
-rw-r--r--mysql-test/suite/federated/timestamps.test45
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_schemata.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_triggers.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_views.inc6
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_priv.inc26
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc14
-rw-r--r--mysql-test/suite/funcs_1/datadict/tables2.inc2
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_10.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result116
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result176
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0407.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result42
-rw-r--r--mysql-test/suite/funcs_1/r/is_basics_mixed.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_check_constraints.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_column_privileges.result65
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns.result1
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result18
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result18
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result64
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result59
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage.result33
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result33
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines_embedded.result18
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges.result34
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result1
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata.result3
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata_embedded.result3
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result58
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result23
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_privileges.result44
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result44
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_embedded.result52
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_innodb.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result164
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is_embedded.result164
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_memory.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam.result10
-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.result85
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result170
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result13
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers_embedded.result3
-rw-r--r--mysql-test/suite/funcs_1/r/is_user_privileges.result71
-rw-r--r--mysql-test/suite/funcs_1/r/is_views.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_views_embedded.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_10.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result116
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result172
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0407.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result42
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result8
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_10.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result116
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result172
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0407.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views-big.result42
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result192
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result192
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_no_prot.result55
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_ps.result55
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result65
-rw-r--r--mysql-test/suite/funcs_1/t/is_basics_mixed.test6
-rw-r--r--mysql-test/suite/funcs_1/t/is_check_constraints.test3
-rw-r--r--mysql-test/suite/funcs_1/t/is_statistics.test3
-rw-r--r--mysql-test/suite/funcs_1/t/is_table_constraints.test4
-rw-r--r--mysql-test/suite/funcs_1/views/views_master.inc6
-rw-r--r--mysql-test/suite/funcs_2/include/check_charset.inc2
-rw-r--r--mysql-test/suite/funcs_2/r/innodb_charset.result496
-rw-r--r--mysql-test/suite/funcs_2/r/memory_charset.result496
-rw-r--r--mysql-test/suite/funcs_2/r/myisam_charset.result496
-rw-r--r--mysql-test/suite/galera/disabled.def4
-rw-r--r--mysql-test/suite/galera/r/GAL-382.result4
-rw-r--r--mysql-test/suite/galera/r/MDEV-15443.result15
-rw-r--r--mysql-test/suite/galera/r/MW-388.result6
-rw-r--r--mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result2
-rw-r--r--mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result47
-rw-r--r--mysql-test/suite/galera/r/galera_forced_binlog_format.result4
-rw-r--r--mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff103
-rw-r--r--mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result96
-rw-r--r--mysql-test/suite/galera/r/galera_ist_xtrabackup-v2,debug.rdiff114
-rw-r--r--mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result287
-rw-r--r--mysql-test/suite/galera/r/galera_roles.result12
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff116
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result (renamed from mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result)0
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff116
-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_data_dir,debug.rdiff103
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result262
-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_sync_wait_show.result2
-rw-r--r--mysql-test/suite/galera/r/lp1376747-4.result9
-rw-r--r--mysql-test/suite/galera/r/versioning_trx_id.result52
-rw-r--r--mysql-test/suite/galera/t/MDEV-15443.cnf5
-rw-r--r--mysql-test/suite/galera/t/MDEV-15443.test53
-rw-r--r--mysql-test/suite/galera/t/MW-388.test7
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test8
-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.test96
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf15
-rw-r--r--mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test13
-rw-r--r--mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test15
-rw-r--r--mysql-test/suite/galera/t/galera_load_data.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf17
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.test23
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf26
-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.cnf16
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test20
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.cnf17
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.test23
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test14
-rw-r--r--mysql-test/suite/galera/t/lp1376747-4.test12
-rw-r--r--mysql-test/suite/galera/t/versioning_trx_id.cnf1
-rw-r--r--mysql-test/suite/galera/t/versioning_trx_id.test28
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result5
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result22
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf29
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.opt1
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test58
-rw-r--r--mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc2
-rw-r--r--mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result4
-rw-r--r--mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result4
-rw-r--r--mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result18
-rw-r--r--mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result18
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_innodb.result2
-rw-r--r--mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result4
-rw-r--r--mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result4
-rw-r--r--mysql-test/suite/gcol/r/gcol_select_innodb.result8
-rw-r--r--mysql-test/suite/gcol/r/gcol_select_myisam.result10
-rw-r--r--mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result10
-rw-r--r--mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result10
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_basic.result6
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result9
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result4
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_rebuild.result8
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_basic.test1
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug_purge.opt1
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test22
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_rebuild.test2
-rw-r--r--mysql-test/suite/handler/heap.result21
-rw-r--r--mysql-test/suite/handler/heap.test20
-rw-r--r--mysql-test/suite/handler/innodb.test5
-rw-r--r--mysql-test/suite/handler/interface.result22
-rw-r--r--mysql-test/suite/handler/interface.test25
-rw-r--r--mysql-test/suite/heap/heap.result6
-rw-r--r--mysql-test/suite/innodb/include/ibd_convert.pl31
-rw-r--r--mysql-test/suite/innodb/include/innodb-page-compression.inc5
-rw-r--r--mysql-test/suite/innodb/include/innodb_wl6501_crash.inc416
-rw-r--r--mysql-test/suite/innodb/include/innodb_wl6501_crash_temp.inc98
-rw-r--r--mysql-test/suite/innodb/include/truncate_recover.inc8
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff155
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff142
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff147
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm.result124
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm2.result76
-rw-r--r--mysql-test/suite/innodb/r/alter_crash.result44
-rw-r--r--mysql-test/suite/innodb/r/alter_kill.result2
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff42
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff72
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff66
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null.result114
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null_debug,STRICT.rdiff11
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null_debug.result78
-rw-r--r--mysql-test/suite/innodb/r/alter_partitioned.result10
-rw-r--r--mysql-test/suite/innodb/r/alter_primary_key.result26
-rw-r--r--mysql-test/suite/innodb/r/alter_rename_existing.result7
-rw-r--r--mysql-test/suite/innodb/r/alter_varchar_change.result24
-rw-r--r--mysql-test/suite/innodb/r/create-index-debug.result3
-rw-r--r--mysql-test/suite/innodb/r/ddl_purge.result25
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter.result40
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_compatibility.result38
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_create,dynamic.rdiff6
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff10
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_create.result32
-rw-r--r--mysql-test/suite/innodb/r/dml_purge.result47
-rw-r--r--mysql-test/suite/innodb/r/fake_changes-7000.result6
-rw-r--r--mysql-test/suite/innodb/r/file_format_defaults.result45
-rw-r--r--mysql-test/suite/innodb/r/foreign-keys.result2
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result3
-rw-r--r--mysql-test/suite/innodb/r/group_commit_crash.result2
-rw-r--r--mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result2
-rw-r--r--mysql-test/suite/innodb/r/ibuf_not_empty.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-16k.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-debug.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-nullable.result25
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-tempfile.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-timestamp.result36
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result35
-rw-r--r--mysql-test/suite/innodb/r/innodb-changed-pages.result72
-rw-r--r--mysql-test/suite/innodb/r/innodb-corrupted-table.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk-warnings.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-fkcheck.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-debug.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-online-fk.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-online.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-mdev-7513.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-online-alter-gis.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb-page-cleaners.result45
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_default.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lz4.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lzma.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lzo.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_snappy.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_tables.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_zip.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb-system-table-view.result35
-rw-r--r--mysql-test/suite/innodb/r/innodb-table-online.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb-timeout.result60
-rw-r--r--mysql-test/suite/innodb/r/innodb-virtual-columns.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5980-alter.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb.result57
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14147491.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30113362.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug47167.result32
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug51378.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug60229.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug84958.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bulk_create_index_flush.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_file_format.result66
-rw-r--r--mysql-test/suite/innodb/r/innodb_gis.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_information_schema.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_wl6326.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_xtradb_compat.result313
-rw-r--r--mysql-test/suite/innodb/r/instant_alter,32k.rdiff113
-rw-r--r--mysql-test/suite/innodb/r/instant_alter,4k.rdiff306
-rw-r--r--mysql-test/suite/innodb/r/instant_alter,64k.rdiff113
-rw-r--r--mysql-test/suite/innodb/r/instant_alter,8k.rdiff191
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result1507
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_bugs.result204
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_crash.result114
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result284
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_import.result46
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_inject.result66
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_rollback.result40
-rw-r--r--mysql-test/suite/innodb/r/log_corruption.result19
-rw-r--r--mysql-test/suite/innodb/r/log_file_name.result38
-rw-r--r--mysql-test/suite/innodb/r/monitor.result16
-rw-r--r--mysql-test/suite/innodb/r/mvcc.result1
-rw-r--r--mysql-test/suite/innodb/r/read_only_recover_committed.result28
-rw-r--r--mysql-test/suite/innodb/r/row_format_redundant.result2
-rw-r--r--mysql-test/suite/innodb/r/strict_mode.result2
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff42
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k,release.rdiff89
-rw-r--r--mysql-test/suite/innodb/r/table_flags,4k,debug.rdiff133
-rw-r--r--mysql-test/suite/innodb/r/table_flags,4k,release.rdiff92
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff42
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k,release.rdiff89
-rw-r--r--mysql-test/suite/innodb/r/table_flags,8k,debug.rdiff133
-rw-r--r--mysql-test/suite/innodb/r/table_flags,8k,release.rdiff92
-rw-r--r--mysql-test/suite/innodb/r/table_flags,debug.rdiff53
-rw-r--r--mysql-test/suite/innodb/r/table_flags.result57
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result8
-rw-r--r--mysql-test/suite/innodb/r/truncate.result4
-rw-r--r--mysql-test/suite/innodb/r/truncate_debug.result88
-rw-r--r--mysql-test/suite/innodb/r/truncate_inject.result114
-rw-r--r--mysql-test/suite/innodb/r/truncate_purge_debug.result29
-rw-r--r--mysql-test/suite/innodb/r/truncate_restart.result12
-rw-r--r--mysql-test/suite/innodb/r/trx_id_future.result5
-rw-r--r--mysql-test/suite/innodb/r/undo_truncate.result1
-rw-r--r--mysql-test/suite/innodb/r/undo_truncate_recover.result2
-rw-r--r--mysql-test/suite/innodb/r/update_time_wl6658.result10
-rw-r--r--mysql-test/suite/innodb/t/101_compatibility.test5
-rw-r--r--mysql-test/suite/innodb/t/alter_algorithm.combinations11
-rw-r--r--mysql-test/suite/innodb/t/alter_algorithm.inc2
-rw-r--r--mysql-test/suite/innodb/t/alter_algorithm.test145
-rw-r--r--mysql-test/suite/innodb/t/alter_algorithm2.test59
-rw-r--r--mysql-test/suite/innodb/t/alter_copy.opt1
-rw-r--r--mysql-test/suite/innodb/t/alter_crash.opt1
-rw-r--r--mysql-test/suite/innodb/t/alter_crash.test27
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test2
-rw-r--r--mysql-test/suite/innodb/t/alter_missing_tablespace.test1
-rw-r--r--mysql-test/suite/innodb/t/alter_non_null.inc2
-rw-r--r--mysql-test/suite/innodb/t/alter_not_null.combinations5
-rw-r--r--mysql-test/suite/innodb/t/alter_not_null.test102
-rw-r--r--mysql-test/suite/innodb/t/alter_not_null_debug.test72
-rw-r--r--mysql-test/suite/innodb/t/alter_partitioned.test15
-rw-r--r--mysql-test/suite/innodb/t/alter_primary_key.test34
-rw-r--r--mysql-test/suite/innodb/t/alter_rename_existing.test8
-rw-r--r--mysql-test/suite/innodb/t/alter_sql_mode.combinations5
-rw-r--r--mysql-test/suite/innodb/t/alter_sql_mode.inc2
-rw-r--r--mysql-test/suite/innodb/t/alter_varchar_change.test18
-rw-r--r--mysql-test/suite/innodb/t/ddl_purge.test36
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_compatibility.test10
-rw-r--r--mysql-test/suite/innodb/t/dml_purge.test77
-rw-r--r--mysql-test/suite/innodb/t/doublewrite.test12
-rw-r--r--mysql-test/suite/innodb/t/drop_table_background.opt1
-rw-r--r--mysql-test/suite/innodb/t/fake_changes-7000.test9
-rw-r--r--mysql-test/suite/innodb/t/file_format_defaults-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/file_format_defaults.test41
-rw-r--r--mysql-test/suite/innodb/t/foreign-keys.test2
-rw-r--r--mysql-test/suite/innodb/t/group_commit_crash.test4
-rw-r--r--mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test4
-rw-r--r--mysql-test/suite/innodb/t/ibuf_not_empty.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-16k.test16
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-debug.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-nullable.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-timestamp.test39
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test32
-rw-r--r--mysql-test/suite/innodb/t/innodb-changed-pages-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-changed-pages.test63
-rw-r--r--mysql-test/suite/innodb/t/innodb-corrupted-table.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb-enlarge-blob.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-debug.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-mdev-7513.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-online-alter-gis.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-page-cleaners.test100
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test15
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lz4.test14
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzma.test15
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzo.test15
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_tables.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_zip.test14
-rw-r--r--mysql-test/suite/innodb/t/innodb-system-table-view.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online.test20
-rw-r--r--mysql-test/suite/innodb/t/innodb-timeout.test83
-rw-r--r--mysql-test/suite/innodb/t/innodb-trim.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb.test35
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug13510739.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14147491.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug30113362.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47167.test51
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug84958.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bulk_create_index_flush.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_default_row_format.combinations6
-rw-r--r--mysql-test/suite/innodb/t/innodb_default_row_format.inc2
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format.test44
-rw-r--r--mysql-test/suite/innodb/t/innodb_force_recovery.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_wl6326.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_xtradb_compat-master.opt38
-rw-r--r--mysql-test/suite/innodb/t/innodb_xtradb_compat.test160
-rw-r--r--mysql-test/suite/innodb/t/instant_alter.opt1
-rw-r--r--mysql-test/suite/innodb/t/instant_alter.test440
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test207
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_crash.test133
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test321
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_import.test52
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_inject.test46
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_rollback.test51
-rw-r--r--mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test2
-rw-r--r--mysql-test/suite/innodb/t/log_corruption.test142
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test38
-rw-r--r--mysql-test/suite/innodb/t/monitor.test21
-rw-r--r--mysql-test/suite/innodb/t/read_only_recover_committed.test25
-rw-r--r--mysql-test/suite/innodb/t/rename_table_debug.opt1
-rw-r--r--mysql-test/suite/innodb/t/row_format_redundant.test14
-rw-r--r--mysql-test/suite/innodb/t/strict_mode.test2
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test31
-rw-r--r--mysql-test/suite/innodb/t/table_index_statistics.inc59
-rw-r--r--mysql-test/suite/innodb/t/table_index_statistics.test2
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test9
-rw-r--r--mysql-test/suite/innodb/t/tmpdir.test5
-rw-r--r--mysql-test/suite/innodb/t/truncate.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_crash.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_debug.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_debug.test127
-rw-r--r--mysql-test/suite/innodb/t/truncate_foreign.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_inject.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_inject.test97
-rw-r--r--mysql-test/suite/innodb/t/truncate_missing.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_purge_debug.opt4
-rw-r--r--mysql-test/suite/innodb/t/truncate_purge_debug.test49
-rw-r--r--mysql-test/suite/innodb/t/truncate_restart.opt1
-rw-r--r--mysql-test/suite/innodb/t/truncate_restart.test16
-rw-r--r--mysql-test/suite/innodb/t/trx_id_future.test10
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate.opt1
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate.test2
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate_recover.test2
-rw-r--r--mysql-test/suite/innodb/t/update_time_wl6658.test5
-rw-r--r--mysql-test/suite/innodb_fts/r/create.result4
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext.result4
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext2.result1
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext_misc.result6
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext_var.result1
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result46
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-fic.result4
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_misc.result49
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result4
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result10
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result16
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_debug.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/sync_ddl.result12
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext2.test3
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext_var.test9
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test50
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc.test9
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_multiple_index.test2
-rw-r--r--mysql-test/suite/innodb_gis/r/0.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/1.result29
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result62
-rw-r--r--mysql-test/suite/innodb_gis/r/create_spatial_index.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/geometry.result19
-rw-r--r--mysql-test/suite/innodb_gis/r/gis.result29
-rw-r--r--mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result218
-rw-r--r--mysql-test/suite/innodb_gis/r/point_basic.result6
-rw-r--r--mysql-test/suite/innodb_gis/r/precise.result3
-rw-r--r--mysql-test/suite/innodb_gis/r/rollback.result2
-rw-r--r--mysql-test/suite/innodb_gis/t/1.test12
-rw-r--r--mysql-test/suite/innodb_gis/t/alter_spatial_index.test33
-rw-r--r--mysql-test/suite/innodb_gis/t/create_spatial_index.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/geometry.test8
-rw-r--r--mysql-test/suite/innodb_gis/t/gis.test11
-rw-r--r--mysql-test/suite/innodb_gis/t/innodb_gis_rtree.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/precise.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/rollback.test3
-rw-r--r--mysql-test/suite/innodb_zip/include/innodb_wl6501_scale.inc112
-rw-r--r--mysql-test/suite/innodb_zip/r/bug56680.result3
-rw-r--r--mysql-test/suite/innodb_zip/r/create_options.result107
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix.result82
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result40
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result67
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb-zip.result143
-rw-r--r--mysql-test/suite/innodb_zip/r/page_size,4k.rdiff38
-rw-r--r--mysql-test/suite/innodb_zip/r/page_size,8k.rdiff30
-rw-r--r--mysql-test/suite/innodb_zip/r/page_size.result28
-rw-r--r--mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result26
-rw-r--r--mysql-test/suite/innodb_zip/r/wl6501_1.result1202
-rw-r--r--mysql-test/suite/innodb_zip/r/wl6501_crash_3.result462
-rw-r--r--mysql-test/suite/innodb_zip/r/wl6501_crash_4.result519
-rw-r--r--mysql-test/suite/innodb_zip/r/wl6501_crash_5.result462
-rw-r--r--mysql-test/suite/innodb_zip/r/wl6501_scale_1.result345
-rw-r--r--mysql-test/suite/innodb_zip/t/bug56680.test16
-rw-r--r--mysql-test/suite/innodb_zip/t/create_options.test55
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix.test33
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test11
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test27
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb-zip.test101
-rw-r--r--mysql-test/suite/innodb_zip/t/page_size.test9
-rw-r--r--mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test34
-rw-r--r--mysql-test/suite/innodb_zip/t/recover.test3
-rw-r--r--mysql-test/suite/innodb_zip/t/restart.opt1
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_1.opt1
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_1.test451
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt1
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_crash_3.test25
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt1
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_crash_4.test27
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt1
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_crash_5.test25
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt1
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6501_scale_1.test37
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_sjis.result2
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_ucs2.result2
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_ujis.result2
-rw-r--r--mysql-test/suite/jp/r/jp_create_db_utf8.result2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_sjis.test2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_ucs2.test2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_ujis.test2
-rw-r--r--mysql-test/suite/jp/t/jp_create_db_utf8.test2
-rw-r--r--mysql-test/suite/json/r/json_no_table.result2
-rw-r--r--mysql-test/suite/maria/lock.result24
-rw-r--r--mysql-test/suite/maria/lock.test20
-rw-r--r--mysql-test/suite/maria/maria-recover.result1
-rw-r--r--mysql-test/suite/maria/maria.result79
-rw-r--r--mysql-test/suite/maria/maria.test31
-rw-r--r--mysql-test/suite/maria/max_length.result13
-rw-r--r--mysql-test/suite/maria/max_length.test5
-rw-r--r--mysql-test/suite/maria/partition.result4
-rw-r--r--mysql-test/suite/maria/partition.test11
-rw-r--r--mysql-test/suite/maria/ps_maria.result272
-rw-r--r--mysql-test/suite/mariabackup/binlog.result8
-rw-r--r--mysql-test/suite/mariabackup/binlog.test25
-rw-r--r--mysql-test/suite/mariabackup/compress_qpress.result1
-rw-r--r--mysql-test/suite/mariabackup/encrypted_page_compressed.result1
-rw-r--r--mysql-test/suite/mariabackup/encrypted_page_compressed.test3
-rw-r--r--mysql-test/suite/mariabackup/encrypted_page_corruption.result1
-rw-r--r--mysql-test/suite/mariabackup/encrypted_page_corruption.test3
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.test8
-rw-r--r--mysql-test/suite/mariabackup/log_checksum_mismatch.test2
-rw-r--r--mysql-test/suite/mariabackup/system_versioning.result49
-rw-r--r--mysql-test/suite/mariabackup/system_versioning.test50
-rw-r--r--mysql-test/suite/mariabackup/truncate_during_backup.opt1
-rw-r--r--mysql-test/suite/mariabackup/undo_space_id.opt2
-rw-r--r--mysql-test/suite/mariabackup/unencrypted_page_compressed.result1
-rw-r--r--mysql-test/suite/mariabackup/unencrypted_page_compressed.test3
-rw-r--r--mysql-test/suite/mariabackup/xb_aws_key_management.result2
-rw-r--r--mysql-test/suite/mariabackup/xb_compressed_encrypted.opt1
-rw-r--r--mysql-test/suite/multi_source/disabled.def0
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.result5
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.test5
-rw-r--r--mysql-test/suite/multi_source/gtid_slave_pos.result155
-rw-r--r--mysql-test/suite/multi_source/gtid_slave_pos.test173
-rw-r--r--mysql-test/suite/multi_source/info_logs.result12
-rw-r--r--mysql-test/suite/multi_source/multi_parallel.cnf6
-rw-r--r--mysql-test/suite/multi_source/multi_parallel.result64
-rw-r--r--mysql-test/suite/multi_source/multi_parallel.test125
-rw-r--r--mysql-test/suite/multi_source/multi_parallel_loop.inc19
-rw-r--r--mysql-test/suite/multi_source/multisource.result2
-rw-r--r--mysql-test/suite/multi_source/multisource.test2
-rw-r--r--mysql-test/suite/multi_source/reset_slave.result8
-rw-r--r--mysql-test/suite/multi_source/simple.result23
-rw-r--r--mysql-test/suite/multi_source/syntax.result6
-rw-r--r--mysql-test/suite/parts/r/alter_data_directory_innodb.result4
-rw-r--r--mysql-test/suite/parts/r/cache.result15
-rw-r--r--mysql-test/suite/parts/r/fulltext.result6
-rw-r--r--mysql-test/suite/parts/r/optimizer.result4
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_innodb.result2
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result42
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result12
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_innodb.result24
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_myisam.result12
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_innodb.result60
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_myisam.result24
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result30
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result30
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_maria.result36
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_myisam.result36
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result30
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result30
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_maria.result36
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_myisam.result36
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_innodb.result138
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_myisam.result138
-rw-r--r--mysql-test/suite/parts/r/partition_basic_innodb.result48
-rw-r--r--mysql-test/suite/parts/r/partition_basic_myisam.result24
-rw-r--r--mysql-test/suite/parts/r/partition_basic_symlink_myisam.result28
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result12
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result12
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_6.result16
-rw-r--r--mysql-test/suite/parts/r/partition_open.result8
-rw-r--r--mysql-test/suite/parts/r/partition_recover_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_innodb.result4
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_myisam.result4
-rw-r--r--mysql-test/suite/parts/r/print_error.result18
-rw-r--r--mysql-test/suite/parts/r/reorganize_partition_innodb.result4
-rw-r--r--mysql-test/suite/parts/r/show_create.result4
-rw-r--r--mysql-test/suite/parts/t/cache.test22
-rw-r--r--mysql-test/suite/parts/t/fulltext.test9
-rw-r--r--mysql-test/suite/parts/t/partition_debug_innodb-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_12.test1
-rw-r--r--mysql-test/suite/parts/t/partition_open.test24
-rw-r--r--mysql-test/suite/parts/t/print_error.test30
-rw-r--r--mysql-test/suite/percona/disabled.def45
-rw-r--r--mysql-test/suite/percona/have_response_time_distribution.inc4
-rw-r--r--mysql-test/suite/percona/have_response_time_distribution.require2
-rw-r--r--mysql-test/suite/percona/innodb_sys_index.result11
-rw-r--r--mysql-test/suite/percona/innodb_sys_index.test19
-rw-r--r--mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error-master.opt1
-rw-r--r--mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.result16
-rw-r--r--mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.test54
-rw-r--r--mysql-test/suite/percona/percona_flush_contiguous_neighbors-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_flush_contiguous_neighbors.result21
-rw-r--r--mysql-test/suite/percona/percona_flush_contiguous_neighbors.test37
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result4
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test2
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.result28
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.test51
-rw-r--r--mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.result64
-rw-r--r--mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.test45
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes.result55
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes.test49
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes_locks.result23
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes_locks.test24
-rw-r--r--mysql-test/suite/percona/percona_innodb_kill_idle_trx.result41
-rw-r--r--mysql-test/suite/percona/percona_innodb_kill_idle_trx.test28
-rw-r--r--mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.result45
-rw-r--r--mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.test31
-rw-r--r--mysql-test/suite/percona/percona_innodb_kill_idle_trx_show.inc2
-rw-r--r--mysql-test/suite/percona/percona_log_warnings_suppress-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_log_warnings_suppress.result31
-rw-r--r--mysql-test/suite/percona/percona_log_warnings_suppress.test47
-rw-r--r--mysql-test/suite/percona/percona_processlist_row_stats.result70
-rw-r--r--mysql-test/suite/percona/percona_processlist_row_stats.test79
-rw-r--r--mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup88
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-replication.result727
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-replication.test28
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-stored.result544
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-stored.test36
-rw-r--r--mysql-test/suite/percona/percona_query_response_time.result1307
-rw-r--r--mysql-test/suite/percona/percona_query_response_time.test20
-rw-r--r--mysql-test/suite/percona/percona_query_response_time_flush.inc1
-rw-r--r--mysql-test/suite/percona/percona_query_response_time_show.inc8
-rw-r--r--mysql-test/suite/percona/percona_query_response_time_sleep.inc19
-rw-r--r--mysql-test/suite/percona/percona_server_variables.inc3
-rw-r--r--mysql-test/suite/percona/percona_server_variables_debug.result382
-rw-r--r--mysql-test/suite/percona/percona_server_variables_debug.test2
-rw-r--r--mysql-test/suite/percona/percona_server_variables_release.result377
-rw-r--r--mysql-test/suite/percona/percona_server_variables_release.test2
-rw-r--r--mysql-test/suite/percona/percona_show_temp_tables.result58
-rw-r--r--mysql-test/suite/percona/percona_show_temp_tables.test65
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result3
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_control.result12
-rw-r--r--mysql-test/suite/percona/percona_slow_extended-use_global_control.test12
-rw-r--r--mysql-test/suite/percona/percona_sync_flush.result35
-rw-r--r--mysql-test/suite/percona/percona_sync_flush.test33
-rw-r--r--mysql-test/suite/percona/percona_xtradb_bug317074.result5
-rw-r--r--mysql-test/suite/percona/percona_xtradb_bug317074.test48
-rw-r--r--mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.result21
-rw-r--r--mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.test49
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc117
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup88
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result1058
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test5
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc12
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc5
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result21
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test22
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result1057
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test3
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc3
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc7
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result396
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test208
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc8
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result20
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test35
-rw-r--r--mysql-test/suite/percona/query_response_time-replication.inc57
-rw-r--r--mysql-test/suite/percona/query_response_time-stored.inc37
-rw-r--r--mysql-test/suite/percona/query_response_time.inc43
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.result70
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.test57
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.result313
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.test90
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.result567
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.test68
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_flush.inc1
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_show.inc8
-rw-r--r--mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_sleep.inc19
-rw-r--r--mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result69
-rw-r--r--mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test90
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/grep.inc16
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.result18
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.test6
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.result12
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.test4
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result12
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test12
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result25
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test32
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.result3
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.test1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.result3
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.test1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.result9
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.test3
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result9
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test12
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result24
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test23
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result13
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test23
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result25
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test32
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result22
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test51
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result89
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test107
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result94
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test133
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result3
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.result3
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.test1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result46
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test40
-rw-r--r--mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.result12
-rw-r--r--mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.test11
-rw-r--r--mysql-test/suite/percona/userstat_bug602047.result15
-rw-r--r--mysql-test/suite/percona/userstat_bug602047.test12
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_setup.inc16
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc7
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_load.inc11
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result2
-rw-r--r--mysql-test/suite/perfschema/r/dml_handler.result9
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate.result2009
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a.result1337
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result1120
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result637
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result420
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_h.result1792
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u.result1309
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result1092
-rw-r--r--mysql-test/suite/perfschema/r/information_schema.result45
-rw-r--r--mysql-test/suite/perfschema/r/nesting.result266
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result5
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result2
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result2
-rw-r--r--mysql-test/suite/perfschema/r/read_only.result12
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result10
-rw-r--r--mysql-test/suite/perfschema/r/setup_instruments_defaults.result2
-rw-r--r--mysql-test/suite/perfschema/r/sizing_default.result2
-rw-r--r--mysql-test/suite/perfschema/r/sizing_high.result2
-rw-r--r--mysql-test/suite/perfschema/r/sizing_low.result2
-rw-r--r--mysql-test/suite/perfschema/r/sizing_med.result2
-rw-r--r--mysql-test/suite/perfschema/r/sizing_off.result2
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_function.result20
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_global.result20
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_procedure.result20
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_table.result27
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statement_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_nothing.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result90
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result87
-rw-r--r--mysql-test/suite/perfschema/r/start_server_variables.result56
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_off.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result60
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result60
-rw-r--r--mysql-test/suite/perfschema/r/threads_innodb,xtradb.rdiff-disabled10
-rw-r--r--mysql-test/suite/perfschema/r/threads_mysql.result4
-rw-r--r--mysql-test/suite/perfschema/r/view_table_io.result2
-rw-r--r--mysql-test/suite/perfschema/t/dml_handler.test3
-rw-r--r--mysql-test/suite/perfschema/t/information_schema.test30
-rw-r--r--mysql-test/suite/perfschema/t/nesting.test1
-rw-r--r--mysql-test/suite/perfschema/t/ortho_iter.test3
-rw-r--r--mysql-test/suite/perfschema/t/stage_mdl_global-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_off.test3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_variables.test11
-rw-r--r--mysql-test/suite/perfschema_stress/t/read.test1
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result2
-rw-r--r--mysql-test/suite/plugins/r/qc_info.result22
-rw-r--r--mysql-test/suite/plugins/r/qc_info_priv.result6
-rw-r--r--mysql-test/suite/plugins/t/qc_info.test6
-rw-r--r--mysql-test/suite/roles/acl_statistics.result4
-rw-r--r--mysql-test/suite/roles/admin.result92
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result6
-rw-r--r--mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result4
-rw-r--r--mysql-test/suite/roles/create_and_grant_role.result8
-rw-r--r--mysql-test/suite/roles/definer.result10
-rw-r--r--mysql-test/suite/roles/drop_routines.result64
-rw-r--r--mysql-test/suite/roles/flush_roles-17898.result14
-rw-r--r--mysql-test/suite/roles/grant-5771.result14
-rw-r--r--mysql-test/suite/roles/grant_empty.result4
-rw-r--r--mysql-test/suite/roles/grant_proxy-5526.result2
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.result20
-rw-r--r--mysql-test/suite/roles/ip-6401.result4
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.result26
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.result18
-rw-r--r--mysql-test/suite/roles/recursive.result224
-rw-r--r--mysql-test/suite/roles/recursive_dbug.result224
-rw-r--r--mysql-test/suite/roles/revoke_all.result204
-rw-r--r--mysql-test/suite/roles/role_case_sensitive-10744.result10
-rw-r--r--mysql-test/suite/roles/rpl_definer.result28
-rw-r--r--mysql-test/suite/roles/set_and_drop.result8
-rw-r--r--mysql-test/suite/roles/set_default_role_clear.result10
-rw-r--r--mysql-test/suite/roles/set_default_role_for.result18
-rw-r--r--mysql-test/suite/roles/set_default_role_invalid.result26
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.result20
-rw-r--r--mysql-test/suite/roles/set_role-13655.result22
-rw-r--r--mysql-test/suite/roles/set_role-9614.result20
-rw-r--r--mysql-test/suite/roles/set_role-database-recursive.result24
-rw-r--r--mysql-test/suite/roles/set_role-multiple-role.result52
-rw-r--r--mysql-test/suite/roles/set_role-recursive.result72
-rw-r--r--mysql-test/suite/roles/set_role-routine-simple.result38
-rw-r--r--mysql-test/suite/roles/set_role-simple.result16
-rw-r--r--mysql-test/suite/roles/set_role-table-column-priv.result28
-rw-r--r--mysql-test/suite/roles/set_role-table-simple.result28
-rw-r--r--mysql-test/suite/roles/show_create_database-10463.result8
-rw-r--r--mysql-test/suite/roles/show_create_database-10463.test8
-rw-r--r--mysql-test/suite/roles/show_grants.result92
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.result18
-rw-r--r--mysql-test/suite/rpl/disabled.def1
-rw-r--r--mysql-test/suite/rpl/include/check_type.inc70
-rw-r--r--mysql-test/suite/rpl/include/create_recursive_construct.inc405
-rw-r--r--mysql-test/suite/rpl/include/delayed_slave_wait_on_query.inc55
-rw-r--r--mysql-test/suite/rpl/include/multisource.inc304
-rw-r--r--mysql-test/suite/rpl/include/rpl_EE_err.test23
-rw-r--r--mysql-test/suite/rpl/include/rpl_auto_increment.test317
-rw-r--r--mysql-test/suite/rpl/include/rpl_auto_increment_insert_view.test43
-rw-r--r--mysql-test/suite/rpl/include/rpl_auto_increment_invoke_trigger.test79
-rw-r--r--mysql-test/suite/rpl/include/rpl_autoinc_func_invokes_trigger.test55
-rw-r--r--mysql-test/suite/rpl/include/rpl_binlog_errors.inc438
-rw-r--r--mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test452
-rw-r--r--mysql-test/suite/rpl/include/rpl_blackhole.test30
-rw-r--r--mysql-test/suite/rpl/include/rpl_blackhole_basic.test97
-rw-r--r--mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc83
-rw-r--r--mysql-test/suite/rpl/include/rpl_charset.test148
-rw-r--r--mysql-test/suite/rpl/include/rpl_checksum.inc335
-rw-r--r--mysql-test/suite/rpl/include/rpl_checksum_cache.inc261
-rw-r--r--mysql-test/suite/rpl/include/rpl_commit_after_flush.test14
-rw-r--r--mysql-test/suite/rpl/include/rpl_conflicts.test170
-rw-r--r--mysql-test/suite/rpl/include/rpl_corruption.inc175
-rw-r--r--mysql-test/suite/rpl/include/rpl_ddl.test531
-rw-r--r--mysql-test/suite/rpl/include/rpl_deadlock.test142
-rw-r--r--mysql-test/suite/rpl/include/rpl_delete_no_where.test17
-rw-r--r--mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc1047
-rw-r--r--mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test506
-rw-r--r--mysql-test/suite/rpl/include/rpl_extra_col_master.test1023
-rw-r--r--mysql-test/suite/rpl/include/rpl_extra_col_slave.test913
-rw-r--r--mysql-test/suite/rpl/include/rpl_failed_optimize.test28
-rw-r--r--mysql-test/suite/rpl/include/rpl_flsh_tbls.test66
-rw-r--r--mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test83
-rw-r--r--mysql-test/suite/rpl/include/rpl_gtid_basic.inc572
-rw-r--r--mysql-test/suite/rpl/include/rpl_implicit_commit_binlog.test145
-rw-r--r--mysql-test/suite/rpl/include/rpl_incident.inc61
-rw-r--r--mysql-test/suite/rpl/include/rpl_init_slave_errors.inc96
-rw-r--r--mysql-test/suite/rpl/include/rpl_innodb.test171
-rw-r--r--mysql-test/suite/rpl/include/rpl_insert_delayed.test163
-rw-r--r--mysql-test/suite/rpl/include/rpl_insert_id.test559
-rw-r--r--mysql-test/suite/rpl/include/rpl_insert_id_pk.test83
-rw-r--r--mysql-test/suite/rpl/include/rpl_insert_ignore.test121
-rw-r--r--mysql-test/suite/rpl/include/rpl_loaddata.test247
-rw-r--r--mysql-test/suite/rpl/include/rpl_loaddata_local.inc232
-rw-r--r--mysql-test/suite/rpl/include/rpl_loadfile.inc120
-rw-r--r--mysql-test/suite/rpl/include/rpl_loadfile.test32
-rw-r--r--mysql-test/suite/rpl/include/rpl_log.test151
-rw-r--r--mysql-test/suite/rpl/include/rpl_lower_case_table_names.test141
-rw-r--r--mysql-test/suite/rpl/include/rpl_max_relay_size.test118
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixing_engines.inc637
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixing_engines.test1816
-rw-r--r--mysql-test/suite/rpl/include/rpl_multi_query.test26
-rw-r--r--mysql-test/suite/rpl/include/rpl_multi_update.test33
-rw-r--r--mysql-test/suite/rpl/include/rpl_multi_update2.test63
-rw-r--r--mysql-test/suite/rpl/include/rpl_multi_update3.test223
-rw-r--r--mysql-test/suite/rpl/include/rpl_not_null.test360
-rw-r--r--mysql-test/suite/rpl/include/rpl_packet.inc184
-rw-r--r--mysql-test/suite/rpl/include/rpl_parallel.inc2217
-rw-r--r--mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc38
-rw-r--r--mysql-test/suite/rpl/include/rpl_partition.test262
-rw-r--r--mysql-test/suite/rpl/include/rpl_record_compare.test64
-rw-r--r--mysql-test/suite/rpl/include/rpl_relayrotate.inc18
-rw-r--r--mysql-test/suite/rpl/include/rpl_relayrotate.test77
-rw-r--r--mysql-test/suite/rpl/include/rpl_reset_slave.test113
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_001.test96
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_UUID.test77
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_annotate.test185
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_basic.test675
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_blob.test175
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_delayed_ins.test21
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_func003.test81
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_img.test241
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_img_blobs.test179
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_sp002.test208
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_sp003.test79
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_sp006.test84
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_sp007.test46
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_tabledefs.test232
-rw-r--r--mysql-test/suite/rpl/include/rpl_semi_sync.inc551
-rw-r--r--mysql-test/suite/rpl/include/rpl_set_null.test82
-rw-r--r--mysql-test/suite/rpl/include/rpl_show_binlog_events.inc17
-rw-r--r--mysql-test/suite/rpl/include/rpl_show_log_events_with_varying_options.inc11
-rw-r--r--mysql-test/suite/rpl/include/rpl_show_relaylog_events.inc65
-rw-r--r--mysql-test/suite/rpl/include/rpl_skip_replication.inc402
-rw-r--r--mysql-test/suite/rpl/include/rpl_special_charset.inc32
-rw-r--r--mysql-test/suite/rpl/include/rpl_sporadic_master.inc32
-rw-r--r--mysql-test/suite/rpl/include/rpl_ssl.inc115
-rw-r--r--mysql-test/suite/rpl/include/rpl_start_stop_slave.test216
-rw-r--r--mysql-test/suite/rpl/include/rpl_stm_EE_err2.test41
-rw-r--r--mysql-test/suite/rpl/include/rpl_stm_create_if_not_exists.test268
-rw-r--r--mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc107
-rw-r--r--mysql-test/suite/rpl/include/rpl_stop_middle_group.test148
-rw-r--r--mysql-test/suite/rpl/include/rpl_stop_slave.test56
-rw-r--r--mysql-test/suite/rpl/include/rpl_sv_relay_space.test24
-rw-r--r--mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc633
-rw-r--r--mysql-test/suite/rpl/include/rpl_sync_test.inc159
-rw-r--r--mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc82
-rw-r--r--mysql-test/suite/rpl/include/rpl_test_framework.inc85
-rw-r--r--mysql-test/suite/rpl/include/rpl_tmp_table_and_DDL.test159
-rw-r--r--mysql-test/suite/rpl/include/rpl_trig004.test48
-rw-r--r--mysql-test/suite/rpl/include/rpl_truncate.test13
-rw-r--r--mysql-test/suite/rpl/include/rpl_truncate_helper.test29
-rw-r--r--mysql-test/suite/rpl/include/rpl_typeconv.inc78
-rw-r--r--mysql-test/suite/rpl/include/type_conversions.test1272
-rw-r--r--mysql-test/suite/rpl/r/rpl_000011.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_instant.result66
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_errors.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_trigger.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_view.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result58
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_view.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_basic.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_ignored.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_stop_start.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_until.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result66
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix2.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev-11092.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev10863.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev12179.result275
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_only2.result53
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_find_row_debug.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result40
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result69
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result353
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result86
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_sp.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_trans_no_trans.result44
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv.result96
-rw-r--r--mysql-test/suite/rpl/r/rpl_update.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_debug.result2
-rw-r--r--mysql-test/suite/rpl/r/sequence.result129
-rw-r--r--mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result1
-rw-r--r--mysql-test/suite/rpl/t/rpl_000011.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_EE_err.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_instant.test50
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum_cache.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_corruption.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_view.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ddl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_delayed_slave.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_delete_no_where.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_view.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test154
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_basic.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_crash.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_ignored.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4484.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_stop_start.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_until.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave_errors.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_delayed.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev-11092.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev10863.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev12179.test316
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev359.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev382.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev6020.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update3.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_not_null_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_not_null_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only2.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_001.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_UUID.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_annotate_do.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_annotate_dont.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test2
-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_conflicts.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_delayed_ins.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test66
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_find_row_debug.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_blobs.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_min.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_max_relay_size.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mixing_engines.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_reset_slave.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.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.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig004.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_triggers.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_master_shutdown.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test87
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test137
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semisync_ali_issues-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semisync_ali_issues-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test410
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_null_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_null_myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_replication.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_special_charset.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_EE_err2.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_conflicts.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_loadfile.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_multi_query.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_reset_slave.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_sp.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_test_framework.test40
-rw-r--r--mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_trans_no_trans.test72
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_2myisam.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_3innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_update.test15
-rw-r--r--mysql-test/suite/rpl/t/semisync_future-7591.test1
-rw-r--r--mysql-test/suite/rpl/t/semisync_memleak_4066.test1
-rw-r--r--mysql-test/suite/rpl/t/sequence.cnf8
-rw-r--r--mysql-test/suite/rpl/t/sequence.test52
-rw-r--r--mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test1
-rw-r--r--mysql-test/suite/sql_sequence/alter.result251
-rw-r--r--mysql-test/suite/sql_sequence/alter.test162
-rw-r--r--mysql-test/suite/sql_sequence/alter_notembedded.result38
-rw-r--r--mysql-test/suite/sql_sequence/alter_notembedded.test37
-rw-r--r--mysql-test/suite/sql_sequence/aria.result66
-rw-r--r--mysql-test/suite/sql_sequence/aria.test43
-rw-r--r--mysql-test/suite/sql_sequence/auto_increment.result30
-rw-r--r--mysql-test/suite/sql_sequence/auto_increment.test30
-rw-r--r--mysql-test/suite/sql_sequence/binlog.result33
-rw-r--r--mysql-test/suite/sql_sequence/binlog.test27
-rw-r--r--mysql-test/suite/sql_sequence/concurrent_create.result33
-rw-r--r--mysql-test/suite/sql_sequence/concurrent_create.test58
-rw-r--r--mysql-test/suite/sql_sequence/create.result689
-rw-r--r--mysql-test/suite/sql_sequence/create.test517
-rw-r--r--mysql-test/suite/sql_sequence/debug_sync.opt1
-rw-r--r--mysql-test/suite/sql_sequence/debug_sync.result7
-rw-r--r--mysql-test/suite/sql_sequence/debug_sync.test15
-rw-r--r--mysql-test/suite/sql_sequence/default.result187
-rw-r--r--mysql-test/suite/sql_sequence/default.test125
-rw-r--r--mysql-test/suite/sql_sequence/disabled.def0
-rw-r--r--mysql-test/suite/sql_sequence/grant.result60
-rw-r--r--mysql-test/suite/sql_sequence/grant.test67
-rw-r--r--mysql-test/suite/sql_sequence/gtid-master.opt3
-rw-r--r--mysql-test/suite/sql_sequence/gtid-slave.opt4
-rw-r--r--mysql-test/suite/sql_sequence/gtid.result831
-rw-r--r--mysql-test/suite/sql_sequence/gtid.test708
-rw-r--r--mysql-test/suite/sql_sequence/kill.result12
-rw-r--r--mysql-test/suite/sql_sequence/kill.test20
-rw-r--r--mysql-test/suite/sql_sequence/lock.result39
-rw-r--r--mysql-test/suite/sql_sequence/lock.test64
-rw-r--r--mysql-test/suite/sql_sequence/mysqldump.result49
-rw-r--r--mysql-test/suite/sql_sequence/mysqldump.test26
-rw-r--r--mysql-test/suite/sql_sequence/next.result536
-rw-r--r--mysql-test/suite/sql_sequence/next.test282
-rw-r--r--mysql-test/suite/sql_sequence/other.result303
-rw-r--r--mysql-test/suite/sql_sequence/other.test318
-rw-r--r--mysql-test/suite/sql_sequence/partition.result7
-rw-r--r--mysql-test/suite/sql_sequence/partition.test11
-rw-r--r--mysql-test/suite/sql_sequence/read_only.result38
-rw-r--r--mysql-test/suite/sql_sequence/read_only.test44
-rw-r--r--mysql-test/suite/sql_sequence/rebuild.result161
-rw-r--r--mysql-test/suite/sql_sequence/rebuild.test21
-rw-r--r--mysql-test/suite/sql_sequence/rename.result6
-rw-r--r--mysql-test/suite/sql_sequence/rename.test6
-rw-r--r--mysql-test/suite/sql_sequence/replication-master.opt1
-rw-r--r--mysql-test/suite/sql_sequence/replication-slave.opt1
-rw-r--r--mysql-test/suite/sql_sequence/replication.result1094
-rw-r--r--mysql-test/suite/sql_sequence/replication.test883
-rw-r--r--mysql-test/suite/sql_sequence/replication_drop.result5
-rw-r--r--mysql-test/suite/sql_sequence/replication_drop.test17
-rw-r--r--mysql-test/suite/sql_sequence/replication_mixed.result35
-rw-r--r--mysql-test/suite/sql_sequence/replication_mixed.test27
-rw-r--r--mysql-test/suite/sql_sequence/setval.result271
-rw-r--r--mysql-test/suite/sql_sequence/setval.test156
-rw-r--r--mysql-test/suite/sql_sequence/slave_nextval.result108
-rw-r--r--mysql-test/suite/sql_sequence/slave_nextval.test132
-rw-r--r--mysql-test/suite/sql_sequence/temporary.result43
-rw-r--r--mysql-test/suite/sql_sequence/temporary.test43
-rw-r--r--mysql-test/suite/sql_sequence/view.result36
-rw-r--r--mysql-test/suite/sql_sequence/view.test40
-rw-r--r--mysql-test/suite/storage_engine/alter_table_online.result2
-rw-r--r--mysql-test/suite/storage_engine/autoincrement.result20
-rw-r--r--mysql-test/suite/storage_engine/autoincrement.test10
-rw-r--r--mysql-test/suite/storage_engine/create_table.result2
-rw-r--r--mysql-test/suite/storage_engine/misc.result2
-rw-r--r--mysql-test/suite/storage_engine/parts/repair_table.result5
-rw-r--r--mysql-test/suite/storage_engine/repair_table.result1
-rw-r--r--mysql-test/suite/storage_engine/show_table_status.result6
-rw-r--r--mysql-test/suite/storage_engine/show_table_status.test2
-rw-r--r--mysql-test/suite/storage_engine/truncate_table.result16
-rw-r--r--mysql-test/suite/storage_engine/truncate_table.test8
-rw-r--r--mysql-test/suite/sys_vars/disabled.def1
-rw-r--r--mysql-test/suite/sys_vars/inc/secure_timestamp_func.inc49
-rw-r--r--mysql-test/suite/sys_vars/r/alter_algorithm_basic.result89
-rw-r--r--mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/big_tables_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/bind_address_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_basic.resultbin16498 -> 16271 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_server_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/collation_connection_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/collation_server_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/completion_type_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/concurrent_insert_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/connect_timeout_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/default_master_connection_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/default_week_format_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_limit_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_queue_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/event_scheduler_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/expire_logs_days_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/flush_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/identity_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_method_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_partitions_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_blocking_buffer_pool_restore_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_abort_loads.result95
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_restore_at_startup_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_checksum_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_key_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_checkpoint_age_target_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_corrupt_table_action_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_dict_size_limit_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_doublewrite_file_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fake_changes_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fast_checksum_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_basic.result65
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result80
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result71
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_checkpoint_debug_basic.result15
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_method_func.result15
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_neighbor_pages_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ibuf_accel_rate_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ibuf_active_contract_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ibuf_max_size_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_import_table_from_xtrabackup_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_instant_alter_column_allowed_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_kill_idle_transaction_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result102
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_lazy_drop_table_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_block_size_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_changed_pages_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_mtflush_threads_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result37
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_print_lock_wait_timeout_info_basic.result104
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_read_ahead_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_recovery_stats_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_recovery_update_relay_log_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_show_locks_held_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_show_verbose_locks_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_auto_update_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_update_need_lock_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result227
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_func.result90
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_concurrency_timer_based_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_track_changed_pages_basic.result19
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_track_redo_log_now_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_use_global_flush_log_at_trx_commit_basic.result1
-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_stacktrace_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_use_sys_stats_table_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result37
-rw-r--r--mysql-test/suite/sys_vars/r/insert_id_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/local_infile_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/lock_wait_timeout_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/log_disabled_statements_basic.result60
-rw-r--r--mysql-test/suite/sys_vars/r/log_disabled_statements_func.result82
-rw-r--r--mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/log_result_errors_basic.result148
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result36
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_disabled_statements_basic.result72
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_disabled_statements_func.result166
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_filter_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_connect_errors_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_connections_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/old_alter_table_basic.result90
-rw-r--r--mysql-test/suite/sys_vars/r/old_mode_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result32
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_limit_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_purge_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/secure_timestamp_no.result40
-rw-r--r--mysql-test/suite/sys_vars/r/secure_timestamp_rpl.result42
-rw-r--r--mysql-test/suite/sys_vars/r/secure_timestamp_super.result41
-rw-r--r--mysql-test/suite/sys_vars/r/secure_timestamp_yes.result42
-rw-r--r--mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result32
-rw-r--r--mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result4
-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/slave_transaction_retry_errors.result21
-rw-r--r--mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_basic.result126
-rw-r--r--mysql-test/suite/sys_vars/r/slow_launch_time_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/sync_binlog_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sync_frm_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled1236
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff997
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled697
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result611
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff289
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result242
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff348
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result368
-rw-r--r--mysql-test/suite/sys_vars/r/table_definition_cache_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/tcp_keepalive_time.result9
-rw-r--r--mysql-test/suite/sys_vars/r/tx_isolation_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/t/all_vars.test2
-rw-r--r--mysql-test/suite/sys_vars/t/alter_algorithm_basic.test58
-rw-r--r--mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/big_tables_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/bind_address_basic.test95
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_results_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_server_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/collation_connection_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/collation_database_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/collation_server_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/concurrent_insert_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/connect_timeout_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/default_master_connection_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/default_week_format_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_limit_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_queue_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/div_precision_increment_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/event_scheduler_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/expire_logs_days_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/flush_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/identity_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/init_connect_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/init_slave_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_method_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_blocking_buffer_pool_restore_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.opt5
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.test149
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_restore_at_startup_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_checksum_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_key_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_checkpoint_age_target_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_corrupt_table_action_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_dict_size_limit_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_doublewrite_file_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fake_changes_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fast_checksum_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_basic.test61
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test101
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test66
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_checkpoint_debug_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_method_func.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_neighbor_pages_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ibuf_accel_rate_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ibuf_active_contract_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ibuf_max_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_import_table_from_xtrabackup_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_instant_alter_column_allowed_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_kill_idle_transaction_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test82
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_lazy_drop_table_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_block_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_changed_pages_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_mtflush_threads_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test34
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_print_lock_wait_timeout_info_basic.test89
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_read_ahead_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_recovery_stats_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_recovery_update_relay_log_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_show_locks_held_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_show_verbose_locks_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_auto_update_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_update_need_lock_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test240
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_func.test135
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_thread_concurrency_timer_based_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_track_changed_pages_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_track_redo_log_now_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_use_global_flush_log_at_trx_commit_basic.test1
-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_stacktrace_basic.test56
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_use_sys_stats_table_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/insert_id_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/local_infile_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/log_disabled_statements_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/log_disabled_statements_func-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/log_disabled_statements_func.test61
-rw-r--r--mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test53
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test29
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_disabled_statements_basic.test57
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_disabled_statements_func.test92
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_filter_basic.test6
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_connect_errors_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_connections_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/old_alter_table_basic.test28
-rw-r--r--mysql-test/suite/sys_vars/t/old_mode_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_limit_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/read_only_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_purge_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_no-slave.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_no.test4
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_rpl-slave.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_rpl.test4
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_super-slave.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_super.test4
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_yes-slave.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_timestamp_yes.test4
-rw-r--r--mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test4
-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/slave_transaction_retry_errors-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/slave_transaction_retry_errors.test19
-rw-r--r--mysql-test/suite/sys_vars/t/slave_transaction_retry_interval_basic.test190
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/sql_mode_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/sync_binlog_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/sync_frm_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_innodb.test5
-rw-r--r--mysql-test/suite/sys_vars/t/table_definition_cache_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/tcp_keepalive_time.test11
-rw-r--r--mysql-test/suite/sys_vars/t/thread_stack_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/tx_isolation_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test2
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result6
-rw-r--r--mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result12
-rw-r--r--mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result12
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result2
-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_sql_mode.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result25
-rw-r--r--mysql-test/suite/vcol/r/vcol_view_innodb.result2
-rw-r--r--mysql-test/suite/vcol/r/vcol_view_myisam.result2
-rw-r--r--mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc5
-rw-r--r--mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc6
-rw-r--r--mysql-test/suite/versioning/common.inc89
-rw-r--r--mysql-test/suite/versioning/common.opt1
-rw-r--r--mysql-test/suite/versioning/common_finish.inc8
-rw-r--r--mysql-test/suite/versioning/disabled.def (renamed from mysql-test/suite/handler/disabled.def)0
-rw-r--r--mysql-test/suite/versioning/engines.combinations16
-rw-r--r--mysql-test/suite/versioning/engines.inc1
-rw-r--r--mysql-test/suite/versioning/innodb.combinations5
-rw-r--r--mysql-test/suite/versioning/innodb.inc1
-rw-r--r--mysql-test/suite/versioning/key_type.combinations3
-rw-r--r--mysql-test/suite/versioning/key_type.inc14
-rw-r--r--mysql-test/suite/versioning/r/alter.result695
-rw-r--r--mysql-test/suite/versioning/r/auto_increment.result65
-rw-r--r--mysql-test/suite/versioning/r/commit_id.result100
-rw-r--r--mysql-test/suite/versioning/r/create.result526
-rw-r--r--mysql-test/suite/versioning/r/cte.result314
-rw-r--r--mysql-test/suite/versioning/r/debug.result54
-rw-r--r--mysql-test/suite/versioning/r/delete.result132
-rw-r--r--mysql-test/suite/versioning/r/delete_history.result131
-rw-r--r--mysql-test/suite/versioning/r/derived.result295
-rw-r--r--mysql-test/suite/versioning/r/foreign.result429
-rw-r--r--mysql-test/suite/versioning/r/insert.result112
-rw-r--r--mysql-test/suite/versioning/r/insert2.result86
-rw-r--r--mysql-test/suite/versioning/r/load_data.result8
-rw-r--r--mysql-test/suite/versioning/r/online.result117
-rw-r--r--mysql-test/suite/versioning/r/optimized.result75
-rw-r--r--mysql-test/suite/versioning/r/partition.result686
-rw-r--r--mysql-test/suite/versioning/r/partition_innodb.result80
-rw-r--r--mysql-test/suite/versioning/r/partition_rotation.result70
-rw-r--r--mysql-test/suite/versioning/r/replace.result50
-rw-r--r--mysql-test/suite/versioning/r/rpl.result167
-rw-r--r--mysql-test/suite/versioning/r/rpl_mix.result11
-rw-r--r--mysql-test/suite/versioning/r/rpl_row.result14
-rw-r--r--mysql-test/suite/versioning/r/select.result647
-rw-r--r--mysql-test/suite/versioning/r/select2,trx_id.rdiff38
-rw-r--r--mysql-test/suite/versioning/r/select2.result343
-rw-r--r--mysql-test/suite/versioning/r/simple.result200
-rw-r--r--mysql-test/suite/versioning/r/sysvars.result177
-rw-r--r--mysql-test/suite/versioning/r/truncate_privilege.result33
-rw-r--r--mysql-test/suite/versioning/r/trx_id.result500
-rw-r--r--mysql-test/suite/versioning/r/update,trx_id.rdiff16
-rw-r--r--mysql-test/suite/versioning/r/update-big.result25
-rw-r--r--mysql-test/suite/versioning/r/update.result352
-rw-r--r--mysql-test/suite/versioning/r/view.result281
-rw-r--r--mysql-test/suite/versioning/t/alter.test594
-rw-r--r--mysql-test/suite/versioning/t/auto_increment.test50
-rw-r--r--mysql-test/suite/versioning/t/commit_id.test94
-rw-r--r--mysql-test/suite/versioning/t/create.test408
-rw-r--r--mysql-test/suite/versioning/t/cte.test228
-rw-r--r--mysql-test/suite/versioning/t/debug.test35
-rw-r--r--mysql-test/suite/versioning/t/delete.test97
-rw-r--r--mysql-test/suite/versioning/t/delete_history.test144
-rw-r--r--mysql-test/suite/versioning/t/derived.test238
-rw-r--r--mysql-test/suite/versioning/t/foreign.combinations5
-rw-r--r--mysql-test/suite/versioning/t/foreign.test461
-rw-r--r--mysql-test/suite/versioning/t/insert.test82
-rw-r--r--mysql-test/suite/versioning/t/insert2.test86
-rw-r--r--mysql-test/suite/versioning/t/load_data.test12
-rw-r--r--mysql-test/suite/versioning/t/online.test139
-rw-r--r--mysql-test/suite/versioning/t/optimized.test40
-rw-r--r--mysql-test/suite/versioning/t/partition.test657
-rw-r--r--mysql-test/suite/versioning/t/partition_innodb.test94
-rw-r--r--mysql-test/suite/versioning/t/partition_rotation.test58
-rw-r--r--mysql-test/suite/versioning/t/replace.test62
-rw-r--r--mysql-test/suite/versioning/t/rpl.test136
-rw-r--r--mysql-test/suite/versioning/t/rpl_mix.test19
-rw-r--r--mysql-test/suite/versioning/t/rpl_row.test18
-rw-r--r--mysql-test/suite/versioning/t/select.test427
-rw-r--r--mysql-test/suite/versioning/t/select2.test217
-rw-r--r--mysql-test/suite/versioning/t/simple.test89
-rw-r--r--mysql-test/suite/versioning/t/sysvars.test129
-rw-r--r--mysql-test/suite/versioning/t/truncate_privilege.test41
-rw-r--r--mysql-test/suite/versioning/t/trx_id.opt1
-rw-r--r--mysql-test/suite/versioning/t/trx_id.test527
-rw-r--r--mysql-test/suite/versioning/t/update-big.test34
-rw-r--r--mysql-test/suite/versioning/t/update.test289
-rw-r--r--mysql-test/suite/versioning/t/view.test216
-rw-r--r--mysql-test/suite/versioning/wait_system_clock.inc10
-rw-r--r--mysql-test/suite/wsrep/r/variables.result88
-rw-r--r--mysql-test/suite/wsrep/t/variables.test28
2027 files changed, 126496 insertions, 41207 deletions
diff --git a/mysql-test/suite/archive/archive_gis.result b/mysql-test/suite/archive/archive_gis.result
index 80c1e347764..6e7a5a2c1ea 100644
--- a/mysql-test/suite/archive/archive_gis.result
+++ b/mysql-test/suite/archive/archive_gis.result
@@ -507,8 +507,8 @@ down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersects
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
diff --git a/mysql-test/suite/binlog/include/binlog.test b/mysql-test/suite/binlog/include/binlog.test
new file mode 100644
index 00000000000..40befc9d3d1
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog.test
@@ -0,0 +1,411 @@
+#
+# misc binlogging tests that do not require a slave running
+#
+
+-- source include/have_log_bin.inc
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+reset master;
+
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=innodb;
+begin;
+insert t1 values (5);
+commit;
+begin;
+insert t2 values (5);
+commit;
+# first COMMIT must be Query_log_event, second - Xid_log_event
+source include/show_binlog_events.inc;
+drop table t1,t2;
+
+#
+# binlog rotation after one big transaction
+#
+reset master;
+let $1=100;
+
+create table t1 (n int) engine=innodb;
+begin;
+--disable_query_log
+while ($1)
+{
+ eval insert into t1 values($1 + 4);
+ dec $1;
+}
+--enable_query_log
+commit;
+# Make sure binlog checkpoint is logged before DROP TABLE to avoid random
+# result difference.
+--source include/wait_for_binlog_checkpoint.inc
+drop table t1;
+--source include/show_binlog_events.inc
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source include/show_binlog_events.inc
+--let $binlog_file=
+
+#
+# Bug#22540 - Incorrect value in column End_log_pos of
+# SHOW BINLOG EVENTS using InnoDB
+#
+
+# the following tests will show that certain queries now return
+# absolute offsets (from binlog start, rather than relative to
+# the beginning of the current transaction). under what
+# conditions it should be allowed / is sensible to put the
+# slider into the middle of a transaction is not our concern
+# here; we just guarantee that if and when it's done, the
+# user has valid offsets to use. if the setter function still
+# wants to throw a "positioning into middle of transaction"
+# warning, that's its prerogative and handled elsewhere.
+
+set @ac = @@autocommit;
+
+# first show this to work for SHOW BINLOG EVENTS
+
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+commit;
+drop table t1;
+--source include/show_binlog_events.inc
+
+# now show that nothing breaks if we need to read from the cache more
+# than once, resulting in split event-headers
+
+set @bcs = @@binlog_cache_size;
+set global binlog_cache_size=4096;
+reset master;
+
+create table t1 (a int, b char(255)) engine=innodb;
+
+flush status;
+show status like "binlog_cache_use";
+
+let $1=100;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1, 'just to fill void to make transaction occupying at least two buffers of the trans cache' );
+ dec $1;
+}
+commit;
+--echo *** the following must show the counter value = 1 ***
+show status like "binlog_cache_use";
+enable_query_log;
+
+--source include/show_binlog_events.inc
+
+drop table t1;
+
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+
+#
+# Bug#33798: prepared statements improperly handle large unsigned ints
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+reset master;
+create table t1 (a bigint unsigned, b bigint(20) unsigned);
+prepare stmt from "insert into t1 values (?,?)";
+set @a= 9999999999999999;
+set @b= 14632475938453979136;
+execute stmt using @a, @b;
+deallocate prepare stmt;
+drop table t1;
+--source include/show_binlog_events.inc
+
+
+#
+# Bug #39182: Binary log producing incompatible character set query from
+# stored procedure.
+#
+reset master;
+CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+USE bug39182;
+CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+ DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DELIMITER //;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE s1 VARCHAR(255);
+ SET s1= "test";
+ CREATE TEMPORARY TABLE tmp1
+ SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+ SELECT
+ COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+ COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+ COLLATION(s1) c3,
+ COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+ COERCIBILITY(s1) d3;
+ DROP TEMPORARY TABLE tmp1;
+END//
+
+DELIMITER ;//
+
+CALL p1();
+source include/show_binlog_events.inc;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP DATABASE bug39182;
+USE test;
+
+#
+# Bug#35383: binlog playback and replication breaks due to
+# name_const substitution
+#
+DELIMITER //;
+CREATE PROCEDURE p1(IN v1 INT)
+BEGIN
+ CREATE TABLE t1 SELECT v1;
+ DROP TABLE t1;
+END//
+CREATE PROCEDURE p2()
+BEGIN
+ DECLARE v1 INT;
+ CREATE TABLE t1 SELECT v1+1;
+ DROP TABLE t1;
+END//
+CREATE PROCEDURE p3(IN v1 INT)
+BEGIN
+ CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
+ DROP TABLE t1;
+END//
+CREATE PROCEDURE p4(IN v1 INT)
+BEGIN
+ DECLARE v2 INT;
+ CREATE TABLE t1 SELECT 1, v1, v2;
+ DROP TABLE t1;
+ CREATE TABLE t1 SELECT 1, v1+1, v2;
+ DROP TABLE t1;
+END//
+DELIMITER ;//
+
+CALL p1(1);
+CALL p2();
+CALL p3(0);
+CALL p4(0);
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+
+--echo End of 5.0 tests
+
+# Test of a too big SET INSERT_ID.
+# This should generate an error and should not be put in binlog
+# We look at the binlog further down with SHOW BINLOG EVENTS.
+
+reset master;
+create table t1 (id tinyint auto_increment primary key);
+insert into t1 values(5);
+set insert_id=128;
+--error HA_ERR_AUTOINC_ERANGE
+insert into t1 values(null) /* Not binlogged */;
+
+# The followin insert ignore will be put in binlog
+set insert_id=128;
+insert ignore into t1 values(null) /* Insert 128 */;
+
+# Insert with duplicate key error should not go into binglo
+set insert_id=5;
+--error ER_DUP_ENTRY
+insert into t1 values(null) /* Not binlogged */;
+
+# Insert with autogenerated key + duplicate key error should go into binlog
+set insert_id=5;
+insert ignore into t1 values(null) /* Insert 5 */;
+select * from t1;
+drop table t1;
+
+# Same tests but with 2 rows inserted at a time
+
+create table t1 (id tinyint auto_increment primary key) engine=myisam;
+set insert_id=128;
+--error HA_ERR_AUTOINC_ERANGE
+insert into t1 values(5),(null) /* Insert_id 128 */;
+
+# The followin insert ignore will be put in binlog
+set insert_id=128;
+insert ignore into t1 values (4),(null) /* Insert_id 128 */;
+
+# Insert with duplicate key error should not go into binglo
+set insert_id=5;
+--error ER_DUP_ENTRY
+insert into t1 values(3),(null) /* Insert_id 5 */;
+
+# Insert with autogenerated key + duplicate key error should go into binlog
+set insert_id=5;
+insert ignore into t1 values(2),(null) /* Insert_id 5 */;
+select * from t1 order by id;
+drop table t1;
+
+
+# bug#22027
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+
+# bug#22762
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+
+# BUG#25091 (A DELETE statement to mysql database is not logged with
+# ROW mode format): Checking that some basic operations on tables in
+# the mysql database is replicated even when the current database is
+# 'mysql'.
+
+--disable_warnings
+USE mysql;
+INSERT IGNORE INTO user SET host='localhost', user='@#@', password=password('Just a test');
+UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
+DELETE FROM user WHERE host='localhost' AND user='@#@';
+--enable_warnings
+
+use test;
+source include/show_binlog_events.inc;
+drop table t1,t2,t3,tt1;
+
+-- source suite/binlog/include/binlog_insert_delayed.test
+
+#Bug #26079 max_binlog_size + innodb = not make new binlog and hang server
+# server should not hang, binlog must rotate in the end
+reset master;
+--disable_warnings
+drop table if exists t3;
+--enable_warnings
+create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
+--let $binlog_file1= query_get_value(SHOW MASTER STATUS, File, 1)
+--echo File $binlog_file1
+let $it=4;
+while ($it)
+{
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+dec $it;
+}
+--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1)
+--echo *** show new binlog index after rotating ***
+--echo File $binlog_file2
+drop table t3;
+
+--echo #
+--echo # Bug #45998: database crashes when running "create as select"
+--echo #
+CREATE DATABASE test1;
+USE test1;
+DROP DATABASE test1;
+CREATE TABLE test.t1(a int);
+INSERT INTO test.t1 VALUES (1), (2);
+CREATE TABLE test.t2 SELECT * FROM test.t1;
+USE test;
+DROP TABLES t1, t2;
+
+#
+# Bug#46640
+# This test verifies if the server_id stored in the "format
+# description BINLOG statement" will override the server_id
+# of the server executing the statements.
+#
+
+connect (fresh,localhost,root,,test);
+connection fresh;
+
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+
+# Format description event, with server_id = 10;
+BINLOG '
+3u9kSA8KAAAAZgAAAGoAAAABAAQANS4xLjM1LW1hcmlhLWJldGExLWRlYnVnLWxvZwAAAAAAAAAA
+AAAAAAAAAAAAAAAAAADe72RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
+';
+
+# What server_id is logged for a statement? Should be our own, not the
+# one from the format description event.
+INSERT INTO t1 VALUES (1);
+
+# INSERT INTO t1 VALUES (2), with server_id=20. Check that this is logged
+# with our own server id, not the 20 from the BINLOG statement.
+BINLOG '
+3u9kSBMUAAAAKQAAAJEBAAAAABoAAAAAAAAABHRlc3QAAnQxAAEDAAA=
+3u9kSBcUAAAAIgAAALMBAAAQABoAAAAAAAEAAf/+AgAAAA==
+';
+
+# Show binlog events to check that server ids are correct.
+--replace_column 1 # 2 # 5 #
+--replace_regex /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
+
+DROP TABLE t1;
+
+--echo
+--echo # BUG#54903 BINLOG statement toggles session variables
+--echo # ----------------------------------------------------------------------
+--echo # This test verify that BINLOG statement doesn't change current session's
+--echo # variables foreign_key_checks and unique_checks.
+--echo
+CREATE TABLE t1 (c1 INT KEY);
+
+SET @@SESSION.foreign_key_checks= ON;
+SET @@SESSION.unique_checks= ON;
+
+--echo # INSERT INTO t1 VALUES (1)
+--echo # foreign_key_checks=0 and unique_checks=0
+BINLOG '
+dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
+';
+
+SELECT * FROM t1;
+--echo # Their values should be ON
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
+SHOW SESSION VARIABLES LIKE "unique_checks";
+
+--echo
+SET @@SESSION.foreign_key_checks= OFF;
+SET @@SESSION.unique_checks= OFF;
+
+--echo # INSERT INTO t1 VALUES(2)
+--echo # foreign_key_checks=1 and unique_checks=1
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+
+SELECT * FROM t1;
+--echo # Their values should be OFF
+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
+--echo # It should not change current session's variables, even error happens
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+--error 1062
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+
+SELECT * FROM t1;
+--echo # Their values should be OFF
+SHOW SESSION VARIABLES LIKE "foreign_key_checks";
+SHOW SESSION VARIABLES LIKE "unique_checks";
+
+DROP TABLE t1;
+
+disconnect fresh;
+
diff --git a/mysql-test/suite/binlog/include/binlog_cache_stat.test b/mysql-test/suite/binlog/include/binlog_cache_stat.test
new file mode 100644
index 00000000000..c6287a6bad1
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_cache_stat.test
@@ -0,0 +1,258 @@
+# Embedded server doesn't support binlog
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+# Creating tables
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+
+#
+# This test checks binlog_cache_use and binlog_cache_disk_use when
+# transactions are committed and after when they are aborted.
+#
+
+set @save_binlog_stmt_cache_size=@@global.binlog_stmt_cache_size;
+set @save_binlog_cache_size=@@global.binlog_cache_size;
+set @@global.binlog_stmt_cache_size=32768;
+set @@global.binlog_cache_size=32768;
+#
+# Checking commit.
+#
+--echo **** Preparing the enviroment to check commit and its effect on status variables.
+--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+let $exp_cache= 0;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 0;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which are long enough so they will be flushed to disk...
+--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+let $exp_cache= 1;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Non-Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 1;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Mixed changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+let $exp_cache= 3;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 2;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+#
+# Checking abort.
+#
+--echo **** Preparing the enviroment to check abort and its effect on the status variables.
+--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+let $exp_cache= 0;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 0;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which are long enough so they will be flushed to disk...
+--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+rollback;
+enable_query_log;
+let $exp_cache= 1;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Non-Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 1;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Mixed changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+let $exp_cache= 3;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 2;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+drop table t1, t2;
+
+set @@global.binlog_stmt_cache_size=@save_binlog_stmt_cache_size;
+set @@global.binlog_cache_size=@save_binlog_cache_size;
diff --git a/mysql-test/suite/binlog/include/binlog_incident-master.opt b/mysql-test/suite/binlog/include/binlog_incident-master.opt
new file mode 100644
index 00000000000..57ce0081ae5
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_incident-master.opt
@@ -0,0 +1 @@
+--loose-debug=+d,incident_database_resync_on_replace \ No newline at end of file
diff --git a/mysql-test/suite/binlog/include/binlog_incident.inc b/mysql-test/suite/binlog/include/binlog_incident.inc
new file mode 100644
index 00000000000..dd37a58628a
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_incident.inc
@@ -0,0 +1,68 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+#
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --let $binlog_start_pos= <binlog position> # optional
+# --let $binlog_file= <binlog filename> # optional
+#
+# --source suite/binlog/include/binlog_incident.inc
+#
+# The script uses MYSQLBINLOG to verify certain results.
+# By default, it uses binary logs directly. If it is undesirable,
+# this behavior can be overridden by setting $use_remote_binlog
+# as shown above.
+#
+# All values will be unset after every execution of the script,
+# so if they are needed, they should be set explicitly before each call.
+#
+
+# The purpose of this test is to provide a reference for how the
+# incident log event is represented in the output from the mysqlbinlog
+# program.
+
+source include/have_log_bin.inc;
+source include/have_debug.inc;
+source include/binlog_start_pos.inc;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+
+# This will generate an incident log event and store it in the binary
+# log before the replace statement.
+REPLACE INTO t1 VALUES (4);
+
+DROP TABLE t1;
+FLUSH LOGS;
+
+if ($binlog_start_pos)
+{
+ --let $startpos= --start-position=$binlog_start_pos
+ --let $binlog_start_pos=
+}
+--let $filename= master-bin.000001
+if ($binlog_file)
+{
+ --let $filename= $binlog_file
+ --let $binlog_file=
+}
+--let $mysqlbinlog_args= $MYSQLD_DATADIR/$filename
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot $filename
+ --let $use_remote_mysqlbinlog= 0
+}
+exec $MYSQL_BINLOG $startpos $mysqlbinlog_args >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
+--disable_query_log
+eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
+--enable_query_log
+
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
diff --git a/mysql-test/suite/binlog/include/binlog_index.inc b/mysql-test/suite/binlog/include/binlog_index.inc
new file mode 100644
index 00000000000..d73091d59ab
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_index.inc
@@ -0,0 +1,278 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# testing of purging of binary log files bug#18199/Bug#18453
+#
+source include/have_log_bin.inc;
+source include/not_embedded.inc;
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+source include/have_debug.inc;
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
+call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
+call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
+call mtr.add_suppression('Could not use .*');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+flush tables;
+
+SET @saved_dbug = @@SESSION.debug_dbug;
+
+RESET MASTER;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+let $INDEX=$MYSQLD_DATADIR/master-bin.index;
+
+#
+# testing purge binary logs TO
+#
+
+flush logs;
+flush logs;
+flush logs;
+
+source include/show_binary_logs.inc;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+flush tables;
+
+# there must be a warning with file names
+replace_regex /\.[\\\/]master/master/;
+--source include/wait_for_binlog_checkpoint.inc
+purge binary logs TO 'master-bin.000004';
+
+--echo *** must show a list starting from the 'TO' argument of PURGE ***
+source include/show_binary_logs.inc;
+
+#
+# testing purge binary logs BEFORE
+#
+
+reset master;
+
+flush logs;
+flush logs;
+flush logs;
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+
+--echo *** must be a warning master-bin.000001 was not found ***
+let $date=`select NOW() + INTERVAL 1 MINUTE`;
+--disable_query_log
+replace_regex /\.[\\\/]master/master/;
+--source include/wait_for_binlog_checkpoint.inc
+eval purge binary logs BEFORE '$date';
+--enable_query_log
+
+--echo *** must show one record, of the active binlog, left in the index file after PURGE ***
+source include/show_binary_logs.inc;
+
+#
+# testing a fatal error
+# Turning a binlog file into a directory must be a portable setup
+#
+
+reset master;
+
+flush logs;
+flush logs;
+flush logs;
+
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+mkdir $MYSQLD_DATADIR/master-bin.000001;
+
+--source include/wait_for_binlog_checkpoint.inc
+--error ER_BINLOG_PURGE_FATAL_ERR
+purge binary logs TO 'master-bin.000002';
+replace_regex /\.[\\\/]master/master/;
+show warnings;
+rmdir $MYSQLD_DATADIR/master-bin.000001;
+--disable_warnings
+reset master;
+--enable_warnings
+
+--echo # crash_purge_before_update_index
+flush logs;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_purge_before_update_index";
+--source include/wait_for_binlog_checkpoint.inc
+--error 2013
+purge binary logs TO 'master-bin.000002';
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000001;
+file_exists $MYSQLD_DATADIR/master-bin.000002;
+file_exists $MYSQLD_DATADIR/master-bin.000003;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_purge_non_critical_after_update_index
+flush logs;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
+--source include/wait_for_binlog_checkpoint.inc
+--error 2013
+purge binary logs TO 'master-bin.000004';
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000001;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000002;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000003;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_purge_critical_after_update_index
+flush logs;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
+--source include/wait_for_binlog_checkpoint.inc
+--error 2013
+purge binary logs TO 'master-bin.000006';
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000004;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000005;
+file_exists $MYSQLD_DATADIR/master-bin.000006;
+file_exists $MYSQLD_DATADIR/master-bin.000007;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000008;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_create_non_critical_before_update_index
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
+--error 2013
+flush logs;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000008;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000009;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_create_critical_before_update_index
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
+--error 2013
+flush logs;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000009;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000010;
+--error 1
+file_exists $MYSQLD_DATADIR/master-bin.000011;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # crash_create_after_update_index
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="+d,crash_create_after_update_index";
+--error 2013
+flush logs;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+file_exists $MYSQLD_DATADIR/master-bin.000010;
+file_exists $MYSQLD_DATADIR/master-bin.000011;
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo #
+--echo # This should put the server in unsafe state and stop
+--echo # accepting any command. If we inject a fault at this
+--echo # point and continue the execution the server crashes.
+--echo #
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # fault_injection_registering_index
+SET SESSION debug_dbug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--source include/restart_mysqld.inc
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--echo # fault_injection_updating_index
+SET SESSION debug_dbug="+d,fault_injection_updating_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+--source include/restart_mysqld.inc
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
+SET @@SESSION.debug_dbug = @saved_dbug;
+
+--echo End of tests
diff --git a/mysql-test/suite/binlog/include/binlog_insert_delayed.test b/mysql-test/suite/binlog/include/binlog_insert_delayed.test
new file mode 100644
index 00000000000..8f669fc1152
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_insert_delayed.test
@@ -0,0 +1,71 @@
+# ==== Purpose ====
+#
+# Verify that INSERT DELAYED in mixed or row mode writes events to the
+# binlog, and that AUTO_INCREMENT works correctly.
+#
+# ==== Method ====
+#
+# Insert both single and multiple rows into an autoincrement column,
+# both with specified value and with NULL.
+#
+# With INSERT DELAYED, the rows do not show up in the table
+# immediately, so we must do source include/wait_until_rows_count.inc
+# between any two INSERT DELAYED statements. Moreover, if mixed or
+# row-based logging is used, there is also a delay between when rows
+# show up in the table and when they show up in the binlog. To ensure
+# that the rows show up in the binlog, we call FLUSH TABLES, which
+# waits until the delayed_insert thread has finished.
+#
+# We cannot read the binlog after executing INSERT DELAYED statements
+# that insert multiple rows, because that is nondeterministic. More
+# precisely, rows may be written in batches to the binlog, where each
+# batch has one Table_map_log_event and one or more
+# Write_rows_log_event. The number of rows included in each batch is
+# nondeterministic.
+#
+# ==== Related bugs ====
+#
+# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables
+# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
+
+reset master;
+
+create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
+
+let $table=t1;
+let $count=0;
+
+insert /* before delayed */ delayed /* after delayed */ into t1 values (207);
+inc $count;
+--source include/wait_until_rows_count.inc
+
+insert /*! delayed */ into t1 values (null);
+inc $count;
+--source include/wait_until_rows_count.inc
+
+insert delayed into t1 values (300);
+inc $count;
+--source include/wait_until_rows_count.inc
+
+# It is not enough to wait until all rows have been inserted into the
+# table. FLUSH TABLES ensures that they are in the binlog too. See
+# comment above.
+FLUSH TABLES;
+source include/show_binlog_events.inc;
+
+RESET MASTER;
+insert /* before delayed */ delayed /* after delayed */ into t1 values (null),(null),(null),(null);
+inc $count; inc $count; inc $count; inc $count;
+--source include/wait_until_rows_count.inc
+
+insert /*! delayed */ into t1 values (null),(null),(400),(null);
+inc $count; inc $count; inc $count; inc $count;
+--source include/wait_until_rows_count.inc
+
+if (`SELECT @@SESSION.BINLOG_FORMAT = 'STATEMENT'`) {
+ FLUSH TABLES;
+ source include/show_binlog_events.inc;
+}
+
+select * from t1;
+drop table t1;
diff --git a/mysql-test/suite/binlog/include/binlog_ioerr.inc b/mysql-test/suite/binlog/include/binlog_ioerr.inc
new file mode 100644
index 00000000000..da6fb5ac727
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_ioerr.inc
@@ -0,0 +1,37 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/have_debug.inc;
+source include/have_innodb.inc;
+source include/have_log_bin.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+CALL mtr.add_suppression("Error writing file 'master-bin'");
+
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES(0);
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET SESSION debug_dbug='+d,fail_binlog_write_1';
+--error ER_ERROR_ON_WRITE
+INSERT INTO t1 VALUES(1);
+--error ER_ERROR_ON_WRITE
+INSERT INTO t1 VALUES(2);
+SET SESSION debug_dbug=@saved_dbug;
+INSERT INTO t1 VALUES(3);
+SELECT * FROM t1;
+
+# Actually the output from this currently shows a bug.
+# The injected IO error leaves partially written transactions in the binlog in
+# the form of stray "BEGIN" events.
+# These should disappear from the output if binlog error handling is improved
+# (see MySQL Bug#37148 and WL#1790).
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
+--replace_column 1 BINLOG 2 POS 5 ENDPOS
+SHOW BINLOG EVENTS;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/include/binlog_mysqlbinlog-cp932.inc b/mysql-test/suite/binlog/include/binlog_mysqlbinlog-cp932.inc
new file mode 100644
index 00000000000..3646c34b027
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_mysqlbinlog-cp932.inc
@@ -0,0 +1,50 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --source suite/binlog/include/binlog_mysqlbinlog-cp932.inc
+#
+# By default, the script calls mysqlbinlog to read binary logs directly.
+# If it is undesirable, this behavior can be overridden by setting
+# $use_remote_binlog as shown above.
+# The value will be unset after every execution of the script,
+# so if it is needed, it should be set explicitly before each call.
+
+
+# disabled in embedded until tools running is fixed with embedded
+--source include/not_embedded.inc
+
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
+
+RESET MASTER;
+
+# Bug#16217 (mysql client did not know how not switch its internal charset)
+create table t3 (f text character set utf8);
+create table t4 (f text character set cp932);
+--exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
+--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
+flush logs;
+rename table t3 to t03, t4 to t04;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--let $mysqlbinlog_args= $MYSQLD_DATADIR/master-bin.000001
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot master-bin.000001
+ --let $use_remote_mysqlbinlog= 0
+}
+
+--exec $MYSQL_BINLOG --short-form $mysqlbinlog_args | $MYSQL --default-character-set=utf8
+# original and recovered data must be equal
+select HEX(f) from t03;
+select HEX(f) from t3;
+select HEX(f) from t04;
+select HEX(f) from t4;
+
+drop table t3, t4, t03, t04;
+--echo End of 5.0 tests
diff --git a/mysql-test/suite/binlog/include/binlog_row_annotate.inc b/mysql-test/suite/binlog/include/binlog_row_annotate.inc
new file mode 100644
index 00000000000..69d9dc3cc49
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_row_annotate.inc
@@ -0,0 +1,193 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let use_remote_mysqlbinlog= 1 # optional
+# --source suite/binlog/include/binlog_row_annotate.inc
+#
+# By default, the script uses mysqlbinlog both with direct access to files
+# and via connection to the server. In some cases, direct access to files
+# might be impossible (e.g. with encryption). If use_remote_mysqlbinlog
+# flag is set, this part of the logic will be omitted.
+#
+
+###############################################################################
+# WL47: Store in binlog text of statements that caused RBR events
+# new event: ANNOTATE_ROWS_EVENT
+# new master option: --binlog-annotate-row-events
+# new mysqlbinlog option: --skip-annotate-row-events
+#
+# Intended to test that:
+# *** If the --binlog-annotate-row-events option is switched on on master
+# then Annotate_rows events:
+# - are generated;
+# - are generated only once for "multi-table-maps" rbr queries;
+# - are not generated when the corresponding queries are filtered away;
+# - are generated when the corresponding queries are filtered away partialy
+# (e.g. in case of multi-delete).
+# *** Annotate_rows events are printed by mysqlbinlog started without
+# --skip-annotate-row-events options both in remote and local cases.
+# *** Annotate_rows events are not printed by mysqlbinlog started with
+# --skip-annotate-row-events options both in remote and local cases.
+###############################################################################
+
+set @old_binlog_checksum=@@binlog_checksum;
+set global binlog_checksum=NONE;
+--let datadir= `select @@datadir`
+
+--source include/have_log_bin.inc
+--source include/binlog_start_pos.inc
+--source include/have_binlog_format_row.inc
+
+set sql_mode="";
+let $collation_server=`select @@collation_server`;
+
+# Fix timestamp to avoid varying results
+SET timestamp=1000000000;
+
+# Delete all existing binary logs
+RESET MASTER;
+
+CREATE DATABASE test1;
+CREATE TABLE test1.t1(a int);
+
+CREATE DATABASE test2;
+CREATE TABLE test2.t2(a int);
+CREATE VIEW test2.v2 AS SELECT * FROM test2.t2;
+
+CREATE DATABASE test3;
+CREATE TABLE test3.t3(a int);
+
+CREATE DATABASE xtest1;
+CREATE TABLE xtest1.xt1(a int);
+
+CREATE DATABASE xtest2;
+CREATE TABLE xtest2.xt2(a int);
+
+# By default SESSION binlog_annotate_row_events = OFF
+
+INSERT INTO test1.t1 VALUES (1), (2), (3);
+
+SET SESSION binlog_annotate_row_events = ON;
+
+INSERT INTO test2.t2 VALUES (1), (2), (3);
+INSERT INTO test3.t3 VALUES (1), (2), (3);
+
+# This query generates two Table maps but the Annotate
+# event should appear only once before the first Table map
+DELETE test1.t1, test2.t2
+ FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
+ WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
+
+# This event should be filtered out together with Annotate event
+INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
+
+# This event should pass the filter
+INSERT INTO test2.v2 VALUES (1), (2), (3);
+
+# This event should pass the filter only for test2.t2 part
+DELETE xtest1.xt1, test2.t2
+ FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
+ WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
+
+# These events should be filtered out together with Annotate events
+INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
+INSERT INTO xtest2.xt2 VALUES (1), (2), (3);
+DELETE xtest1.xt1, xtest2.xt2
+ FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3
+ WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a;
+
+FLUSH LOGS;
+
+--echo #####################################################################################
+--echo # The following Annotate_rows events should appear below:
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
+--echo # - DELETE test1.t1, test2.t2 FROM <...>
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...>
+--echo #####################################################################################
+
+--source include/show_binlog_events.inc
+
+if (!$use_remote_mysqlbinlog)
+{
+ --echo #
+ --echo #####################################################################################
+ --echo # mysqlbinlog
+ --echo # The following Annotates should appear in this output:
+ --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+ --echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
+ --echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
+ --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+ --echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
+ --echo #####################################################################################
+
+ --replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+ --exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $datadir/master-bin.000001
+
+ --echo #
+ --echo #####################################################################################
+ --echo # mysqlbinlog --database=test1
+ --echo # The following Annotate should appear in this output:
+ --echo # - DELETE test1.t1, test2.t2 FROM <...>
+ --echo #####################################################################################
+
+ --replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+ --exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v $datadir/master-bin.000001
+
+ --echo #
+ --echo #####################################################################################
+ --echo # mysqlbinlog --skip-annotate-row-events
+ --echo # No Annotates should appear in this output
+ --echo #####################################################################################
+
+ --replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+ --exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v $datadir/master-bin.000001
+
+ --let use_remote_mysqlbinlog= 0
+}
+
+--echo #
+--echo #####################################################################################
+--echo # mysqlbinlog --read-from-remote-server
+--echo # The following Annotates should appear in this output:
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
+--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
+--echo #####################################################################################
+
+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
+
+--echo #
+--echo #####################################################################################
+--echo # mysqlbinlog --read-from-remote-server --database=test1
+--echo # The following Annotate should appear in this output:
+--echo # - DELETE test1.t1, test2.t2 FROM <...>
+--echo #####################################################################################
+
+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
+
+--echo #
+--echo #####################################################################################
+--echo # mysqlbinlog --read-from-remote-server --skip-annotate-row-events
+--echo # No Annotates should appear in this output
+--echo #####################################################################################
+
+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
+
+# Clean-up
+
+set global binlog_checksum=@old_binlog_checksum;
+DROP DATABASE test1;
+DROP DATABASE test2;
+DROP DATABASE test3;
+DROP DATABASE xtest1;
+DROP DATABASE xtest2;
diff --git a/mysql-test/suite/binlog/include/binlog_truncate.test b/mysql-test/suite/binlog/include/binlog_truncate.test
new file mode 100644
index 00000000000..4d297cd2d5c
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_truncate.test
@@ -0,0 +1,63 @@
+# BUG #36763: TRUNCATE TABLE fails to replicate when stmt-based
+# binlogging is not supported.
+
+# This should always be logged as a statement, even when executed as a
+# row-by-row deletion.
+
+# $before_truncate A statement to execute (just) before issuing the
+# TRUNCATE TABLE
+
+
+eval CREATE TABLE t1 (a INT) ENGINE=$engine;
+eval CREATE TABLE t2 (a INT) ENGINE=$engine;
+INSERT INTO t2 VALUES (1),(2),(3);
+let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
+if ($before_truncate) {
+ eval $before_truncate;
+}
+--echo **** Truncate of empty table shall be logged
+TRUNCATE TABLE t1;
+
+if ($before_truncate) {
+ eval $before_truncate;
+}
+TRUNCATE TABLE t2;
+source include/show_binlog_events.inc;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
+--echo #
+
+eval CREATE TABLE t1 (a INT) ENGINE=$engine;
+eval CREATE TABLE t2 (a INT) ENGINE=$engine;
+INSERT INTO t1 VALUES (1),(2);
+
+let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
+if ($before_truncate) {
+ eval $before_truncate;
+}
+
+BEGIN;
+INSERT INTO t2 SELECT * FROM t1;
+
+connect (truncate,localhost,root,,);
+send TRUNCATE TABLE t1;
+
+connection default;
+INSERT INTO t2 SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+COMMIT;
+
+connection truncate;
+--echo # Reaping TRUNCATE TABLE
+--reap
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+connection default;
+
+source include/show_binlog_events.inc;
+disconnect truncate;
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/binlog/include/binlog_write_error.inc b/mysql-test/suite/binlog/include/binlog_write_error.inc
new file mode 100644
index 00000000000..fa3ba087a7e
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_write_error.inc
@@ -0,0 +1,108 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# === Name ===
+#
+# binlog_write_error.test
+#
+# === Description ===
+#
+# This test case check if the error of writing binlog file is properly
+# reported and handled when executing statements.
+#
+# === Related Bugs ===
+#
+# BUG#37148
+#
+
+source include/have_log_bin.inc;
+source include/have_debug.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+--echo #
+--echo # Initialization
+--echo #
+
+disable_warnings;
+DROP TABLE IF EXISTS t1, t2;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr2;
+DROP VIEW IF EXISTS v1, v2;
+enable_warnings;
+
+--echo #
+--echo # Test injecting binlog write error when executing queries
+--echo #
+
+let $query= CREATE TABLE t1 (a INT);
+source include/binlog_inject_error.inc;
+
+INSERT INTO t1 VALUES (1),(2),(3);
+
+let $query= INSERT INTO t1 VALUES (4),(5),(6);
+source include/binlog_inject_error.inc;
+
+let $query= UPDATE t1 set a=a+1;
+source include/binlog_inject_error.inc;
+
+let $query= DELETE FROM t1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
+source include/binlog_inject_error.inc;
+
+let $query= DROP TRIGGER tr1;
+source include/binlog_inject_error.inc;
+
+let $query= ALTER TABLE t1 ADD (b INT);
+source include/binlog_inject_error.inc;
+
+let $query= CREATE VIEW v1 AS SELECT a FROM t1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP VIEW v1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP PROCEDURE p1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP TABLE t1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE FUNCTION f1() RETURNS INT return 1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP FUNCTION f1;
+source include/binlog_inject_error.inc;
+
+let $query= CREATE USER user1;
+source include/binlog_inject_error.inc;
+
+let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
+source include/binlog_inject_error.inc;
+
+let $query= DROP USER user1;
+source include/binlog_inject_error.inc;
+
+--echo #
+--echo # Cleanup
+--echo #
+
+disable_warnings;
+DROP TABLE IF EXISTS t1, t2;
+DROP FUNCTION IF EXISTS f1;
+DROP PROCEDURE IF EXISTS p1;
+DROP TRIGGER IF EXISTS tr1;
+DROP VIEW IF EXISTS v1, v2;
+enable_warnings;
diff --git a/mysql-test/suite/binlog/include/binlog_xa_recover.inc b/mysql-test/suite/binlog/include/binlog_xa_recover.inc
new file mode 100644
index 00000000000..de2703377cc
--- /dev/null
+++ b/mysql-test/suite/binlog/include/binlog_xa_recover.inc
@@ -0,0 +1,281 @@
+#
+# This include file is used by more than one test suite
+# (currently binlog and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_binlog_format_row.inc
+# Valgrind does not work well with test that crashes the server
+--source include/not_valgrind.inc
+
+# (We do not need to restore these settings, as we crash the server).
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
+# Insert some data to force a couple binlog rotations (3), so we get some
+# normal binlog checkpoints before starting the test.
+INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
+# Wait for the master-bin.000002 binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002"
+--let $field= Info
+--let $condition= = "master-bin.000002"
+--source include/wait_show_condition.inc
+INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
+--let $field= Info
+--let $condition= = "master-bin.000003"
+--source include/wait_show_condition.inc
+INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
+--let $field= Info
+--let $condition= = "master-bin.000004"
+--source include/wait_show_condition.inc
+
+# Now start a bunch of transactions that span multiple binlog
+# files. Leave then in the state prepared-but-not-committed in the engine
+# and crash the server. Check that crash recovery is able to recover all
+# of them.
+#
+# We use debug_sync to get all the transactions into the prepared state before
+# we commit any of them. This is because the prepare step flushes the InnoDB
+# redo log - including any commits made before, so recovery would become
+# unnecessary, decreasing the value of this test.
+#
+# We arrange to have con1 with a prepared transaction in master-bin.000004,
+# con2 and con3 with a prepared transaction in master-bin.000005, and a new
+# empty master-bin.000006. So the latest binlog checkpoint should be
+# master-bin.000006.
+
+connect(con1,localhost,root,,);
+# First wait after prepare and before write to binlog.
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
+# Then complete InnoDB commit in memory (but not commit checkpoint / write to
+# disk), and hang until crash, leaving a transaction to be XA recovered.
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
+send INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
+
+connect(con2,localhost,root,,);
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
+send INSERT INTO t1 VALUES (2, NULL);
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
+
+connect(con3,localhost,root,,);
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
+send INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
+
+connect(con4,localhost,root,,);
+SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
+SET SESSION debug_dbug="+d,crash_commit_after_log";
+send INSERT INTO t1 VALUES (4, NULL);
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
+
+SET DEBUG_SYNC= "now SIGNAL con1_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+SET DEBUG_SYNC= "now SIGNAL con2_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
+SET DEBUG_SYNC= "now SIGNAL con3_cont";
+SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
+
+# Check that everything is committed in binary log.
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000003
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+--let $binlog_file= master-bin.000004
+--source include/show_binlog_events.inc
+--let $binlog_file= master-bin.000005
+--source include/show_binlog_events.inc
+--let $binlog_file= master-bin.000006
+--source include/show_binlog_events.inc
+
+
+# Check that server will not purge too much.
+PURGE BINARY LOGS TO "master-bin.000006";
+--source include/show_binary_logs.inc
+
+# Now crash the server with one more transaction in prepared state.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-binlog_xa_recover.test
+EOF
+--error 0,2006,2013
+SET DEBUG_SYNC= "now SIGNAL con4_cont";
+connection con4;
+--error 2006,2013
+reap;
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-group_commit_binlog_pos.test
+EOF
+
+connection default;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that all transactions are recovered.
+SELECT a FROM t1 ORDER BY a;
+
+--echo Test that with multiple binlog checkpoints, recovery starts from the last one.
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+# Rotate to binlog master-bin.000003 while delaying binlog checkpoints.
+# So we get multiple binlog checkpoints in master-bin.000003.
+# Then complete the checkpoints, crash, and check that we only scan
+# the necessary binlog file (ie. that we use the _last_ checkpoint).
+
+connect(con10,localhost,root,,);
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
+send INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
+
+connect(con11,localhost,root,,);
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
+send INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
+
+connect(con12,localhost,root,,);
+SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
+send INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
+
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
+INSERT INTO t1 VALUES (13, NULL);
+
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000004
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+
+SET DEBUG_SYNC= "now SIGNAL con10_cont";
+connection con10;
+reap;
+connection default;
+
+# We need to sync the test case with the background processing of the
+# commit checkpoint, otherwise we get nondeterministic results.
+SET @old_dbug= @@global.DEBUG_DBUG;
+SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
+
+SET DEBUG_SYNC= "now SIGNAL con12_cont";
+connection con12;
+reap;
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
+SET GLOBAL debug_dbug= @old_dbug;
+
+SET DEBUG_SYNC= "now SIGNAL con11_cont";
+connection con11;
+reap;
+
+connection default;
+# Wait for the last (master-bin.000004) binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
+--let $field= Info
+--let $condition= = "master-bin.000004"
+--source include/wait_show_condition.inc
+
+--echo Checking that master-bin.000004 is the last binlog checkpoint
+--source include/show_binlog_events.inc
+
+--echo Now crash the server
+# It is not too easy to test XA recovery, as it runs early during server
+# startup, before any connections can be made.
+# What we do is set a DBUG error insert which will crash if XA recovery
+# starts from any other binlog than master-bin.000004 (check the file
+# binlog_xa_recover-master.opt). Then we will fail here if XA recovery
+# would start from the wrong place.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-binlog_xa_recover.test
+EOF
+SET SESSION debug_dbug="+d,crash_commit_after_log";
+--error 2006,2013
+INSERT INTO t1 VALUES (14, NULL);
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-group_commit_binlog_pos.test
+EOF
+
+connection default;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that all transactions are recovered.
+SELECT a FROM t1 ORDER BY a;
+
+
+--echo *** Check that recovery works if we crashed early during rotate, before
+--echo *** binlog checkpoint event could be written.
+
+SET GLOBAL max_binlog_size= 4096;
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+# We need some initial data to reach binlog master-bin.000004. Otherwise
+# crash recovery fails due to the error insert used for previous test.
+INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
+INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
+# Wait for the master-bin.000003 binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
+--let $field= Info
+--let $condition= = "master-bin.000003"
+--source include/wait_show_condition.inc
+INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
+# Wait for the last (master-bin.000004) binlog checkpoint to appear.
+--let $wait_for_all= 0
+--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
+--let $field= Info
+--let $condition= = "master-bin.000004"
+--source include/wait_show_condition.inc
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-binlog_xa_recover.test
+EOF
+SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
+--error 2006,2013
+INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-group_commit_binlog_pos.test
+EOF
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that all transactions are recovered.
+SELECT a FROM t1 ORDER BY a;
+
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000004
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+
+# Cleanup
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/include/blackhole.test b/mysql-test/suite/binlog/include/blackhole.test
new file mode 100644
index 00000000000..90146d41471
--- /dev/null
+++ b/mysql-test/suite/binlog/include/blackhole.test
@@ -0,0 +1,208 @@
+#
+# Simple test for blackhole example
+# Taken from the select test
+#
+-- source include/not_embedded.inc
+-- source include/have_blackhole.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");
+
+# The server need to be started in $MYSQLTEST_VARDIR since it
+# uses ../../std_data/
+-- source include/uses_vardir.inc
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+ Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+) ENGINE=blackhole;
+
+INSERT INTO t1 VALUES (9410,9412);
+
+select period from t1;
+select * from t1;
+select t1.* from t1;
+
+#
+# Create test table
+#
+
+CREATE TABLE t2 (
+ auto int NOT NULL auto_increment,
+ fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+ companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+ fld3 char(30) DEFAULT '' NOT NULL,
+ fld4 char(35) DEFAULT '' NOT NULL,
+ fld5 char(35) DEFAULT '' NOT NULL,
+ fld6 char(4) DEFAULT '' NOT NULL,
+ primary key (auto)
+) ENGINE=blackhole;
+
+INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
+INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
+--enable_query_log
+
+#
+# Search with a key
+#
+
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+select fld3 from t2 where fld3 like "%cultivation" ;
+
+#
+# Search with a key using sorting and limit the same time
+#
+
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+
+select fld3 from t2 order by fld3 desc limit 10;
+select fld3 from t2 order by fld3 desc limit 5;
+select fld3 from t2 order by fld3 desc limit 5,5;
+
+#
+# Search with a key having a constant with each unique key.
+# The table is read directly with read-next on fld3
+#
+
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+
+#
+# Test sorting with a used key (there is no need for sorting)
+#
+
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+
+
+# Test for fulltext
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+ ('Full-text indexes', 'are called collections'),
+ ('Only MyISAM tables','support collections'),
+ ('Function MATCH ... AGAINST()','is used to do a search'),
+ ('Full-text search in MySQL', 'implements vector space model');
+SHOW INDEX FROM t1;
+
+# nl search
+
+select * from t1 where MATCH(a,b) AGAINST ("collections");
+explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
+select * from t1 where MATCH(a,b) AGAINST ("indexes");
+select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
+select * from t1 where MATCH(a,b) AGAINST ("only");
+
+# Test that every DML (except SELECT) and DDL gets into binlog
+# so that blackhole can be used as "binlog propagator"
+
+reset master;
+drop table t1,t2;
+create table t1 (a int) engine=blackhole;
+delete from t1 where a=10;
+update t1 set a=11 where a=15;
+insert into t1 values(1);
+insert ignore into t1 values(1);
+replace into t1 values(100);
+create table t2 (a varchar(200)) engine=blackhole;
+eval load data infile '../../std_data/words.dat' into table t2;
+alter table t1 add b int;
+alter table t1 drop b;
+create table t3 like t1;
+insert into t1 select * from t3;
+replace into t1 select * from t3;
+# Just to verify
+select * from t1;
+select * from t2;
+select * from t3;
+
+--source include/show_binlog_events.inc
+
+drop table t1,t2,t3;
+
+#
+# BUG#27998 - mysqld crashed when executing INSERT DELAYED on a BLACKHOLE
+# table
+#
+CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
+INSERT DELAYED INTO t1 VALUES(1);
+DROP TABLE t1;
+
+
+#
+#Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX
+#
+CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
+DELETE FROM t1 WHERE a=10;
+ALTER TABLE t1 ADD INDEX(a);
+DELETE FROM t1 WHERE a=10;
+ALTER TABLE t1 DROP INDEX a;
+ALTER TABLE t1 ADD UNIQUE INDEX(a);
+DELETE FROM t1 WHERE a=10;
+ALTER TABLE t1 DROP INDEX a;
+ALTER TABLE t1 ADD PRIMARY KEY(a);
+DELETE FROM t1 WHERE a=10;
+DROP TABLE t1;
+
+
+# Test that a transaction which is rolled back does not go into binlog
+# and that a transaction which is committed does
+
+reset master;
+create table t1 (a int) engine=blackhole;
+set autocommit=0;
+start transaction;
+insert into t1 values(1);
+commit;
+
+let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+start transaction;
+insert into t1 values(2);
+rollback;
+
+let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
+if ($master_log_pos_2 != $master_log_pos_1)
+{
+ echo $master_log_pos_1 $master_log_pos_2;
+ die Rollbacked transaction has been binlogged;
+}
+
+set autocommit=1;
+drop table if exists t1;
+
+#
+# Bug#35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables
+#
+#
+# the test checks that explicitly prescribed with set insert_id= value
+# preceeds the following autoincrement insert in a blachhole
+#
+
+reset master;
+create table t1 (a int auto_increment, primary key (a)) engine=blackhole;
+
+# not insert_id prescribed insert binlogs with the default set insert_id 1
+insert into t1 values (11), (NULL), (NULL), (NULL);
+set insert_id= 3;
+insert into t1 values (NULL), (33), (NULL);
+set insert_id= 5;
+insert into t1 values (55), (NULL);
+source include/show_binlog_events2.inc;
+
+# cleanup
+drop table t1;
+
+
+# End of tests
diff --git a/mysql-test/suite/binlog/include/ctype_cp932.test b/mysql-test/suite/binlog/include/ctype_cp932.test
new file mode 100644
index 00000000000..f42bffd30df
--- /dev/null
+++ b/mysql-test/suite/binlog/include/ctype_cp932.test
@@ -0,0 +1,468 @@
+-- source include/have_cp932.inc
+
+--character_set cp932
+--disable_warnings
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+drop table if exists t4;
+--enable_warnings
+
+SET @test_character_set= 'cp932';
+SET @test_collation= 'cp932_japanese_ci';
+-- source include/ctype_common.inc
+
+set names cp932;
+set character_set_database = cp932;
+
+CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
+
+#Characters which are converted to Unicode ambiguously
+INSERT INTO t1 VALUES
+(0x05),(0x7E),(0x815C),(0x815F),(0x8160),(0x8161),(0x817C),(0x8191),(0x8192),(0x81CA);
+
+#NEC ROW 13 characters (0x8740 - 0x879C)
+INSERT INTO t1 VALUES
+(0x8740),(0x8741),(0x8742),(0x8743),(0x8744),(0x8745),(0x8746),(0x8747),
+(0x8748),(0x8749),(0x874A),(0x874B),(0x874C),(0x874D),(0x874E),(0x874F),
+(0x8750),(0x8751),(0x8752),(0x8753),(0x8754),(0x8755),(0x8756),(0x8757),
+(0x8758),(0x8759),(0x875A),(0x875B),(0x875C),(0x875D),(0x875F),
+(0x8760),(0x8761),(0x8762),(0x8763),(0x8764),(0x8765),(0x8766),(0x8767),
+(0x8768),(0x8769),(0x876A),(0x876B),(0x876C),(0x876D),(0x876E),(0x876F),
+(0x8770),(0x8771),(0x8772),(0x8773),(0x8774),(0x8775),(0x877E),
+(0x8780),(0x8781),(0x8782),(0x8783),(0x8784),(0x8785),(0x8786),(0x8787),
+(0x8788),(0x8789),(0x878A),(0x878B),(0x878C),(0x878D),(0x878E),(0x878F),
+(0x8790),(0x8791),(0x8792),(0x8793),(0x8794),(0x8795),(0x8796),(0x8797),
+(0x8798),(0x8799),(0x879A),(0x879B),(0x879C);
+
+#IBM selected characters kanji & non-kanji, NEC implementation (0xED40 - 0xEEFC)
+INSERT INTO t1 VALUES
+(0xED40),(0xED41),(0xED42),(0xED43),(0xED44),(0xED45),(0xED46),(0xED47),
+(0xED48),(0xED49),(0xED4A),(0xED4B),(0xED4C),(0xED4D),(0xED4E),(0xED4F),
+(0xED50),(0xED51),(0xED52),(0xED53),(0xED54),(0xED55),(0xED56),(0xED57),
+(0xED58),(0xED59),(0xED5A),(0xED5B),(0xED5C),(0xED5D),(0xED5E),(0xED5F),
+(0xED60),(0xED61),(0xED62),(0xED63),(0xED64),(0xED65),(0xED66),(0xED67),
+(0xED68),(0xED69),(0xED6A),(0xED6B),(0xED6C),(0xED6D),(0xED6E),(0xED6F),
+(0xED70),(0xED71),(0xED72),(0xED73),(0xED74),(0xED75),(0xED76),(0xED77),
+(0xED78),(0xED79),(0xED7A),(0xED7B),(0xED7C),(0xED7D),(0xED7E),
+(0xED80),(0xED81),(0xED82),(0xED83),(0xED84),(0xED85),(0xED86),(0xED87),
+(0xED88),(0xED89),(0xED8A),(0xED8B),(0xED8C),(0xED8D),(0xED8E),(0xED8F),
+(0xED90),(0xED91),(0xED92),(0xED93),(0xED94),(0xED95),(0xED96),(0xED97),
+(0xED98),(0xED99),(0xED9A),(0xED9B),(0xED9C),(0xED9D),(0xED9E),(0xED9F),
+(0xEDA0),(0xEDA1),(0xEDA2),(0xEDA3),(0xEDA4),(0xEDA5),(0xEDA6),(0xEDA7),
+(0xEDA8),(0xEDA9),(0xEDAA),(0xEDAB),(0xEDAC),(0xEDAD),(0xEDAE),(0xEDAF),
+(0xEDB0),(0xEDB1),(0xEDB2),(0xEDB3),(0xEDB4),(0xEDB5),(0xEDB6),(0xEDB7),
+(0xEDB8),(0xEDB9),(0xEDBA),(0xEDBB),(0xEDBC),(0xEDBD),(0xEDBE),(0xEDBF),
+(0xEDC0),(0xEDC1),(0xEDC2),(0xEDC3),(0xEDC4),(0xEDC5),(0xEDC6),(0xEDC7),
+(0xEDC8),(0xEDC9),(0xEDCA),(0xEDCB),(0xEDCC),(0xEDCD),(0xEDCE),(0xEDCF),
+(0xEDD0),(0xEDD1),(0xEDD2),(0xEDD3),(0xEDD4),(0xEDD5),(0xEDD6),(0xEDD7),
+(0xEDD8),(0xEDD9),(0xEDDA),(0xEDDB),(0xEDDC),(0xEDDD),(0xEDDE),(0xEDDF),
+(0xEDE0),(0xEDE1),(0xEDE2),(0xEDE3),(0xEDE4),(0xEDE5),(0xEDE6),(0xEDE7),
+(0xEDE8),(0xEDE9),(0xEDEA),(0xEDEB),(0xEDEC),(0xEDED),(0xEDEE),(0xEDEF),
+(0xEDF0),(0xEDF1),(0xEDF2),(0xEDF3),(0xEDF4),(0xEDF5),(0xEDF6),(0xEDF7),
+(0xEDF8),(0xEDF9),(0xEDFA),(0xEDFB),(0xEDFC),
+(0xEE40),(0xEE41),(0xEE42),(0xEE43),(0xEE44),(0xEE45),(0xEE46),(0xEE47),
+(0xEE48),(0xEE49),(0xEE4A),(0xEE4B),(0xEE4C),(0xEE4D),(0xEE4E),(0xEE4F),
+(0xEE50),(0xEE51),(0xEE52),(0xEE53),(0xEE54),(0xEE55),(0xEE56),(0xEE57),
+(0xEE58),(0xEE59),(0xEE5A),(0xEE5B),(0xEE5C),(0xEE5D),(0xEE5E),(0xEE5F),
+(0xEE60),(0xEE61),(0xEE62),(0xEE63),(0xEE64),(0xEE65),(0xEE66),(0xEE67),
+(0xEE68),(0xEE69),(0xEE6A),(0xEE6B),(0xEE6C),(0xEE6D),(0xEE6E),(0xEE6F),
+(0xEE70),(0xEE71),(0xEE72),(0xEE73),(0xEE74),(0xEE75),(0xEE76),(0xEE77),
+(0xEE78),(0xEE79),(0xEE7A),(0xEE7B),(0xEE7C),(0xEE7D),(0xEE7E),
+(0xEE80),(0xEE81),(0xEE82),(0xEE83),(0xEE84),(0xEE85),(0xEE86),(0xEE87),
+(0xEE88),(0xEE89),(0xEE8A),(0xEE8B),(0xEE8C),(0xEE8D),(0xEE8E),(0xEE8F),
+(0xEE90),(0xEE91),(0xEE92),(0xEE93),(0xEE94),(0xEE95),(0xEE96),(0xEE97),
+(0xEE98),(0xEE99),(0xEE9A),(0xEE9B),(0xEE9C),(0xEE9D),(0xEE9E),(0xEE9F),
+(0xEEA0),(0xEEA1),(0xEEA2),(0xEEA3),(0xEEA4),(0xEEA5),(0xEEA6),(0xEEA7),
+(0xEEA8),(0xEEA9),(0xEEAA),(0xEEAB),(0xEEAC),(0xEEAD),(0xEEAE),(0xEEAF),
+(0xEEB0),(0xEEB1),(0xEEB2),(0xEEB3),(0xEEB4),(0xEEB5),(0xEEB6),(0xEEB7),
+(0xEEB8),(0xEEB9),(0xEEBA),(0xEEBB),(0xEEBC),(0xEEBD),(0xEEBE),(0xEEBF),
+(0xEEC0),(0xEEC1),(0xEEC2),(0xEEC3),(0xEEC4),(0xEEC5),(0xEEC6),(0xEEC7),
+(0xEEC8),(0xEEC9),(0xEECA),(0xEECB),(0xEECC),(0xEECD),(0xEECE),(0xEECF),
+(0xEED0),(0xEED1),(0xEED2),(0xEED3),(0xEED4),(0xEED5),(0xEED6),(0xEED7),
+(0xEED8),(0xEED9),(0xEEDA),(0xEEDB),(0xEEDC),(0xEEDD),(0xEEDE),(0xEEDF),
+(0xEEE0),(0xEEE1),(0xEEE2),(0xEEE3),(0xEEE4),(0xEEE5),(0xEEE6),(0xEEE7),
+(0xEEE8),(0xEEE9),(0xEEEA),(0xEEEB),(0xEEEC),(0xEEEF),
+(0xEEF0),(0xEEF1),(0xEEF2),(0xEEF3),(0xEEF4),(0xEEF5),(0xEEF6),(0xEEF7),
+(0xEEF8),(0xEEF9),(0xEEFA),(0xEEFB),(0xEEFC);
+
+#IBM selected kanji & non-kanji (0xFA40 - 0xFC4B)
+INSERT INTO t1 VALUES
+(0xFA40),(0xFA41),(0xFA42),(0xFA43),(0xFA44),(0xFA45),(0xFA46),(0xFA47),
+(0xFA48),(0xFA49),(0xFA4A),(0xFA4B),(0xFA4C),(0xFA4D),(0xFA4E),(0xFA4F),
+(0xFA50),(0xFA51),(0xFA52),(0xFA53),(0xFA54),(0xFA55),(0xFA56),(0xFA57),
+(0xFA58),(0xFA59),(0xFA5A),(0xFA5B),(0xFA5C),(0xFA5D),(0xFA5E),(0xFA5F),
+(0xFA60),(0xFA61),(0xFA62),(0xFA63),(0xFA64),(0xFA65),(0xFA66),(0xFA67),
+(0xFA68),(0xFA69),(0xFA6A),(0xFA6B),(0xFA6C),(0xFA6D),(0xFA6E),(0xFA6F),
+(0xFA70),(0xFA71),(0xFA72),(0xFA73),(0xFA74),(0xFA75),(0xFA76),(0xFA77),
+(0xFA78),(0xFA79),(0xFA7A),(0xFA7B),(0xFA7C),(0xFA7D),(0xFA7E),
+(0xFA80),(0xFA81),(0xFA82),(0xFA83),(0xFA84),(0xFA85),(0xFA86),(0xFA87),
+(0xFA88),(0xFA89),(0xFA8A),(0xFA8B),(0xFA8C),(0xFA8D),(0xFA8E),(0xFA8F),
+(0xFA90),(0xFA91),(0xFA92),(0xFA93),(0xFA94),(0xFA95),(0xFA96),(0xFA97),
+(0xFA98),(0xFA99),(0xFA9A),(0xFA9B),(0xFA9C),(0xFA9D),(0xFA9E),(0xFA9F),
+(0xFAA0),(0xFAA1),(0xFAA2),(0xFAA3),(0xFAA4),(0xFAA5),(0xFAA6),(0xFAA7),
+(0xFAA8),(0xFAA9),(0xFAAA),(0xFAAB),(0xFAAC),(0xFAAD),(0xFAAE),(0xFAAF),
+(0xFAB0),(0xFAB1),(0xFAB2),(0xFAB3),(0xFAB4),(0xFAB5),(0xFAB6),(0xFAB7),
+(0xFAB8),(0xFAB9),(0xFABA),(0xFABB),(0xFABC),(0xFABD),(0xFABE),(0xFABF),
+(0xFAC0),(0xFAC1),(0xFAC2),(0xFAC3),(0xFAC4),(0xFAC5),(0xFAC6),(0xFAC7),
+(0xFAC8),(0xFAC9),(0xFACA),(0xFACB),(0xFACC),(0xFACD),(0xFACE),(0xFACF),
+(0xFAD0),(0xFAD1),(0xFAD2),(0xFAD3),(0xFAD4),(0xFAD5),(0xFAD6),(0xFAD7),
+(0xFAD8),(0xFAD9),(0xFADA),(0xFADB),(0xFADC),(0xFADD),(0xFADE),(0xFADF),
+(0xFAE0),(0xFAE1),(0xFAE2),(0xFAE3),(0xFAE4),(0xFAE5),(0xFAE6),(0xFAE7),
+(0xFAE8),(0xFAE9),(0xFAEA),(0xFAEB),(0xFAEC),(0xFAED),(0xFAEE),(0xFAEF),
+(0xFAF0),(0xFAF1),(0xFAF2),(0xFAF3),(0xFAF4),(0xFAF5),(0xFAF6),(0xFAF7),
+(0xFAF8),(0xFAF9),(0xFAFA),(0xFAFB),(0xFAFC),
+(0xFB40),(0xFB41),(0xFB42),(0xFB43),(0xFB44),(0xFB45),(0xFB46),(0xFB47),
+(0xFB48),(0xFB49),(0xFB4A),(0xFB4B),(0xFB4C),(0xFB4D),(0xFB4E),(0xFB4F),
+(0xFB50),(0xFB51),(0xFB52),(0xFB53),(0xFB54),(0xFB55),(0xFB56),(0xFB57),
+(0xFB58),(0xFB59),(0xFB5A),(0xFB5B),(0xFB5C),(0xFB5D),(0xFB5E),(0xFB5F),
+(0xFB60),(0xFB61),(0xFB62),(0xFB63),(0xFB64),(0xFB65),(0xFB66),(0xFB67),
+(0xFB68),(0xFB69),(0xFB6A),(0xFB6B),(0xFB6C),(0xFB6D),(0xFB6E),(0xFB6F),
+(0xFB70),(0xFB71),(0xFB72),(0xFB73),(0xFB74),(0xFB75),(0xFB76),(0xFB77),
+(0xFB78),(0xFB79),(0xFB7A),(0xFB7B),(0xFB7C),(0xFB7D),(0xFB7E),
+(0xFB80),(0xFB81),(0xFB82),(0xFB83),(0xFB84),(0xFB85),(0xFB86),(0xFB87),
+(0xFB88),(0xFB89),(0xFB8A),(0xFB8B),(0xFB8C),(0xFB8D),(0xFB8E),(0xFB8F),
+(0xFB90),(0xFB91),(0xFB92),(0xFB93),(0xFB94),(0xFB95),(0xFB96),(0xFB97),
+(0xFB98),(0xFB99),(0xFB9A),(0xFB9B),(0xFB9C),(0xFB9D),(0xFB9E),(0xFB9F),
+(0xFBA0),(0xFBA1),(0xFBA2),(0xFBA3),(0xFBA4),(0xFBA5),(0xFBA6),(0xFBA7),
+(0xFBA8),(0xFBA9),(0xFBAA),(0xFBAB),(0xFBAC),(0xFBAD),(0xFBAE),(0xFBAF),
+(0xFBB0),(0xFBB1),(0xFBB2),(0xFBB3),(0xFBB4),(0xFBB5),(0xFBB6),(0xFBB7),
+(0xFBB8),(0xFBB9),(0xFBBA),(0xFBBB),(0xFBBC),(0xFBBD),(0xFBBE),(0xFBBF),
+(0xFBC0),(0xFBC1),(0xFBC2),(0xFBC3),(0xFBC4),(0xFBC5),(0xFBC6),(0xFBC7),
+(0xFBC8),(0xFBC9),(0xFBCA),(0xFBCB),(0xFBCC),(0xFBCD),(0xFBCE),(0xFBCF),
+(0xFBD0),(0xFBD1),(0xFBD2),(0xFBD3),(0xFBD4),(0xFBD5),(0xFBD6),(0xFBD7),
+(0xFBD8),(0xFBD9),(0xFBDA),(0xFBDB),(0xFBDC),(0xFBDD),(0xFBDE),(0xFBDF),
+(0xFBE0),(0xFBE1),(0xFBE2),(0xFBE3),(0xFBE4),(0xFBE5),(0xFBE6),(0xFBE7),
+(0xFBE8),(0xFBE9),(0xFBEA),(0xFBEB),(0xFBEC),(0xFBED),(0xFBEE),(0xFBEF),
+(0xFBF0),(0xFBF1),(0xFBF2),(0xFBF3),(0xFBF4),(0xFBF5),(0xFBF6),(0xFBF7),
+(0xFBF8),(0xFBF9),(0xFBFA),(0xFBFB),(0xFBFC),
+(0xFC40),(0xFC41),(0xFC42),(0xFC43),(0xFC44),(0xFC45),(0xFC46),(0xFC47),
+(0xFC48),(0xFC49),(0xFC4A),(0xFC4B);
+
+#User defined characters (0xF040-0xF9FC)
+INSERT INTO t1 VALUES
+(0xF040),(0xF041),(0xF042),(0xF043),(0xF044),(0xF045),(0xF046),(0xF047),
+(0xF048),(0xF049),(0xF04A),(0xF04B),(0xF04C),(0xF04D),(0xF04E),(0xF04F),
+(0xF050),(0xF051),(0xF052),(0xF053),(0xF054),(0xF055),(0xF056),(0xF057),
+(0xF058),(0xF059),(0xF05A),(0xF05B),(0xF05C),(0xF05D),(0xF05E),(0xF05F),
+(0xF060),(0xF061),(0xF062),(0xF063),(0xF064),(0xF065),(0xF066),(0xF067),
+(0xF068),(0xF069),(0xF06A),(0xF06B),(0xF06C),(0xF06D),(0xF06E),(0xF06F),
+(0xF070),(0xF071),(0xF072),(0xF073),(0xF074),(0xF075),(0xF076),(0xF077),
+(0xF078),(0xF079),(0xF07A),(0xF07B),(0xF07C),(0xF07D),(0xF07E),
+(0xF080),(0xF081),(0xF082),(0xF083),(0xF084),(0xF085),(0xF086),(0xF087),
+(0xF088),(0xF089),(0xF08A),(0xF08B),(0xF08C),(0xF08D),(0xF08E),(0xF08F),
+(0xF090),(0xF091),(0xF092),(0xF093),(0xF094),(0xF095),(0xF096),(0xF097),
+(0xF098),(0xF099),(0xF09A),(0xF09B),(0xF09C),(0xF09D),(0xF09E),(0xF09F),
+(0xF0A0),(0xF0A1),(0xF0A2),(0xF0A3),(0xF0A4),(0xF0A5),(0xF0A6),(0xF0A7),
+(0xF0A8),(0xF0A9),(0xF0AA),(0xF0AB),(0xF0AC),(0xF0AD),(0xF0AE),(0xF0AF),
+(0xF0B0),(0xF0B1),(0xF0B2),(0xF0B3),(0xF0B4),(0xF0B5),(0xF0B6),(0xF0B7),
+(0xF0B8),(0xF0B9),(0xF0BA),(0xF0BB),(0xF0BC),(0xF0BD),(0xF0BE),(0xF0BF),
+(0xF0C0),(0xF0C1),(0xF0C2),(0xF0C3),(0xF0C4),(0xF0C5),(0xF0C6),(0xF0C7),
+(0xF0C8),(0xF0C9),(0xF0CA),(0xF0CB),(0xF0CC),(0xF0CD),(0xF0CE),(0xF0CF),
+(0xF0D0),(0xF0D1),(0xF0D2),(0xF0D3),(0xF0D4),(0xF0D5),(0xF0D6),(0xF0D7),
+(0xF0D8),(0xF0D9),(0xF0DA),(0xF0DB),(0xF0DC),(0xF0DD),(0xF0DE),(0xF0DF),
+(0xF0E0),(0xF0E1),(0xF0E2),(0xF0E3),(0xF0E4),(0xF0E5),(0xF0E6),(0xF0E7),
+(0xF0E8),(0xF0E9),(0xF0EA),(0xF0EB),(0xF0EC),(0xF0ED),(0xF0EE),(0xF0EF),
+(0xF0F0),(0xF0F1),(0xF0F2),(0xF0F3),(0xF0F4),(0xF0F5),(0xF0F6),(0xF0F7),
+(0xF0F8),(0xF0F9),(0xF0FA),(0xF0FB),(0xF0FC),
+(0xF140),(0xF141),(0xF142),(0xF143),(0xF144),(0xF145),(0xF146),(0xF147),
+(0xF148),(0xF149),(0xF14A),(0xF14B),(0xF14C),(0xF14D),(0xF14E),(0xF14F),
+(0xF150),(0xF151),(0xF152),(0xF153),(0xF154),(0xF155),(0xF156),(0xF157),
+(0xF158),(0xF159),(0xF15A),(0xF15B),(0xF15C),(0xF15D),(0xF15E),(0xF15F),
+(0xF160),(0xF161),(0xF162),(0xF163),(0xF164),(0xF165),(0xF166),(0xF167),
+(0xF168),(0xF169),(0xF16A),(0xF16B),(0xF16C),(0xF16D),(0xF16E),(0xF16F),
+(0xF170),(0xF171),(0xF172),(0xF173),(0xF174),(0xF175),(0xF176),(0xF177),
+(0xF178),(0xF179),(0xF17A),(0xF17B),(0xF17C),(0xF17D),(0xF17E),
+(0xF180),(0xF181),(0xF182),(0xF183),(0xF184),(0xF185),(0xF186),(0xF187),
+(0xF188),(0xF189),(0xF18A),(0xF18B),(0xF18C),(0xF18D),(0xF18E),(0xF18F),
+(0xF190),(0xF191),(0xF192),(0xF193),(0xF194),(0xF195),(0xF196),(0xF197),
+(0xF198),(0xF199),(0xF19A),(0xF19B),(0xF19C),(0xF19D),(0xF19E),(0xF19F),
+(0xF1A0),(0xF1A1),(0xF1A2),(0xF1A3),(0xF1A4),(0xF1A5),(0xF1A6),(0xF1A7),
+(0xF1A8),(0xF1A9),(0xF1AA),(0xF1AB),(0xF1AC),(0xF1AD),(0xF1AE),(0xF1AF),
+(0xF1B0),(0xF1B1),(0xF1B2),(0xF1B3),(0xF1B4),(0xF1B5),(0xF1B6),(0xF1B7),
+(0xF1B8),(0xF1B9),(0xF1BA),(0xF1BB),(0xF1BC),(0xF1BD),(0xF1BE),(0xF1BF),
+(0xF1C0),(0xF1C1),(0xF1C2),(0xF1C3),(0xF1C4),(0xF1C5),(0xF1C6),(0xF1C7),
+(0xF1C8),(0xF1C9),(0xF1CA),(0xF1CB),(0xF1CC),(0xF1CD),(0xF1CE),(0xF1CF),
+(0xF1D0),(0xF1D1),(0xF1D2),(0xF1D3),(0xF1D4),(0xF1D5),(0xF1D6),(0xF1D7),
+(0xF1D8),(0xF1D9),(0xF1DA),(0xF1DB),(0xF1DC),(0xF1DD),(0xF1DE),(0xF1DF),
+(0xF1E0),(0xF1E1),(0xF1E2),(0xF1E3),(0xF1E4),(0xF1E5),(0xF1E6),(0xF1E7),
+(0xF1E8),(0xF1E9),(0xF1EA),(0xF1EB),(0xF1EC),(0xF1ED),(0xF1EE),(0xF1EF),
+(0xF1F0),(0xF1F1),(0xF1F2),(0xF1F3),(0xF1F4),(0xF1F5),(0xF1F6),(0xF1F7),
+(0xF1F8),(0xF1F9),(0xF1FA),(0xF1FB),(0xF1FC),
+(0xF240),(0xF241),(0xF242),(0xF243),(0xF244),(0xF245),(0xF246),(0xF247),
+(0xF248),(0xF249),(0xF24A),(0xF24B),(0xF24C),(0xF24D),(0xF24E),(0xF24F),
+(0xF250),(0xF251),(0xF252),(0xF253),(0xF254),(0xF255),(0xF256),(0xF257),
+(0xF258),(0xF259),(0xF25A),(0xF25B),(0xF25C),(0xF25D),(0xF25E),(0xF25F),
+(0xF260),(0xF261),(0xF262),(0xF263),(0xF264),(0xF265),(0xF266),(0xF267),
+(0xF268),(0xF269),(0xF26A),(0xF26B),(0xF26C),(0xF26D),(0xF26E),(0xF26F),
+(0xF270),(0xF271),(0xF272),(0xF273),(0xF274),(0xF275),(0xF276),(0xF277),
+(0xF278),(0xF279),(0xF27A),(0xF27B),(0xF27C),(0xF27D),(0xF27E),
+(0xF280),(0xF281),(0xF282),(0xF283),(0xF284),(0xF285),(0xF286),(0xF287),
+(0xF288),(0xF289),(0xF28A),(0xF28B),(0xF28C),(0xF28D),(0xF28E),(0xF28F),
+(0xF290),(0xF291),(0xF292),(0xF293),(0xF294),(0xF295),(0xF296),(0xF297),
+(0xF298),(0xF299),(0xF29A),(0xF29B),(0xF29C),(0xF29D),(0xF29E),(0xF29F),
+(0xF2A0),(0xF2A1),(0xF2A2),(0xF2A3),(0xF2A4),(0xF2A5),(0xF2A6),(0xF2A7),
+(0xF2A8),(0xF2A9),(0xF2AA),(0xF2AB),(0xF2AC),(0xF2AD),(0xF2AE),(0xF2AF),
+(0xF2B0),(0xF2B1),(0xF2B2),(0xF2B3),(0xF2B4),(0xF2B5),(0xF2B6),(0xF2B7),
+(0xF2B8),(0xF2B9),(0xF2BA),(0xF2BB),(0xF2BC),(0xF2BD),(0xF2BE),(0xF2BF),
+(0xF2C0),(0xF2C1),(0xF2C2),(0xF2C3),(0xF2C4),(0xF2C5),(0xF2C6),(0xF2C7),
+(0xF2C8),(0xF2C9),(0xF2CA),(0xF2CB),(0xF2CC),(0xF2CD),(0xF2CE),(0xF2CF),
+(0xF2D0),(0xF2D1),(0xF2D2),(0xF2D3),(0xF2D4),(0xF2D5),(0xF2D6),(0xF2D7),
+(0xF2D8),(0xF2D9),(0xF2DA),(0xF2DB),(0xF2DC),(0xF2DD),(0xF2DE),(0xF2DF),
+(0xF2E0),(0xF2E1),(0xF2E2),(0xF2E3),(0xF2E4),(0xF2E5),(0xF2E6),(0xF2E7),
+(0xF2E8),(0xF2E9),(0xF2EA),(0xF2EB),(0xF2EC),(0xF2ED),(0xF2EE),(0xF2EF),
+(0xF2F0),(0xF2F1),(0xF2F2),(0xF2F3),(0xF2F4),(0xF2F5),(0xF2F6),(0xF2F7),
+(0xF2F8),(0xF2F9),(0xF2FA),(0xF2FB),(0xF2FC),
+(0xF340),(0xF341),(0xF342),(0xF343),(0xF344),(0xF345),(0xF346),(0xF347),
+(0xF348),(0xF349),(0xF34A),(0xF34B),(0xF34C),(0xF34D),(0xF34E),(0xF34F),
+(0xF350),(0xF351),(0xF352),(0xF353),(0xF354),(0xF355),(0xF356),(0xF357),
+(0xF358),(0xF359),(0xF35A),(0xF35B),(0xF35C),(0xF35D),(0xF35E),(0xF35F),
+(0xF360),(0xF361),(0xF362),(0xF363),(0xF364),(0xF365),(0xF366),(0xF367),
+(0xF368),(0xF369),(0xF36A),(0xF36B),(0xF36C),(0xF36D),(0xF36E),(0xF36F),
+(0xF370),(0xF371),(0xF372),(0xF373),(0xF374),(0xF375),(0xF376),(0xF377),
+(0xF378),(0xF379),(0xF37A),(0xF37B),(0xF37C),(0xF37D),(0xF37E),
+(0xF380),(0xF381),(0xF382),(0xF383),(0xF384),(0xF385),(0xF386),(0xF387),
+(0xF388),(0xF389),(0xF38A),(0xF38B),(0xF38C),(0xF38D),(0xF38E),(0xF38F),
+(0xF390),(0xF391),(0xF392),(0xF393),(0xF394),(0xF395),(0xF396),(0xF397),
+(0xF398),(0xF399),(0xF39A),(0xF39B),(0xF39C),(0xF39D),(0xF39E),(0xF39F),
+(0xF3A0),(0xF3A1),(0xF3A2),(0xF3A3),(0xF3A4),(0xF3A5),(0xF3A6),(0xF3A7),
+(0xF3A8),(0xF3A9),(0xF3AA),(0xF3AB),(0xF3AC),(0xF3AD),(0xF3AE),(0xF3AF),
+(0xF3B0),(0xF3B1),(0xF3B2),(0xF3B3),(0xF3B4),(0xF3B5),(0xF3B6),(0xF3B7),
+(0xF3B8),(0xF3B9),(0xF3BA),(0xF3BB),(0xF3BC),(0xF3BD),(0xF3BE),(0xF3BF),
+(0xF3C0),(0xF3C1),(0xF3C2),(0xF3C3),(0xF3C4),(0xF3C5),(0xF3C6),(0xF3C7),
+(0xF3C8),(0xF3C9),(0xF3CA),(0xF3CB),(0xF3CC),(0xF3CD),(0xF3CE),(0xF3CF),
+(0xF3D0),(0xF3D1),(0xF3D2),(0xF3D3),(0xF3D4),(0xF3D5),(0xF3D6),(0xF3D7),
+(0xF3D8),(0xF3D9),(0xF3DA),(0xF3DB),(0xF3DC),(0xF3DD),(0xF3DE),(0xF3DF),
+(0xF3E0),(0xF3E1),(0xF3E2),(0xF3E3),(0xF3E4),(0xF3E5),(0xF3E6),(0xF3E7),
+(0xF3E8),(0xF3E9),(0xF3EA),(0xF3EB),(0xF3EC),(0xF3ED),(0xF3EE),(0xF3EF),
+(0xF3F0),(0xF3F1),(0xF3F2),(0xF3F3),(0xF3F4),(0xF3F5),(0xF3F6),(0xF3F7),
+(0xF3F8),(0xF3F9),(0xF3FA),(0xF3FB),(0xF3FC),
+(0xF440),(0xF441),(0xF442),(0xF443),(0xF444),(0xF445),(0xF446),(0xF447),
+(0xF448),(0xF449),(0xF44A),(0xF44B),(0xF44C),(0xF44D),(0xF44E),(0xF44F),
+(0xF450),(0xF451),(0xF452),(0xF453),(0xF454),(0xF455),(0xF456),(0xF457),
+(0xF458),(0xF459),(0xF45A),(0xF45B),(0xF45C),(0xF45D),(0xF45E),(0xF45F),
+(0xF460),(0xF461),(0xF462),(0xF463),(0xF464),(0xF465),(0xF466),(0xF467),
+(0xF468),(0xF469),(0xF46A),(0xF46B),(0xF46C),(0xF46D),(0xF46E),(0xF46F),
+(0xF470),(0xF471),(0xF472),(0xF473),(0xF474),(0xF475),(0xF476),(0xF477),
+(0xF478),(0xF479),(0xF47A),(0xF47B),(0xF47C),(0xF47D),(0xF47E),
+(0xF480),(0xF481),(0xF482),(0xF483),(0xF484),(0xF485),(0xF486),(0xF487),
+(0xF488),(0xF489),(0xF48A),(0xF48B),(0xF48C),(0xF48D),(0xF48E),(0xF48F),
+(0xF490),(0xF491),(0xF492),(0xF493),(0xF494),(0xF495),(0xF496),(0xF497),
+(0xF498),(0xF499),(0xF49A),(0xF49B),(0xF49C),(0xF49D),(0xF49E),(0xF49F),
+(0xF4A0),(0xF4A1),(0xF4A2),(0xF4A3),(0xF4A4),(0xF4A5),(0xF4A6),(0xF4A7),
+(0xF4A8),(0xF4A9),(0xF4AA),(0xF4AB),(0xF4AC),(0xF4AD),(0xF4AE),(0xF4AF),
+(0xF4B0),(0xF4B1),(0xF4B2),(0xF4B3),(0xF4B4),(0xF4B5),(0xF4B6),(0xF4B7),
+(0xF4B8),(0xF4B9),(0xF4BA),(0xF4BB),(0xF4BC),(0xF4BD),(0xF4BE),(0xF4BF),
+(0xF4C0),(0xF4C1),(0xF4C2),(0xF4C3),(0xF4C4),(0xF4C5),(0xF4C6),(0xF4C7),
+(0xF4C8),(0xF4C9),(0xF4CA),(0xF4CB),(0xF4CC),(0xF4CD),(0xF4CE),(0xF4CF),
+(0xF4D0),(0xF4D1),(0xF4D2),(0xF4D3),(0xF4D4),(0xF4D5),(0xF4D6),(0xF4D7),
+(0xF4D8),(0xF4D9),(0xF4DA),(0xF4DB),(0xF4DC),(0xF4DD),(0xF4DE),(0xF4DF),
+(0xF4E0),(0xF4E1),(0xF4E2),(0xF4E3),(0xF4E4),(0xF4E5),(0xF4E6),(0xF4E7),
+(0xF4E8),(0xF4E9),(0xF4EA),(0xF4EB),(0xF4EC),(0xF4ED),(0xF4EE),(0xF4EF),
+(0xF4F0),(0xF4F1),(0xF4F2),(0xF4F3),(0xF4F4),(0xF4F5),(0xF4F6),(0xF4F7),
+(0xF4F8),(0xF4F9),(0xF4FA),(0xF4FB),(0xF4FC),
+(0xF540),(0xF541),(0xF542),(0xF543),(0xF544),(0xF545),(0xF546),(0xF547),
+(0xF548),(0xF549),(0xF54A),(0xF54B),(0xF54C),(0xF54D),(0xF54E),(0xF54F),
+(0xF550),(0xF551),(0xF552),(0xF553),(0xF554),(0xF555),(0xF556),(0xF557),
+(0xF558),(0xF559),(0xF55A),(0xF55B),(0xF55C),(0xF55D),(0xF55E),(0xF55F),
+(0xF560),(0xF561),(0xF562),(0xF563),(0xF564),(0xF565),(0xF566),(0xF567),
+(0xF568),(0xF569),(0xF56A),(0xF56B),(0xF56C),(0xF56D),(0xF56E),(0xF56F),
+(0xF570),(0xF571),(0xF572),(0xF573),(0xF574),(0xF575),(0xF576),(0xF577),
+(0xF578),(0xF579),(0xF57A),(0xF57B),(0xF57C),(0xF57D),(0xF57E),
+(0xF580),(0xF581),(0xF582),(0xF583),(0xF584),(0xF585),(0xF586),(0xF587),
+(0xF588),(0xF589),(0xF58A),(0xF58B),(0xF58C),(0xF58D),(0xF58E),(0xF58F),
+(0xF590),(0xF591),(0xF592),(0xF593),(0xF594),(0xF595),(0xF596),(0xF597),
+(0xF598),(0xF599),(0xF59A),(0xF59B),(0xF59C),(0xF59D),(0xF59E),(0xF59F),
+(0xF5A0),(0xF5A1),(0xF5A2),(0xF5A3),(0xF5A4),(0xF5A5),(0xF5A6),(0xF5A7),
+(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),(0xF5AF),
+(0xF5B0),(0xF5B1),(0xF5B2),(0xF5B3),(0xF5B4),(0xF5B5),(0xF5B6),(0xF5B7),
+(0xF5B8),(0xF5B9),(0xF5BA),(0xF5BB),(0xF5BC),(0xF5BD),(0xF5BE),(0xF5BF),
+(0xF5C0),(0xF5C1),(0xF5C2),(0xF5C3),(0xF5C4),(0xF5C5),(0xF5C6),(0xF5C7),
+(0xF5C8),(0xF5C9),(0xF5CA),(0xF5CB),(0xF5CC),(0xF5CD),(0xF5CE),(0xF5CF),
+(0xF5D0),(0xF5D1),(0xF5D2),(0xF5D3),(0xF5D4),(0xF5D5),(0xF5D6),(0xF5D7),
+(0xF5D8),(0xF5D9),(0xF5DA),(0xF5DB),(0xF5DC),(0xF5DD),(0xF5DE),(0xF5DF),
+(0xF5E0),(0xF5E1),(0xF5E2),(0xF5E3),(0xF5E4),(0xF5E5),(0xF5E6),(0xF5E7),
+(0xF5E8),(0xF5E9),(0xF5EA),(0xF5EB),(0xF5EC),(0xF5ED),(0xF5EE),(0xF5EF),
+(0xF5F0),(0xF5F1),(0xF5F2),(0xF5F3),(0xF5F4),(0xF5F5),(0xF5F6),(0xF5F7),
+(0xF5F8),(0xF5F9),(0xF5FA),(0xF5FB),(0xF5FC),
+(0xF640),(0xF641),(0xF642),(0xF643),(0xF644),(0xF645),(0xF646),(0xF647),
+(0xF648),(0xF649),(0xF64A),(0xF64B),(0xF64C),(0xF64D),(0xF64E),(0xF64F),
+(0xF650),(0xF651),(0xF652),(0xF653),(0xF654),(0xF655),(0xF656),(0xF657),
+(0xF658),(0xF659),(0xF65A),(0xF65B),(0xF65C),(0xF65D),(0xF65E),(0xF65F),
+(0xF660),(0xF661),(0xF662),(0xF663),(0xF664),(0xF665),(0xF666),(0xF667),
+(0xF668),(0xF669),(0xF66A),(0xF66B),(0xF66C),(0xF66D),(0xF66E),(0xF66F),
+(0xF670),(0xF671),(0xF672),(0xF673),(0xF674),(0xF675),(0xF676),(0xF677),
+(0xF678),(0xF679),(0xF67A),(0xF67B),(0xF67C),(0xF67D),(0xF67E),
+(0xF680),(0xF681),(0xF682),(0xF683),(0xF684),(0xF685),(0xF686),(0xF687),
+(0xF688),(0xF689),(0xF68A),(0xF68B),(0xF68C),(0xF68D),(0xF68E),(0xF68F),
+(0xF690),(0xF691),(0xF692),(0xF693),(0xF694),(0xF695),(0xF696),(0xF697),
+(0xF698),(0xF699),(0xF69A),(0xF69B),(0xF69C),(0xF69D),(0xF69E),(0xF69F),
+(0xF6A0),(0xF6A1),(0xF6A2),(0xF6A3),(0xF6A4),(0xF6A5),(0xF6A6),(0xF6A7),
+(0xF6A8),(0xF6A9),(0xF6AA),(0xF6AB),(0xF6AC),(0xF6AD),(0xF6AE),(0xF6AF),
+(0xF6B0),(0xF6B1),(0xF6B2),(0xF6B3),(0xF6B4),(0xF6B5),(0xF6B6),(0xF6B7),
+(0xF6B8),(0xF6B9),(0xF6BA),(0xF6BB),(0xF6BC),(0xF6BD),(0xF6BE),(0xF6BF),
+(0xF6C0),(0xF6C1),(0xF6C2),(0xF6C3),(0xF6C4),(0xF6C5),(0xF6C6),(0xF6C7),
+(0xF6C8),(0xF6C9),(0xF6CA),(0xF6CB),(0xF6CC),(0xF6CD),(0xF6CE),(0xF6CF),
+(0xF6D0),(0xF6D1),(0xF6D2),(0xF6D3),(0xF6D4),(0xF6D5),(0xF6D6),(0xF6D7),
+(0xF6D8),(0xF6D9),(0xF6DA),(0xF6DB),(0xF6DC),(0xF6DD),(0xF6DE),(0xF6DF),
+(0xF6E0),(0xF6E1),(0xF6E2),(0xF6E3),(0xF6E4),(0xF6E5),(0xF6E6),(0xF6E7),
+(0xF6E8),(0xF6E9),(0xF6EA),(0xF6EB),(0xF6EC),(0xF6ED),(0xF6EE),(0xF6EF),
+(0xF6F0),(0xF6F1),(0xF6F2),(0xF6F3),(0xF6F4),(0xF6F5),(0xF6F6),(0xF6F7),
+(0xF6F8),(0xF6F9),(0xF6FA),(0xF6FB),(0xF6FC),
+(0xF740),(0xF741),(0xF742),(0xF743),(0xF744),(0xF745),(0xF746),(0xF747),
+(0xF748),(0xF749),(0xF74A),(0xF74B),(0xF74C),(0xF74D),(0xF74E),(0xF74F),
+(0xF750),(0xF751),(0xF752),(0xF753),(0xF754),(0xF755),(0xF756),(0xF757),
+(0xF758),(0xF759),(0xF75A),(0xF75B),(0xF75C),(0xF75D),(0xF75E),(0xF75F),
+(0xF760),(0xF761),(0xF762),(0xF763),(0xF764),(0xF765),(0xF766),(0xF767),
+(0xF768),(0xF769),(0xF76A),(0xF76B),(0xF76C),(0xF76D),(0xF76E),(0xF76F),
+(0xF770),(0xF771),(0xF772),(0xF773),(0xF774),(0xF775),(0xF776),(0xF777),
+(0xF778),(0xF779),(0xF77A),(0xF77B),(0xF77C),(0xF77D),(0xF77E),
+(0xF780),(0xF781),(0xF782),(0xF783),(0xF784),(0xF785),(0xF786),(0xF787),
+(0xF788),(0xF789),(0xF78A),(0xF78B),(0xF78C),(0xF78D),(0xF78E),(0xF78F),
+(0xF790),(0xF791),(0xF792),(0xF793),(0xF794),(0xF795),(0xF796),(0xF797),
+(0xF798),(0xF799),(0xF79A),(0xF79B),(0xF79C),(0xF79D),(0xF79E),(0xF79F),
+(0xF7A0),(0xF7A1),(0xF7A2),(0xF7A3),(0xF7A4),(0xF7A5),(0xF7A6),(0xF7A7),
+(0xF7A8),(0xF7A9),(0xF7AA),(0xF7AB),(0xF7AC),(0xF7AD),(0xF7AE),(0xF7AF),
+(0xF7B0),(0xF7B1),(0xF7B2),(0xF7B3),(0xF7B4),(0xF7B5),(0xF7B6),(0xF7B7),
+(0xF7B8),(0xF7B9),(0xF7BA),(0xF7BB),(0xF7BC),(0xF7BD),(0xF7BE),(0xF7BF),
+(0xF7C0),(0xF7C1),(0xF7C2),(0xF7C3),(0xF7C4),(0xF7C5),(0xF7C6),(0xF7C7),
+(0xF7C8),(0xF7C9),(0xF7CA),(0xF7CB),(0xF7CC),(0xF7CD),(0xF7CE),(0xF7CF),
+(0xF7D0),(0xF7D1),(0xF7D2),(0xF7D3),(0xF7D4),(0xF7D5),(0xF7D6),(0xF7D7),
+(0xF7D8),(0xF7D9),(0xF7DA),(0xF7DB),(0xF7DC),(0xF7DD),(0xF7DE),(0xF7DF),
+(0xF7E0),(0xF7E1),(0xF7E2),(0xF7E3),(0xF7E4),(0xF7E5),(0xF7E6),(0xF7E7),
+(0xF7E8),(0xF7E9),(0xF7EA),(0xF7EB),(0xF7EC),(0xF7ED),(0xF7EE),(0xF7EF),
+(0xF7F0),(0xF7F1),(0xF7F2),(0xF7F3),(0xF7F4),(0xF7F5),(0xF7F6),(0xF7F7),
+(0xF7F8),(0xF7F9),(0xF7FA),(0xF7FB),(0xF7FC),
+(0xF840),(0xF841),(0xF842),(0xF843),(0xF844),(0xF845),(0xF846),(0xF847),
+(0xF848),(0xF849),(0xF84A),(0xF84B),(0xF84C),(0xF84D),(0xF84E),(0xF84F),
+(0xF850),(0xF851),(0xF852),(0xF853),(0xF854),(0xF855),(0xF856),(0xF857),
+(0xF858),(0xF859),(0xF85A),(0xF85B),(0xF85C),(0xF85D),(0xF85E),(0xF85F),
+(0xF860),(0xF861),(0xF862),(0xF863),(0xF864),(0xF865),(0xF866),(0xF867),
+(0xF868),(0xF869),(0xF86A),(0xF86B),(0xF86C),(0xF86D),(0xF86E),(0xF86F),
+(0xF870),(0xF871),(0xF872),(0xF873),(0xF874),(0xF875),(0xF876),(0xF877),
+(0xF878),(0xF879),(0xF87A),(0xF87B),(0xF87C),(0xF87D),(0xF87E),
+(0xF880),(0xF881),(0xF882),(0xF883),(0xF884),(0xF885),(0xF886),(0xF887),
+(0xF888),(0xF889),(0xF88A),(0xF88B),(0xF88C),(0xF88D),(0xF88E),(0xF88F),
+(0xF890),(0xF891),(0xF892),(0xF893),(0xF894),(0xF895),(0xF896),(0xF897),
+(0xF898),(0xF899),(0xF89A),(0xF89B),(0xF89C),(0xF89D),(0xF89E),(0xF89F),
+(0xF8A0),(0xF8A1),(0xF8A2),(0xF8A3),(0xF8A4),(0xF8A5),(0xF8A6),(0xF8A7),
+(0xF8A8),(0xF8A9),(0xF8AA),(0xF8AB),(0xF8AC),(0xF8AD),(0xF8AE),(0xF8AF),
+(0xF8B0),(0xF8B1),(0xF8B2),(0xF8B3),(0xF8B4),(0xF8B5),(0xF8B6),(0xF8B7),
+(0xF8B8),(0xF8B9),(0xF8BA),(0xF8BB),(0xF8BC),(0xF8BD),(0xF8BE),(0xF8BF),
+(0xF8C0),(0xF8C1),(0xF8C2),(0xF8C3),(0xF8C4),(0xF8C5),(0xF8C6),(0xF8C7),
+(0xF8C8),(0xF8C9),(0xF8CA),(0xF8CB),(0xF8CC),(0xF8CD),(0xF8CE),(0xF8CF),
+(0xF8D0),(0xF8D1),(0xF8D2),(0xF8D3),(0xF8D4),(0xF8D5),(0xF8D6),(0xF8D7),
+(0xF8D8),(0xF8D9),(0xF8DA),(0xF8DB),(0xF8DC),(0xF8DD),(0xF8DE),(0xF8DF),
+(0xF8E0),(0xF8E1),(0xF8E2),(0xF8E3),(0xF8E4),(0xF8E5),(0xF8E6),(0xF8E7),
+(0xF8E8),(0xF8E9),(0xF8EA),(0xF8EB),(0xF8EC),(0xF8ED),(0xF8EE),(0xF8EF),
+(0xF8F0),(0xF8F1),(0xF8F2),(0xF8F3),(0xF8F4),(0xF8F5),(0xF8F6),(0xF8F7),
+(0xF8F8),(0xF8F9),(0xF8FA),(0xF8FB),(0xF8FC),
+(0xF940),(0xF941),(0xF942),(0xF943),(0xF944),(0xF945),(0xF946),(0xF947),
+(0xF948),(0xF949),(0xF94A),(0xF94B),(0xF94C),(0xF94D),(0xF94E),(0xF94F),
+(0xF950),(0xF951),(0xF952),(0xF953),(0xF954),(0xF955),(0xF956),(0xF957),
+(0xF958),(0xF959),(0xF95A),(0xF95B),(0xF95C),(0xF95D),(0xF95E),(0xF95F),
+(0xF960),(0xF961),(0xF962),(0xF963),(0xF964),(0xF965),(0xF966),(0xF967),
+(0xF968),(0xF969),(0xF96A),(0xF96B),(0xF96C),(0xF96D),(0xF96E),(0xF96F),
+(0xF970),(0xF971),(0xF972),(0xF973),(0xF974),(0xF975),(0xF976),(0xF977),
+(0xF978),(0xF979),(0xF97A),(0xF97B),(0xF97C),(0xF97D),(0xF97E),
+(0xF980),(0xF981),(0xF982),(0xF983),(0xF984),(0xF985),(0xF986),(0xF987),
+(0xF988),(0xF989),(0xF98A),(0xF98B),(0xF98C),(0xF98D),(0xF98E),(0xF98F),
+(0xF990),(0xF991),(0xF992),(0xF993),(0xF994),(0xF995),(0xF996),(0xF997),
+(0xF998),(0xF999),(0xF99A),(0xF99B),(0xF99C),(0xF99D),(0xF99E),(0xF99F),
+(0xF9A0),(0xF9A1),(0xF9A2),(0xF9A3),(0xF9A4),(0xF9A5),(0xF9A6),(0xF9A7),
+(0xF9A8),(0xF9A9),(0xF9AA),(0xF9AB),(0xF9AC),(0xF9AD),(0xF9AE),(0xF9AF),
+(0xF9B0),(0xF9B1),(0xF9B2),(0xF9B3),(0xF9B4),(0xF9B5),(0xF9B6),(0xF9B7),
+(0xF9B8),(0xF9B9),(0xF9BA),(0xF9BB),(0xF9BC),(0xF9BD),(0xF9BE),(0xF9BF),
+(0xF9C0),(0xF9C1),(0xF9C2),(0xF9C3),(0xF9C4),(0xF9C5),(0xF9C6),(0xF9C7),
+(0xF9C8),(0xF9C9),(0xF9CA),(0xF9CB),(0xF9CC),(0xF9CD),(0xF9CE),(0xF9CF),
+(0xF9D0),(0xF9D1),(0xF9D2),(0xF9D3),(0xF9D4),(0xF9D5),(0xF9D6),(0xF9D7),
+(0xF9D8),(0xF9D9),(0xF9DA),(0xF9DB),(0xF9DC),(0xF9DD),(0xF9DE),(0xF9DF),
+(0xF9E0),(0xF9E1),(0xF9E2),(0xF9E3),(0xF9E4),(0xF9E5),(0xF9E6),(0xF9E7),
+(0xF9E8),(0xF9E9),(0xF9EA),(0xF9EB),(0xF9EC),(0xF9ED),(0xF9EE),(0xF9EF),
+(0xF9F0),(0xF9F1),(0xF9F2),(0xF9F3),(0xF9F4),(0xF9F5),(0xF9F6),(0xF9F7),
+(0xF9F8),(0xF9F9),(0xF9FA),(0xF9FB),(0xF9FC);
+
+#Test that all the characters are stored correctly
+SELECT HEX(c1) FROM t1;
+
+#Test conversion to ucs2
+CREATE TABLE t2 SELECT CONVERT(c1 USING ucs2) AS c1 FROM t1;
+SELECT HEX(c1) FROM t2;
+
+#Test round trip conversion
+CREATE TABLE t3 SELECT CONVERT(c1 USING cp932) AS c1 FROM t2;
+SELECT HEX(c1) FROM t3;
+
+#Test conversion to eucjpms
+CREATE TABLE t4 SELECT CONVERT(c1 USING eucjpms) AS c1 FROM t1;
+SELECT HEX(c1) FROM t4;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+
+SET collation_connection='cp932_japanese_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_range_f1f2.inc
+SET collation_connection='cp932_bin';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_range_f1f2.inc
+
+#
+# Bug#29333 myisam corruption with
+# character set cp932 collate cp932_japanese_ci
+#
+create table t2 (a char(1));
+insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+create table t1 (
+ a varchar(2) character set cp932
+) engine=myisam;
+--disable_warnings
+insert into t1
+select unhex(concat(t24.a, t23.a, t22.a, t21.a))
+from t2 t21, t2 t22, t2 t23, t2 t24;
+--enable_warnings
+delete from t1 where a='';
+alter table t1 add key(a);
+check table t1;
+drop table t1;
+drop table t2;
+
+
+#
+# Bug#12547: Inserting long string into varchar causes table crash in cp932
+#
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert ignore into t1 values ('ab');
+select * from t1;
+insert ignore into t1 values ('abc');
+select * from t1;
+drop table t1;
+
+#
+# Bug#25815 Data truncated for column TEXT
+#
+set names utf8;
+create table t1 (a text) default character set cp932;
+insert into t1 values (_utf8 0xE38182);
+show warnings;
+select * from t1;
+select hex(a) from t1;
+drop table t1;
+
+#
+# BUG#16217 - MySQL client misinterpretes multi-byte char as escape `\'
+#
+
+# new command \C or charset
+--exec $MYSQL --default-character-set=utf8 test -e "\C cp932 \g"
+--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
+
+# its usage to switch internally in mysql to requested charset
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ƒ\'); select * from t1; drop table t1;"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select 'ƒ\'"
diff --git a/mysql-test/suite/binlog/include/ctype_cp932_binlog.test b/mysql-test/suite/binlog/include/ctype_cp932_binlog.test
new file mode 100644
index 00000000000..5c172afd122
--- /dev/null
+++ b/mysql-test/suite/binlog/include/ctype_cp932_binlog.test
@@ -0,0 +1,35 @@
+-- source include/not_embedded.inc
+-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
+
+--character_set cp932
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+set names cp932;
+set character_set_database = cp932;
+
+# Test prepared statement with 0x8300 sequence in parameter while
+# running with cp932 client character set.
+RESET MASTER;
+CREATE TABLE t1(f1 blob);
+PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
+SET @var1= x'8300';
+# TODO: Note that this doesn't actually test the code which was added for
+# bug#11338 because this syntax for prepared statements causes the PS to
+# be replicated differently than if we executed the PS from C or Java.
+# Using this syntax, variable names are inserted into the binlog instead
+# of values. The real goal of this test is to check the code that was
+# added to Item_param::query_val_str() in order to do hex encoding of
+# PS parameters when the client character set is cp932;
+# Bug#11338 has an example java program which can be used to verify this
+# code (and I have used it to test the fix) until there is some way to
+# exercise this code from mysql-test-run.
+EXECUTE stmt1 USING @var1;
+source include/show_binlog_events.inc;
+SELECT HEX(f1) FROM t1;
+DROP table t1;
+# end test for bug#11338
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/binlog/include/ctype_ucs_binlog.result b/mysql-test/suite/binlog/include/ctype_ucs_binlog.result
new file mode 100644
index 00000000000..c358cfcd4f2
--- /dev/null
+++ b/mysql-test/suite/binlog/include/ctype_ucs_binlog.result
@@ -0,0 +1,212 @@
+SET TIMESTAMP=10000;
+create table t2 (c char(30)) charset=ucs2;
+set @v=convert('abc' using ucs2);
+reset master;
+insert into t2 values (@v);
+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 # User var # # @`v`=_ucs2 X'006100620063' COLLATE ucs2_general_ci
+master-bin.000001 # Query # # use `test`; insert into t2 values (@v)
+master-bin.000001 # Query # # COMMIT
+flush 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 /*!*/;
+ROLLBACK/*!*/;
+BEGIN
+/*!*/;
+SET @`v`:=_ucs2 X'006100620063' COLLATE `ucs2_general_ci`/*!*/;
+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, @@session.check_constraint_checks=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/*!*/;
+insert into t2 values (@v)
+/*!*/;
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+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 t2;
+#
+# Start of 10.2 tests
+#
+#
+# MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
+#
+FLUSH LOGS;
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (''ä(i1)'')';
+EXECUTE IMMEDIATE CONVERT('INSERT INTO t1 VALUES (''ä(i2)'')' USING ucs2);
+SET @stmt=CONVERT('INSERT INTO t1 VALUES (''ä(i3)'')' USING ucs2);
+EXECUTE IMMEDIATE @stmt;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (''ä(p1)'')';
+EXECUTE stmt;
+PREPARE stmt FROM CONVERT('INSERT INTO t1 VALUES (''ä(p2)'')' USING ucs2);
+EXECUTE stmt;
+SET @stmt=CONVERT('INSERT INTO t1 VALUES (''ä(p3)'')' USING ucs2);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SELECT * FROM t1;
+a
+ä(i1)
+ä(i2)
+ä(i3)
+ä(p1)
+ä(p2)
+ä(p3)
+DROP TABLE t1;
+FLUSH 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 #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 700101 6:46:40
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Gtid list [#-#-#]
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=#*//*!*/;
+/*!100001 SET @@session.server_id=#*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+use `test`/*!*/;
+SET TIMESTAMP=10000/*!*/;
+SET @@session.pseudo_thread_id=#/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
+SET @@session.sql_mode=1342177280/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C utf8 *//*!*/;
+SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+INSERT INTO t1 VALUES ('ä(i1)')
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+INSERT INTO t1 VALUES ('ä(i2)')
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+INSERT INTO t1 VALUES ('ä(i3)')
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+INSERT INTO t1 VALUES ('ä(p1)')
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+INSERT INTO t1 VALUES ('ä(p2)')
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+BEGIN
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+INSERT INTO t1 VALUES ('ä(p3)')
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
+/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=10000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+# at #
+#700101 6:46:40 server id # end_log_pos # CRC32 XXX Rotate to master-bin.000004 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*/;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/suite/binlog/include/ctype_ucs_binlog.test b/mysql-test/suite/binlog/include/ctype_ucs_binlog.test
new file mode 100644
index 00000000000..11646f28bfe
--- /dev/null
+++ b/mysql-test/suite/binlog/include/ctype_ucs_binlog.test
@@ -0,0 +1,64 @@
+--source include/not_embedded.inc
+--source include/have_ucs2.inc
+--source include/have_log_bin.inc
+
+#
+# Check correct binlogging of UCS2 user variables (BUG#3875)
+#
+SET TIMESTAMP=10000;
+create table t2 (c char(30)) charset=ucs2;
+set @v=convert('abc' using ucs2);
+reset master;
+insert into t2 values (@v);
+source include/show_binlog_events.inc;
+# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
+# absolutely need variables names to be quoted and strings to be
+# escaped).
+flush logs;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_regex /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
+drop table t2;
+
+# End of 4.1 tests
+
+
+--echo #
+--echo # Start of 10.2 tests
+--echo #
+
+--echo #
+--echo # MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
+--echo #
+
+SET TIMESTAMP=UNIX_TIMESTAMP('1970-01-01 06:46:40');
+
+FLUSH LOGS;
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (''ä(i1)'')';
+EXECUTE IMMEDIATE CONVERT('INSERT INTO t1 VALUES (''ä(i2)'')' USING ucs2);
+SET @stmt=CONVERT('INSERT INTO t1 VALUES (''ä(i3)'')' USING ucs2);
+EXECUTE IMMEDIATE @stmt;
+
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (''ä(p1)'')';
+EXECUTE stmt;
+PREPARE stmt FROM CONVERT('INSERT INTO t1 VALUES (''ä(p2)'')' USING ucs2);
+EXECUTE stmt;
+SET @stmt=CONVERT('INSERT INTO t1 VALUES (''ä(p3)'')' USING ucs2);
+PREPARE stmt FROM @stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SELECT * FROM t1;
+DROP TABLE t1;
+FLUSH LOGS;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/ /(^#|created )[0-9]{6} [ 1][0-9]:[0-9]{2}:[0-9]{2}/\1YYMMDD HH:MM:SS/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -vv $MYSQLD_DATADIR/master-bin.000003
+
+SET TIMESTAMP=DEFAULT;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/suite/binlog/include/database.test b/mysql-test/suite/binlog/include/database.test
new file mode 100644
index 00000000000..097a501cc34
--- /dev/null
+++ b/mysql-test/suite/binlog/include/database.test
@@ -0,0 +1,94 @@
+source include/have_log_bin.inc;
+source include/not_embedded.inc;
+
+# Checking that the drop of a database does not replicate anything in
+# addition to the drop of the database
+
+reset master;
+create database testing_1;
+use testing_1;
+create table t1 (a int);
+create function sf1 (a int) returns int return a+1;
+create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a);
+create procedure sp1 (a int) insert into t1 values(a);
+drop database testing_1;
+source include/show_binlog_events.inc;
+
+# BUG#38773: DROP DATABASE cause switch to stmt-mode when there are
+# temporary tables open
+
+use test;
+reset master;
+create temporary table tt1 (a int);
+create table t1 (a int);
+insert into t1 values (1);
+disable_warnings;
+drop database if exists mysqltest1;
+enable_warnings;
+insert into t1 values (1);
+drop table tt1, t1;
+source include/show_binlog_events.inc;
+
+FLUSH STATUS;
+
+--echo
+--echo # 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
+--echo # when 'DROP DATABASE' fails and at least one table is deleted
+--echo # from the database.
+RESET MASTER;
+CREATE DATABASE testing_1;
+USE testing_1;
+CREATE TABLE t1(c1 INT);
+CREATE TABLE t2(c1 INT);
+
+let $prefix= `SELECT UUID()`;
+--echo # Create a file in the database directory
+--replace_result $prefix FAKE_FILE
+eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix';
+
+--echo
+--echo # 'DROP DATABASE' will fail if there is any other file in the the
+--echo # database directory
+
+# Use '/' instead of '\' in the error message. On windows platform, dir is
+# formed with '\'.
+--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /93/39/ /17/39/ /247/39/ /File exists/Directory not empty/
+--error 1010
+DROP DATABASE testing_1;
+let $wait_binlog_event= DROP TABLE IF EXIST;
+source include/wait_for_binlog_event.inc;
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+--echo
+--echo # Remove the fake file.
+--remove_file $MYSQLD_DATADIR/testing_1/fake_file.$prefix
+--echo # Now we can drop the database.
+DROP DATABASE testing_1;
+
+
+--echo #
+--echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
+--echo # BASED REPLICATION
+--echo #
+
+USE test;
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb;
+CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
+ engine=innodb;
+RESET MASTER;
+
+--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
+
+# Cleanup
+DROP TABLE t3;
+DROP DATABASE db1;
diff --git a/mysql-test/suite/binlog/include/drop_table.test b/mysql-test/suite/binlog/include/drop_table.test
new file mode 100644
index 00000000000..c55cbb67560
--- /dev/null
+++ b/mysql-test/suite/binlog/include/drop_table.test
@@ -0,0 +1,34 @@
+#
+# Bug#989: If DROP TABLE while there's an active transaction, wrong binlog order
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+RESET MASTER;
+CREATE TABLE t1 (a INT);
+SET AUTOCOMMIT=OFF;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+
+connection con2;
+--send DROP TABLE t1;
+
+connection con1;
+COMMIT;
+
+connection con2;
+--reap
+
+connection default;
+
+--disconnect con1
+--disconnect con2
+
+let $VERSION=`select version()`;
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/binlog/include/drop_temp_table.test b/mysql-test/suite/binlog/include/drop_temp_table.test
new file mode 100644
index 00000000000..7c95195eadc
--- /dev/null
+++ b/mysql-test/suite/binlog/include/drop_temp_table.test
@@ -0,0 +1,176 @@
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP DATABASE IF EXISTS `drop-temp+table-test`;
+--enable_warnings
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connection con1;
+RESET MASTER;
+CREATE DATABASE `drop-temp+table-test`;
+USE `drop-temp+table-test`;
+CREATE TEMPORARY TABLE shortn1 (a INT);
+CREATE TEMPORARY TABLE `table:name` (a INT);
+CREATE TEMPORARY TABLE shortn2 (a INT);
+
+##############################################################################
+# MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written
+# to binlog only if the corresponding temporary table exists.
+##############################################################################
+CREATE TEMPORARY TABLE tmp(c1 int);
+CREATE TEMPORARY TABLE tmp1(c1 int);
+CREATE TEMPORARY TABLE tmp2(c1 int);
+CREATE TEMPORARY TABLE tmp3(c1 int);
+CREATE TABLE t(c1 int);
+
+DROP TEMPORARY TABLE IF EXISTS tmp;
+
+--disable_warnings
+# Post MDEV-20091: Following DROP TEMPORARY TABLE statement should not be
+# logged as the table is already dropped above.
+DROP TEMPORARY TABLE IF EXISTS tmp;
+
+# Post MDEV-20091: Only DROP TEMPORARY TABLE statement should be written only
+# for 'tmp1' table.
+DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
+DROP TEMPORARY TABLE tmp3;
+
+#In RBR, tmp2 will NOT be binlogged, because it is a temporary table.
+DROP TABLE IF EXISTS tmp2, t;
+
+#In RBR, tmp2 will be binlogged, because it does not exist and master do not know
+# whether it is a temporary table or not.
+DROP TABLE IF EXISTS tmp2, t;
+--enable_warnings
+
+SELECT GET_LOCK("a",10);
+
+#
+# BUG48216 Replication fails on all slaves after upgrade to 5.0.86 on master
+#
+# When the session is closed, any temporary tables of the session are dropped
+# and are binlogged. But it will be binlogged with a wrong database name when
+# the length of the database name('drop-temp-table-test') is greater than the
+# current database name('test').
+#
+USE test;
+disconnect con1;
+
+connection con2;
+# We want to SHOW BINLOG EVENTS, to know what was logged. But there is no
+# guarantee that logging of the terminated con1 has been done yet.
+# To be sure that logging has been done, we use a user lock.
+SELECT GET_LOCK("a",10);
+let $VERSION=`SELECT VERSION()`;
+source include/show_binlog_events.inc;
+DROP DATABASE `drop-temp+table-test`;
+
+
+#
+# Bug #54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW
+#
+# Sanity test. Checking that implicit DROP event is logged.
+#
+# After BUG#52616, the switch to ROW mode becomes effective even
+# if there are open temporary tables. As such the implicit drop
+# for temporary tables on session closing must be logged.
+#
+# MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written to
+# binlog only if the corresponding temporary table exists. In row based
+# replication temporary tables are not replicated hence their corresponding
+# DROP TEMPORARY TABLE statement will be not be written to binary log upon
+# session closure.
+#
+
+RESET MASTER;
+
+CREATE TABLE t1 ( i text );
+
+--connect(con1,localhost,root,,)
+CREATE TEMPORARY TABLE ttmp1 ( i text );
+SET @@session.binlog_format=ROW;
+INSERT INTO t1 VALUES ('1');
+SELECT @@session.binlog_format;
+--disconnect con1
+
+-- connection default
+if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
+--let $wait_binlog_event= DROP
+--source include/wait_for_binlog_event.inc
+}
+-- source include/show_binlog_events.inc
+RESET MASTER;
+
+DROP TABLE t1;
+
+# End of 4.1 tests
+
+
+--echo #
+--echo # BUG#28642318: POINT IN TIME RECOVERY USING MYSQLBINLOG BROKEN
+--echo # WITH TEMPORARY TABLE -> ERRORS
+
+--echo # Test case for DELETE query.
+
+RESET MASTER;
+connect (con1,localhost,root,,);
+
+--echo # Set up.
+--connection default
+--disable_warnings
+SET @save_binlog_format= @@session.binlog_format;
+SET @@session.binlog_format=STATEMENT;
+let $MYSQLD_DATADIR= `select @@datadir`;
+CREATE TABLE t1 (a INT) ENGINE=INNODB;
+
+--connection con1
+SET @@session.binlog_format=STATEMENT;
+CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
+
+--connection default
+DELETE d1, d2 FROM t1 AS d1, t1 AS d2 WHERE d1.a<>d2.a;
+
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug28642318.sql
+
+--connection default
+DROP TABLE t1;
+
+--echo # DELETE query fails with table re-open error without patch.
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug28642318.sql
+
+--echo # Clean up.
+--connection con1
+DROP TABLE IF EXISTS t1;
+
+--connection default
+DROP TABLE IF EXISTS t1;
+RESET MASTER;
+
+--echo # Test case for DROP query.
+
+--connection default
+CREATE TABLE t2 (a INT) ENGINE=INNODB;
+
+--connection con1
+CREATE TEMPORARY TABLE t2 (b BLOB) ENGINE=INNODB;
+
+--connection default
+DROP TABLE t2;
+
+--connection con1
+DROP TABLE t2;
+
+--connection default
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug28642318.sql
+
+--echo # DROP table query fails with unknown table error without patch.
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug28642318.sql
+
+--echo # Clean up
+--connection default
+SET @@session.binlog_format= @save_binlog_format;
+RESET MASTER;
+
+--disconnect con1
+--enable_warnings
diff --git a/mysql-test/suite/binlog/include/implicit.test b/mysql-test/suite/binlog/include/implicit.test
new file mode 100644
index 00000000000..de906fc0605
--- /dev/null
+++ b/mysql-test/suite/binlog/include/implicit.test
@@ -0,0 +1,28 @@
+# First part: outside a transaction
+RESET MASTER;
+eval $prepare;
+
+INSERT INTO t1 VALUES (1);
+source include/show_binlog_events.inc;
+eval $statement;
+source include/show_binlog_events.inc;
+if ($cleanup) {
+ eval $cleanup;
+}
+
+# Second part: inside a transaction
+RESET MASTER;
+eval $prepare;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+source include/show_binlog_events.inc;
+eval $statement;
+source include/show_binlog_events.inc;
+INSERT INTO t1 VALUES (3);
+source include/show_binlog_events.inc;
+COMMIT;
+source include/show_binlog_events.inc;
+if ($cleanup) {
+ eval $cleanup;
+}
+
diff --git a/mysql-test/suite/binlog/include/insert_select-binlog.test b/mysql-test/suite/binlog/include/insert_select-binlog.test
new file mode 100644
index 00000000000..ef22373a628
--- /dev/null
+++ b/mysql-test/suite/binlog/include/insert_select-binlog.test
@@ -0,0 +1,38 @@
+# Embedded server doesn't support binlog
+-- source include/not_embedded.inc
+-- source include/have_log_bin.inc
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+# Check if a partly-completed INSERT SELECT in a MyISAM table goes into the
+# binlog
+
+create table t1(a int, unique(a));
+insert into t1 values(2);
+create table t2(a int);
+insert into t2 values(1),(2);
+reset master;
+--error ER_DUP_ENTRY
+insert into t1 select * from t2;
+# The above should produce an error, but still be in the binlog;
+# verify the binlog :
+let $VERSION=`select version()`;
+source include/show_binlog_events.inc;
+select * from t1;
+drop table t1, t2;
+
+# Verify that a partly-completed CREATE TABLE .. SELECT does not
+# get into the binlog (Bug #6682)
+create table t1(a int);
+insert into t1 values(1),(1);
+reset master;
+--error ER_DUP_ENTRY
+create table t2(unique(a)) select a from t1;
+# The above should produce an error, *and* not appear in the binlog
+let $VERSION=`select version()`;
+source include/show_binlog_events.inc;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/binlog/include/mix_innodb_myisam_binlog.test b/mysql-test/suite/binlog/include/mix_innodb_myisam_binlog.test
new file mode 100644
index 00000000000..74fbe6b482a
--- /dev/null
+++ b/mysql-test/suite/binlog/include/mix_innodb_myisam_binlog.test
@@ -0,0 +1,654 @@
+# Check that binlog is ok when a transaction mixes updates to InnoDB and
+# MyISAM.
+# It would be nice to make this a replication test, but in 4.0 the
+# slave is always with --skip-innodb in the testsuite. I (Guilhem) however
+# did some tests manually on a slave; tables are replicated fine and
+# Exec_Master_Log_Pos advances as expected.
+
+-- source include/have_log_bin.inc
+-- source include/have_innodb.inc
+
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+
+reset master;
+
+begin;
+insert into t1 values(1);
+insert into t2 select * from t1;
+commit;
+
+source include/show_binlog_events.inc;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(2);
+insert into t2 select * from t1;
+# should say some changes to non-transact1onal tables couldn't be rolled back
+rollback;
+
+source include/show_binlog_events.inc;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(3);
+savepoint my_savepoint;
+insert into t1 values(4);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+commit;
+
+source include/show_binlog_events.inc;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(5);
+savepoint my_savepoint;
+insert into t1 values(6);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+insert into t1 values(7);
+commit;
+select a from t1 order by a; # check that savepoints work :)
+
+source include/show_binlog_events.inc;
+
+# and when ROLLBACK is not explicit?
+delete from t1;
+delete from t2;
+reset master;
+
+select get_lock("a",10);
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+disconnect con1;
+
+connection con2;
+# We want to SHOW BINLOG EVENTS, to know what was logged. But there is no
+# guarantee that logging of the terminated con1 has been done yet (it may not
+# even be started, so con1 may have not even attempted to lock the binlog yet;
+# so SHOW BINLOG EVENTS may come before con1 does the loggin. To be sure that
+# logging has been done, we use a user lock.
+select get_lock("a",10);
+source include/show_binlog_events.inc;
+
+# and when not in a transact1on?
+delete from t1;
+delete from t2;
+reset master;
+
+insert into t1 values(9);
+insert into t2 select * from t1;
+
+source include/show_binlog_events.inc;
+
+# Check that when the query updat1ng the MyISAM table is the first in the
+# transaction, we log it immediately.
+delete from t1;
+delete from t2;
+reset master;
+
+insert into t1 values(10); # first make t1 non-empty
+begin;
+insert into t2 select * from t1;
+source include/show_binlog_events.inc;
+insert into t1 values(11);
+commit;
+
+source include/show_binlog_events.inc;
+
+# Check that things work like before this BEGIN/ROLLBACK code was added,
+# when t2 is INNODB
+
+alter table t2 engine=INNODB;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(12);
+insert into t2 select * from t1;
+commit;
+
+source include/show_binlog_events.inc;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(13);
+insert into t2 select * from t1;
+rollback;
+
+source include/show_binlog_events.inc;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(14);
+savepoint my_savepoint;
+insert into t1 values(15);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+commit;
+
+source include/show_binlog_events.inc;
+
+delete from t1;
+delete from t2;
+reset master;
+
+begin;
+insert into t1 values(16);
+savepoint my_savepoint;
+insert into t1 values(17);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+insert into t1 values(18);
+commit;
+select a from t1 order by a; # check that savepoints work :)
+
+source include/show_binlog_events.inc;
+
+# Test for BUG#5714, where a MyISAM update in the transaction used to
+# release row-level locks in InnoDB
+
+connect (con3,localhost,root,,);
+
+connection con3;
+delete from t1;
+delete from t2;
+--disable_warnings
+alter table t2 engine=MyISAM;
+--enable_warnings
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+
+connection con2;
+select (@before:=unix_timestamp())*0; # always give repeatable output
+begin;
+send select * from t1 for update;
+
+connection con3;
+insert into t2 values (20);
+
+connection con2;
+--error 1205
+reap;
+select (@after:=unix_timestamp())*0; # always give repeatable output
+# verify that innodb_lock_wait_timeout was exceeded. When there was
+# the bug, the reap would return immediately after the insert into t2.
+select (@after-@before) >= 2;
+
+connection con3;
+commit;
+
+connection con2;
+drop table t1,t2;
+commit;
+
+# test for BUG#7947 - DO RELEASE_LOCK() not written to binlog on rollback in
+# the middle of a transaction
+
+connection con2;
+begin;
+create temporary table ti (a int) engine=innodb;
+rollback;
+insert into ti values(1);
+set autocommit=0;
+create temporary table t1 (a int) engine=myisam;
+commit;
+insert t1 values (1);
+rollback;
+create table t0 (n int);
+insert t0 select * from t1;
+set autocommit=1;
+insert into t0 select GET_LOCK("lock1",0);
+set autocommit=0;
+create table t2 (n int) engine=innodb;
+insert into t2 values (3);
+disconnect con2;
+connection con3;
+select get_lock("lock1",60);
+source include/show_binlog_events.inc;
+do release_lock("lock1");
+drop table t0,t2;
+
+# End of 4.1 tests
+
+#
+# Test behaviour of CREATE ... SELECT when mixing MyISAM and InnoDB tables
+#
+
+set autocommit=0;
+CREATE TABLE t1 (a int, b int) engine=myisam;
+reset master;
+INSERT INTO t1 values (1,1),(1,2);
+--error ER_DUP_ENTRY
+CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
+# This should give warning
+DROP TABLE if exists t2;
+INSERT INTO t1 values (3,3);
+--error ER_DUP_ENTRY
+CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
+ROLLBACK;
+# This should give warning
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
+INSERT INTO t1 VALUES (4,4);
+CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+SELECT * from t2;
+TRUNCATE table t2;
+INSERT INTO t1 VALUES (5,5);
+--error ER_DUP_ENTRY
+INSERT INTO t2 select * from t1;
+SELECT * FROM t2;
+DROP TABLE t2;
+
+INSERT INTO t1 values (6,6);
+CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
+INSERT INTO t1 values (7,7);
+ROLLBACK;
+INSERT INTO t1 values (8,8);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+COMMIT;
+INSERT INTO t1 values (9,9);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ROLLBACK;
+SELECT * from t2;
+TRUNCATE table t2;
+INSERT INTO t1 values (10,10);
+--error ER_DUP_ENTRY
+INSERT INTO t2 select * from t1;
+SELECT * from t1;
+INSERT INTO t2 values (100,100);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+COMMIT;
+INSERT INTO t2 values (101,101);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ROLLBACK;
+SELECT * from t2;
+DROP TABLE t1,t2;
+source include/show_binlog_events.inc;
+
+# Test for BUG#16559 (ROLLBACK should always have a zero error code in
+# binlog). Has to be here and not earlier, as the SELECTs influence
+# XIDs differently between normal and ps-protocol (and SHOW BINLOG
+# EVENTS above read XIDs).
+
+connect (con4,localhost,root,,);
+connection con3;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+select get_lock("a",10);
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+
+disconnect con3;
+
+connection con4;
+select get_lock("a",10); # wait for rollback to finish
+if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
+{
+ --let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 11)
+ --let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 11)
+ if ($binlog_query != ROLLBACK) {
+ --echo Wrong query from SHOW BINLOG EVENTS. Expected ROLLBACK, got '$binlog_query'
+ --source include/show_rpl_debug_info.inc
+ --die Wrong value for slave parameter
+ }
+}
+flush logs;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+# we check that the error code of the "ROLLBACK" event is 0 and not
+# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
+# and does not make slave to stop)
+
+-- source include/binlog_start_pos.inc
+
+if (`select @@binlog_format = 'ROW'`)
+{
+ --echo There is nothing to roll back; transactional changes are removed from the trans cache.
+}
+
+if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
+{
+ --exec $MYSQL_BINLOG --start-position=$binlog_rollback $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+
+ --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+ eval select
+ (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
+ is not null;
+ --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+ eval select
+ @a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
+ @a like "%#%error_code=0%ROLLBACK\\r\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
+ @a not like "%#%error_code=%error_code=%";
+}
+drop table t1, t2;
+
+#
+# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
+# bug #28960 non-trans temp table changes with insert .. select
+# not binlogged after rollback
+#
+# testing appearence of insert into temp_table in binlog.
+# There are two branches of execution that require different setup.
+
+## send_eof() branch
+
+# prepare
+
+create temporary table tt (a int unique);
+create table ti (a int) engine=innodb;
+reset master;
+
+# action
+
+begin;
+insert into ti values (1);
+insert into ti values (2) ;
+# This is SAFE because --binlog-direct-non-transactional-updates=FALSE
+insert into tt select * from ti;
+rollback;
+
+# check
+
+select count(*) from tt /* 2 */;
+source include/show_binlog_events.inc;
+select count(*) from ti /* zero */;
+insert into ti select * from tt;
+select * from ti /* that is what slave would miss - a bug */;
+
+
+## send_error() branch
+delete from ti;
+delete from tt where a=1;
+reset master;
+
+# action
+
+begin;
+insert into ti values (1);
+insert into ti values (2) /* to make the dup error in the following */;
+--error ER_DUP_ENTRY
+insert into tt select * from ti /* one affected and error */;
+rollback;
+
+# check
+
+source include/show_binlog_events.inc;
+select count(*) from ti /* zero */;
+insert into ti select * from tt;
+select * from tt /* that is what otherwise slave missed - the bug */;
+
+drop table ti, tt;
+
+
+#
+# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
+#
+# Testing asserts: if there is a side effect of modifying non-transactional
+# table thd->no_trans_update.stmt must be TRUE;
+# the assert is active with debug build
+#
+
+--disable_warnings
+drop function if exists bug27417;
+drop table if exists t1,t2;
+--enable_warnings
+# side effect table
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+# target tables
+CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
+
+delimiter |;
+create function bug27417(n int)
+RETURNS int(11)
+begin
+ insert into t1 values (null);
+ return n;
+end|
+delimiter ;|
+
+reset master;
+
+# execute
+
+insert into t2 values (bug27417(1));
+insert into t2 select bug27417(2);
+reset master;
+
+--error ER_DUP_ENTRY
+insert into t2 values (bug27417(2));
+source include/show_binlog_events.inc; /* only (!) with fixes for #23333 will show there is the query */;
+select count(*) from t1 /* must be 3 */;
+
+reset master;
+select count(*) from t2;
+delete from t2 where a=bug27417(3);
+select count(*) from t2 /* nothing got deleted */;
+source include/show_binlog_events.inc; /* the query must be in regardless of #23333 */;
+select count(*) from t1 /* must be 5 */;
+
+--enable_info
+delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
+--disable_info
+select count(*) from t1 /* must be 7 */;
+
+# function bug27417 remains for the following testing of bug#23333
+drop table t1,t2;
+
+#
+# Bug#23333 using the patch (and the test) for bug#27471
+#
+# throughout the bug tests
+# t1 - non-trans side effects gatherer;
+# t2 - transactional table;
+#
+
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
+CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
+CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+
+
+#
+# INSERT
+#
+
+# prepare
+
+ insert into t2 values (1);
+ reset master;
+
+# execute
+
+ --error ER_DUP_ENTRY
+ insert into t2 values (bug27417(1));
+
+# check
+
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+ select count(*) from t1 /* must be 1 */;
+
+#
+# INSERT SELECT
+#
+
+# prepare
+ delete from t1;
+ delete from t2;
+ insert into t2 values (2);
+ reset master;
+
+# execute
+
+ --error ER_DUP_ENTRY
+ insert into t2 select bug27417(1) union select bug27417(2);
+
+# check
+
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+ select count(*) from t1 /* must be 2 */;
+
+#
+# UPDATE inc multi-update
+#
+
+# prepare
+ delete from t1;
+ insert into t3 values (1,1),(2,3),(3,4);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ update t3 set b=b+bug27417(1);
+
+# check
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+ select count(*) from t1 /* must be 2 */;
+
+## multi_update::send_eof() branch
+
+# prepare
+ delete from t3;
+ delete from t4;
+ insert into t3 values (1,1);
+ insert into t4 values (1,1),(2,2);
+
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
+
+# check
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+ select count(*) from t1 /* must be 4 */;
+
+## send_error() branch of multi_update
+
+# prepare
+ delete from t1;
+ delete from t3;
+ delete from t4;
+ insert into t3 values (1,1),(2,2);
+ insert into t4 values (1,1),(2,2);
+
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+
+# check
+ select count(*) from t1 /* must be 1 */;
+
+# cleanup
+ drop table t4;
+
+
+#
+# DELETE incl multi-delete
+#
+
+# prepare
+ delete from t1;
+ delete from t2;
+ delete from t3;
+ insert into t2 values (1);
+ insert into t3 values (1,1);
+ create trigger trg_del before delete on t2 for each row
+ insert into t3 values (bug27417(1), 2);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ delete from t2;
+# check
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+ select count(*) from t1 /* must be 1 */;
+
+# cleanup
+ drop trigger trg_del;
+
+# prepare
+ delete from t1;
+ delete from t2;
+ delete from t5;
+ create trigger trg_del_t2 after delete on t2 for each row
+ insert into t1 values (1);
+ insert into t2 values (2),(3);
+ insert into t5 values (1),(2);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ delete t2.* from t2,t5 where t2.a=t5.a + 1;
+
+# check
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+ select count(*) from t1 /* must be 1 */;
+
+
+#
+# LOAD DATA
+#
+
+# prepare
+ delete from t1;
+ create table t4 (a int default 0, b int primary key) engine=innodb;
+ insert into t4 values (0, 17);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+# check
+ select * from t4;
+ select count(*) from t1 /* must be 2 */;
+ source include/show_binlog_events.inc; /* the output must denote there is the query */;
+
+#
+# bug#23333 cleanup
+#
+
+
+drop trigger trg_del_t2;
+drop table t1,t2,t3,t4,t5;
+drop function bug27417;
+
+
+--echo end of tests
+
diff --git a/mysql-test/suite/binlog/include/mix_innodb_myisam_side_effects.test b/mysql-test/suite/binlog/include/mix_innodb_myisam_side_effects.test
new file mode 100644
index 00000000000..7eca19bc834
--- /dev/null
+++ b/mysql-test/suite/binlog/include/mix_innodb_myisam_side_effects.test
@@ -0,0 +1,295 @@
+# the file to be sourced from binlog.binlog_mix_innodb_myisam
+
+#
+# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
+# bug #28960 non-trans temp table changes with insert .. select
+# not binlogged after rollback
+#
+# testing appearence of insert into temp_table in binlog.
+# There are two branches of execution that require different setup.
+
+# checking binlog content filled with row-based events due to
+# a used stored function modifies non-transactional table
+
+## send_eof() branch
+
+# prepare
+
+create temporary table tt (a int unique);
+create table ti (a int) engine=innodb;
+reset master;
+
+# action
+
+begin;
+insert into ti values (1);
+insert into ti values (2) ;
+# This is SAFE because --binlog-direct-non-transactional-updates=FALSE
+insert into tt select * from ti;
+rollback;
+
+# check
+
+select count(*) from tt /* 2 */;
+source include/show_binlog_events.inc;
+select count(*) from ti /* zero */;
+insert into ti select * from tt;
+select * from ti /* that is what slave would miss - bug#28960 */;
+
+
+## send_error() branch
+delete from ti;
+delete from tt where a=1;
+reset master;
+
+# action
+
+begin;
+insert into ti values (1);
+insert into ti values (2) /* to make the dup error in the following */;
+--error ER_DUP_ENTRY
+insert into tt select * from ti /* one affected and error */;
+rollback;
+
+# check
+
+source include/show_binlog_events.inc; # nothing in binlog with row bilog format
+select count(*) from ti /* zero */;
+insert into ti select * from tt;
+select * from tt /* that is what otherwise slave missed - the bug */;
+
+drop table ti;
+
+
+#
+# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
+#
+# Testing asserts: if there is a side effect of modifying non-transactional
+# table thd->no_trans_update.stmt must be TRUE;
+# the assert is active with debug build
+#
+
+--disable_warnings
+drop function if exists bug27417;
+drop table if exists t1,t2;
+--enable_warnings
+# side effect table
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+# target tables
+CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
+
+delimiter |;
+create function bug27417(n int)
+RETURNS int(11)
+begin
+ insert into t1 values (null);
+ return n;
+end|
+delimiter ;|
+
+reset master;
+
+# execute
+
+insert into t2 values (bug27417(1));
+insert into t2 select bug27417(2);
+reset master;
+
+--error ER_DUP_ENTRY
+insert into t2 values (bug27417(2));
+source include/show_binlog_events.inc; #only (!) with fixes for #23333 will show there is the query
+select count(*) from t1 /* must be 3 */;
+
+reset master;
+select count(*) from t2;
+delete from t2 where a=bug27417(3);
+select count(*) from t2 /* nothing got deleted */;
+source include/show_binlog_events.inc; # the query must be in regardless of #23333
+select count(*) from t1 /* must be 5 */;
+
+--enable_info
+delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
+--disable_info
+select count(*) from t1 /* must be 7 */;
+
+# function bug27417 remains for the following testing of bug#23333
+drop table t1,t2;
+
+#
+# Bug#23333 using the patch (and the test) for bug#27471
+# throughout the bug tests
+# t1 - non-trans side effects gatherer;
+# t2 - transactional table;
+#
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
+CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
+CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+
+
+#
+# INSERT
+#
+
+# prepare
+
+ insert into t2 values (1);
+ reset master;
+
+# execute
+
+ --error ER_DUP_ENTRY
+ insert into t2 values (bug27417(1));
+
+# check
+
+ source include/show_binlog_events.inc; # must be event of the query
+ select count(*) from t1 /* must be 1 */;
+
+#
+# INSERT SELECT
+#
+
+# prepare
+ delete from t1;
+ delete from t2;
+ insert into t2 values (2);
+ reset master;
+
+# execute
+
+ --error ER_DUP_ENTRY
+ insert into t2 select bug27417(1) union select bug27417(2);
+
+# check
+
+ source include/show_binlog_events.inc; # must be events of the query
+ select count(*) from t1 /* must be 2 */;
+
+#
+# UPDATE inc multi-update
+#
+
+# prepare
+ delete from t1;
+ insert into t3 values (1,1),(2,3),(3,4);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ update t3 set b=b+bug27417(1);
+
+# check
+ source include/show_binlog_events.inc; # must be events of the query
+ select count(*) from t1 /* must be 2 */;
+
+## multi_update::send_eof() branch
+
+# prepare
+ delete from t3;
+ delete from t4;
+ insert into t3 values (1,1);
+ insert into t4 values (1,1),(2,2);
+
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
+
+# check
+ source include/show_binlog_events.inc; # the offset must denote there is the query
+ select count(*) from t1 /* must be 4 */;
+
+## send_error() branch of multi_update
+
+# prepare
+ delete from t1;
+ delete from t3;
+ delete from t4;
+ insert into t3 values (1,1),(2,2);
+ insert into t4 values (1,1),(2,2);
+
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
+
+# check
+ select count(*) from t1 /* must be 1 */;
+
+# cleanup
+ drop table t4;
+
+
+#
+# DELETE incl multi-delete
+#
+
+# prepare
+ delete from t1;
+ delete from t2;
+ delete from t3;
+ insert into t2 values (1);
+ insert into t3 values (1,1);
+ create trigger trg_del before delete on t2 for each row
+ insert into t3 values (bug27417(1), 2);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ delete from t2;
+# check
+ source include/show_binlog_events.inc; # the offset must denote there is the query
+ select count(*) from t1 /* must be 1 */;
+
+# cleanup
+ drop trigger trg_del;
+
+# prepare
+ delete from t1;
+ delete from t2;
+ delete from t5;
+ create trigger trg_del_t2 after delete on t2 for each row
+ insert into t1 values (1);
+ insert into t2 values (2),(3);
+ insert into t5 values (1),(2);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ delete t2.* from t2,t5 where t2.a=t5.a + 1;
+
+# check
+ source include/show_binlog_events.inc; # must be events of the query
+ select count(*) from t1 /* must be 1 */;
+
+
+#
+# LOAD DATA
+#
+
+# prepare
+ delete from t1;
+ create table t4 (a int default 0, b int primary key) engine=innodb;
+ insert into t4 values (0, 17);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+# check
+ select * from t4;
+ select count(*) from t1 /* must be 2 */;
+ source include/show_binlog_events.inc; # must be events of the query
+
+#
+# bug#23333 cleanup
+#
+
+
+drop trigger trg_del_t2;
+drop table t1,t2,t3,t4,t5;
+drop function bug27417;
diff --git a/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc b/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc
new file mode 100644
index 00000000000..ce919550b51
--- /dev/null
+++ b/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc
@@ -0,0 +1,1923 @@
+# mysqlbinlog_row.test
+#
+# Show that mysqlbinlog displays human readable comments to
+# row-based log events.
+#
+# Procedure:
+# Create a table that represents all-known types in 5.1.
+# Write rows that contain the mins, maxes, and NULL for each type.
+# Write a random or "problematic" value (i.e. one that might require
+# escaping if it's represented as a string-y type) for each type.
+# Update each of these rows.
+# Delete each of these rows.
+# Inspect the binlog.
+#
+# Bug#31455 - mysqlbinlog don't print user readable info about RBR events
+#
+
+--source include/have_log_bin.inc
+set sql_mode="";
+
+SET NAMES 'utf8';
+#SHOW VARIABLES LIKE 'character_set%';
+
+
+--echo #
+--echo # Preparatory cleanup.
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+--echo #
+--echo # We need a fixed timestamp to avoid varying results.
+--echo #
+SET timestamp=1000000000;
+
+--echo #
+--echo # ===================================================
+--echo # Test #1 - Insert/update/delete with all data types.
+--echo # ===================================================
+--echo #
+--echo # Delete all existing binary logs.
+--echo #
+RESET MASTER;
+
+--echo #
+--echo # Create a test table with all data types.
+--echo #
+eval CREATE TABLE t1 (
+ c01 BIT,
+ c02 BIT(64),
+ c03 TINYINT,
+ c04 TINYINT UNSIGNED,
+ c05 TINYINT ZEROFILL,
+ c06 BOOL,
+ c07 SMALLINT,
+ c08 SMALLINT UNSIGNED,
+ c09 SMALLINT ZEROFILL,
+ c10 MEDIUMINT,
+ c11 MEDIUMINT UNSIGNED,
+ c12 MEDIUMINT ZEROFILL,
+ c13 INT,
+ c14 INT UNSIGNED,
+ c15 INT ZEROFILL,
+ c16 BIGINT,
+ c17 BIGINT UNSIGNED,
+ c18 BIGINT ZEROFILL,
+ c19 FLOAT,
+ c20 FLOAT UNSIGNED,
+ c21 FLOAT ZEROFILL,
+ c22 DOUBLE,
+ c23 DOUBLE UNSIGNED,
+ c24 DOUBLE ZEROFILL,
+ c25 DECIMAL,
+ c26 DECIMAL UNSIGNED,
+ c27 DECIMAL ZEROFILL,
+ #
+ c28 DATE,
+ c29 DATETIME,
+ c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ c31 TIME,
+ c32 YEAR,
+ #
+ c33 CHAR,
+ c34 CHAR(0),
+ c35 CHAR(1),
+ c36 CHAR(255),
+ c37 NATIONAL CHAR,
+ c38 NATIONAL CHAR(0),
+ c39 NATIONAL CHAR(1),
+ c40 NATIONAL CHAR(255),
+ c41 CHAR CHARACTER SET UCS2,
+ c42 CHAR(0) CHARACTER SET UCS2,
+ c43 CHAR(1) CHARACTER SET UCS2,
+ c44 CHAR(255) CHARACTER SET UCS2,
+ #
+ c45 VARCHAR(0),
+ c46 VARCHAR(1),
+ c47 VARCHAR(255),
+ c48 VARCHAR(261),
+ c49 NATIONAL VARCHAR(0),
+ c50 NATIONAL VARCHAR(1),
+ c51 NATIONAL VARCHAR(255),
+ c52 NATIONAL VARCHAR(261),
+ c53 VARCHAR(0) CHARACTER SET UCS2,
+ c54 VARCHAR(1) CHARACTER SET UCS2,
+ c55 VARCHAR(255) CHARACTER SET UCS2,
+ c56 VARCHAR(261) CHARACTER SET UCS2,
+ #
+ c57 BINARY,
+ c58 BINARY(0),
+ c59 BINARY(1),
+ c60 BINARY(255),
+ #
+ c61 VARBINARY(0),
+ c62 VARBINARY(1),
+ c63 VARBINARY(255),
+ c64 VARBINARY(261),
+ #
+ c65 TINYBLOB,
+ c66 TINYTEXT,
+ c67 TINYTEXT CHARACTER SET UCS2,
+ c68 BLOB,
+ c69 TEXT,
+ c70 TEXT CHARACTER SET UCS2,
+ c71 MEDIUMBLOB,
+ c72 MEDIUMTEXT,
+ c73 MEDIUMTEXT CHARACTER SET UCS2,
+ c74 LONGBLOB,
+ c75 LONGTEXT,
+ c76 LONGTEXT CHARACTER SET UCS2,
+ #
+ c77 ENUM('a','b','c'),
+ c78 SET('a','b','c'),
+ #
+ crn INT -- row number
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+
+--echo #
+--echo # Insert minimum values.
+--echo #
+INSERT INTO t1 VALUES (
+ b'0', -- c01
+ b'0000000000000000000000000000000000000000000000000000000000000000', -- c02
+ -128, -- c03
+ 0, -- c04
+ 000, -- c05
+ false, -- c06
+ -32768, -- c07
+ 0, -- c08
+ 00000, -- c09
+ -8388608, -- c10
+ 0, -- c11
+ 00000000, -- c12
+ -2147483648, -- c13
+ 0, -- c14
+ 0000000000, -- c15
+ -9223372036854775808, -- c16
+ 0, -- c17
+ 00000000000000000000, -- c18
+ -3.402823466E+38, -- c19
+ 1.175494351E-38, -- c20
+ 000000000000, -- c21
+ -1.7976931348623E+308, -- c22 three digits cut for ps-protocol
+ 2.2250738585072E-308, -- c23 three digits cut for ps-protocol
+ 0000000000000000000000, -- c24
+ -9999999999, -- c25
+ 0, -- c26
+ 0000000000, -- c27
+ #
+ '1000-01-01', -- c28
+ '1000-01-01 00:00:00', -- c29
+ '1970-01-02 00:00:01', -- c30 one day later due to timezone issues
+ '-838:59:59', -- c31
+ '1901', -- c32
+ #
+ '', -- c33
+ '', -- c34
+ '', -- c35
+ '', -- c36
+ '', -- c37
+ '', -- c38
+ '', -- c39
+ '', -- c40
+ '', -- c41
+ '', -- c42
+ '', -- c43
+ '', -- c44
+ #
+ '', -- c45
+ '', -- c46
+ '', -- c47
+ '', -- c48
+ '', -- c49
+ '', -- c50
+ '', -- c51
+ '', -- c52
+ '', -- c53
+ '', -- c54
+ '', -- c55
+ '', -- c56
+ #
+ '', -- c57
+ '', -- c58
+ '', -- c59
+ '', -- c60
+ #
+ '', -- c61
+ '', -- c62
+ '', -- c63
+ '', -- c64
+ #
+ '', -- c65
+ '', -- c66
+ '', -- c67
+ '', -- c68
+ '', -- c69
+ '', -- c70
+ '', -- c71
+ '', -- c72
+ '', -- c73
+ '', -- c74
+ '', -- c75
+ '', -- c76
+ #
+ 'a', -- c77
+ '', -- c78
+ #
+ 1 -- crn -- row number
+ );
+
+--echo #
+--echo # Insert maximum values.
+--echo #
+INSERT INTO t1 VALUES (
+ b'1', -- c01
+ b'1111111111111111111111111111111111111111111111111111111111111111', -- c02
+ 127, -- c03
+ 255, -- c04
+ 255, -- c05
+ true, -- c06
+ 32767, -- c07
+ 65535, -- c08
+ 65535, -- c09
+ 8388607, -- c10
+ 16777215, -- c11
+ 16777215, -- c12
+ 2147483647, -- c13
+ 4294967295, -- c14
+ 4294967295, -- c15
+ 9223372036854775807, -- c16
+ 18446744073709551615, -- c17
+ 18446744073709551615, -- c18
+ 3.402823466E+38, -- c19
+ 3.402823466E+38, -- c20
+ 3.402823466E+38, -- c21
+ 1.7976931348623E+308, -- c22 three digits cut for ps-protocol
+ 1.7976931348623E+308, -- c23 three digits cut for ps-protocol
+ 1.7976931348623E+308, -- c24 three digits cut for ps-protocol
+ 9999999999, -- c25
+ 9999999999, -- c26
+ 9999999999, -- c27
+ #
+ '9999-12-31', -- c28
+ '9999-12-31 23:59:59', -- c29
+ '2038-01-08 03:14:07', -- c30 one day earlier due to timezone issues
+ '838:59:59', -- c31
+ '2155', -- c32
+ #
+ x'ff', -- c33
+ '', -- c34
+ x'ff', -- c35
+ REPEAT(x'ff',255), -- c36
+ _utf8 x'efbfbf', -- c37
+ '', -- c38
+ _utf8 x'efbfbf', -- c39
+ REPEAT(_utf8 x'efbfbf',255), -- c40
+ _ucs2 x'ffff', -- c41
+ '', -- c42
+ _ucs2 x'ffff', -- c43
+ REPEAT(_ucs2 x'ffff',255), -- c44
+ #
+ '', -- c45
+ x'ff', -- c46
+ REPEAT(x'ff',255), -- c47
+ REPEAT(x'ff',261), -- c48
+ '', -- c49
+ _utf8 x'efbfbf', -- c50
+ REPEAT(_utf8 x'efbfbf',255), -- c51
+ REPEAT(_utf8 x'efbfbf',261), -- c52
+ '', -- c53
+ _ucs2 x'ffff', -- c54
+ REPEAT(_ucs2 x'ffff',255), -- c55
+ REPEAT(_ucs2 x'ffff',261), -- c56
+ #
+ x'ff', -- c57
+ '', -- c58
+ x'ff', -- c59
+ REPEAT(x'ff',255), -- c60
+ #
+ '', -- c61
+ x'ff', -- c62
+ REPEAT(x'ff',255), -- c63
+ REPEAT(x'ff',261), -- c64
+ #
+ 'tinyblob', -- c65 not using maximum value here
+ 'tinytext', -- c66 not using maximum value here
+ 'tinytext-ucs2', -- c67 not using maximum value here
+ 'blob', -- c68 not using maximum value here
+ 'text', -- c69 not using maximum value here
+ 'text-ucs2', -- c70 not using maximum value here
+ 'mediumblob', -- c71 not using maximum value here
+ 'mediumtext', -- c72 not using maximum value here
+ 'mediumtext-ucs2', -- c73 not using maximum value here
+ 'longblob', -- c74 not using maximum value here
+ 'longtext', -- c75 not using maximum value here
+ 'longtext-ucs2', -- c76 not using maximum value here
+ #
+ 'c', -- c77
+ 'a,b,c', -- c78
+ #
+ 2 -- crn -- row number
+ );
+
+--echo #
+--echo # Insert a row with NULL values and one with arbitrary values.
+--echo #
+INSERT INTO t1 VALUES (
+ NULL, -- c01
+ NULL, -- c02
+ NULL, -- c03
+ NULL, -- c04
+ NULL, -- c05
+ NULL, -- c06
+ NULL, -- c07
+ NULL, -- c08
+ NULL, -- c09
+ NULL, -- c10
+ NULL, -- c11
+ NULL, -- c12
+ NULL, -- c13
+ NULL, -- c14
+ NULL, -- c15
+ NULL, -- c16
+ NULL, -- c17
+ NULL, -- c18
+ NULL, -- c19
+ NULL, -- c20
+ NULL, -- c21
+ NULL, -- c22
+ NULL, -- c23
+ NULL, -- c24
+ NULL, -- c25
+ NULL, -- c26
+ NULL, -- c27
+ #
+ NULL, -- c28
+ NULL, -- c29
+ NULL, -- c30
+ NULL, -- c31
+ NULL, -- c32
+ #
+ NULL, -- c33
+ NULL, -- c34
+ NULL, -- c35
+ NULL, -- c36
+ NULL, -- c37
+ NULL, -- c38
+ NULL, -- c39
+ NULL, -- c40
+ NULL, -- c41
+ NULL, -- c42
+ NULL, -- c43
+ NULL, -- c44
+ #
+ NULL, -- c45
+ NULL, -- c46
+ NULL, -- c47
+ NULL, -- c48
+ NULL, -- c49
+ NULL, -- c50
+ NULL, -- c51
+ NULL, -- c52
+ NULL, -- c53
+ NULL, -- c54
+ NULL, -- c55
+ NULL, -- c56
+ #
+ NULL, -- c57
+ NULL, -- c58
+ NULL, -- c59
+ NULL, -- c60
+ #
+ NULL, -- c61
+ NULL, -- c62
+ NULL, -- c63
+ NULL, -- c64
+ #
+ NULL, -- c65
+ NULL, -- c66
+ NULL, -- c67
+ NULL, -- c68
+ NULL, -- c69
+ NULL, -- c70
+ NULL, -- c71
+ NULL, -- c72
+ NULL, -- c73
+ NULL, -- c74
+ NULL, -- c75
+ NULL, -- c76
+ #
+ NULL, -- c77
+ NULL, -- c78
+ #
+ 3 -- crn -- row number
+ ), (
+ b'1', -- c01
+ b'1111111111111111111111111111111111111111111111111111111111111111', -- c02
+ 127, -- c03
+ 0, -- c04
+ 001, -- c05
+ true, -- c06
+ 32767, -- c07
+ 0, -- c08
+ 00001, -- c09
+ 8388607, -- c10
+ 0, -- c11
+ 00000001, -- c12
+ 2147483647, -- c13
+ 0, -- c14
+ 0000000001, -- c15
+ 9223372036854775807, -- c16
+ 0, -- c17
+ 00000000000000000001, -- c18
+ -1.175494351E-38, -- c19
+ 1.175494351E-38, -- c20
+ 000000000000001, -- c21
+ -2.2250738585072E-308, -- c22
+ 2.2250738585072E-308, -- c23
+ 00000000000000000000001, -- c24
+ -9999999999, -- c25
+ 9999999999, -- c26
+ 0000000001, -- c27
+ #
+ '2008-08-04', -- c28
+ '2008-08-04 16:18:06', -- c29
+ '2008-08-04 16:18:24', -- c30
+ '16:18:47', -- c31
+ '2008', -- c32
+ #
+ 'a', -- c33
+ '', -- c34
+ 'e', -- c35
+ REPEAT('i',255), -- c36
+ _utf8 x'c3a4', -- c37
+ '', -- c38
+ _utf8 x'c3b6', -- c39
+ REPEAT(_utf8 x'c3bc',255), -- c40
+ _ucs2 x'00e4', -- c41
+ '', -- c42
+ _ucs2 x'00f6', -- c43
+ REPEAT(_ucs2 x'00fc',255), -- c44
+ #
+ '', -- c45
+ 'a', -- c46
+ REPEAT('e',255), -- c47
+ REPEAT('i',261), -- c48
+ '', -- c49
+ _utf8 x'c3a4', -- c50
+ REPEAT(_utf8 x'c3b6',255), -- c51
+ REPEAT(_utf8 x'c3bc',261), -- c52
+ '', -- c53
+ _ucs2 x'00e4', -- c54
+ REPEAT(_ucs2 x'00f6',255), -- c55
+ REPEAT(_ucs2 x'00fc',261), -- c56
+ #
+ '0', -- c57
+ '', -- c58
+ '1', -- c59
+ REPEAT('1',255), -- c60
+ #
+ '', -- c61
+ 'b', -- c62
+ REPEAT('c',255), -- c63
+ REPEAT('\'',261), -- c64
+ #
+ 'tinyblob', -- c65
+ 'tinytext', -- c66
+ 'tinytext-ucs2', -- c67
+ 'blob', -- c68
+ 'text', -- c69
+ 'text-ucs2', -- c70
+ 'mediumblob', -- c71
+ 'mediumtext', -- c72
+ 'mediumtext-ucs2', -- c73
+ 'longblob', -- c74
+ 'longtext', -- c75
+ 'longtext-ucs2', -- c76
+ #
+ 'b', -- c77
+ 'b,c', -- c78
+ #
+ 4 -- crn -- row number
+ );
+
+--echo #
+--echo # Show what we have in the table.
+--echo # Do not display bit type output. It's binary and confuses diff.
+--echo # Also BINARY with nul-bytes should be avoided.
+--echo #
+--replace_column 1 # 2 # 57 # 58 # 59 # 60 #
+query_vertical SELECT * FROM t1;
+
+--echo #
+--echo # NOTE: For matching FLOAT and DOUBLE values in WHERE conditions,
+--echo # don't use exact match, but < or > and tweak the numbers a bit.
+--echo #
+--echo # Show how much rows are affected by each statement.
+--echo #
+--enable_info
+
+--echo #
+--echo # Update min values to max values.
+--echo #
+UPDATE t1 SET
+ c01 = b'1',
+ c02 = b'1111111111111111111111111111111111111111111111111111111111111111',
+ c03 = 127,
+ c04 = 255,
+ c05 = 255,
+ c06 = true,
+ c07 = 32767,
+ c08 = 65535,
+ c09 = 65535,
+ c10 = 8388607,
+ c11 = 16777215,
+ c12 = 16777215,
+ c13 = 2147483647,
+ c14 = 4294967295,
+ c15 = 4294967295,
+ c16 = 9223372036854775807,
+ c17 = 18446744073709551615,
+ c18 = 18446744073709551615,
+ c19 = 3.402823466E+38,
+ c20 = 3.402823466E+38,
+ c21 = 3.402823466E+38,
+ c22 = 1.7976931348623E+308,
+ c23 = 1.7976931348623E+308,
+ c24 = 1.7976931348623E+308,
+ c25 = 9999999999,
+ c26 = 9999999999,
+ c27 = 9999999999,
+ #
+ c28 = '9999-12-31',
+ c29 = '9999-12-31 23:59:59',
+ c30 = '2038-01-08 03:14:07',
+ c31 = '838:59:59',
+ c32 = '2155',
+ #
+ c33 = x'ff',
+ c34 = '',
+ c35 = x'ff',
+ c36 = REPEAT(x'ff',255),
+ c37 = _utf8 x'efbfbf',
+ c38 = '',
+ c39 = _utf8 x'efbfbf',
+ c40 = REPEAT(_utf8 x'efbfbf',255),
+ c41 = _ucs2 x'ffff',
+ c42 = '',
+ c43 = _ucs2 x'ffff',
+ c44 = REPEAT(_ucs2 x'ffff',255),
+ #
+ c45 = '',
+ c46 = x'ff',
+ c47 = REPEAT(x'ff',255),
+ c48 = REPEAT(x'ff',261),
+ c49 = '',
+ c50 = _utf8 x'efbfbf',
+ c51 = REPEAT(_utf8 x'efbfbf',255),
+ c52 = REPEAT(_utf8 x'efbfbf',261),
+ c53 = '',
+ c54 = _ucs2 x'ffff',
+ c55 = REPEAT(_ucs2 x'ffff',255),
+ c56 = REPEAT(_ucs2 x'ffff',261),
+ #
+ c57 = x'ff',
+ c58 = '',
+ c59 = x'ff',
+ c60 = REPEAT(x'ff',255),
+ #
+ c61 = '',
+ c62 = x'ff',
+ c63 = REPEAT(x'ff',255),
+ c64 = REPEAT(x'ff',261),
+ #
+ c65 = 'tinyblob',
+ c66 = 'tinytext',
+ c67 = 'tinytext-ucs2',
+ c68 = 'blob',
+ c69 = 'text',
+ c70 = 'text-ucs2',
+ c71 = 'mediumblob',
+ c72 = 'mediumtext',
+ c73 = 'mediumtext-ucs2',
+ c74 = 'longblob',
+ c75 = 'longtext',
+ c76 = 'longtext-ucs2',
+ #
+ c77 = 'c',
+ c78 = 'a,b,c',
+ #
+ crn = crn
+ #
+ WHERE
+ #
+ c01 = b'0' AND
+ c02 = b'0000000000000000000000000000000000000000000000000000000000000000' AND
+ c03 = -128 AND
+ c04 = 0 AND
+ c05 = 000 AND
+ c06 = false AND
+ c07 = -32768 AND
+ c08 = 0 AND
+ c09 = 00000 AND
+ c10 = -8388608 AND
+ c11 = 0 AND
+ c12 = 00000000 AND
+ c13 = -2147483648 AND
+ c14 = 0 AND
+ c15 = 0000000000 AND
+ c16 = -9223372036854775808 AND
+ c17 = 0 AND
+ c18 = 00000000000000000000 AND
+ c19 < -3.402823465E+38 AND
+ c20 < 1.175494352E-38 AND
+ c21 = 000000000000 AND
+ c22 < -1.7976931348622E+308 AND
+ c23 < 2.2250738585073E-308 AND
+ c24 = 0000000000000000000000 AND
+ c25 = -9999999999 AND
+ c26 = 0 AND
+ c27 = 0000000000 AND
+ #
+ c28 = '1000-01-01' AND
+ c29 = '1000-01-01 00:00:00' AND
+ c30 = '1970-01-02 00:00:01' AND
+ c31 = '-838:59:59' AND
+ c32 = '1901' AND
+ #
+ c33 = '' AND
+ c34 = '' AND
+ c35 = '' AND
+ c36 = '' AND
+ c37 = '' AND
+ c38 = '' AND
+ c39 = '' AND
+ c40 = '' AND
+ c41 = '' AND
+ c42 = '' AND
+ c43 = '' AND
+ c44 = '' AND
+ #
+ c45 = '' AND
+ c46 = '' AND
+ c47 = '' AND
+ c48 = '' AND
+ c49 = '' AND
+ c50 = '' AND
+ c51 = '' AND
+ c52 = '' AND
+ c53 = '' AND
+ c54 = '' AND
+ c55 = '' AND
+ c56 = '' AND
+ #
+ # this does not reproduce the inserted value: c57 = '' AND
+ c58 = '' AND
+ # this does not reproduce the inserted value: c59 = '' AND
+ # this does not reproduce the inserted value: c60 = '' AND
+ #
+ c61 = '' AND
+ c62 = '' AND
+ c63 = '' AND
+ c64 = '' AND
+ #
+ c65 = '' AND
+ c66 = '' AND
+ c67 = '' AND
+ c68 = '' AND
+ c69 = '' AND
+ c70 = '' AND
+ c71 = '' AND
+ c72 = '' AND
+ c73 = '' AND
+ c74 = '' AND
+ c75 = '' AND
+ c76 = '' AND
+ #
+ c77 = 'a' AND
+ c78 = '' AND
+ #
+ crn = 1;
+
+--echo #
+--echo # Update max values to min values.
+--echo #
+UPDATE t1 SET
+ c01 = b'0',
+ c02 = b'0000000000000000000000000000000000000000000000000000000000000000',
+ c03 = -128,
+ c04 = 0,
+ c05 = 000,
+ c06 = false,
+ c07 = -32768,
+ c08 = 0,
+ c09 = 00000,
+ c10 = -8388608,
+ c11 = 0,
+ c12 = 00000000,
+ c13 = -2147483648,
+ c14 = 0,
+ c15 = 0000000000,
+ c16 = -9223372036854775808,
+ c17 = 0,
+ c18 = 00000000000000000000,
+ c19 = -3.402823466E+38,
+ c20 = 1.175494351E-38,
+ c21 = 000000000000,
+ c22 = -1.7976931348623E+308,
+ c23 = 2.2250738585072E-308,
+ c24 = 0000000000000000000000,
+ c25 = -9999999999,
+ c26 = 0,
+ c27 = 0000000000,
+ #
+ c28 = '1000-01-01',
+ c29 = '1000-01-01 00:00:00',
+ c30 = '1970-01-02 00:00:01',
+ c31 = '-838:59:59',
+ c32 = '1901',
+ #
+ c33 = '',
+ c34 = '',
+ c35 = '',
+ c36 = '',
+ c37 = '',
+ c38 = '',
+ c39 = '',
+ c40 = '',
+ c41 = '',
+ c42 = '',
+ c43 = '',
+ c44 = '',
+ #
+ c45 = '',
+ c46 = '',
+ c47 = '',
+ c48 = '',
+ c49 = '',
+ c50 = '',
+ c51 = '',
+ c52 = '',
+ c53 = '',
+ c54 = '',
+ c55 = '',
+ c56 = '',
+ #
+ c57 = '',
+ c58 = '',
+ c59 = '',
+ c60 = '',
+ #
+ c61 = '',
+ c62 = '',
+ c63 = '',
+ c64 = '',
+ #
+ c65 = '',
+ c66 = '',
+ c67 = '',
+ c68 = '',
+ c69 = '',
+ c70 = '',
+ c71 = '',
+ c72 = '',
+ c73 = '',
+ c74 = '',
+ c75 = '',
+ c76 = '',
+ #
+ c77 = 'a',
+ c78 = '',
+ #
+ crn = crn
+ #
+ WHERE
+ #
+ c01 = b'1' AND
+ # the below does not reproduce the inserted value:
+ #c02 = b'1111111111111111111111111111111111111111111111111111111111111111' AND
+ c03 = 127 AND
+ c04 = 255 AND
+ c05 = 255 AND
+ c06 = true AND
+ c07 = 32767 AND
+ c08 = 65535 AND
+ c09 = 65535 AND
+ c10 = 8388607 AND
+ c11 = 16777215 AND
+ c12 = 16777215 AND
+ c13 = 2147483647 AND
+ c14 = 4294967295 AND
+ c15 = 4294967295 AND
+ c16 = 9223372036854775807 AND
+ c17 = 18446744073709551615 AND
+ c18 = 18446744073709551615 AND
+ c19 > 3.402823465E+38 AND
+ c20 > 3.402823465E+38 AND
+ c21 > 3.402823465E+38 AND
+ c22 > 1.7976931348622E+308 AND
+ c23 > 1.7976931348622E+308 AND
+ c24 > 1.7976931348622E+308 AND
+ c25 = 9999999999 AND
+ c26 = 9999999999 AND
+ c27 = 9999999999 AND
+ #
+ c28 = '9999-12-31' AND
+ c29 = '9999-12-31 23:59:59' AND
+ c30 = '2038-01-08 03:14:07' AND
+ c31 = '838:59:59' AND
+ c32 = '2155' AND
+ #
+ c33 = x'ff' AND
+ c34 = '' AND
+ c35 = x'ff' AND
+ c36 = REPEAT(x'ff',255) AND
+ c37 = _utf8 x'efbfbf' AND
+ c38 = '' AND
+ c39 = _utf8 x'efbfbf' AND
+ c40 = REPEAT(_utf8 x'efbfbf',255) AND
+ c41 = _ucs2 x'ffff' AND
+ c42 = '' AND
+ c43 = _ucs2 x'ffff' AND
+ c44 = REPEAT(_ucs2 x'ffff',255) AND
+ #
+ c45 = '' AND
+ c46 = x'ff' AND
+ c47 = REPEAT(x'ff',255) AND
+ c48 = REPEAT(x'ff',261) AND
+ c49 = '' AND
+ c50 = _utf8 x'efbfbf' AND
+ c51 = REPEAT(_utf8 x'efbfbf',255) AND
+ c52 = REPEAT(_utf8 x'efbfbf',261) AND
+ c53 = '' AND
+ c54 = _ucs2 x'ffff' AND
+ c55 = REPEAT(_ucs2 x'ffff',255) AND
+ c56 = REPEAT(_ucs2 x'ffff',261) AND
+ #
+ c57 = x'ff' AND
+ c58 = '' AND
+ c59 = x'ff' AND
+ c60 = REPEAT(x'ff',255) AND
+ #
+ c61 = '' AND
+ c62 = x'ff' AND
+ c63 = REPEAT(x'ff',255) AND
+ c64 = REPEAT(x'ff',261) AND
+ #
+ c65 = 'tinyblob' AND
+ c66 = 'tinytext' AND
+ c67 = 'tinytext-ucs2' AND
+ c68 = 'blob' AND
+ c69 = 'text' AND
+ c70 = 'text-ucs2' AND
+ c71 = 'mediumblob' AND
+ c72 = 'mediumtext' AND
+ c73 = 'mediumtext-ucs2' AND
+ c74 = 'longblob' AND
+ c75 = 'longtext' AND
+ c76 = 'longtext-ucs2' AND
+ #
+ c77 = 'c' AND
+ c78 = 'a,b,c' AND
+ #
+ crn = 2;
+
+--echo #
+--echo # Update NULL values to arbitrary values.
+--echo #
+UPDATE t1 SET
+ c01 = b'1',
+ c02 = b'1111111111111111111111111111111111111111111111111111111111111111',
+ c03 = 127,
+ c04 = 0,
+ c05 = 001,
+ c06 = true,
+ c07 = 32767,
+ c08 = 0,
+ c09 = 00001,
+ c10 = 8388607,
+ c11 = 0,
+ c12 = 00000001,
+ c13 = 2147483647,
+ c14 = 0,
+ c15 = 0000000001,
+ c16 = 9223372036854775807,
+ c17 = 0,
+ c18 = 00000000000000000001,
+ c19 = -1.175494351E-38,
+ c20 = 1.175494351E-38,
+ c21 = 000000000000001,
+ c22 = -2.2250738585072E-308,
+ c23 = 2.2250738585072E-308,
+ c24 = 00000000000000000000001,
+ c25 = -9999999999,
+ c26 = 9999999999,
+ c27 = 0000000001,
+ #
+ c28 = '2008-08-04',
+ c29 = '2008-08-04 16:18:06',
+ c30 = '2008-08-04 16:18:24',
+ c31 = '16:18:47',
+ c32 = '2008',
+ #
+ c33 = 'a',
+ c34 = '',
+ c35 = 'e',
+ c36 = REPEAT('i',255),
+ c37 = _utf8 x'c3a4',
+ c38 = '',
+ c39 = _utf8 x'c3b6',
+ c40 = REPEAT(_utf8 x'c3bc',255),
+ c41 = _ucs2 x'00e4',
+ c42 = '',
+ c43 = _ucs2 x'00f6',
+ c44 = REPEAT(_ucs2 x'00fc',255),
+ #
+ c45 = '',
+ c46 = 'a',
+ c47 = REPEAT('e',255),
+ c48 = REPEAT('i',261),
+ c49 = '',
+ c50 = _utf8 x'c3a4',
+ c51 = REPEAT(_utf8 x'c3b6',255),
+ c52 = REPEAT(_utf8 x'c3bc',261),
+ c53 = '',
+ c54 = _ucs2 x'00e4',
+ c55 = REPEAT(_ucs2 x'00f6',255),
+ c56 = REPEAT(_ucs2 x'00fc',261),
+ #
+ c57 = '0',
+ c58 = '',
+ c59 = '1',
+ c60 = REPEAT('1',255),
+ #
+ c61 = '',
+ c62 = 'b',
+ c63 = REPEAT('c',255),
+ c64 = REPEAT('\'',261),
+ #
+ c65 = 'tinyblob',
+ c66 = 'tinytext',
+ c67 = 'tinytext-ucs2',
+ c68 = 'blob',
+ c69 = 'text',
+ c70 = 'text-ucs2',
+ c71 = 'mediumblob',
+ c72 = 'mediumtext',
+ c73 = 'mediumtext-ucs2',
+ c74 = 'longblob',
+ c75 = 'longtext',
+ c76 = 'longtext-ucs2',
+ #
+ c77 = 'b',
+ c78 = 'b,c',
+ #
+ crn = crn
+ #
+ WHERE
+ #
+ c01 IS NULL AND
+ c02 IS NULL AND
+ c03 IS NULL AND
+ c04 IS NULL AND
+ c05 IS NULL AND
+ c06 IS NULL AND
+ c07 IS NULL AND
+ c08 IS NULL AND
+ c09 IS NULL AND
+ c10 IS NULL AND
+ c11 IS NULL AND
+ c12 IS NULL AND
+ c13 IS NULL AND
+ c14 IS NULL AND
+ c15 IS NULL AND
+ c16 IS NULL AND
+ c17 IS NULL AND
+ c18 IS NULL AND
+ c19 IS NULL AND
+ c20 IS NULL AND
+ c21 IS NULL AND
+ c22 IS NULL AND
+ c23 IS NULL AND
+ c24 IS NULL AND
+ c25 IS NULL AND
+ c26 IS NULL AND
+ c27 IS NULL AND
+ #
+ c28 IS NULL AND
+ c29 IS NULL AND
+ # this got a timestamp instead of NULL: c30 IS NULL AND
+ c31 IS NULL AND
+ c32 IS NULL AND
+ #
+ c33 IS NULL AND
+ c34 IS NULL AND
+ c35 IS NULL AND
+ c36 IS NULL AND
+ c37 IS NULL AND
+ c38 IS NULL AND
+ c39 IS NULL AND
+ c40 IS NULL AND
+ c41 IS NULL AND
+ c42 IS NULL AND
+ c43 IS NULL AND
+ c44 IS NULL AND
+ #
+ c45 IS NULL AND
+ c46 IS NULL AND
+ c47 IS NULL AND
+ c48 IS NULL AND
+ c49 IS NULL AND
+ c50 IS NULL AND
+ c51 IS NULL AND
+ c52 IS NULL AND
+ c53 IS NULL AND
+ c54 IS NULL AND
+ c55 IS NULL AND
+ c56 IS NULL AND
+ #
+ c57 IS NULL AND
+ c58 IS NULL AND
+ c59 IS NULL AND
+ c60 IS NULL AND
+ #
+ c61 IS NULL AND
+ c62 IS NULL AND
+ c63 IS NULL AND
+ c64 IS NULL AND
+ #
+ c65 IS NULL AND
+ c66 IS NULL AND
+ c67 IS NULL AND
+ c68 IS NULL AND
+ c69 IS NULL AND
+ c70 IS NULL AND
+ c71 IS NULL AND
+ c72 IS NULL AND
+ c73 IS NULL AND
+ c74 IS NULL AND
+ c75 IS NULL AND
+ c76 IS NULL AND
+ #
+ c77 IS NULL AND
+ c78 IS NULL AND
+ #
+ crn = 3;
+
+--echo #
+--echo # Update arbitrary values to NULL values.
+--echo #
+UPDATE t1 SET
+ c01 = NULL,
+ c02 = NULL,
+ c03 = NULL,
+ c04 = NULL,
+ c05 = NULL,
+ c06 = NULL,
+ c07 = NULL,
+ c08 = NULL,
+ c09 = NULL,
+ c10 = NULL,
+ c11 = NULL,
+ c12 = NULL,
+ c13 = NULL,
+ c14 = NULL,
+ c15 = NULL,
+ c16 = NULL,
+ c17 = NULL,
+ c18 = NULL,
+ c19 = NULL,
+ c20 = NULL,
+ c21 = NULL,
+ c22 = NULL,
+ c23 = NULL,
+ c24 = NULL,
+ c25 = NULL,
+ c26 = NULL,
+ c27 = NULL,
+ #
+ c28 = NULL,
+ c29 = NULL,
+ c30 = NULL,
+ c31 = NULL,
+ c32 = NULL,
+ #
+ c33 = NULL,
+ c34 = NULL,
+ c35 = NULL,
+ c36 = NULL,
+ c37 = NULL,
+ c38 = NULL,
+ c39 = NULL,
+ c40 = NULL,
+ c41 = NULL,
+ c42 = NULL,
+ c43 = NULL,
+ c44 = NULL,
+ #
+ c45 = NULL,
+ c46 = NULL,
+ c47 = NULL,
+ c48 = NULL,
+ c49 = NULL,
+ c50 = NULL,
+ c51 = NULL,
+ c52 = NULL,
+ c53 = NULL,
+ c54 = NULL,
+ c55 = NULL,
+ c56 = NULL,
+ #
+ c57 = NULL,
+ c58 = NULL,
+ c59 = NULL,
+ c60 = NULL,
+ #
+ c61 = NULL,
+ c62 = NULL,
+ c63 = NULL,
+ c64 = NULL,
+ #
+ c65 = NULL,
+ c66 = NULL,
+ c67 = NULL,
+ c68 = NULL,
+ c69 = NULL,
+ c70 = NULL,
+ c71 = NULL,
+ c72 = NULL,
+ c73 = NULL,
+ c74 = NULL,
+ c75 = NULL,
+ c76 = NULL,
+ #
+ c77 = NULL,
+ c78 = NULL,
+ #
+ crn = crn
+ #
+ WHERE
+ #
+ c01 = b'1' AND
+ # the below does not reproduce the inserted value:
+ #c02 = b'1111111111111111111111111111111111111111111111111111111111111111' AND
+ c03 = 127 AND
+ c04 = 0 AND
+ c05 = 001 AND
+ c06 = true AND
+ c07 = 32767 AND
+ c08 = 0 AND
+ c09 = 00001 AND
+ c10 = 8388607 AND
+ c11 = 0 AND
+ c12 = 00000001 AND
+ c13 = 2147483647 AND
+ c14 = 0 AND
+ c15 = 0000000001 AND
+ c16 = 9223372036854775807 AND
+ c17 = 0 AND
+ c18 = 00000000000000000001 AND
+ c19 > -1.175494352E-38 AND
+ c20 < 1.175494352E-38 AND
+ c21 = 000000000000001 AND
+ c22 > -2.2250738585073E-308 AND
+ c23 < 2.2250738585073E-308 AND
+ c24 = 00000000000000000000001 AND
+ c25 = -9999999999 AND
+ c26 = 9999999999 AND
+ c27 = 0000000001 AND
+ #
+ c28 = '2008-08-04' AND
+ c29 = '2008-08-04 16:18:06' AND
+ c30 = '2008-08-04 16:18:24' AND
+ c31 = '16:18:47' AND
+ c32 = '2008' AND
+ #
+ c33 = 'a' AND
+ c34 = '' AND
+ c35 = 'e' AND
+ c36 = REPEAT('i',255) AND
+ c37 = _utf8 x'c3a4' AND
+ c38 = '' AND
+ c39 = _utf8 x'c3b6' AND
+ c40 = REPEAT(_utf8 x'c3bc',255) AND
+ c41 = _ucs2 x'00e4' AND
+ c42 = '' AND
+ c43 = _ucs2 x'00f6' AND
+ c44 = REPEAT(_ucs2 x'00fc',255) AND
+ #
+ c45 = '' AND
+ c46 = 'a' AND
+ c47 = REPEAT('e',255) AND
+ c48 = REPEAT('i',261) AND
+ c49 = '' AND
+ c50 = _utf8 x'c3a4' AND
+ c51 = REPEAT(_utf8 x'c3b6',255) AND
+ c52 = REPEAT(_utf8 x'c3bc',261) AND
+ c53 = '' AND
+ c54 = _ucs2 x'00e4' AND
+ c55 = REPEAT(_ucs2 x'00f6',255) AND
+ c56 = REPEAT(_ucs2 x'00fc',261) AND
+ #
+ c57 = '0' AND
+ c58 = '' AND
+ c59 = '1' AND
+ c60 = REPEAT('1',255) AND
+ #
+ c61 = '' AND
+ c62 = 'b' AND
+ c63 = REPEAT('c',255) AND
+ c64 = REPEAT('\'',261) AND
+ #
+ c65 = 'tinyblob' AND
+ c66 = 'tinytext' AND
+ c67 = 'tinytext-ucs2' AND
+ c68 = 'blob' AND
+ c69 = 'text' AND
+ c70 = 'text-ucs2' AND
+ c71 = 'mediumblob' AND
+ c72 = 'mediumtext' AND
+ c73 = 'mediumtext-ucs2' AND
+ c74 = 'longblob' AND
+ c75 = 'longtext' AND
+ c76 = 'longtext-ucs2' AND
+ #
+ c77 = 'b' AND
+ c78 = 'b,c' AND
+ #
+ crn = 4;
+
+--echo #
+--echo # Show what we have in the table.
+--echo # Do not display bit type output. It's binary and confuses diff.
+--echo # Also BINARY with nul-bytes should be avoided.
+--echo #
+--replace_column 1 # 2 # 57 # 58 # 59 # 60 #
+query_vertical SELECT * FROM t1;
+
+--echo #
+--echo # Delete the row that has max values now.
+--echo #
+DELETE FROM t1 WHERE
+ #
+ c01 = b'1' AND
+ # the below does not reproduce the inserted value:
+ #c02 = b'1111111111111111111111111111111111111111111111111111111111111111' AND
+ c03 = 127 AND
+ c04 = 255 AND
+ c05 = 255 AND
+ c06 = true AND
+ c07 = 32767 AND
+ c08 = 65535 AND
+ c09 = 65535 AND
+ c10 = 8388607 AND
+ c11 = 16777215 AND
+ c12 = 16777215 AND
+ c13 = 2147483647 AND
+ c14 = 4294967295 AND
+ c15 = 4294967295 AND
+ c16 = 9223372036854775807 AND
+ c17 = 18446744073709551615 AND
+ c18 = 18446744073709551615 AND
+ c19 > 3.402823465E+38 AND
+ c20 > 3.402823465E+38 AND
+ c21 > 3.402823465E+38 AND
+ c22 > 1.7976931348622E+308 AND
+ c23 > 1.7976931348622E+308 AND
+ c24 > 1.7976931348622E+308 AND
+ c25 = 9999999999 AND
+ c26 = 9999999999 AND
+ c27 = 9999999999 AND
+ #
+ c28 = '9999-12-31' AND
+ c29 = '9999-12-31 23:59:59' AND
+ c30 = '2038-01-08 03:14:07' AND
+ c31 = '838:59:59' AND
+ c32 = '2155' AND
+ #
+ c33 = x'ff' AND
+ c34 = '' AND
+ c35 = x'ff' AND
+ c36 = REPEAT(x'ff',255) AND
+ c37 = _utf8 x'efbfbf' AND
+ c38 = '' AND
+ c39 = _utf8 x'efbfbf' AND
+ c40 = REPEAT(_utf8 x'efbfbf',255) AND
+ c41 = _ucs2 x'ffff' AND
+ c42 = '' AND
+ c43 = _ucs2 x'ffff' AND
+ c44 = REPEAT(_ucs2 x'ffff',255) AND
+ #
+ c45 = '' AND
+ c46 = x'ff' AND
+ c47 = REPEAT(x'ff',255) AND
+ c48 = REPEAT(x'ff',261) AND
+ c49 = '' AND
+ c50 = _utf8 x'efbfbf' AND
+ c51 = REPEAT(_utf8 x'efbfbf',255) AND
+ c52 = REPEAT(_utf8 x'efbfbf',261) AND
+ c53 = '' AND
+ c54 = _ucs2 x'ffff' AND
+ c55 = REPEAT(_ucs2 x'ffff',255) AND
+ c56 = REPEAT(_ucs2 x'ffff',261) AND
+ #
+ c57 = x'ff' AND
+ c58 = '' AND
+ c59 = x'ff' AND
+ c60 = REPEAT(x'ff',255) AND
+ #
+ c61 = '' AND
+ c62 = x'ff' AND
+ c63 = REPEAT(x'ff',255) AND
+ c64 = REPEAT(x'ff',261) AND
+ #
+ c65 = 'tinyblob' AND
+ c66 = 'tinytext' AND
+ c67 = 'tinytext-ucs2' AND
+ c68 = 'blob' AND
+ c69 = 'text' AND
+ c70 = 'text-ucs2' AND
+ c71 = 'mediumblob' AND
+ c72 = 'mediumtext' AND
+ c73 = 'mediumtext-ucs2' AND
+ c74 = 'longblob' AND
+ c75 = 'longtext' AND
+ c76 = 'longtext-ucs2' AND
+ #
+ c77 = 'c' AND
+ c78 = 'a,b,c' AND
+ #
+ crn = 1;
+
+--echo #
+--echo # Delete the row that has min values now.
+--echo #
+DELETE FROM t1 WHERE
+ #
+ c01 = b'0' AND
+ c02 = b'0000000000000000000000000000000000000000000000000000000000000000' AND
+ c03 = -128 AND
+ c04 = 0 AND
+ c05 = 000 AND
+ c06 = false AND
+ c07 = -32768 AND
+ c08 = 0 AND
+ c09 = 00000 AND
+ c10 = -8388608 AND
+ c11 = 0 AND
+ c12 = 00000000 AND
+ c13 = -2147483648 AND
+ c14 = 0 AND
+ c15 = 0000000000 AND
+ c16 = -9223372036854775808 AND
+ c17 = 0 AND
+ c18 = 00000000000000000000 AND
+ c19 < -3.402823465E+38 AND
+ c20 < 1.175494352E-38 AND
+ c21 = 000000000000 AND
+ c22 < -1.7976931348622E+308 AND
+ c23 < 2.2250738585073E-308 AND
+ c24 = 0000000000000000000000 AND
+ c25 = -9999999999 AND
+ c26 = 0 AND
+ c27 = 0000000000 AND
+ #
+ c28 = '1000-01-01' AND
+ c29 = '1000-01-01 00:00:00' AND
+ c30 = '1970-01-02 00:00:01' AND
+ c31 = '-838:59:59' AND
+ c32 = '1901' AND
+ #
+ c33 = '' AND
+ c34 = '' AND
+ c35 = '' AND
+ c36 = '' AND
+ c37 = '' AND
+ c38 = '' AND
+ c39 = '' AND
+ c40 = '' AND
+ c41 = '' AND
+ c42 = '' AND
+ c43 = '' AND
+ c44 = '' AND
+ #
+ c45 = '' AND
+ c46 = '' AND
+ c47 = '' AND
+ c48 = '' AND
+ c49 = '' AND
+ c50 = '' AND
+ c51 = '' AND
+ c52 = '' AND
+ c53 = '' AND
+ c54 = '' AND
+ c55 = '' AND
+ c56 = '' AND
+ #
+ # this does not reproduce the inserted value: c57 = '' AND
+ c58 = '' AND
+ # this does not reproduce the inserted value: c59 = '' AND
+ # this does not reproduce the inserted value: c60 = '' AND
+ #
+ c61 = '' AND
+ c62 = '' AND
+ c63 = '' AND
+ c64 = '' AND
+ #
+ c65 = '' AND
+ c66 = '' AND
+ c67 = '' AND
+ c68 = '' AND
+ c69 = '' AND
+ c70 = '' AND
+ c71 = '' AND
+ c72 = '' AND
+ c73 = '' AND
+ c74 = '' AND
+ c75 = '' AND
+ c76 = '' AND
+ #
+ c77 = 'a' AND
+ c78 = '' AND
+ #
+ crn = 2;
+
+--echo #
+--echo # Delete the row that has arbitrary values now.
+--echo #
+DELETE FROM t1 WHERE
+ #
+ c01 = b'1' AND
+ # the below does not reproduce the inserted value:
+ #c02 = b'1111111111111111111111111111111111111111111111111111111111111111' AND
+ c03 = 127 AND
+ c04 = 0 AND
+ c05 = 001 AND
+ c06 = true AND
+ c07 = 32767 AND
+ c08 = 0 AND
+ c09 = 00001 AND
+ c10 = 8388607 AND
+ c11 = 0 AND
+ c12 = 00000001 AND
+ c13 = 2147483647 AND
+ c14 = 0 AND
+ c15 = 0000000001 AND
+ c16 = 9223372036854775807 AND
+ c17 = 0 AND
+ c18 = 00000000000000000001 AND
+ c19 > -1.175494352E-38 AND
+ c20 < 1.175494352E-38 AND
+ c21 = 000000000000001 AND
+ c22 > -2.2250738585073E-308 AND
+ c23 < 2.2250738585073E-308 AND
+ c24 = 00000000000000000000001 AND
+ c25 = -9999999999 AND
+ c26 = 9999999999 AND
+ c27 = 0000000001 AND
+ #
+ c28 = '2008-08-04' AND
+ c29 = '2008-08-04 16:18:06' AND
+ c30 = '2008-08-04 16:18:24' AND
+ c31 = '16:18:47' AND
+ c32 = '2008' AND
+ #
+ c33 = 'a' AND
+ c34 = '' AND
+ c35 = 'e' AND
+ c36 = REPEAT('i',255) AND
+ c37 = _utf8 x'c3a4' AND
+ c38 = '' AND
+ c39 = _utf8 x'c3b6' AND
+ c40 = REPEAT(_utf8 x'c3bc',255) AND
+ c41 = _ucs2 x'00e4' AND
+ c42 = '' AND
+ c43 = _ucs2 x'00f6' AND
+ c44 = REPEAT(_ucs2 x'00fc',255) AND
+ #
+ c45 = '' AND
+ c46 = 'a' AND
+ c47 = REPEAT('e',255) AND
+ c48 = REPEAT('i',261) AND
+ c49 = '' AND
+ c50 = _utf8 x'c3a4' AND
+ c51 = REPEAT(_utf8 x'c3b6',255) AND
+ c52 = REPEAT(_utf8 x'c3bc',261) AND
+ c53 = '' AND
+ c54 = _ucs2 x'00e4' AND
+ c55 = REPEAT(_ucs2 x'00f6',255) AND
+ c56 = REPEAT(_ucs2 x'00fc',261) AND
+ #
+ c57 = '0' AND
+ c58 = '' AND
+ c59 = '1' AND
+ c60 = REPEAT('1',255) AND
+ #
+ c61 = '' AND
+ c62 = 'b' AND
+ c63 = REPEAT('c',255) AND
+ c64 = REPEAT('\'',261) AND
+ #
+ c65 = 'tinyblob' AND
+ c66 = 'tinytext' AND
+ c67 = 'tinytext-ucs2' AND
+ c68 = 'blob' AND
+ c69 = 'text' AND
+ c70 = 'text-ucs2' AND
+ c71 = 'mediumblob' AND
+ c72 = 'mediumtext' AND
+ c73 = 'mediumtext-ucs2' AND
+ c74 = 'longblob' AND
+ c75 = 'longtext' AND
+ c76 = 'longtext-ucs2' AND
+ #
+ c77 = 'b' AND
+ c78 = 'b,c' AND
+ #
+ crn = 3;
+
+--echo #
+--echo # Delete the row that has NULL values now.
+--echo #
+DELETE FROM t1 WHERE
+ #
+ c01 IS NULL AND
+ c02 IS NULL AND
+ c03 IS NULL AND
+ c04 IS NULL AND
+ c05 IS NULL AND
+ c06 IS NULL AND
+ c07 IS NULL AND
+ c08 IS NULL AND
+ c09 IS NULL AND
+ c10 IS NULL AND
+ c11 IS NULL AND
+ c12 IS NULL AND
+ c13 IS NULL AND
+ c14 IS NULL AND
+ c15 IS NULL AND
+ c16 IS NULL AND
+ c17 IS NULL AND
+ c18 IS NULL AND
+ c19 IS NULL AND
+ c20 IS NULL AND
+ c21 IS NULL AND
+ c22 IS NULL AND
+ c23 IS NULL AND
+ c24 IS NULL AND
+ c25 IS NULL AND
+ c26 IS NULL AND
+ c27 IS NULL AND
+ #
+ c28 IS NULL AND
+ c29 IS NULL AND
+ # this got a timestamp instead of NULL: c30 IS NULL AND
+ c31 IS NULL AND
+ c32 IS NULL AND
+ #
+ c33 IS NULL AND
+ c34 IS NULL AND
+ c35 IS NULL AND
+ c36 IS NULL AND
+ c37 IS NULL AND
+ c38 IS NULL AND
+ c39 IS NULL AND
+ c40 IS NULL AND
+ c41 IS NULL AND
+ c42 IS NULL AND
+ c43 IS NULL AND
+ c44 IS NULL AND
+ #
+ c45 IS NULL AND
+ c46 IS NULL AND
+ c47 IS NULL AND
+ c48 IS NULL AND
+ c49 IS NULL AND
+ c50 IS NULL AND
+ c51 IS NULL AND
+ c52 IS NULL AND
+ c53 IS NULL AND
+ c54 IS NULL AND
+ c55 IS NULL AND
+ c56 IS NULL AND
+ #
+ c57 IS NULL AND
+ c58 IS NULL AND
+ c59 IS NULL AND
+ c60 IS NULL AND
+ #
+ c61 IS NULL AND
+ c62 IS NULL AND
+ c63 IS NULL AND
+ c64 IS NULL AND
+ #
+ c65 IS NULL AND
+ c66 IS NULL AND
+ c67 IS NULL AND
+ c68 IS NULL AND
+ c69 IS NULL AND
+ c70 IS NULL AND
+ c71 IS NULL AND
+ c72 IS NULL AND
+ c73 IS NULL AND
+ c74 IS NULL AND
+ c75 IS NULL AND
+ c76 IS NULL AND
+ #
+ c77 IS NULL AND
+ c78 IS NULL AND
+ #
+ crn = 4;
+
+--echo #
+--echo # Show what we have in the table. Should be empty now.
+--echo #
+query_vertical SELECT * FROM t1;
+
+--echo #
+--echo # Hide how much rows are affected by each statement.
+--echo #
+--disable_info
+
+--echo #
+--echo # Flush all log buffers to the log file.
+--echo #
+FLUSH LOGS;
+
+--echo #
+--echo # Call mysqlbinlog to display the log file contents.
+--echo #
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+--echo #
+--echo # Cleanup.
+--echo #
+DROP TABLE t1;
+
+--echo #
+--echo # =========================================
+--echo # Test #2 - Multi-row insert/update/delete.
+--echo # =========================================
+--echo #
+--echo # Delete all existing binary logs.
+--echo #
+RESET MASTER;
+
+--echo #
+--echo # Create a test table with selected data types.
+--echo #
+eval CREATE TABLE t1 (
+ c28 DATE,
+ c47 VARCHAR(24),
+ crn INT -- row number
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+
+--echo #
+--echo # Show how much rows are affected by each statement.
+--echo #
+--enable_info
+
+--echo #
+--echo # Multi-row insert.
+--echo #
+INSERT INTO t1 VALUES
+ ('2008-08-01','VARCHAR-01',1),
+ ('2008-08-02','VARCHAR-02',2),
+ ('2008-08-03','VARCHAR-03',3),
+ ('2008-08-04','VARCHAR-04',4),
+ ('2008-08-05','VARCHAR-05',5),
+ ('2008-08-06','VARCHAR-06',6),
+ ('2008-08-07','VARCHAR-07',7),
+ ('2008-08-08','VARCHAR-08',8),
+ ('2008-08-09','VARCHAR-09',9);
+
+--echo #
+--echo # Multi-row update.
+--echo #
+UPDATE t1 SET c28 = ADDDATE(c28,10) WHERE crn < 8;
+
+--echo #
+--echo # Show what we have in the table.
+--echo #
+SELECT * FROM t1;
+
+--echo #
+--echo # Multi-row delete.
+--echo #
+DELETE FROM t1 WHERE crn < 8;
+
+--echo #
+--echo # Show what we have in the table.
+--echo #
+SELECT * FROM t1;
+
+--echo #
+--echo # Hide how much rows are affected by each statement.
+--echo #
+--disable_info
+
+--echo #
+--echo # Flush all log buffers to the log file.
+--echo #
+FLUSH LOGS;
+
+--echo #
+--echo # Call mysqlbinlog to display the log file contents.
+--echo #
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+--echo #
+--echo # Cleanup.
+--echo #
+DROP TABLE t1;
+
+--echo #
+--echo # ====================================
+--echo # Test #3 - Multi-table update/delete.
+--echo # ====================================
+--echo #
+--echo # Delete all existing binary logs.
+--echo #
+RESET MASTER;
+
+--echo #
+--echo # Create test tables with selected data types.
+--echo #
+eval CREATE TABLE t1 (
+ c_1_1 DATE,
+ c_1_2 VARCHAR(255),
+ c_1_n INT -- row number
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+#
+eval CREATE TABLE t2 (
+ c_2_1 DATE,
+ c_2_2 VARCHAR(255),
+ c_2_n INT -- row number
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+#
+eval CREATE TABLE t3 (
+ c_3_1 DATE,
+ c_3_2 VARCHAR(255),
+ c_3_n INT -- row number
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+
+--echo #
+--echo # Show how much rows are affected by each statement.
+--echo #
+--enable_info
+
+--echo #
+--echo # Insert data.
+--echo #
+INSERT INTO t1 VALUES
+ ('2008-01-01','VARCHAR-01-01',11),
+ ('2008-01-02','VARCHAR-01-02',2),
+ ('2008-01-03','VARCHAR-01-03',3),
+ ('2008-01-04','VARCHAR-01-04',4),
+ ('2008-01-05','VARCHAR-01-05',5),
+ ('2008-01-06','VARCHAR-01-06',6),
+ ('2008-01-07','VARCHAR-01-07',7),
+ ('2008-01-08','VARCHAR-01-08',18),
+ ('2008-01-09','VARCHAR-01-09',19);
+#
+INSERT INTO t2 VALUES
+ ('2008-02-01','VARCHAR-02-01',21),
+ ('2008-02-02','VARCHAR-02-02',2),
+ ('2008-02-03','VARCHAR-02-03',3),
+ ('2008-02-04','VARCHAR-02-04',4),
+ ('2008-02-05','VARCHAR-02-05',5),
+ ('2008-02-06','VARCHAR-02-06',6),
+ ('2008-02-07','VARCHAR-02-07',7),
+ ('2008-02-08','VARCHAR-02-08',28),
+ ('2008-02-09','VARCHAR-02-09',29);
+#
+INSERT INTO t3 VALUES
+ ('2008-03-01','VARCHAR-03-01',31),
+ ('2008-03-02','VARCHAR-03-02',2),
+ ('2008-03-03','VARCHAR-03-03',3),
+ ('2008-03-04','VARCHAR-03-04',4),
+ ('2008-03-05','VARCHAR-03-05',5),
+ ('2008-03-06','VARCHAR-03-06',6),
+ ('2008-03-07','VARCHAR-03-07',7),
+ ('2008-03-08','VARCHAR-03-08',38),
+ ('2008-03-09','VARCHAR-03-09',39);
+
+--echo #
+--echo # Multi-table update.
+--echo #
+UPDATE t1,t2,t3 SET
+ c_1_1 = ADDDATE(c_1_1,INTERVAL 10 YEAR),
+ c_2_1 = ADDDATE(c_2_1,INTERVAL 20 YEAR),
+ c_3_1 = ADDDATE(c_3_1,INTERVAL 30 YEAR)
+ WHERE c_1_n = c_2_n AND c_2_n = c_3_n;
+
+--echo #
+--echo # Show what we have in the tables.
+--echo #
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+--echo #
+--echo # Multi-table delete.
+--echo #
+DELETE FROM t1,t2,t3 USING t1 INNER JOIN t2 INNER JOIN t3
+ WHERE c_1_n = c_2_n AND c_2_n = c_3_n;
+
+--echo #
+--echo # Show what we have in the tables.
+--echo #
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+--echo #
+--echo # Hide how much rows are affected by each statement.
+--echo #
+--disable_info
+
+--echo #
+--echo # Flush all log buffers to the log file.
+--echo #
+FLUSH LOGS;
+
+--echo #
+--echo # Call mysqlbinlog to display the log file contents.
+--echo #
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+--echo #
+--echo # Cleanup.
+--echo #
+DROP TABLE t1, t2, t3;
+
+--echo #
+--echo # ===========================
+--echo # Test #4 - LOAD DATA INFILE.
+--echo # ===========================
+--echo #
+--echo # Delete all existing binary logs.
+--echo #
+RESET MASTER;
+
+--echo #
+--echo # Create a test table with selected data types.
+--echo #
+eval CREATE TABLE t1 (
+ c1 INT DEFAULT 100,
+ c2 INT,
+ c3 VARCHAR(60)
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+
+--echo #
+--echo # Show how much rows are affected by each statement.
+--echo #
+--enable_info
+
+--echo #
+--echo # Load data.
+--echo #
+LOAD DATA INFILE '../../std_data/loaddata5.dat'
+ INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
+ SET c3 = 'Wow';
+
+--echo #
+--echo # Show what we have in the table.
+--echo #
+SELECT * FROM t1;
+
+--echo #
+--echo # Hide how much rows are affected by each statement.
+--echo #
+--disable_info
+
+--echo #
+--echo # Flush all log buffers to the log file.
+--echo #
+FLUSH LOGS;
+
+--echo #
+--echo # Call mysqlbinlog to display the log file contents.
+--echo #
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+--echo #
+--echo # Cleanup.
+--echo #
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index 553206cab86..114272329de 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -9,7 +9,7 @@ BINLOG '
SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+AgAAAA==
';
-ERROR HY000: The BINLOG statement of type `Table_map` was not preceded by a format description BINLOG statement
+ERROR HY000: The BINLOG statement of type Table_map was not preceded by a format description BINLOG statement
select * from t1;
a
1
@@ -52,10 +52,10 @@ NULL NULL NULL
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-# at 4
-<#>ROLLBACK/*!*/;
-# at 102
-<#>use `test`/*!*/;
+<#>
+ROLLBACK/*!*/;
+<#>
+use `test`/*!*/;
SET TIMESTAMP=1196959712/*!*/;
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
@@ -66,7 +66,11 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int) engine= myisam
/*!*/;
-# at 203
+<#>
+<#>
+<#>
+<#>
+<#>
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index 201e7b9e722..e077182fe8b 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -4,7 +4,7 @@ set @saved_binlog_format = @@global.binlog_format;
create user mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
connect plain,localhost,mysqltest_1,,test;
connect root,localhost,root,,test;
**** Variable SQL_LOG_BIN ****
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index 1f3428e6eef..4b6b4c7fbee 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -2,7 +2,7 @@ call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
-call mtr.add_suppression('Could not open .*');
+call mtr.add_suppression('Could not use .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
SET @saved_dbug = @@SESSION.debug_dbug;
diff --git a/mysql-test/suite/binlog/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result
index cda4e8ad6f4..ae851c38e5f 100644
--- a/mysql-test/suite/binlog/r/binlog_killed.result
+++ b/mysql-test/suite/binlog/r/binlog_killed.result
@@ -179,6 +179,95 @@ RELEASE_LOCK("a")
1
drop table t4;
drop function bug27563;
+FLUSH LOGS;
+connect con3, localhost, root,,;
+connection con3;
+MI: MyISAM, INNODB
+BEGIN;
+INSERT INTO t2 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+connection con1;
+KILL ID;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000002 # Gtid_list # # [#-#-#]
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=3
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (NULL, 1)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=4
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (NULL, 2)
+master-bin.000002 # Query # # ROLLBACK
+disconnect con3;
+connect con3, localhost, root,,;
+connection con3;
+IM: INNODB, MyISAM
+BEGIN;
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t2 VALUES (NULL, 4);
+connection con1;
+KILL ID;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=4
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (NULL, 4)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=5
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (NULL, 3)
+master-bin.000002 # Query # # ROLLBACK
+disconnect con3;
+connect con3, localhost, root,,;
+connection con3;
+IMI: INNODB, MyISAM, INNODB
+BEGIN;
+INSERT INTO t1 VALUES (NULL, 5);
+INSERT INTO t2 VALUES (NULL, 6);
+INSERT INTO t1 VALUES (NULL, 7);
+connection con1;
+KILL ID;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=5
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (NULL, 6)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=6
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (NULL, 5)
+master-bin.000002 # Intvar # # INSERT_ID=7
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (NULL, 7)
+master-bin.000002 # Query # # ROLLBACK
+disconnect con3;
+connect con3, localhost, root,,;
+connection con3;
+MI2: MyISAM, INNODB, MyISAM, INNODB
+BEGIN;
+INSERT INTO t2 VALUES (NULL, 8);
+INSERT INTO t1 VALUES (NULL, 9);
+INSERT INTO t2 VALUES (NULL, 10);
+INSERT INTO t1 VALUES (NULL, 11);
+connection con1;
+KILL ID;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=6
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (NULL, 8)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=7
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (NULL, 10)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Intvar # # INSERT_ID=8
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (NULL, 9)
+master-bin.000002 # Intvar # # INSERT_ID=9
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (NULL, 11)
+master-bin.000002 # Query # # ROLLBACK
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
index 8ecd4d37b1f..2a0e1d3c810 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
@@ -34,7 +34,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -43,7 +43,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -52,7 +52,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -61,7 +61,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -70,7 +70,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -91,7 +91,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -109,7 +109,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -118,7 +118,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -127,7 +127,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -136,7 +136,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -157,7 +157,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -175,7 +175,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -184,7 +184,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -217,7 +217,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -226,7 +226,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -247,7 +247,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -274,7 +274,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -292,7 +292,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -301,7 +301,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -334,7 +334,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -343,7 +343,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -377,7 +377,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -386,7 +386,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -395,7 +395,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -404,7 +404,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -413,7 +413,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -424,7 +424,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -454,7 +454,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -472,7 +472,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -481,7 +481,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -490,7 +490,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -499,7 +499,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -510,7 +510,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -540,7 +540,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -558,7 +558,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -567,7 +567,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -578,7 +578,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -620,7 +620,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -629,7 +629,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -638,7 +638,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -647,7 +647,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -656,7 +656,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -667,7 +667,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
DELIMITER ;
# End of log file
@@ -681,7 +681,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -699,7 +699,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -708,7 +708,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -719,7 +719,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -761,7 +761,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -770,7 +770,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -803,7 +803,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -812,7 +812,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -821,7 +821,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -830,7 +830,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -839,7 +839,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -860,7 +860,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -878,7 +878,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -887,7 +887,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -896,7 +896,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -905,7 +905,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -925,7 +925,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -943,7 +943,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -952,7 +952,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -985,7 +985,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -994,7 +994,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1014,7 +1014,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1041,7 +1041,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1059,7 +1059,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1068,7 +1068,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1101,7 +1101,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1110,7 +1110,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1143,7 +1143,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1152,7 +1152,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1161,7 +1161,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1170,7 +1170,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1179,7 +1179,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1190,7 +1190,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1220,7 +1220,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -1238,7 +1238,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1247,7 +1247,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1256,7 +1256,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1265,7 +1265,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1276,7 +1276,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1305,7 +1305,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1323,7 +1323,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1332,7 +1332,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1343,7 +1343,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1385,7 +1385,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1394,7 +1394,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1403,7 +1403,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1412,7 +1412,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1421,7 +1421,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1444,7 +1444,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1462,7 +1462,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1471,7 +1471,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1482,7 +1482,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1524,7 +1524,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1533,7 +1533,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1566,7 +1566,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1575,7 +1575,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1584,7 +1584,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1593,7 +1593,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1602,7 +1602,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1611,7 +1611,7 @@ insert into t1 values(null, "e")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
SET TIMESTAMP=1773143/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 716d887b138..469eb97badc 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -327,6 +327,15 @@ INSERT INTO t2 SET a=1;
INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
+#
+# MDEV-20591 Wrong Number of rows in mysqlbinlog output.
+#
+CREATE TABLE t1(c_char_utf8 CHAR(10) ,
+c_varchar_utf8 char(10) ,
+c_text_utf8 blob );
+INSERT into t1 values("B", "B", REPEAT("#", 2000));
+drop table t1;
+flush logs;
INSERT INTO t1dec102 VALUES (-999.99);
INSERT INTO t1dec102 VALUES (0);
INSERT INTO t1dec102 VALUES (999.99);
@@ -374,7 +383,7 @@ CREATE TABLE t1 (c01 BIT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -386,6 +395,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -394,7 +404,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -406,6 +416,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -430,7 +441,7 @@ CREATE TABLE t1 (c01 BIT(7))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -442,6 +453,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000001' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -450,7 +462,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -462,6 +474,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000010' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -470,7 +483,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -482,6 +495,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000100' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -490,7 +504,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -502,6 +516,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0001000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -510,7 +525,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -522,6 +537,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0010000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -530,7 +546,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-11
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -542,6 +558,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0100000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -550,7 +567,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -562,6 +579,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1000000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -570,7 +588,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-13
/*!100001 SET @@session.gtid_seq_no=13*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -582,6 +600,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1111111' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -590,7 +609,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-14
/*!100001 SET @@session.gtid_seq_no=14*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -602,6 +621,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1111111' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -610,7 +630,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-15
/*!100001 SET @@session.gtid_seq_no=15*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -624,6 +644,7 @@ BEGIN
### @1=b'0010000' /* BIT(7) meta=7 nullable=1 is_null=0 */
### SET
### @1=b'0001111' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -648,7 +669,7 @@ CREATE TABLE t1 (a BIT(20), b CHAR(2))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-18
/*!100001 SET @@session.gtid_seq_no=18*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -661,6 +682,7 @@ BEGIN
### SET
### @1=b'00010010010010001001' /* BIT(20) meta=516 nullable=1 is_null=0 */
### @2='ab' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -685,7 +707,7 @@ CREATE TABLE t1 (c02 BIT(64))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-21
/*!100001 SET @@session.gtid_seq_no=21*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -697,6 +719,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000000000001' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -705,7 +728,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-22
/*!100001 SET @@session.gtid_seq_no=22*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -717,6 +740,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000000000010' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -725,7 +749,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-23
/*!100001 SET @@session.gtid_seq_no=23*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -737,6 +761,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000010000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -745,7 +770,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-24
/*!100001 SET @@session.gtid_seq_no=24*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -757,6 +782,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -781,7 +807,7 @@ CREATE TABLE t1 (c03 TINYINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-27
/*!100001 SET @@session.gtid_seq_no=27*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -799,6 +825,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=3 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -807,7 +834,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-28
/*!100001 SET @@session.gtid_seq_no=28*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -819,6 +846,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -827,7 +855,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-29
/*!100001 SET @@session.gtid_seq_no=29*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -841,6 +869,7 @@ BEGIN
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -849,7 +878,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-30
/*!100001 SET @@session.gtid_seq_no=30*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -861,6 +890,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -885,7 +915,7 @@ CREATE TABLE t1 (c04 TINYINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-33
/*!100001 SET @@session.gtid_seq_no=33*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -900,6 +930,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -908,7 +939,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-34
/*!100001 SET @@session.gtid_seq_no=34*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -920,6 +951,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -944,7 +976,7 @@ CREATE TABLE t1 (c06 BOOL)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-37
/*!100001 SET @@session.gtid_seq_no=37*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -956,6 +988,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -964,7 +997,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-38
/*!100001 SET @@session.gtid_seq_no=38*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -976,6 +1009,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1000,7 +1034,7 @@ CREATE TABLE t1 (c07 SMALLINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-41
/*!100001 SET @@session.gtid_seq_no=41*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1012,6 +1046,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=1234 /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1020,7 +1055,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-42
/*!100001 SET @@session.gtid_seq_no=42*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1032,6 +1067,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=1234 /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1056,7 +1092,7 @@ CREATE TABLE t1 (c08 SMALLINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-45
/*!100001 SET @@session.gtid_seq_no=45*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1071,6 +1107,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (65535) /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1079,7 +1116,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-46
/*!100001 SET @@session.gtid_seq_no=46*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1093,6 +1130,7 @@ BEGIN
### @1=-32768 (32768) /* SHORTINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1101,7 +1139,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-47
/*!100001 SET @@session.gtid_seq_no=47*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1113,6 +1151,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (65535) /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1137,7 +1176,7 @@ CREATE TABLE t1 (c10 MEDIUMINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-50
/*!100001 SET @@session.gtid_seq_no=50*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1149,6 +1188,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=12345 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1157,7 +1197,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-51
/*!100001 SET @@session.gtid_seq_no=51*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1169,6 +1209,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=12345 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1193,7 +1234,7 @@ CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-54
/*!100001 SET @@session.gtid_seq_no=54*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1208,6 +1249,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (16777215) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1216,7 +1258,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-55
/*!100001 SET @@session.gtid_seq_no=55*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1230,6 +1272,7 @@ BEGIN
### @1=-8388608 (8388608) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1238,7 +1281,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-56
/*!100001 SET @@session.gtid_seq_no=56*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1250,6 +1293,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (16777215) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1274,7 +1318,7 @@ CREATE TABLE t1 (c13 INT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-59
/*!100001 SET @@session.gtid_seq_no=59*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1286,6 +1330,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=123456 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1294,7 +1339,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-60
/*!100001 SET @@session.gtid_seq_no=60*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1306,6 +1351,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=123456 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1330,7 +1376,7 @@ CREATE TABLE t1 (c14 INT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-63
/*!100001 SET @@session.gtid_seq_no=63*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1345,6 +1391,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (4294967295) /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1353,7 +1400,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-64
/*!100001 SET @@session.gtid_seq_no=64*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1367,6 +1414,7 @@ BEGIN
### @1=-2147483648 (2147483648) /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1375,7 +1423,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-65
/*!100001 SET @@session.gtid_seq_no=65*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1387,6 +1435,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (4294967295) /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1411,7 +1460,7 @@ CREATE TABLE t1 (c16 BIGINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-68
/*!100001 SET @@session.gtid_seq_no=68*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1423,6 +1472,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=1234567890 /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1431,7 +1481,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-69
/*!100001 SET @@session.gtid_seq_no=69*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1443,6 +1493,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=1234567890 /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1467,7 +1518,7 @@ CREATE TABLE t1 (c17 BIGINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-72
/*!100001 SET @@session.gtid_seq_no=72*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1482,6 +1533,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (18446744073709551615) /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1490,7 +1542,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-73
/*!100001 SET @@session.gtid_seq_no=73*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1504,6 +1556,7 @@ BEGIN
### @1=-9223372036854775808 (9223372036854775808) /* LONGINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1512,7 +1565,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-74
/*!100001 SET @@session.gtid_seq_no=74*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1524,6 +1577,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (18446744073709551615) /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1548,7 +1602,7 @@ CREATE TABLE t1 (c19 FLOAT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-77
/*!100001 SET @@session.gtid_seq_no=77*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1560,6 +1614,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=123.223... /* FLOAT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1568,7 +1623,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-78
/*!100001 SET @@session.gtid_seq_no=78*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1580,6 +1635,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=123.223... /* FLOAT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1604,7 +1660,7 @@ CREATE TABLE t1 (c22 DOUBLE)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-81
/*!100001 SET @@session.gtid_seq_no=81*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1616,6 +1672,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=123434.223... /* DOUBLE meta=8 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1624,7 +1681,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-82
/*!100001 SET @@session.gtid_seq_no=82*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1636,6 +1693,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=123434.223... /* DOUBLE meta=8 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1660,7 +1718,7 @@ CREATE TABLE t1 (c25 DECIMAL(10,5))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-85
/*!100001 SET @@session.gtid_seq_no=85*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1672,6 +1730,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1680,7 +1739,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-86
/*!100001 SET @@session.gtid_seq_no=86*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1692,6 +1751,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-543.21000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1700,7 +1760,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-87
/*!100001 SET @@session.gtid_seq_no=87*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1712,6 +1772,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1736,7 +1797,7 @@ CREATE TABLE t1 (c28 DATE)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-90
/*!100001 SET @@session.gtid_seq_no=90*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1748,6 +1809,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='2001:02:03' /* DATE meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1756,7 +1818,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-91
/*!100001 SET @@session.gtid_seq_no=91*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1768,6 +1830,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='2001:02:03' /* DATE meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1792,7 +1855,7 @@ CREATE TABLE t1 (c29 DATETIME)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-94
/*!100001 SET @@session.gtid_seq_no=94*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1804,6 +1867,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='2001-02-03 10:20:30' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1812,7 +1876,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-95
/*!100001 SET @@session.gtid_seq_no=95*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1824,6 +1888,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='2001-02-03 10:20:30' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1848,7 +1913,7 @@ CREATE TABLE t1 (c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURR
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-98
/*!100001 SET @@session.gtid_seq_no=98*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1860,6 +1925,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=981184830 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1869,7 +1935,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-99
/*!100001 SET @@session.gtid_seq_no=99*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1881,6 +1947,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=981184830 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1905,7 +1972,7 @@ CREATE TABLE t1 (c31 TIME)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-102
/*!100001 SET @@session.gtid_seq_no=102*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1917,6 +1984,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='11:22:33' /* TIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1925,7 +1993,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-103
/*!100001 SET @@session.gtid_seq_no=103*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1937,6 +2005,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='11:22:33' /* TIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1961,7 +2030,7 @@ CREATE TABLE t1 (c32 YEAR)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-106
/*!100001 SET @@session.gtid_seq_no=106*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1973,6 +2042,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=2001 /* YEAR meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1981,7 +2051,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-107
/*!100001 SET @@session.gtid_seq_no=107*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1993,6 +2063,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=2001 /* YEAR meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2017,7 +2088,7 @@ CREATE TABLE t1 (c33 CHAR)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-110
/*!100001 SET @@session.gtid_seq_no=110*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2029,6 +2100,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2037,7 +2109,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-111
/*!100001 SET @@session.gtid_seq_no=111*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2049,6 +2121,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2073,7 +2146,7 @@ CREATE TABLE t1 (c34 CHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-114
/*!100001 SET @@session.gtid_seq_no=114*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2085,6 +2158,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2093,7 +2167,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-115
/*!100001 SET @@session.gtid_seq_no=115*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2105,6 +2179,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2129,7 +2204,7 @@ CREATE TABLE t1 (c35 CHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-118
/*!100001 SET @@session.gtid_seq_no=118*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2141,6 +2216,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='b' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2149,7 +2225,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-119
/*!100001 SET @@session.gtid_seq_no=119*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2161,6 +2237,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='b' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2185,7 +2262,7 @@ CREATE TABLE t1 (c36 CHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-122
/*!100001 SET @@session.gtid_seq_no=122*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2197,6 +2274,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2205,7 +2283,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-123
/*!100001 SET @@session.gtid_seq_no=123*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2217,6 +2295,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2241,7 +2320,7 @@ CREATE TABLE t1 (c37 NATIONAL CHAR)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-126
/*!100001 SET @@session.gtid_seq_no=126*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2253,6 +2332,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2261,7 +2341,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-127
/*!100001 SET @@session.gtid_seq_no=127*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2273,6 +2353,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2297,7 +2378,7 @@ CREATE TABLE t1 (c38 NATIONAL CHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-130
/*!100001 SET @@session.gtid_seq_no=130*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2309,6 +2390,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2317,7 +2399,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-131
/*!100001 SET @@session.gtid_seq_no=131*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2329,6 +2411,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2353,7 +2436,7 @@ CREATE TABLE t1 (c39 NATIONAL CHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-134
/*!100001 SET @@session.gtid_seq_no=134*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2365,6 +2448,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2373,7 +2457,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-135
/*!100001 SET @@session.gtid_seq_no=135*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2385,6 +2469,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2409,7 +2494,7 @@ CREATE TABLE t1 (c40 NATIONAL CHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-138
/*!100001 SET @@session.gtid_seq_no=138*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2421,6 +2506,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* STRING(765) meta=57085 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2429,7 +2515,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-139
/*!100001 SET @@session.gtid_seq_no=139*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2441,6 +2527,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* STRING(765) meta=57085 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2449,7 +2536,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-140
/*!100001 SET @@session.gtid_seq_no=140*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2464,6 +2551,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* STRING(765) meta=57085 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2488,7 +2576,7 @@ CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-143
/*!100001 SET @@session.gtid_seq_no=143*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2500,6 +2588,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2508,7 +2597,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-144
/*!100001 SET @@session.gtid_seq_no=144*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2520,6 +2609,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2544,7 +2634,7 @@ CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-147
/*!100001 SET @@session.gtid_seq_no=147*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2556,6 +2646,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2564,7 +2655,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-148
/*!100001 SET @@session.gtid_seq_no=148*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2576,6 +2667,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2600,7 +2692,7 @@ CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-151
/*!100001 SET @@session.gtid_seq_no=151*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2612,6 +2704,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2620,7 +2713,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-152
/*!100001 SET @@session.gtid_seq_no=152*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2632,6 +2725,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2656,7 +2750,7 @@ CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-155
/*!100001 SET @@session.gtid_seq_no=155*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2668,6 +2762,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(510) meta=61182 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2676,7 +2771,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-156
/*!100001 SET @@session.gtid_seq_no=156*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2688,6 +2783,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß' /* STRING(510) meta=61182 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2696,7 +2792,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-157
/*!100001 SET @@session.gtid_seq_no=157*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2711,6 +2807,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß' /* STRING(510) meta=61182 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2735,7 +2832,7 @@ CREATE TABLE t1 (c45 VARCHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-160
/*!100001 SET @@session.gtid_seq_no=160*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2747,6 +2844,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2755,7 +2853,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-161
/*!100001 SET @@session.gtid_seq_no=161*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2767,6 +2865,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2791,7 +2890,7 @@ CREATE TABLE t1 (c46 VARCHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-164
/*!100001 SET @@session.gtid_seq_no=164*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2803,6 +2902,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2811,7 +2911,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-165
/*!100001 SET @@session.gtid_seq_no=165*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2823,6 +2923,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2847,7 +2948,7 @@ CREATE TABLE t1 (c47 VARCHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-168
/*!100001 SET @@session.gtid_seq_no=168*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2859,6 +2960,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2867,7 +2969,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-169
/*!100001 SET @@session.gtid_seq_no=169*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2879,6 +2981,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2903,7 +3006,7 @@ CREATE TABLE t1 (c48 VARCHAR(261))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-172
/*!100001 SET @@session.gtid_seq_no=172*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2915,6 +3018,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2923,7 +3027,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-173
/*!100001 SET @@session.gtid_seq_no=173*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2935,6 +3039,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2959,7 +3064,7 @@ CREATE TABLE t1 (c49 NATIONAL VARCHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-176
/*!100001 SET @@session.gtid_seq_no=176*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2971,6 +3076,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2979,7 +3085,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-177
/*!100001 SET @@session.gtid_seq_no=177*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2991,6 +3097,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3015,7 +3122,7 @@ CREATE TABLE t1 (c50 NATIONAL VARCHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-180
/*!100001 SET @@session.gtid_seq_no=180*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3027,6 +3134,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(3) meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3035,7 +3143,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-181
/*!100001 SET @@session.gtid_seq_no=181*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3047,6 +3155,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* VARSTRING(3) meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3071,7 +3180,7 @@ CREATE TABLE t1 (c51 NATIONAL VARCHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-184
/*!100001 SET @@session.gtid_seq_no=184*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3083,6 +3192,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3091,7 +3201,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-185
/*!100001 SET @@session.gtid_seq_no=185*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3103,6 +3213,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3111,7 +3222,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-186
/*!100001 SET @@session.gtid_seq_no=186*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3126,6 +3237,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3150,7 +3262,7 @@ CREATE TABLE t1 (c52 NATIONAL VARCHAR(261))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-189
/*!100001 SET @@session.gtid_seq_no=189*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3162,6 +3274,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3170,7 +3283,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-190
/*!100001 SET @@session.gtid_seq_no=190*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3182,6 +3295,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3190,7 +3304,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-191
/*!100001 SET @@session.gtid_seq_no=191*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3205,6 +3319,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3229,7 +3344,7 @@ CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-194
/*!100001 SET @@session.gtid_seq_no=194*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3241,6 +3356,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3249,7 +3365,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-195
/*!100001 SET @@session.gtid_seq_no=195*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3261,6 +3377,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3285,7 +3402,7 @@ CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-198
/*!100001 SET @@session.gtid_seq_no=198*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3297,6 +3414,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* VARSTRING(2) meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3305,7 +3423,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-199
/*!100001 SET @@session.gtid_seq_no=199*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3317,6 +3435,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* VARSTRING(2) meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3341,7 +3460,7 @@ CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-202
/*!100001 SET @@session.gtid_seq_no=202*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3353,6 +3472,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(510) meta=510 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3361,7 +3481,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-203
/*!100001 SET @@session.gtid_seq_no=203*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3373,6 +3493,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(510) meta=510 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3397,7 +3518,7 @@ CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-206
/*!100001 SET @@session.gtid_seq_no=206*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3409,6 +3530,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(522) meta=522 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3417,7 +3539,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-207
/*!100001 SET @@session.gtid_seq_no=207*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3429,6 +3551,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(522) meta=522 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3453,7 +3576,7 @@ CREATE TABLE t1 (c57 BINARY)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-210
/*!100001 SET @@session.gtid_seq_no=210*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3465,6 +3588,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3473,7 +3597,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-211
/*!100001 SET @@session.gtid_seq_no=211*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3485,6 +3609,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3493,7 +3618,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-212
/*!100001 SET @@session.gtid_seq_no=212*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3505,6 +3630,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3513,7 +3639,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-213
/*!100001 SET @@session.gtid_seq_no=213*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3525,6 +3651,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3549,7 +3676,7 @@ CREATE TABLE t1 (c58 BINARY(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-216
/*!100001 SET @@session.gtid_seq_no=216*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3561,6 +3688,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3569,7 +3697,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-217
/*!100001 SET @@session.gtid_seq_no=217*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3581,6 +3709,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3605,7 +3734,7 @@ CREATE TABLE t1 (c59 BINARY(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-220
/*!100001 SET @@session.gtid_seq_no=220*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3617,6 +3746,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3625,7 +3755,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-221
/*!100001 SET @@session.gtid_seq_no=221*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3637,6 +3767,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3645,7 +3776,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-222
/*!100001 SET @@session.gtid_seq_no=222*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3657,6 +3788,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3665,7 +3797,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-223
/*!100001 SET @@session.gtid_seq_no=223*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3677,6 +3809,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3701,7 +3834,7 @@ CREATE TABLE t1 (c60 BINARY(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-226
/*!100001 SET @@session.gtid_seq_no=226*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3713,6 +3846,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3721,7 +3855,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-227
/*!100001 SET @@session.gtid_seq_no=227*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3733,6 +3867,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3741,7 +3876,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-228
/*!100001 SET @@session.gtid_seq_no=228*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3753,6 +3888,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3761,7 +3897,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-229
/*!100001 SET @@session.gtid_seq_no=229*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3773,6 +3909,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3797,7 +3934,7 @@ CREATE TABLE t1 (c61 VARBINARY(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-232
/*!100001 SET @@session.gtid_seq_no=232*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3809,6 +3946,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3817,7 +3955,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-233
/*!100001 SET @@session.gtid_seq_no=233*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3829,6 +3967,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3853,7 +3992,7 @@ CREATE TABLE t1 (c62 VARBINARY(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-236
/*!100001 SET @@session.gtid_seq_no=236*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3865,6 +4004,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3873,7 +4013,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-237
/*!100001 SET @@session.gtid_seq_no=237*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3885,6 +4025,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3893,7 +4034,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-238
/*!100001 SET @@session.gtid_seq_no=238*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3905,6 +4046,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3913,7 +4055,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-239
/*!100001 SET @@session.gtid_seq_no=239*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3925,6 +4067,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x02' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3949,7 +4092,7 @@ CREATE TABLE t1 (c63 VARBINARY(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-242
/*!100001 SET @@session.gtid_seq_no=242*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3961,6 +4104,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3969,7 +4113,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-243
/*!100001 SET @@session.gtid_seq_no=243*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3981,6 +4125,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3989,7 +4134,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-244
/*!100001 SET @@session.gtid_seq_no=244*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4001,6 +4146,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4009,7 +4155,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-245
/*!100001 SET @@session.gtid_seq_no=245*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4021,6 +4167,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4045,7 +4192,7 @@ CREATE TABLE t1 (c65 TINYBLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-248
/*!100001 SET @@session.gtid_seq_no=248*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4057,6 +4204,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='tinyblob1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4065,7 +4213,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-249
/*!100001 SET @@session.gtid_seq_no=249*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4077,6 +4225,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='tinyblob1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4101,7 +4250,7 @@ CREATE TABLE t1 (c68 BLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-252
/*!100001 SET @@session.gtid_seq_no=252*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4113,6 +4262,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='blob1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4121,7 +4271,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-253
/*!100001 SET @@session.gtid_seq_no=253*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4133,6 +4283,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='blob1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4157,7 +4308,7 @@ CREATE TABLE t1 (c71 MEDIUMBLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-256
/*!100001 SET @@session.gtid_seq_no=256*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4169,6 +4320,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='mediumblob1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4177,7 +4329,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-257
/*!100001 SET @@session.gtid_seq_no=257*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4189,6 +4341,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='mediumblob1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4213,7 +4366,7 @@ CREATE TABLE t1 (c74 LONGBLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-260
/*!100001 SET @@session.gtid_seq_no=260*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4225,6 +4378,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='longblob1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4233,7 +4387,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-261
/*!100001 SET @@session.gtid_seq_no=261*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4245,6 +4399,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='longblob1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4269,7 +4424,7 @@ CREATE TABLE t1 (c66 TINYTEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-264
/*!100001 SET @@session.gtid_seq_no=264*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4281,6 +4436,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='tinytext1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4289,7 +4445,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-265
/*!100001 SET @@session.gtid_seq_no=265*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4301,6 +4457,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='tinytext1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4325,7 +4482,7 @@ CREATE TABLE t1 (c69 TEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-268
/*!100001 SET @@session.gtid_seq_no=268*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4337,6 +4494,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='text1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4345,7 +4503,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-269
/*!100001 SET @@session.gtid_seq_no=269*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4357,6 +4515,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='text1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4381,7 +4540,7 @@ CREATE TABLE t1 (c72 MEDIUMTEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-272
/*!100001 SET @@session.gtid_seq_no=272*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4393,6 +4552,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='mediumtext1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4401,7 +4561,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-273
/*!100001 SET @@session.gtid_seq_no=273*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4413,6 +4573,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='mediumtext1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4437,7 +4598,7 @@ CREATE TABLE t1 (c75 LONGTEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-276
/*!100001 SET @@session.gtid_seq_no=276*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4449,6 +4610,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='longtext1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4457,7 +4619,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-277
/*!100001 SET @@session.gtid_seq_no=277*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4469,6 +4631,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='longtext1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4493,7 +4656,7 @@ CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-280
/*!100001 SET @@session.gtid_seq_no=280*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4505,6 +4668,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x001' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4513,7 +4677,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-281
/*!100001 SET @@session.gtid_seq_no=281*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4525,6 +4689,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x001' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4549,7 +4714,7 @@ CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-284
/*!100001 SET @@session.gtid_seq_no=284*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4561,6 +4726,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00t\x00e\x00x\x00t\x001' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4569,7 +4735,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-285
/*!100001 SET @@session.gtid_seq_no=285*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4581,6 +4747,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00t\x00e\x00x\x00t\x001' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4605,7 +4772,7 @@ CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-288
/*!100001 SET @@session.gtid_seq_no=288*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4617,6 +4784,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00m\x00e\x00d\x00i\x00u\x00m\x00t\x00e\x00x\x00t\x001' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4625,7 +4793,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-289
/*!100001 SET @@session.gtid_seq_no=289*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4637,6 +4805,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00m\x00e\x00d\x00i\x00u\x00m\x00t\x00e\x00x\x00t\x001' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4661,7 +4830,7 @@ CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-292
/*!100001 SET @@session.gtid_seq_no=292*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4673,6 +4842,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00l\x00o\x00n\x00g\x00t\x00e\x00x\x00t\x001' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4681,7 +4851,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-293
/*!100001 SET @@session.gtid_seq_no=293*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4693,6 +4863,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00l\x00o\x00n\x00g\x00t\x00e\x00x\x00t\x001' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4717,7 +4888,7 @@ CREATE TABLE t1 (c77 ENUM('a','b','c'))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-296
/*!100001 SET @@session.gtid_seq_no=296*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4729,6 +4900,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4737,7 +4909,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-297
/*!100001 SET @@session.gtid_seq_no=297*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4749,6 +4921,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4773,7 +4946,7 @@ CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-300
/*!100001 SET @@session.gtid_seq_no=300*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4785,6 +4958,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000011' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4793,7 +4967,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-301
/*!100001 SET @@session.gtid_seq_no=301*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4805,6 +4979,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000101' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4813,7 +4988,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-302
/*!100001 SET @@session.gtid_seq_no=302*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4825,6 +5000,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4833,7 +5009,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-303
/*!100001 SET @@session.gtid_seq_no=303*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4845,6 +5021,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4853,7 +5030,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-304
/*!100001 SET @@session.gtid_seq_no=304*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4865,6 +5042,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00001111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4873,7 +5051,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-305
/*!100001 SET @@session.gtid_seq_no=305*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4885,6 +5063,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00011111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4893,7 +5072,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-306
/*!100001 SET @@session.gtid_seq_no=306*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4905,6 +5084,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00111111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4913,7 +5093,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-307
/*!100001 SET @@session.gtid_seq_no=307*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4925,6 +5105,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=b'00000011' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4957,7 +5138,7 @@ CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-311
/*!100001 SET @@session.gtid_seq_no=311*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4970,6 +5151,7 @@ BEGIN
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4978,7 +5160,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-312
/*!100001 SET @@session.gtid_seq_no=312*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4991,6 +5173,7 @@ BEGIN
### SET
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4999,7 +5182,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-313
/*!100001 SET @@session.gtid_seq_no=313*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5012,6 +5195,7 @@ BEGIN
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5020,7 +5204,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-314
/*!100001 SET @@session.gtid_seq_no=314*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5033,6 +5217,7 @@ BEGIN
### SET
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5041,7 +5226,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-315
/*!100001 SET @@session.gtid_seq_no=315*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5082,6 +5267,7 @@ BEGIN
### SET
### @1=20 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 4
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5096,69 +5282,45 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1`,`t2` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-317
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-317 ddl
/*!100001 SET @@session.gtid_seq_no=317*//*!*/;
-BEGIN
-/*!*/;
# at #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
-#Q> INSERT INTO t1dec102 VALUES (-999.99)
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
-### INSERT INTO `test`.`t1dec102`
-### SET
-### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-COMMIT
+CREATE TABLE t1(c_char_utf8 CHAR(10) ,
+c_varchar_utf8 char(10) ,
+c_text_utf8 blob )
/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-318
/*!100001 SET @@session.gtid_seq_no=318*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
-#Q> INSERT INTO t1dec102 VALUES (0)
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
+#Q> INSERT into t1 values("B", "B", REPEAT("#", 2000))
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
-### INSERT INTO `test`.`t1dec102`
+### INSERT INTO `test`.`t1`
### SET
-### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-COMMIT
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-319
-/*!100001 SET @@session.gtid_seq_no=319*//*!*/;
-BEGIN
-/*!*/;
+### @1='B' /* STRING(10) meta=65034 nullable=1 is_null=0 */
+### @2='B' /* STRING(10) meta=65034 nullable=1 is_null=0 */
+### @3='################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
-#Q> INSERT INTO t1dec102 VALUES (999.99)
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
-### INSERT INTO `test`.`t1dec102`
-### SET
-### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-320 ddl
-/*!100001 SET @@session.gtid_seq_no=320*//*!*/;
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-319 ddl
+/*!100001 SET @@session.gtid_seq_no=319*//*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-DROP TABLE `t1dec102` /* generated by server */
+DROP TABLE `t1` /* generated by server */
/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
@@ -5167,3 +5329,34 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 010909 4:46:40
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Gtid list [0-1-319]
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000001
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-320
+/*!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=320*//*!*/;
+START TRANSACTION
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
+#Q> INSERT INTO t1dec102 VALUES (-999.99)
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test`.`t1dec102`
+### SET
+### @1=
+Error: Found Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value.
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 388bec68db7..d8a5864ba3d 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2368,7 +2368,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2543,13 +2543,14 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2724,13 +2725,14 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3071,13 +3073,14 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3410,13 +3413,14 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3754,13 +3758,14 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4096,13 +4101,14 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8 trans
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4441,13 +4447,14 @@ BEGIN
### @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 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4620,13 +4627,14 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-10 trans
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4796,13 +4804,14 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-11 trans
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4975,13 +4984,14 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12 trans
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5152,6 +5162,7 @@ BEGIN
### @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 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5282,7 +5293,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5345,13 +5356,14 @@ BEGIN
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=9 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5423,13 +5435,14 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5473,6 +5486,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5703,7 +5717,7 @@ c_3_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5766,13 +5780,14 @@ BEGIN
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=19 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5835,13 +5850,14 @@ BEGIN
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=29 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5904,13 +5920,14 @@ BEGIN
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=39 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6093,13 +6110,14 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8 trans
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6207,6 +6225,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -6312,7 +6331,7 @@ c3 VARCHAR(60)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6338,6 +6357,7 @@ BEGIN
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
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 44dbbba8eab..a75593055d7 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2368,7 +2368,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2543,6 +2543,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2552,7 +2553,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2727,6 +2728,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2735,7 +2737,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3076,6 +3078,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3084,7 +3087,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3417,6 +3420,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3425,7 +3429,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3763,6 +3767,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3771,7 +3776,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4107,6 +4112,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4115,7 +4121,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4454,6 +4460,7 @@ BEGIN
### @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 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4462,7 +4469,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4635,6 +4642,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4643,7 +4651,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4813,6 +4821,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4821,7 +4830,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-11
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4994,6 +5003,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5002,7 +5012,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5173,6 +5183,7 @@ BEGIN
### @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 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5305,7 +5316,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5368,6 +5379,7 @@ BEGIN
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=9 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5376,7 +5388,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5448,6 +5460,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5456,7 +5469,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5500,6 +5513,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5732,7 +5746,7 @@ c_3_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5795,6 +5809,7 @@ BEGIN
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=19 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5803,7 +5818,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5866,6 +5881,7 @@ BEGIN
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=29 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5874,7 +5890,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5937,6 +5953,7 @@ BEGIN
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=39 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5945,7 +5962,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6128,6 +6145,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -6136,7 +6154,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6244,6 +6262,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -6351,7 +6370,7 @@ c3 VARCHAR(60)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6377,6 +6396,7 @@ BEGIN
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
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 8616a639b0b..545cb8f7857 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -172,7 +172,7 @@ c2 VARCHAR(20)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -193,6 +193,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -221,6 +222,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -232,6 +234,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -254,7 +257,7 @@ TRUNCATE TABLE t1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -275,6 +278,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -283,7 +287,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -313,6 +317,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -321,7 +326,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -334,6 +339,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -342,7 +348,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -363,6 +369,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -391,6 +398,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -402,6 +410,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -424,7 +433,7 @@ TRUNCATE TABLE t2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -445,6 +454,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -453,7 +463,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-13
/*!100001 SET @@session.gtid_seq_no=13*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -483,6 +493,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -491,7 +502,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-14
/*!100001 SET @@session.gtid_seq_no=14*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -504,6 +515,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result b/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result
index 349de2f01d0..c77f5844dc3 100644
--- a/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result
+++ b/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result
@@ -17,7 +17,7 @@ master-bin.2147483647 # Query # # CREATE DATABASE db1
RESET MASTER TO 2147483648;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
-FOUND 1 /Turning logging off for the whole duration of the MySQL server process/ in mysqld.1.err
+FOUND 1 /Turning logging off for the whole duration of the MariaDB server process/ in mysqld.1.err
"Following CREATE DATABSE db2 command will not be present in binary log"
"as binary log got closed due to ER_NO_UNIQUE_LOGFILE error."
CREATE DATABASE db2;
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
index c4a1ba9b83b..bca96dd5fd0 100644
--- a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
@@ -38,13 +38,13 @@ disconnect tmp_con;
connection default;
FLUSH LOGS;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (1,0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (2,0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
@@ -52,13 +52,13 @@ COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ ALTER TABLE t1 ADD c INT
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (3,0,0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Update_rows: table id # flags: STMT_END_F
@@ -70,7 +70,7 @@ BEGIN
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ DELETE FROM t1 WHERE a=5
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Delete_rows: table id # flags: STMT_END_F
@@ -82,25 +82,25 @@ BEGIN
# server id 1 end_log_pos # CRC32 0x######## Update_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (8, 5, 0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (9, 5, 1)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (10, 6, 0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (11, 7, 0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
index c56dff9c8a0..4a6cd6f4ac0 100644
--- a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
@@ -38,21 +38,21 @@ disconnect tmp_con;
connection default;
FLUSH LOGS;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (1,0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (2,0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ ALTER TABLE t1 ADD c INT
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (3,0,0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
-BEGIN
+START TRANSACTION
/* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2
/* GTID */ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
/* GTID */ INSERT INTO t2 VALUES (4,10), (5,20)
@@ -63,7 +63,7 @@ COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
-BEGIN
+START TRANSACTION
/* GTID */ DELETE FROM t1 WHERE a=5
/* GTID */ INSERT INTO t3 VALUES (7)
/* GTID */ INSERT INTO t1 SELECT a, 4, 0 FROM t3
@@ -73,21 +73,21 @@ COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (8, 5, 0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ ALTER TABLE t4 ADD b INT
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (9, 5, 1)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (10, 6, 0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
-BEGIN
+START TRANSACTION
/* GTID */ CREATE TEMPORARY TABLE t5 (a INT PRIMARY KEY) ENGINE=InnoDB
/* GTID */ INSERT INTO t1 VALUES (11, 7, 0)
COMMIT/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index 2104d6b0e51..e65569853aa 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -144,7 +144,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -162,6 +162,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -170,7 +171,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -188,6 +189,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -196,7 +198,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -214,6 +216,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -222,7 +225,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -255,6 +258,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -263,7 +267,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -281,6 +285,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -289,7 +294,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -309,6 +314,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -368,7 +374,7 @@ CREATE DATABASE test1
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -386,6 +392,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -394,7 +401,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -407,7 +414,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -420,7 +427,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -451,7 +458,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -464,7 +471,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -535,7 +542,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -551,6 +558,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -559,7 +567,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -575,6 +583,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -583,7 +592,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -599,6 +608,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -607,7 +617,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -636,6 +646,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -644,7 +655,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -660,6 +671,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -668,7 +680,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -684,6 +696,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -755,7 +768,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -773,6 +786,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -781,7 +795,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -799,6 +813,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -807,7 +822,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -825,6 +840,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -833,7 +849,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -866,6 +882,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -874,7 +891,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -892,6 +909,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -900,7 +918,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -920,6 +938,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -979,7 +998,7 @@ CREATE DATABASE test1
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -997,6 +1016,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1005,7 +1025,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1018,7 +1038,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1031,7 +1051,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1062,7 +1082,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1075,7 +1095,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1146,7 +1166,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -1161,6 +1181,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1169,7 +1190,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -1184,6 +1205,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1192,7 +1214,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
@@ -1207,6 +1229,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1215,7 +1238,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -1243,6 +1266,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1251,7 +1275,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -1266,6 +1290,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1274,7 +1299,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -1289,6 +1314,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
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 db6df1d458a..0fe726766d2 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -16,8 +16,10 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
+# Annotate_rows:
+#Q> insert into t2 values (@v)
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, @@session.check_constraint_checks=1/*!*/;
@@ -102,7 +104,7 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -114,6 +116,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -122,7 +125,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -134,6 +137,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -142,7 +146,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -154,6 +158,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -162,7 +167,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -174,6 +179,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -182,7 +188,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -194,6 +200,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -202,7 +209,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -214,6 +221,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
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 56121a96349..0232443573a 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -62,7 +62,7 @@ CREATE TABLE t1 (a INT, b INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -79,6 +79,7 @@ BEGIN
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -96,7 +97,7 @@ CREATE TABLE t2 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -111,6 +112,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -119,7 +121,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -132,6 +134,7 @@ BEGIN
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -149,7 +152,7 @@ CREATE TABLE t3 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -164,6 +167,7 @@ BEGIN
### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -172,7 +176,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -185,6 +189,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -193,7 +198,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -223,6 +228,7 @@ BEGIN
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 5
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -231,7 +237,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -243,6 +249,7 @@ BEGIN
### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -296,7 +303,7 @@ CREATE TABLE t1 (a INT, b INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -313,6 +320,7 @@ BEGIN
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -330,7 +338,7 @@ CREATE TABLE t2 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -345,6 +353,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -353,7 +362,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -366,6 +375,7 @@ BEGIN
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -383,7 +393,7 @@ CREATE TABLE t3 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -398,6 +408,7 @@ BEGIN
### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -406,7 +417,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -419,6 +430,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -427,7 +439,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -457,6 +469,7 @@ BEGIN
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 5
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -465,7 +478,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -477,6 +490,7 @@ BEGIN
### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
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 00f7ce6ead0..05b1520724a 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -15,7 +15,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`v`:=_ucs2 X'006100620063' COLLATE `ucs2_general_ci`/*!*/;
use `test`/*!*/;
@@ -106,7 +106,7 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -121,7 +121,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -136,7 +136,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -151,7 +151,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -166,7 +166,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -181,7 +181,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result
index 0b7491e4364..75f64500878 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ps.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result
@@ -185,3 +185,46 @@ master-bin.000004 # Gtid # # GTID #-#-#
master-bin.000004 # Query # # use `test`; DROP PROCEDURE p1
master-bin.000004 # Gtid # # GTID #-#-#
master-bin.000004 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+#
+#MDEV-14467 Item_param: replace {INT|DECIMAL|REAL|STRING|TIME}_VALUE with Type_handler
+#
+FLUSH LOGS;
+CREATE TABLE t1 (a INT);
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING 10;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING 10.1;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING 10.1e0;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING '10';
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING TIME'10:10:10';
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+DROP TABLE t1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000005 # Binlog_checkpoint # # master-bin.000005
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t1 SELECT 1 LIMIT 10
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t1 SELECT 1 LIMIT 10
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t1 SELECT 1 LIMIT 10
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t1 SELECT 1 LIMIT 10
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t1 SELECT 1 LIMIT 101010
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/mysql-test/suite/binlog/r/binlog_stm_sp.result b/mysql-test/suite/binlog/r/binlog_stm_sp.result
new file mode 100644
index 00000000000..2fbb1cbce2e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_sp.result
@@ -0,0 +1,174 @@
+#
+# MDEV-11815 SP variables of temporal data types do not replicate correctly
+#
+CREATE TABLE t1(a INT);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE i INT DEFAULT 123;
+DECLARE b8 BIT(8) DEFAULT 0x61;
+DECLARE t0 TIME DEFAULT '01:01:01';
+DECLARE t6 TIME(6) DEFAULT '01:01:01.123456';
+DECLARE d DATE DEFAULT '2001-01-01';
+DECLARE dt0 DATETIME DEFAULT '2001-01-01 01:01:01';
+DECLARE dt6 DATETIME(6) DEFAULT '2001-01-01 01:01:01.123456';
+DECLARE ts0 TIMESTAMP DEFAULT '2001-01-01 01:01:01';
+DECLARE ts6 TIMESTAMP(6) DEFAULT '2001-01-01 01:01:01.123456';
+INSERT INTO t1 VALUES (i=0x61);
+INSERT INTO t1 VALUES (b8=0x61);
+INSERT INTO t1 VALUES (t0=10101);
+INSERT INTO t1 VALUES (t6=10101);
+INSERT INTO t1 VALUES (d=20010101);
+INSERT INTO t1 VALUES (dt0=20010101010101);
+INSERT INTO t1 VALUES (dt6=20010101010101);
+INSERT INTO t1 VALUES (ts0=20010101010101);
+INSERT INTO t1 VALUES (ts6=20010101010101);
+END;
+$$
+CALL p1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+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(a INT)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE i INT DEFAULT 123;
+DECLARE b8 BIT(8) DEFAULT 0x61;
+DECLARE t0 TIME DEFAULT '01:01:01';
+DECLARE t6 TIME(6) DEFAULT '01:01:01.123456';
+DECLARE d DATE DEFAULT '2001-01-01';
+DECLARE dt0 DATETIME DEFAULT '2001-01-01 01:01:01';
+DECLARE dt6 DATETIME(6) DEFAULT '2001-01-01 01:01:01.123456';
+DECLARE ts0 TIMESTAMP DEFAULT '2001-01-01 01:01:01';
+DECLARE ts6 TIMESTAMP(6) DEFAULT '2001-01-01 01:01:01.123456';
+INSERT INTO t1 VALUES (i=0x61);
+INSERT INTO t1 VALUES (b8=0x61);
+INSERT INTO t1 VALUES (t0=10101);
+INSERT INTO t1 VALUES (t6=10101);
+INSERT INTO t1 VALUES (d=20010101);
+INSERT INTO t1 VALUES (dt0=20010101010101);
+INSERT INTO t1 VALUES (dt6=20010101010101);
+INSERT INTO t1 VALUES (ts0=20010101010101);
+INSERT INTO t1 VALUES (ts6=20010101010101);
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('i',123)=0x61)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('b8',_binary'a' COLLATE 'binary')=0x61)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('t0',TIME'01:01:01')=10101)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('t6',TIME'01:01:01.123456')=10101)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('d',DATE'2001-01-01')=20010101)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('dt0',TIMESTAMP'2001-01-01 01:01:01')=20010101010101)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('dt6',TIMESTAMP'2001-01-01 01:01:01.123456')=20010101010101)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('ts0',TIMESTAMP'2001-01-01 01:01:01')=20010101010101)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('ts6',TIMESTAMP'2001-01-01 01:01:01.123456')=20010101010101)
+master-bin.000001 # Query # # COMMIT
+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`; DROP PROCEDURE p1
+#
+# MDEV-16020 SP variables inside GROUP BY..WITH ROLLUP break replication
+#
+FLUSH LOGS;
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+CREATE TABLE t2 (d DATE, c BIGINT);
+BEGIN NOT ATOMIC
+BEGIN
+DECLARE var INT DEFAULT 10;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var WITH ROLLUP;
+END;
+BEGIN
+DECLARE atomic INT DEFAULT 20;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic WITH ROLLUP;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic` WITH ROLLUP;
+END;
+BEGIN
+DECLARE atomic ROW (atomic INT, xxx INT) DEFAULT (31,32);
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.atomic;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.atomic WITH ROLLUP;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`atomic`;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`atomic` WITH ROLLUP;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.xxx;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.xxx WITH ROLLUP;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`xxx`;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`xxx` WITH ROLLUP;
+END;
+END;
+$$
+DROP TABLE t1,t2;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (d DATE)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24')
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (d DATE, c BIGINT)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('var',10)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('var',10) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic',20)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic',20) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic',20)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic',20) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.atomic',31)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.atomic',31) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.atomic',31)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.atomic',31) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.xxx',32)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.xxx',32) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.xxx',32)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('atomic.xxx',32) WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */
diff --git a/mysql-test/suite/binlog/r/binlog_stm_sp_type_row.result b/mysql-test/suite/binlog/r/binlog_stm_sp_type_row.result
new file mode 100644
index 00000000000..cc21904f5af
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_sp_type_row.result
@@ -0,0 +1,227 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10914 ROW data type for stored routine variables
+#
+CREATE TABLE t1 (a INT, b INT);
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec.a:=100;
+rec.b:=200;
+INSERT INTO t1 VALUES (rec.a,rec.b);
+INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.a:=NULL;
+INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.b:=NULL;
+INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+100 200
+10 1
+10 1
+10 20
+10 21
+11 NULL
+11 0
+11 NULL
+11 0
+12 NULL
+12 NULL
+DROP TABLE t1;
+DROP PROCEDURE p1;
+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 (a INT, b INT)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec.a:=100;
+rec.b:=200;
+INSERT INTO t1 VALUES (rec.a,rec.b);
+INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.a:=NULL;
+INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.b:=NULL;
+INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('rec.a',100), NAME_CONST('rec.b',200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10, ROW(100,200)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10, ROW(100,200)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE ROW(100,200)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(NULL,200)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(NULL,200)=ROW(100,201))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(100,200)=ROW(NULL,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(100,201)=ROW(NULL,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE ROW(NULL,200)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=ROW(NULL,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (12, ROW(NULL,NULL)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (12, ROW(100,200)=ROW(NULL,NULL))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE ROW(NULL,NULL)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=ROW(NULL,NULL)
+master-bin.000001 # Query # # COMMIT
+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`; DROP PROCEDURE p1
+#
+# Testing ROW fields in LIMIT
+#
+FLUSH LOGS;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(10);
+CREATE TABLE t2 (a INT);
+CREATE PROCEDURE p1()
+AS
+a INT:= 1;
+rec ROW(a INT);
+BEGIN
+rec.a:= 1;
+INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END;
+$$
+CALL p1();
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+DROP TABLE t1,t2;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (10),(10)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (a INT)
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+a INT:= 1;
+rec ROW(a INT);
+BEGIN
+rec.a:= 1;
+INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT 1 FROM t1 LIMIT 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT 2 FROM t1 LIMIT 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP PROCEDURE p1
+#
+# End of MDEV-10914 ROW data type for stored routine variables
+#
+#
+# MDEV-12291 Allow ROW variables as SELECT INTO targets
+#
+FLUSH LOGS;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE rec1 ROW(a INT, b VARCHAR(32));
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+10 b10
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000003 # Binlog_checkpoint # # master-bin.000003
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT, b VARCHAR(32))
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (10, 'b10')
+master-bin.000003 # Query # # COMMIT
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; CREATE TABLE t2 LIKE t1
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE rec1 ROW(a INT, b VARCHAR(32));
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Query # # use `test`; INSERT INTO t2 VALUES ( NAME_CONST('rec1.a',10), NAME_CONST('rec1.b',_latin1'b10' COLLATE 'latin1_swedish_ci'))
+master-bin.000003 # Query # # COMMIT
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; DROP PROCEDURE p1
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index cc341fad196..a8143ef086e 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -85,8 +85,6 @@ DROP TRIGGER trig_2;
Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function.
CREATE VIEW view_retval_2 AS SELECT func_retval_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_retval_2;
Warnings:
@@ -149,8 +147,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -411,8 +407,6 @@ DROP TRIGGER trig_2;
Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable.
CREATE VIEW view_retval_2 AS SELECT func_retval_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_retval_2;
Warnings:
@@ -475,8 +469,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -657,8 +649,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1049,8 +1039,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-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
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1245,8 +1233,6 @@ DROP TRIGGER trig_2;
Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UDF.
CREATE VIEW view_retval_2 AS SELECT func_retval_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_retval_2;
Warnings:
@@ -1309,8 +1295,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UDF.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1551,8 +1535,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1823,14 +1805,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves
-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. Statement is unsafe because it uses a UDF which may not return the same value on the slave
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
-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
* binlog_format = STATEMENT: expect 7 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -2099,9 +2073,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
* binlog_format = STATEMENT: expect 2 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -2235,9 +2206,6 @@ DROP TRIGGER trig_1;
Invoking view view_sidef_1 invoking statement that is unsafe several times.
CREATE VIEW view_sidef_1 AS SELECT multi_unsafe_func();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
* binlog_format = STATEMENT: expect 2 warnings.
INSERT INTO t1 SELECT * FROM view_sidef_1;
Warnings:
@@ -2281,9 +2249,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times.
CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
* binlog_format = STATEMENT: expect 2 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index f4d2f859f12..eaced02b7a9 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -81,7 +81,7 @@ c08 TEXT
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -100,13 +100,14 @@ BEGIN
### @6='' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -125,13 +126,14 @@ BEGIN
### @6='abc' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='abcdefg' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='abcedfghijklmnopqrstuvwxyz' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -150,13 +152,14 @@ BEGIN
### @6='aaaaaaaaaa' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='aaaaaaaaaaaaaaaaaaaa' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -203,13 +206,14 @@ BEGIN
### @6='abc' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='abcdefg' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='abcedfghijklmnopqrstuvwxyz' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -248,6 +252,7 @@ BEGIN
### @6='aaaaaaaaaa' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='aaaaaaaaaaaaaaaaaaaa' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -272,21 +277,26 @@ ROLLBACK/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(0,0,0,0,0,'','','')
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz")
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 255))
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> UPDATE t1 SET c01=100 WHERE c02=0 OR c03=3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 2
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> DELETE FROM t1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -321,7 +331,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -364,7 +374,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -379,7 +389,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -394,7 +404,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
diff --git a/mysql-test/suite/binlog/r/load_data_stm_view.result b/mysql-test/suite/binlog/r/load_data_stm_view.result
index ddbdb71983f..c21ffb7dcc6 100644
--- a/mysql-test/suite/binlog/r/load_data_stm_view.result
+++ b/mysql-test/suite/binlog/r/load_data_stm_view.result
@@ -1,3 +1,4 @@
+reset master;
create table t1 (i int, j int);
create view v1 as select i from t1;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/3940.data' INTO TABLE v1 (i);
diff --git a/mysql-test/suite/binlog/r/read_only.result b/mysql-test/suite/binlog/r/read_only.result
new file mode 100644
index 00000000000..8aaad55684b
--- /dev/null
+++ b/mysql-test/suite/binlog/r/read_only.result
@@ -0,0 +1,128 @@
+#
+# MDEV-17863 DROP TEMPORARY TABLE creates a transaction in
+# binary log on read only server
+# MDEV-19074 Improved read_only mode for slaves with
+# gtid_strict_mode enabled
+#
+create user test@localhost;
+grant CREATE, DROP, INSERT, SELECT on *.* to test@localhost;
+create table t1 (a int) engine=myisam;
+insert into t1 values (1),(2);
+reset master;
+set global read_only=1;
+# Ensure that optimize and analyze doesn't log to binary log
+connect con1,localhost,test,,test;
+insert into t1 values(3);
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair Error The MariaDB server is running with the --read-only option so it cannot execute this statement
+test.t1 repair error Corrupt
+optimize table t1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+# Ensure that using temporary tables is not logged
+create temporary table tmp1 (a int) engine=myisam;
+insert into tmp1 values (1),(2);
+update tmp1 set a=10 where a=2;
+delete from tmp1 where a=1;
+create temporary table tmp2 select * from t1;
+select * from tmp1;
+a
+10
+select * from tmp2;
+a
+1
+2
+create temporary table tmp3 like t1;
+create or replace temporary table tmp3 like t1;
+alter table tmp2 add column (b int);
+select * from tmp2;
+a b
+1 NULL
+2 NULL
+insert into t1 select a+100 from tmp2;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+drop table tmp1,tmp2,tmp3;
+# Clean up test connection
+disconnect con1;
+connection default;
+# Execute some commands as root that should not be logged
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# Changes to temporary tables created under readonly should not
+# be logged
+create temporary table tmp4 (a int) engine=myisam;
+insert into tmp4 values (1),(2);
+create temporary table tmp5 (a int) engine=myisam;
+insert into tmp5 select * from tmp4;
+alter table tmp5 add column (b int);
+set global read_only=0;
+insert into tmp4 values (3),(4);
+insert into tmp5 values (10,3),(11,4);
+select * from tmp4;
+a
+1
+2
+3
+4
+select * from tmp5;
+a b
+1 NULL
+2 NULL
+10 3
+11 4
+update tmp4 set a=10 where a=2;
+delete from tmp4 where a=1;
+create table t2 select * from tmp4;
+alter table tmp5 add column (c int);
+insert into tmp5 values (20,5,1),(21,5,2);
+select * from tmp5;
+a b c
+1 NULL NULL
+2 NULL NULL
+10 3 NULL
+11 4 NULL
+20 5 1
+21 5 2
+insert into t1 select a+200 from tmp5;
+select * from t1;
+a
+1
+2
+201
+202
+210
+211
+220
+221
+drop table tmp4,tmp5;
+# Check what is logged. Only last create select and the insert...select's should be
+# row-logged
+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 `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Annotate_rows # # create table t2 select * from tmp4
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+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 # Annotate_rows # # insert into t1 select a+200 from tmp5
+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
+# Clean up
+drop user test@localhost;
+drop table t1,t2;
diff --git a/mysql-test/suite/binlog/r/read_only_statement.result b/mysql-test/suite/binlog/r/read_only_statement.result
new file mode 100644
index 00000000000..8aaad55684b
--- /dev/null
+++ b/mysql-test/suite/binlog/r/read_only_statement.result
@@ -0,0 +1,128 @@
+#
+# MDEV-17863 DROP TEMPORARY TABLE creates a transaction in
+# binary log on read only server
+# MDEV-19074 Improved read_only mode for slaves with
+# gtid_strict_mode enabled
+#
+create user test@localhost;
+grant CREATE, DROP, INSERT, SELECT on *.* to test@localhost;
+create table t1 (a int) engine=myisam;
+insert into t1 values (1),(2);
+reset master;
+set global read_only=1;
+# Ensure that optimize and analyze doesn't log to binary log
+connect con1,localhost,test,,test;
+insert into t1 values(3);
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair Error The MariaDB server is running with the --read-only option so it cannot execute this statement
+test.t1 repair error Corrupt
+optimize table t1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+# Ensure that using temporary tables is not logged
+create temporary table tmp1 (a int) engine=myisam;
+insert into tmp1 values (1),(2);
+update tmp1 set a=10 where a=2;
+delete from tmp1 where a=1;
+create temporary table tmp2 select * from t1;
+select * from tmp1;
+a
+10
+select * from tmp2;
+a
+1
+2
+create temporary table tmp3 like t1;
+create or replace temporary table tmp3 like t1;
+alter table tmp2 add column (b int);
+select * from tmp2;
+a b
+1 NULL
+2 NULL
+insert into t1 select a+100 from tmp2;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+drop table tmp1,tmp2,tmp3;
+# Clean up test connection
+disconnect con1;
+connection default;
+# Execute some commands as root that should not be logged
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# Changes to temporary tables created under readonly should not
+# be logged
+create temporary table tmp4 (a int) engine=myisam;
+insert into tmp4 values (1),(2);
+create temporary table tmp5 (a int) engine=myisam;
+insert into tmp5 select * from tmp4;
+alter table tmp5 add column (b int);
+set global read_only=0;
+insert into tmp4 values (3),(4);
+insert into tmp5 values (10,3),(11,4);
+select * from tmp4;
+a
+1
+2
+3
+4
+select * from tmp5;
+a b
+1 NULL
+2 NULL
+10 3
+11 4
+update tmp4 set a=10 where a=2;
+delete from tmp4 where a=1;
+create table t2 select * from tmp4;
+alter table tmp5 add column (c int);
+insert into tmp5 values (20,5,1),(21,5,2);
+select * from tmp5;
+a b c
+1 NULL NULL
+2 NULL NULL
+10 3 NULL
+11 4 NULL
+20 5 1
+21 5 2
+insert into t1 select a+200 from tmp5;
+select * from t1;
+a
+1
+2
+201
+202
+210
+211
+220
+221
+drop table tmp4,tmp5;
+# Check what is logged. Only last create select and the insert...select's should be
+# row-logged
+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 `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Annotate_rows # # create table t2 select * from tmp4
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+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 # Annotate_rows # # insert into t1 select a+200 from tmp5
+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
+# Clean up
+drop user test@localhost;
+drop table t1,t2;
diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test
index 575a7307665..e1187cd895c 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -90,15 +90,12 @@ select * from t1;
# show "one-shot" feature of binlog_fragment variables
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
-# Test that mysqlbinlog stops with an error message when the
-# --base64-output=never flag is used on a binlog with base64 events.
+# New mysqlbinlog supports --base64-output=never
--echo ==== Test --base64-output=never on a binlog with row events ====
# mysqlbinlog should fail
---replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
-error 1;
-exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/bug32407.001;
-# the above line should output the query log event and then stop
+--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] \N*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
+exec $MYSQL_BINLOG --base64-output=never --print-row-count=0 --print-row-event-positions=0 suite/binlog/std_data/bug32407.001;
# Test that the following fails cleanly: "First, read a
diff --git a/mysql-test/suite/binlog/t/binlog_database.test b/mysql-test/suite/binlog/t/binlog_database.test
index 9c2a43575fc..8d298b8ae7f 100644
--- a/mysql-test/suite/binlog/t/binlog_database.test
+++ b/mysql-test/suite/binlog/t/binlog_database.test
@@ -6,10 +6,10 @@
--source include/have_binlog_format_statement.inc
set binlog_format=statement;
-source extra/binlog_tests/database.test;
+source include/database.test;
set binlog_format=mixed;
-source extra/binlog_tests/database.test;
+source include/database.test;
set binlog_format=row;
-source extra/binlog_tests/database.test;
+source include/database.test;
show databases;
diff --git a/mysql-test/suite/binlog/t/binlog_implicit_commit.test b/mysql-test/suite/binlog/t/binlog_implicit_commit.test
index a682ab95e3d..11ceae5f8d2 100644
--- a/mysql-test/suite/binlog/t/binlog_implicit_commit.test
+++ b/mysql-test/suite/binlog/t/binlog_implicit_commit.test
@@ -15,36 +15,36 @@ let $cleanup = COMMIT;
let $prepare = SET AUTOCOMMIT = 0;
let $statement = SET AUTOCOMMIT = 1;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
let $prepare = SET AUTOCOMMIT = 1;
let $statement = SET AUTOCOMMIT = 1;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
let $prepare = SET AUTOCOMMIT = 0;
let $statement = SET AUTOCOMMIT = 0;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
let $prepare = SET AUTOCOMMIT = 1;
let $statement = SET AUTOCOMMIT = 0;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
SET BINLOG_FORMAT = ROW;
let $prepare = SET AUTOCOMMIT = 0;
let $statement = SET AUTOCOMMIT = 1;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
let $prepare = SET AUTOCOMMIT = 1;
let $statement = SET AUTOCOMMIT = 1;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
let $prepare = SET AUTOCOMMIT = 0;
let $statement = SET AUTOCOMMIT = 0;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
let $prepare = SET AUTOCOMMIT = 1;
let $statement = SET AUTOCOMMIT = 0;
-source extra/binlog_tests/implicit.test;
+source include/implicit.test;
RESET MASTER;
SET AUTOCOMMIT = 0;
diff --git a/mysql-test/suite/binlog/t/binlog_incident.test b/mysql-test/suite/binlog/t/binlog_incident.test
index c4270a074f0..de7abf20a95 100644
--- a/mysql-test/suite/binlog/t/binlog_incident.test
+++ b/mysql-test/suite/binlog/t/binlog_incident.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_incident.inc
+--source include/binlog_incident.inc
diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index 1837c683bba..a7c4ce8feee 100644
--- a/mysql-test/suite/binlog/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_index.inc
+--source include/binlog_index.inc
diff --git a/mysql-test/suite/binlog/t/binlog_ioerr.test b/mysql-test/suite/binlog/t/binlog_ioerr.test
index 3155e14e6b0..e75adb19172 100644
--- a/mysql-test/suite/binlog/t/binlog_ioerr.test
+++ b/mysql-test/suite/binlog/t/binlog_ioerr.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_ioerr.inc
+--source include/binlog_ioerr.inc
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index 73759ee5aa5..7c3a262d2c1 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -10,6 +10,13 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
-- source include/not_embedded.inc
+#
+# Avoid printing binlog checkpoints
+#
+
+--let $skip_checkpoint_events=1
+
+
###
### bug#22725 : incorrect killed error in binlogged query
###
@@ -349,6 +356,94 @@ drop table t4;
drop function bug27563;
+# Prove that killing connection in the middle
+# of mixed engine transactions affect binlogging
+# as specified.
+
+# keep binlogging for this piece of test in a new file
+FLUSH LOGS;
+
+# Connection con3 as transaction generator thoughout the test
+connect (con3, localhost, root,,);
+
+connection con3;
+let $ID= `select connection_id()`;
+
+--let $threads_connected=`select variable_value from information_schema.global_status where variable_name="threads_connected"`
+--let wait_condition=select variable_value < $threads_connected from information_schema.global_status where variable_name="threads_connected"
+
+--echo MI: MyISAM, INNODB
+BEGIN;
+INSERT INTO t2 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+
+#Connection con1 as killer throughout the test
+connection con1;
+--replace_result $ID ID
+--eval KILL $ID
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+--source include/wait_condition.inc
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+--let $binlog_killed_pos=query_get_value(SHOW MASTER STATUS, Position, 1)
+
+disconnect con3;
+connect (con3, localhost, root,,);
+connection con3;
+let $ID= `select connection_id()`;
+
+--echo IM: INNODB, MyISAM
+BEGIN;
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t2 VALUES (NULL, 4);
+
+connection con1;
+--replace_result $ID ID
+--eval KILL $ID
+--source include/wait_condition.inc
+--let $binlog_start= $binlog_killed_pos
+--source include/show_binlog_events.inc
+--let $binlog_killed_pos=query_get_value(SHOW MASTER STATUS, Position, 1)
+
+disconnect con3;
+connect (con3, localhost, root,,);
+connection con3;
+let $ID= `select connection_id()`;
+
+--echo IMI: INNODB, MyISAM, INNODB
+BEGIN;
+INSERT INTO t1 VALUES (NULL, 5);
+INSERT INTO t2 VALUES (NULL, 6);
+INSERT INTO t1 VALUES (NULL, 7);
+
+connection con1;
+--replace_result $ID ID
+--eval KILL $ID
+--source include/wait_condition.inc
+--let $binlog_start= $binlog_killed_pos
+--source include/show_binlog_events.inc
+--let $binlog_killed_pos=query_get_value(SHOW MASTER STATUS, Position, 1)
+
+disconnect con3;
+connect (con3, localhost, root,,);
+connection con3;
+let $ID= `select connection_id()`;
+
+--echo MI2: MyISAM, INNODB, MyISAM, INNODB
+BEGIN;
+INSERT INTO t2 VALUES (NULL, 8);
+INSERT INTO t1 VALUES (NULL, 9);
+INSERT INTO t2 VALUES (NULL, 10);
+INSERT INTO t1 VALUES (NULL, 11);
+
+connection con1;
+--replace_result $ID ID
+--eval KILL $ID
+--source include/wait_condition.inc
+--let $binlog_start= $binlog_killed_pos
+--source include/show_binlog_events.inc
+
+
#
# common cleanup
#
diff --git a/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
index 3e63fb3bc9c..f22ea65d9a0 100644
--- a/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed.inc
--- source extra/binlog_tests/binlog_cache_stat.test
+-- source include/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
index 58c4befa8d6..80710261ef4 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
+--source include/binlog_mysqlbinlog-cp932.inc
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
index 90ea96dd64d..add977bf07a 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
@@ -438,6 +438,20 @@ INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-20591 Wrong Number of rows in mysqlbinlog output.
+--echo #
+
+CREATE TABLE t1(c_char_utf8 CHAR(10) ,
+ c_varchar_utf8 char(10) ,
+ c_text_utf8 blob );
+
+INSERT into t1 values("B", "B", REPEAT("#", 2000));
+
+drop table t1;
+
+flush logs;
+
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
@@ -455,3 +469,9 @@ flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
+--error 1
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000002 2>&1
+
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test
index e8ba283807b..cef1a712f7d 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test
@@ -20,5 +20,5 @@ let $engine_type=InnoDB;
--source include/have_binlog_format_row.inc
--source include/have_ucs2.inc
---source extra/binlog_tests/mysqlbinlog_row_engine.inc
+--source include/mysqlbinlog_row_engine.inc
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test
index 9b941282399..e7b0335812a 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test
@@ -20,4 +20,4 @@ let $engine_type=MyISAM;
--source include/have_binlog_format_row.inc
--source include/have_ucs2.inc
---source extra/binlog_tests/mysqlbinlog_row_engine.inc
+--source include/mysqlbinlog_row_engine.inc
diff --git a/mysql-test/suite/binlog/t/binlog_no_uniqfile_crash.test b/mysql-test/suite/binlog/t/binlog_no_uniqfile_crash.test
index 2a685a786c5..cb8b1078bdd 100644
--- a/mysql-test/suite/binlog/t/binlog_no_uniqfile_crash.test
+++ b/mysql-test/suite/binlog/t/binlog_no_uniqfile_crash.test
@@ -57,7 +57,7 @@ CREATE DATABASE db1;
RESET MASTER TO 2147483648;
--let SEARCH_FILE=$log_error_
---let SEARCH_PATTERN=Turning logging off for the whole duration of the MySQL server process
+--let SEARCH_PATTERN=Turning logging off for the whole duration of the MariaDB server process
--source include/search_pattern_in_file.inc
--echo "Following CREATE DATABSE db2 command will not be present in binary log"
diff --git a/mysql-test/suite/binlog/t/binlog_row_annotate.test b/mysql-test/suite/binlog/t/binlog_row_annotate.test
index 569391e68ce..a6e5f8289c8 100644
--- a/mysql-test/suite/binlog/t/binlog_row_annotate.test
+++ b/mysql-test/suite/binlog/t/binlog_row_annotate.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_row_annotate.inc
+--source include/binlog_row_annotate.inc
diff --git a/mysql-test/suite/binlog/t/binlog_row_binlog.test b/mysql-test/suite/binlog/t/binlog_row_binlog.test
index 2bf4f93f332..14cc00a2326 100644
--- a/mysql-test/suite/binlog/t/binlog_row_binlog.test
+++ b/mysql-test/suite/binlog/t/binlog_row_binlog.test
@@ -4,4 +4,4 @@
-- source include/have_binlog_format_row.inc
let collation=utf8_unicode_ci;
--source include/have_collation.inc
---source extra/binlog_tests/binlog.test
+--source include/binlog.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_cache_stat.test b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
index 03f9c53f0cc..6f406119e38 100644
--- a/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/binlog_cache_stat.test
+-- source include/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
index 595af5a3114..b99afb6c728 100644
--- a/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/ctype_cp932.test
+-- source include/ctype_cp932.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
index 96e14ed8882..02a9b6478ce 100644
--- a/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
+++ b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
@@ -2,5 +2,5 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/ctype_ucs_binlog.test
+-- source include/ctype_ucs_binlog.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_drop_tbl.test b/mysql-test/suite/binlog/t/binlog_row_drop_tbl.test
index 06854900612..828530652a5 100644
--- a/mysql-test/suite/binlog/t/binlog_row_drop_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_row_drop_tbl.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/drop_table.test
+-- source include/drop_table.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
index 5b503b78d85..e45e659c1d3 100644
--- a/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/drop_temp_table.test
+-- source include/drop_temp_table.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_insert_select.test b/mysql-test/suite/binlog/t/binlog_row_insert_select.test
index 806d495c8fb..e2a08536447 100644
--- a/mysql-test/suite/binlog/t/binlog_row_insert_select.test
+++ b/mysql-test/suite/binlog/t/binlog_row_insert_select.test
@@ -6,5 +6,5 @@
# The use of the ps protocol causes extra table maps in the binlog, so
# we disable the ps-protocol for this statement.
--disable_ps_protocol
--- source extra/binlog_tests/insert_select-binlog.test
+-- source include/insert_select-binlog.test
--enable_ps_protocol
diff --git a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
index a7722075d6e..9692c6ee1c2 100644
--- a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
@@ -8,8 +8,8 @@
# we disable the ps-protocol for this statement.
--disable_ps_protocol
--- source extra/binlog_tests/mix_innodb_myisam_binlog.test
+-- source include/mix_innodb_myisam_binlog.test
--enable_ps_protocol
--- source extra/binlog_tests/mix_innodb_myisam_side_effects.test
+-- source include/mix_innodb_myisam_side_effects.test
diff --git a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
index 570a7440592..b2af560fa50 100644
--- a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
+++ b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
@@ -9,4 +9,4 @@ reset master; # get rid of previous tests binlog
disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
--- source extra/binlog_tests/binlog_insert_delayed.test
+-- source include/binlog_insert_delayed.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_binlog.test b/mysql-test/suite/binlog/t/binlog_stm_binlog.test
index 682b0a3bfa7..c3d8066f807 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_binlog.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog.test
@@ -20,4 +20,4 @@ drop table t1;
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
--- source extra/binlog_tests/binlog.test
+-- source include/binlog.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_blackhole.test b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
index 6047d8ca2fc..9dea4d1b4d5 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
@@ -3,4 +3,4 @@
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
--- source extra/binlog_tests/blackhole.test
+-- source include/blackhole.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
index 0f5aa9f6013..a03f4c54f5e 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
--- source extra/binlog_tests/binlog_cache_stat.test
+-- source include/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
index c0791d81445..33378b28edf 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
@@ -3,4 +3,4 @@
-- source include/not_embedded.inc
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/binlog_tests/ctype_cp932.test
+-- source include/ctype_cp932.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
index c8cd7e06398..ed5b899c033 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
@@ -2,5 +2,5 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/binlog_tests/ctype_ucs_binlog.test
+-- source include/ctype_ucs_binlog.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test b/mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test
index f2b07bb69f6..fb8b290a41e 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/binlog_tests/drop_table.test
+-- source include/drop_table.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
index 6017f272d01..201aa45b4c6 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/binlog_tests/drop_temp_table.test
+-- source include/drop_temp_table.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_insert_select.test b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
index 3aefa1e6cf7..d0782c70699 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/binlog_tests/insert_select-binlog.test
+-- source include/insert_select-binlog.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
index ba3da73dead..911c90b5fff 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
@@ -5,10 +5,10 @@
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
--- source extra/binlog_tests/mix_innodb_myisam_binlog.test
+-- source include/mix_innodb_myisam_binlog.test
set @@session.binlog_format=statement;
--- source extra/binlog_tests/mix_innodb_myisam_side_effects.test
+-- source include/mix_innodb_myisam_side_effects.test
set @@session.binlog_format=@@global.binlog_format;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_ps.test b/mysql-test/suite/binlog/t/binlog_stm_ps.test
index e6e54985f6f..b83991b1356 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_ps.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ps.test
@@ -99,3 +99,19 @@ DROP TABLE t1;
--let $binlog_file = LAST
source include/show_binlog_events.inc;
+
+--echo #
+--echo #MDEV-14467 Item_param: replace {INT|DECIMAL|REAL|STRING|TIME}_VALUE with Type_handler
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (a INT);
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING 10;
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING 10.1;
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING 10.1e0;
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING '10';
+EXECUTE IMMEDIATE 'INSERT INTO t1 SELECT 1 LIMIT ?' USING TIME'10:10:10';
+DROP TABLE t1;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_sp.test b/mysql-test/suite/binlog/t/binlog_stm_sp.test
new file mode 100644
index 00000000000..047cab741ce
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_sp.test
@@ -0,0 +1,82 @@
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+--echo #
+--echo # MDEV-11815 SP variables of temporal data types do not replicate correctly
+--echo #
+
+CREATE TABLE t1(a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE i INT DEFAULT 123;
+ DECLARE b8 BIT(8) DEFAULT 0x61;
+ DECLARE t0 TIME DEFAULT '01:01:01';
+ DECLARE t6 TIME(6) DEFAULT '01:01:01.123456';
+ DECLARE d DATE DEFAULT '2001-01-01';
+ DECLARE dt0 DATETIME DEFAULT '2001-01-01 01:01:01';
+ DECLARE dt6 DATETIME(6) DEFAULT '2001-01-01 01:01:01.123456';
+ DECLARE ts0 TIMESTAMP DEFAULT '2001-01-01 01:01:01';
+ DECLARE ts6 TIMESTAMP(6) DEFAULT '2001-01-01 01:01:01.123456';
+ INSERT INTO t1 VALUES (i=0x61);
+ INSERT INTO t1 VALUES (b8=0x61);
+ INSERT INTO t1 VALUES (t0=10101);
+ INSERT INTO t1 VALUES (t6=10101);
+ INSERT INTO t1 VALUES (d=20010101);
+ INSERT INTO t1 VALUES (dt0=20010101010101);
+ INSERT INTO t1 VALUES (dt6=20010101010101);
+ INSERT INTO t1 VALUES (ts0=20010101010101);
+ INSERT INTO t1 VALUES (ts6=20010101010101);
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+--echo #
+--echo # MDEV-16020 SP variables inside GROUP BY..WITH ROLLUP break replication
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+CREATE TABLE t2 (d DATE, c BIGINT);
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ BEGIN
+ DECLARE var INT DEFAULT 10;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var WITH ROLLUP;
+ END;
+ BEGIN
+ DECLARE atomic INT DEFAULT 20;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic WITH ROLLUP;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic` WITH ROLLUP;
+ END;
+ BEGIN
+ DECLARE atomic ROW (atomic INT, xxx INT) DEFAULT (31,32);
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.atomic;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.atomic WITH ROLLUP;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`atomic`;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`atomic` WITH ROLLUP;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.xxx;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, atomic.xxx WITH ROLLUP;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`xxx`;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, `atomic`.`xxx` WITH ROLLUP;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1,t2;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_sp_type_row.test b/mysql-test/suite/binlog/t/binlog_stm_sp_type_row.test
new file mode 100644
index 00000000000..a7e21ee55c5
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_sp_type_row.test
@@ -0,0 +1,108 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+CREATE TABLE t1 (a INT, b INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ rec.a:=100;
+ rec.b:=200;
+ INSERT INTO t1 VALUES (rec.a,rec.b);
+ INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+ INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+ rec.a:=NULL;
+ INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+ INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+ INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+ INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+ rec.b:=NULL;
+ INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+ INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--echo #
+--echo # Testing ROW fields in LIMIT
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(10);
+CREATE TABLE t2 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a INT:= 1;
+ rec ROW(a INT);
+BEGIN
+ rec.a:= 1;
+ INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+ INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1,t2;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--echo #
+--echo # End of MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+
+--echo #
+--echo # MDEV-12291 Allow ROW variables as SELECT INTO targets
+--echo #
+
+FLUSH LOGS;
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE rec1 ROW(a INT, b VARCHAR(32));
+ SELECT * INTO rec1 FROM t1;
+ INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_innodb.test b/mysql-test/suite/binlog/t/binlog_truncate_innodb.test
index 56dd5bda505..54a32b96ef1 100644
--- a/mysql-test/suite/binlog/t/binlog_truncate_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_truncate_innodb.test
@@ -8,37 +8,37 @@ SET @old_binlog_format=@@binlog_format;
SET BINLOG_FORMAT=ROW;
RESET MASTER;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
--echo # Even though the isolation level might be permissive, truncate
--echo # table follows a stricter isolation as its locking is based on
--echo # (exclusive) metadata locks.
let $before_truncate = SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
let $before_truncate = SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
let $before_truncate = SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
let $before_truncate = SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
SET BINLOG_FORMAT=STATEMENT;
RESET MASTER;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
--echo # Truncate is not supported for SBR if the isolation level is
--echo # READ UNCOMMITTED or READ COMMITTED. These specific isolation
--echo # levels are tested elsewhere.
let $before_truncate = SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
let $before_truncate = SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
SET BINLOG_FORMAT=@old_binlog_format;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_myisam.test b/mysql-test/suite/binlog/t/binlog_truncate_myisam.test
index fc28bd7c7e2..864e9c63b10 100644
--- a/mysql-test/suite/binlog/t/binlog_truncate_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_truncate_myisam.test
@@ -7,11 +7,11 @@ let $engine = MyISAM;
SET BINLOG_FORMAT=ROW;
RESET MASTER;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
SET BINLOG_FORMAT=STATEMENT;
RESET MASTER;
-source extra/binlog_tests/binlog_truncate.test;
+source include/binlog_truncate.test;
SET BINLOG_FORMAT=@old_binlog_format;
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index a23155e6c1d..673712ff209 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -261,7 +261,7 @@ while ($unsafe_type < 9) {
--let $CRC_ARG_sel_sidef= $sel_sidef_0
--let $CRC_ARG_sel_retval= $sel_retval_0
--let $CRC_ARG_desc= $desc_0
- --source extra/rpl_tests/create_recursive_construct.inc
+ --source suite/rpl/include/create_recursive_construct.inc
--let $stmt_sidef_1= $CRC_RET_stmt_sidef
--let $value_1= $CRC_RET_value
--let $sel_sidef_1= $CRC_RET_sel_sidef
@@ -292,7 +292,7 @@ while ($unsafe_type < 9) {
--let $CRC_ARG_sel_sidef= $sel_sidef_1
--let $CRC_ARG_sel_retval= $sel_retval_1
--let $CRC_ARG_desc= $desc_1
- --source extra/rpl_tests/create_recursive_construct.inc
+ --source suite/rpl/include/create_recursive_construct.inc
--let $stmt_sidef_2= $CRC_RET_stmt_sidef
--let $value_2= $CRC_RET_value
--let $sel_sidef_2= $CRC_RET_sel_sidef
@@ -321,7 +321,7 @@ while ($unsafe_type < 9) {
--let $CRC_ARG_sel_sidef= $sel_sidef_2
--let $CRC_ARG_sel_retval= $sel_retval_2
--let $CRC_ARG_desc= $desc_2
- --source extra/rpl_tests/create_recursive_construct.inc
+ --source suite/rpl/include/create_recursive_construct.inc
# Drop created object.
if ($drop_3) {
diff --git a/mysql-test/suite/binlog/t/binlog_write_error.test b/mysql-test/suite/binlog/t/binlog_write_error.test
index 05f8eff6c3a..d66efb0bcf3 100644
--- a/mysql-test/suite/binlog/t/binlog_write_error.test
+++ b/mysql-test/suite/binlog/t/binlog_write_error.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_write_error.inc
+--source include/binlog_write_error.inc
diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test
index 0e0b80433ff..411394d4bef 100644
--- a/mysql-test/suite/binlog/t/binlog_xa_recover.test
+++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_xa_recover.inc
+--source include/binlog_xa_recover.inc
diff --git a/mysql-test/suite/binlog/t/load_data_stm_view.test b/mysql-test/suite/binlog/t/load_data_stm_view.test
index b70651b4e2d..9f64b813eec 100644
--- a/mysql-test/suite/binlog/t/load_data_stm_view.test
+++ b/mysql-test/suite/binlog/t/load_data_stm_view.test
@@ -8,6 +8,8 @@
1
EOF
+reset master;
+
create table t1 (i int, j int);
create view v1 as select i from t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -15,6 +17,8 @@ create view v1 as select i from t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/3940.data' INTO TABLE v1
select * from v1;
+--let $binlog_file = LAST
--source include/show_binlog_events.inc
drop view v1;
drop table t1;
+--remove_file $MYSQLTEST_VARDIR/3940.data
diff --git a/mysql-test/suite/binlog/t/read_only.inc b/mysql-test/suite/binlog/t/read_only.inc
new file mode 100644
index 00000000000..37f1cb3b2b8
--- /dev/null
+++ b/mysql-test/suite/binlog/t/read_only.inc
@@ -0,0 +1,79 @@
+--echo #
+--echo # MDEV-17863 DROP TEMPORARY TABLE creates a transaction in
+--echo # binary log on read only server
+--echo # MDEV-19074 Improved read_only mode for slaves with
+--echo # gtid_strict_mode enabled
+--echo #
+
+create user test@localhost;
+grant CREATE, DROP, INSERT, SELECT on *.* to test@localhost;
+create table t1 (a int) engine=myisam;
+insert into t1 values (1),(2);
+reset master;
+
+set global read_only=1;
+--echo # Ensure that optimize and analyze doesn't log to binary log
+connect (con1,localhost,test,,test);
+--error ER_OPTION_PREVENTS_STATEMENT
+insert into t1 values(3);
+analyze table t1;
+check table t1;
+repair table t1;
+--error ER_OPTION_PREVENTS_STATEMENT
+optimize table t1;
+
+--echo # Ensure that using temporary tables is not logged
+create temporary table tmp1 (a int) engine=myisam;
+insert into tmp1 values (1),(2);
+update tmp1 set a=10 where a=2;
+delete from tmp1 where a=1;
+create temporary table tmp2 select * from t1;
+select * from tmp1;
+select * from tmp2;
+create temporary table tmp3 like t1;
+create or replace temporary table tmp3 like t1;
+alter table tmp2 add column (b int);
+select * from tmp2;
+--error ER_OPTION_PREVENTS_STATEMENT
+insert into t1 select a+100 from tmp2;
+drop table tmp1,tmp2,tmp3;
+
+--echo # Clean up test connection
+disconnect con1;
+connection default;
+
+--echo # Execute some commands as root that should not be logged
+optimize table t1;
+repair table t1;
+
+--echo # Changes to temporary tables created under readonly should not
+--echo # be logged
+create temporary table tmp4 (a int) engine=myisam;
+insert into tmp4 values (1),(2);
+create temporary table tmp5 (a int) engine=myisam;
+insert into tmp5 select * from tmp4;
+alter table tmp5 add column (b int);
+
+set global read_only=0;
+
+insert into tmp4 values (3),(4);
+insert into tmp5 values (10,3),(11,4);
+select * from tmp4;
+select * from tmp5;
+update tmp4 set a=10 where a=2;
+delete from tmp4 where a=1;
+create table t2 select * from tmp4;
+alter table tmp5 add column (c int);
+insert into tmp5 values (20,5,1),(21,5,2);
+select * from tmp5;
+insert into t1 select a+200 from tmp5;
+select * from t1;
+drop table tmp4,tmp5;
+
+--echo # Check what is logged. Only last create select and the insert...select's should be
+--echo # row-logged
+source include/show_binlog_events.inc;
+
+--echo # Clean up
+drop user test@localhost;
+drop table t1,t2;
diff --git a/mysql-test/suite/binlog/t/read_only.test b/mysql-test/suite/binlog/t/read_only.test
new file mode 100644
index 00000000000..14a4650b36f
--- /dev/null
+++ b/mysql-test/suite/binlog/t/read_only.test
@@ -0,0 +1,2 @@
+--source include/have_binlog_format_mixed_or_row.inc
+--source read_only.inc
diff --git a/mysql-test/suite/binlog/t/read_only_statement.test b/mysql-test/suite/binlog/t/read_only_statement.test
new file mode 100644
index 00000000000..a976854fbb2
--- /dev/null
+++ b/mysql-test/suite/binlog/t/read_only_statement.test
@@ -0,0 +1,2 @@
+--source include/have_binlog_format_statement.inc
+--source read_only.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_incident.test b/mysql-test/suite/binlog_encryption/binlog_incident.test
index d37ed3d552d..6fc599596f7 100644
--- a/mysql-test/suite/binlog_encryption/binlog_incident.test
+++ b/mysql-test/suite/binlog_encryption/binlog_incident.test
@@ -1,2 +1,2 @@
--let $use_remote_mysqlbinlog= 1
---source extra/binlog_tests/binlog_incident.inc
+--source suite/binlog/include/binlog_incident.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_index.result b/mysql-test/suite/binlog_encryption/binlog_index.result
index 1f3428e6eef..4b6b4c7fbee 100644
--- a/mysql-test/suite/binlog_encryption/binlog_index.result
+++ b/mysql-test/suite/binlog_encryption/binlog_index.result
@@ -2,7 +2,7 @@ call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
-call mtr.add_suppression('Could not open .*');
+call mtr.add_suppression('Could not use .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
SET @saved_dbug = @@SESSION.debug_dbug;
diff --git a/mysql-test/suite/binlog_encryption/binlog_index.test b/mysql-test/suite/binlog_encryption/binlog_index.test
index 1837c683bba..cd48a313809 100644
--- a/mysql-test/suite/binlog_encryption/binlog_index.test
+++ b/mysql-test/suite/binlog_encryption/binlog_index.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_index.inc
+--source suite/binlog/include/binlog_index.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_ioerr.test b/mysql-test/suite/binlog_encryption/binlog_ioerr.test
index 3155e14e6b0..e77ecd6d517 100644
--- a/mysql-test/suite/binlog_encryption/binlog_ioerr.test
+++ b/mysql-test/suite/binlog_encryption/binlog_ioerr.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_ioerr.inc
+--source suite/binlog/include/binlog_ioerr.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test
index 3af0015a486..6232720b8e2 100644
--- a/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test
+++ b/mysql-test/suite/binlog_encryption/binlog_mysqlbinlog-cp932.test
@@ -1,2 +1,2 @@
--let $use_remote_mysqlbinlog= 1
---source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
+--source suite/binlog/include/binlog_mysqlbinlog-cp932.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
index 9b843dc8a6b..004f163f192 100644
--- a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
@@ -148,7 +148,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -166,6 +166,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -174,7 +175,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -192,6 +193,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -200,7 +202,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -218,6 +220,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -226,7 +229,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -259,6 +262,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -267,7 +271,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -285,6 +289,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -293,7 +298,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -313,6 +318,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -375,7 +381,7 @@ CREATE DATABASE test1
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -393,6 +399,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -401,7 +408,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -414,7 +421,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -427,7 +434,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -458,7 +465,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -471,7 +478,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -545,7 +552,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -560,6 +567,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -568,7 +576,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -583,6 +591,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -591,7 +600,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
@@ -606,6 +615,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -614,7 +624,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -642,6 +652,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -650,7 +661,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -665,6 +676,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -673,7 +685,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -688,6 +700,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.test b/mysql-test/suite/binlog_encryption/binlog_row_annotate.test
index 40aa0dbc6e3..b5c3bb2e55e 100644
--- a/mysql-test/suite/binlog_encryption/binlog_row_annotate.test
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.test
@@ -1,2 +1,2 @@
--let $use_remote_mysqlbinlog= 1
---source extra/binlog_tests/binlog_row_annotate.inc
+--source suite/binlog/include/binlog_row_annotate.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.test b/mysql-test/suite/binlog_encryption/binlog_write_error.test
index 05f8eff6c3a..68e59655eab 100644
--- a/mysql-test/suite/binlog_encryption/binlog_write_error.test
+++ b/mysql-test/suite/binlog_encryption/binlog_write_error.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_write_error.inc
+--source suite/binlog/include/binlog_write_error.inc
diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test
index 0e0b80433ff..e603ccc30fe 100644
--- a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test
+++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test
@@ -1 +1 @@
---source extra/binlog_tests/binlog_xa_recover.inc
+--source suite/binlog/include/binlog_xa_recover.inc
diff --git a/mysql-test/suite/binlog_encryption/multisource.result b/mysql-test/suite/binlog_encryption/multisource.result
index d99a377f0c5..928c9799854 100644
--- a/mysql-test/suite/binlog_encryption/multisource.result
+++ b/mysql-test/suite/binlog_encryption/multisource.result
@@ -47,6 +47,8 @@ drop database if exists db1;
create database db1;
use db1;
create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
insert into t1 (f1) values ('one'),('two');
connection slave;
select * from db1.t1;
diff --git a/mysql-test/suite/binlog_encryption/multisource.test b/mysql-test/suite/binlog_encryption/multisource.test
index fc58fe81803..53d9f40877f 100644
--- a/mysql-test/suite/binlog_encryption/multisource.test
+++ b/mysql-test/suite/binlog_encryption/multisource.test
@@ -1 +1 @@
---source extra/rpl_tests/multisource.inc
+--source suite/rpl/include/multisource.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result
index eb4e45ad28e..4c667bd7f5a 100644
--- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result
+++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result
@@ -174,7 +174,7 @@ SET SQL_LOG_BIN=1;
SET @@global.debug_dbug=@old_debug;
###################### TEST #10
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
-call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("Could not use .*");
RESET MASTER;
SHOW WARNINGS;
Level Code Message
@@ -234,7 +234,7 @@ include/rpl_reset.inc
connection slave;
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
call mtr.add_suppression("Error writing file .*");
-call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("Could not use .*");
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
###################### TEST #13
diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
index a4611f515c4..c2a7ec9d27a 100644
--- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
+++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
@@ -1,2 +1,2 @@
--let $binlog_limit= 5,1
---source extra/rpl_tests/rpl_binlog_errors.inc
+--source suite/rpl/include/rpl_binlog_errors.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
index 6d222cba115..acbe0d59a5e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
+++ b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_cant_read_event_incident.inc
+--source suite/rpl/include/rpl_cant_read_event_incident.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.test b/mysql-test/suite/binlog_encryption/rpl_checksum.test
index 8e006b1b6a0..ca8cdc06726 100644
--- a/mysql-test/suite/binlog_encryption/rpl_checksum.test
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_checksum.inc
+--source suite/rpl/include/rpl_checksum.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
index 56c3e1e1cb5..8fa44136fc2 100644
--- a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_checksum_cache.inc
+--source suite/rpl/include/rpl_checksum_cache.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.test b/mysql-test/suite/binlog_encryption/rpl_corruption.test
index 310b0cef8e8..1abf2c882ec 100644
--- a/mysql-test/suite/binlog_encryption/rpl_corruption.test
+++ b/mysql-test/suite/binlog_encryption/rpl_corruption.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_corruption.inc
+--source suite/rpl/include/rpl_corruption.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
index 70be6fbff1f..b9f5a18a588 100644
--- a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
+++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_gtid_basic.inc
+--source suite/rpl/include/rpl_gtid_basic.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.test b/mysql-test/suite/binlog_encryption/rpl_incident.test
index 9be855e1a8b..b6d2a24a71e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_incident.test
+++ b/mysql-test/suite/binlog_encryption/rpl_incident.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_incident.inc
+--source suite/rpl/include/rpl_incident.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
index 6f515b9390a..872b8cd3598 100644
--- a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
+++ b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_init_slave_errors.inc
+--source suite/rpl/include/rpl_init_slave_errors.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
index 8d90afaed27..9e0bb9598bf 100644
--- a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
+++ b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_loaddata_local.inc
+--source suite/rpl/include/rpl_loaddata_local.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_loadfile.test b/mysql-test/suite/binlog_encryption/rpl_loadfile.test
index 40379a5c3d0..84e6ecd7a0d 100644
--- a/mysql-test/suite/binlog_encryption/rpl_loadfile.test
+++ b/mysql-test/suite/binlog_encryption/rpl_loadfile.test
@@ -1,4 +1,4 @@
---source extra/rpl_tests/rpl_loadfile.inc
+--source suite/rpl/include/rpl_loadfile.inc
--let $datadir= `SELECT @@datadir`
diff --git a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test
index 8fb7350b815..144f86cceba 100644
--- a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test
+++ b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.test
@@ -3,5 +3,5 @@
--source include/not_windows.inc
--source include/have_binlog_format_mixed.inc
---source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source suite/rpl/include/rpl_binlog_max_cache_size.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.test b/mysql-test/suite/binlog_encryption/rpl_packet.test
index 31357cb148e..43637314236 100644
--- a/mysql-test/suite/binlog_encryption/rpl_packet.test
+++ b/mysql-test/suite/binlog_encryption/rpl_packet.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_packet.inc
+--source suite/rpl/include/rpl_packet.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.test b/mysql-test/suite/binlog_encryption/rpl_parallel.test
index b7c4bb429a4..dba54e4fd7a 100644
--- a/mysql-test/suite/binlog_encryption/rpl_parallel.test
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_parallel.inc
+--source suite/rpl/include/rpl_parallel.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
index 9e93b0b56e9..7bdfaaf9adb 100644
--- a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc
+--source suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
index 5e3bcdcd711..e52f5159fcc 100644
--- a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
+++ b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_relayrotate.inc
+--source suite/rpl/include/rpl_relayrotate.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result
index 6d574681d73..106efb555d3 100644
--- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result
+++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result
@@ -4,6 +4,7 @@ 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("mysqld: Got an error reading communication packets");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
@@ -176,7 +177,7 @@ 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
+Rpl_semi_sync_master_clients 0
[ semi-sync replication of these transactions will fail ]
insert into t1 values (500);
[ master status should be OFF ]
@@ -321,7 +322,6 @@ connection slave;
include/stop_slave.inc
reset slave;
connection master;
-kill query _tid;
connection slave;
include/start_slave.inc
connection master;
@@ -353,7 +353,6 @@ include/stop_slave.inc
reset slave;
connection 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;
@@ -404,7 +403,6 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
connection master;
-kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
index d5f80619aeb..dfc68b699c0 100644
--- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
+++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_semi_sync.inc
+--source suite/rpl/include/rpl_semi_sync.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
index e7b52f2fadb..40992586c7c 100644
--- a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
+++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
@@ -1,2 +1,2 @@
--let $use_remote_mysqlbinlog= 1
---source extra/rpl_tests/rpl_skip_replication.inc
+--source suite/rpl/include/rpl_skip_replication.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_special_charset.test b/mysql-test/suite/binlog_encryption/rpl_special_charset.test
index 6f196005711..eb697204860 100644
--- a/mysql-test/suite/binlog_encryption/rpl_special_charset.test
+++ b/mysql-test/suite/binlog_encryption/rpl_special_charset.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_special_charset.inc
+--source suite/rpl/include/rpl_special_charset.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
index 0a756982047..0dab68a4b08 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
+++ b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_sporadic_master.inc
+--source suite/rpl/include/rpl_sporadic_master.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_ssl.test b/mysql-test/suite/binlog_encryption/rpl_ssl.test
index 883b367e9f2..9a4788c1d2d 100644
--- a/mysql-test/suite/binlog_encryption/rpl_ssl.test
+++ b/mysql-test/suite/binlog_encryption/rpl_ssl.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_ssl.inc
+--source suite/rpl/include/rpl_ssl.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
index f72300ee2de..45d18a25410 100644
--- a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
+++ b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_stm_relay_ign_space.inc
+--source suite/rpl/include/rpl_stm_relay_ign_space.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
index cd826c6be1e..2a16d90f9ad 100644
--- a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_switch_stm_row_mixed.inc
+--source suite/rpl/include/rpl_switch_stm_row_mixed.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt b/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
index 2e8be18dbd7..795330535c1 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
+++ b/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
@@ -1,2 +1,2 @@
---sync-relay-log-info=1 --relay-log-recovery=1 --loose-innodb_file_format_check=1 --default-storage-engine=MyISAM --loose-innodb-file-per-table=0
+--sync-relay-log-info=1 --relay-log-recovery=1 --default-storage-engine=MyISAM --loose-innodb-file-per-table=0
--skip-core-file --skip-slave-start
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync.test b/mysql-test/suite/binlog_encryption/rpl_sync.test
index 189dd8220ef..8dbd6ff254b 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sync.test
+++ b/mysql-test/suite/binlog_encryption/rpl_sync.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_sync.inc
+--source suite/rpl/include/rpl_sync_test.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
index 99a70e011c4..30f5f247c23 100644
--- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
+--source suite/rpl/include/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
index 1df4a48f0a9..68afb4148ef 100644
--- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
@@ -3,4 +3,4 @@
--let $force_master_mysql56_temporal_format=false;
--let $force_slave_mysql56_temporal_format=true;
---source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
+--source suite/rpl/include/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
index f7436ed6fef..96d928fcf08 100644
--- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
@@ -1,4 +1,4 @@
--let $force_master_mysql56_temporal_format=true;
--let $force_slave_mysql56_temporal_format=false;
---source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
+--source suite/rpl/include/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_typeconv.result b/mysql-test/suite/binlog_encryption/rpl_typeconv.result
index e65dede28e0..1ba259edf8e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_typeconv.result
+++ b/mysql-test/suite/binlog_encryption/rpl_typeconv.result
@@ -40,6 +40,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -52,6 +56,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -64,6 +72,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -76,6 +88,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -208,6 +224,26 @@ BIT(5) BIT(6) <Correct error>
BIT(6) BIT(5) <Correct error>
BIT(5) BIT(12) <Correct error>
BIT(12) BIT(5) <Correct error>
+TINYBLOB COMPRE TINYBLOB <Correct error>
+TINYBLOB COMPRE BLOB <Correct error>
+TINYBLOB COMPRE MEDIUMBLOB <Correct error>
+TINYBLOB COMPRE LONGBLOB <Correct error>
+TINYBLOB COMPRE VARBINARY(255) <Correct error>
+BLOB COMPRESSED TINYBLOB <Correct error>
+BLOB COMPRESSED BLOB <Correct error>
+BLOB COMPRESSED MEDIUMBLOB <Correct error>
+BLOB COMPRESSED LONGBLOB <Correct error>
+BLOB COMPRESSED VARBINARY(65500 <Correct error>
+MEDIUMBLOB COMP TINYBLOB <Correct error>
+MEDIUMBLOB COMP BLOB <Correct error>
+MEDIUMBLOB COMP MEDIUMBLOB <Correct error>
+MEDIUMBLOB COMP LONGBLOB <Correct error>
+MEDIUMBLOB COMP VARBINARY(65500 <Correct error>
+LONGBLOB COMPRE TINYBLOB <Correct error>
+LONGBLOB COMPRE BLOB <Correct error>
+LONGBLOB COMPRE MEDIUMBLOB <Correct error>
+LONGBLOB COMPRE LONGBLOB <Correct error>
+LONGBLOB COMPRE VARBINARY(65500 <Correct error>
TINYBLOB BLOB <Correct error>
TINYBLOB MEDIUMBLOB <Correct error>
TINYBLOB LONGBLOB <Correct error>
@@ -352,6 +388,26 @@ BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
+TINYBLOB COMPRE TINYBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE BLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE LONGBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE VARBINARY(255) ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED TINYBLOB ALL_NON_LOSSY <Correct error>
+BLOB COMPRESSED BLOB ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED LONGBLOB ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED VARBINARY(65500 ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB COMP TINYBLOB ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB COMP BLOB ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB COMP MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP LONGBLOB ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP VARBINARY(65500 ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE TINYBLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE BLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE MEDIUMBLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE LONGBLOB ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE VARBINARY(65500 ALL_NON_LOSSY <Correct error>
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
TINYBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
@@ -496,6 +552,26 @@ BIT(5) BIT(6) ALL_LOSSY <Correct error>
BIT(6) BIT(5) ALL_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY <Correct error>
BIT(12) BIT(5) ALL_LOSSY <Correct value>
+TINYBLOB COMPRE TINYBLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE BLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE MEDIUMBLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE LONGBLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE VARBINARY(255) ALL_LOSSY <Correct error>
+BLOB COMPRESSED TINYBLOB ALL_LOSSY <Correct value>
+BLOB COMPRESSED BLOB ALL_LOSSY <Correct error>
+BLOB COMPRESSED MEDIUMBLOB ALL_LOSSY <Correct error>
+BLOB COMPRESSED LONGBLOB ALL_LOSSY <Correct error>
+BLOB COMPRESSED VARBINARY(65500 ALL_LOSSY <Correct value>
+MEDIUMBLOB COMP TINYBLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB COMP BLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB COMP MEDIUMBLOB ALL_LOSSY <Correct error>
+MEDIUMBLOB COMP LONGBLOB ALL_LOSSY <Correct error>
+MEDIUMBLOB COMP VARBINARY(65500 ALL_LOSSY <Correct value>
+LONGBLOB COMPRE TINYBLOB ALL_LOSSY <Correct value>
+LONGBLOB COMPRE BLOB ALL_LOSSY <Correct value>
+LONGBLOB COMPRE MEDIUMBLOB ALL_LOSSY <Correct value>
+LONGBLOB COMPRE LONGBLOB ALL_LOSSY <Correct error>
+LONGBLOB COMPRE VARBINARY(65500 ALL_LOSSY <Correct value>
TINYBLOB BLOB ALL_LOSSY <Correct error>
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
TINYBLOB LONGBLOB ALL_LOSSY <Correct error>
@@ -640,6 +716,26 @@ BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE VARBINARY(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
diff --git a/mysql-test/suite/binlog_encryption/rpl_typeconv.test b/mysql-test/suite/binlog_encryption/rpl_typeconv.test
index 4dbfc27d088..fe56a148256 100644
--- a/mysql-test/suite/binlog_encryption/rpl_typeconv.test
+++ b/mysql-test/suite/binlog_encryption/rpl_typeconv.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_typeconv.inc
+--source suite/rpl/include/rpl_typeconv.inc
diff --git a/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result
new file mode 100644
index 00000000000..7c2012945c9
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result
@@ -0,0 +1,65 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:00:00');
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
+SET sql_mode=MAXDB;
+CREATE TABLE t2 SELECT * FROM t1;
+SET timestamp=DEFAULT;
+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 (a TIMESTAMP)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (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 # Annotate_rows # # INSERT INTO t1 VALUES ('2001-01-01 10:20:30')
+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 TABLE "t2" (
+ "a" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp()
+)
+master-bin.000001 # Annotate_rows # # CREATE TABLE t2 SELECT * FROM t1
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+connection slave;
+SELECT * FROM t1;
+a
+2001-01-01 10:00:00
+2001-01-01 10:20:30
+SET sql_mode=DEFAULT;
+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
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp()
+)
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp()
+)
+connection master;
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test
new file mode 100644
index 00000000000..50663229937
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test
@@ -0,0 +1,34 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+--echo #
+
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:00:00');
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
+SET sql_mode=MAXDB;
+CREATE TABLE t2 SELECT * FROM t1;
+SET timestamp=DEFAULT;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--sync_slave_with_master
+SELECT * FROM t1;
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection master
+DROP TABLE t1, t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/compat/maxdb/type_timestamp.result b/mysql-test/suite/compat/maxdb/type_timestamp.result
new file mode 100644
index 00000000000..355a4e28414
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/type_timestamp.result
@@ -0,0 +1,53 @@
+#
+# MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+def_timestamp TIMESTAMP,
+mdb_timestamp mariadb_schema.TIMESTAMP,
+ora_timestamp oracle_schema.TIMESTAMP,
+max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `def_timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+ `mdb_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `ora_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `max_timestamp` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "def_timestamp" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp(),
+ "mdb_timestamp" mariadb_schema.timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ "ora_timestamp" mariadb_schema.timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ "max_timestamp" datetime DEFAULT NULL
+)
+DROP TABLE t1;
+SET sql_mode=MAXDB;
+CREATE TABLE t1 (
+def_timestamp TIMESTAMP,
+mdb_timestamp mariadb_schema.TIMESTAMP,
+ora_timestamp oracle_schema.TIMESTAMP,
+max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "def_timestamp" datetime DEFAULT NULL,
+ "mdb_timestamp" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp(),
+ "ora_timestamp" mariadb_schema.timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ "max_timestamp" datetime DEFAULT NULL
+)
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `def_timestamp` datetime DEFAULT NULL,
+ `mdb_timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+ `ora_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `max_timestamp` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/maxdb/type_timestamp.test b/mysql-test/suite/compat/maxdb/type_timestamp.test
new file mode 100644
index 00000000000..cd60ffc0795
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/type_timestamp.test
@@ -0,0 +1,29 @@
+--echo #
+--echo # MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+--echo #
+
+
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+ def_timestamp TIMESTAMP,
+ mdb_timestamp mariadb_schema.TIMESTAMP,
+ ora_timestamp oracle_schema.TIMESTAMP,
+ max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+SET sql_mode=MAXDB;
+CREATE TABLE t1 (
+ def_timestamp TIMESTAMP,
+ mdb_timestamp mariadb_schema.TIMESTAMP,
+ ora_timestamp oracle_schema.TIMESTAMP,
+ max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result b/mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result
new file mode 100644
index 00000000000..0656a685976
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result
@@ -0,0 +1,100 @@
+SET @@SQL_MODE = 'ORACLE';
+##########################################################################
+# Test verifies Gtid_log_event/Xid_log_event specific print #
+##########################################################################
+CREATE TABLE tm (f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+CREATE OR REPLACE PROCEDURE simpleproc (param1 OUT INT) AS
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t;
+END;
+/
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+RETURN 10;
+END;
+/
+FLUSH LOGS;
+##########################################################################
+# Delete data from master so that it can be restored from binlog #
+##########################################################################
+DROP FUNCTION f1;
+DROP PROCEDURE simpleproc;
+DROP TABLE tm;
+DROP TABLE t;
+##########################################################################
+# Post recovery using mysqlbinlog #
+##########################################################################
+SHOW TABLES;
+Tables_in_test
+t
+tm
+SELECT * FROM tm;
+f
+10
+SELECT * FROM t;
+f
+10
+SELECT f1();
+f1()
+10
+CALL simpleproc(@a);
+SELECT @a;
+@a
+1
+"***** Clean Up *****"
+DROP TABLE t,tm;
+DROP PROCEDURE simpleproc;
+DROP FUNCTION f1;
+RESET MASTER;
+##########################################################################
+# Test verifies Gtid_log_event/Xid_log_event/Qery_log_event #
+# specific print along with flashback option #
+##########################################################################
+CREATE TABLE tm(f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+INSERT INTO tm VALUES (20);
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+INSERT INTO t VALUES (20);
+##########################################################################
+# Initial data #
+##########################################################################
+SELECT * FROM tm;
+f
+10
+20
+SELECT * FROM t;
+f
+10
+20
+FLUSH LOGS;
+DELETE FROM tm WHERE f=20;
+DELETE FROM t WHERE f=20;
+FLUSH LOGS;
+##########################################################################
+# Data after deletion #
+##########################################################################
+SELECT * FROM tm;
+f
+10
+SELECT * FROM t;
+f
+10
+FOUND 2 /START TRANSACTION/ in test.sql
+##########################################################################
+# Data after recovery using flashback #
+##########################################################################
+SELECT * FROM tm;
+f
+10
+20
+SELECT * FROM t;
+f
+10
+20
+"***** Clean Up *****"
+DROP TABLE t,tm;
diff --git a/mysql-test/suite/compat/oracle/r/binlog_stm_ps.result b/mysql-test/suite/compat/oracle/r/binlog_stm_ps.result
new file mode 100644
index 00000000000..01fe3be3a04
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/binlog_stm_ps.result
@@ -0,0 +1,98 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10801 sql_mode: dynamic SQL placeholders
+#
+CREATE TABLE t1 (a INT, b INT);
+SET @a=10, @b=20;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?,?)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:a,:b)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:aaa,:bbb)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"a",:"b")';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"aaa",:"bbb")';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:1,:2)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:222,:111)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:0,:65535)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:65535,:0)';
+EXECUTE stmt USING @a, @b;
+SELECT * FROM t1;
+a b
+10 20
+10 20
+10 20
+10 20
+10 20
+10 20
+10 20
+10 20
+10 20
+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 (a INT, b INT)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
+master-bin.000001 # Query # # COMMIT
+DROP TABLE t1;
+#
+# MDEV-16095 Oracle-style placeholder inside GROUP BY..WITH ROLLUP breaks replication
+#
+FLUSH LOGS;
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+CREATE TABLE t2 (d DATE, c BIGINT);
+BEGIN
+EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param' USING 1;
+EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param WITH ROLLUP' USING 1;
+END;
+$$
+DROP TABLE t1,t2;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (d DATE)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24')
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (d DATE, c BIGINT)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, 1 WITH ROLLUP
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */
diff --git a/mysql-test/suite/compat/oracle/r/binlog_stm_sp.result b/mysql-test/suite/compat/oracle/r/binlog_stm_sp.result
new file mode 100644
index 00000000000..468309a0e56
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/binlog_stm_sp.result
@@ -0,0 +1,510 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10914 ROW data type for stored routine variables
+#
+CREATE TABLE t1 (a INT, b INT);
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec.a:=100;
+rec.b:=200;
+INSERT INTO t1 VALUES (rec.a,rec.b);
+INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.a:=NULL;
+INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.b:=NULL;
+INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+100 200
+10 1
+10 1
+10 20
+10 21
+11 NULL
+11 0
+11 NULL
+11 0
+12 NULL
+12 NULL
+DROP TABLE t1;
+DROP PROCEDURE p1;
+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 (a INT, b INT)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec.a:=100;
+rec.b:=200;
+INSERT INTO t1 VALUES (rec.a,rec.b);
+INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.a:=NULL;
+INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.b:=NULL;
+INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('rec.a',100), NAME_CONST('rec.b',200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10, ROW(100,200)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10, ROW(100,200)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE ROW(100,200)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(NULL,200)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(NULL,200)=ROW(100,201))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(100,200)=ROW(NULL,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(100,201)=ROW(NULL,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE ROW(NULL,200)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=ROW(NULL,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (12, ROW(NULL,NULL)=ROW(100,200))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (12, ROW(100,200)=ROW(NULL,NULL))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE ROW(NULL,NULL)=ROW(100,200)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=ROW(NULL,NULL)
+master-bin.000001 # Query # # COMMIT
+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`; DROP PROCEDURE p1
+#
+# Testing ROW fields in LIMIT
+#
+FLUSH LOGS;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(10);
+CREATE TABLE t2 (a INT);
+CREATE PROCEDURE p1()
+AS
+a INT:= 1;
+rec ROW(a INT);
+BEGIN
+rec.a:= 1;
+INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END;
+$$
+CALL p1();
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
+DROP TABLE t1,t2;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (10),(10)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (a INT)
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+a INT:= 1;
+rec ROW(a INT);
+BEGIN
+rec.a:= 1;
+INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT 1 FROM t1 LIMIT 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT 2 FROM t1 LIMIT 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP PROCEDURE p1
+#
+# End of MDEV-10914 ROW data type for stored routine variables
+#
+#
+# MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
+#
+CREATE TABLE t1 (a INT, b INT);
+CREATE PROCEDURE p1
+AS
+rec t1%ROWTYPE;
+BEGIN
+rec.a:=100;
+rec.b:=200;
+SELECT rec=ROW(100,200) AS true1, ROW(100,200)=rec AS true2;
+INSERT INTO t1 VALUES (rec.a,rec.b);
+INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.a:=NULL;
+INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.b:=NULL;
+INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END;
+$$
+CALL p1();
+true1 true2
+1 1
+SELECT * FROM t1;
+a b
+100 200
+10 1
+10 1
+10 20
+10 21
+11 NULL
+11 0
+11 NULL
+11 0
+12 NULL
+12 NULL
+DROP TABLE t1;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (10),(10)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (a INT)
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+a INT:= 1;
+rec ROW(a INT);
+BEGIN
+rec.a:= 1;
+INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT 1 FROM t1 LIMIT 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT 2 FROM t1 LIMIT 1
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP PROCEDURE p1
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT)
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+rec t1%ROWTYPE;
+BEGIN
+rec.a:=100;
+rec.b:=200;
+SELECT rec=ROW(100,200) AS true1, ROW(100,200)=rec AS true2;
+INSERT INTO t1 VALUES (rec.a,rec.b);
+INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.a:=NULL;
+INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+rec.b:=NULL;
+INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('rec.a',100), NAME_CONST('rec.b',200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (10, ROW(100,200)=ROW(100,200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (10, ROW(100,200)=ROW(100,200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE ROW(100,200)=ROW(100,200)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=ROW(100,200)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(NULL,200)=ROW(100,200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(NULL,200)=ROW(100,201))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(100,200)=ROW(NULL,200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (11, ROW(100,201)=ROW(NULL,200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE ROW(NULL,200)=ROW(100,200)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=ROW(NULL,200)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (12, ROW(NULL,NULL)=ROW(100,200))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (12, ROW(100,200)=ROW(NULL,NULL))
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE ROW(NULL,NULL)=ROW(100,200)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # BEGIN GTID #-#-#
+master-bin.000002 # Query # # use `test`; INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=ROW(NULL,NULL)
+master-bin.000002 # Query # # COMMIT
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP TABLE "t1" /* generated by server */
+master-bin.000002 # Gtid # # GTID #-#-#
+master-bin.000002 # Query # # use `test`; DROP PROCEDURE p1
+#
+# MDEV-12291 Allow ROW variables as SELECT INTO targets
+#
+FLUSH LOGS;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+CREATE PROCEDURE p1
+AS
+rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+10 b10
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000003 # Binlog_checkpoint # # master-bin.000003
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT, b VARCHAR(32))
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (10, 'b10')
+master-bin.000003 # Query # # COMMIT
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; CREATE TABLE t2 LIKE t1
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END
+master-bin.000003 # Gtid # # BEGIN GTID #-#-#
+master-bin.000003 # Query # # use `test`; INSERT INTO t2 VALUES ( NAME_CONST('rec1.a',10), NAME_CONST('rec1.b',_latin1'b10' COLLATE 'latin1_swedish_ci'))
+master-bin.000003 # Query # # COMMIT
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; DROP TABLE "t1" /* generated by server */
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; DROP TABLE "t2" /* generated by server */
+master-bin.000003 # Gtid # # GTID #-#-#
+master-bin.000003 # Query # # use `test`; DROP PROCEDURE p1
+FLUSH LOGS;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+CREATE PROCEDURE p1
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+10 b10
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000004 # Binlog_checkpoint # # master-bin.000004
+master-bin.000004 # Gtid # # GTID #-#-#
+master-bin.000004 # Query # # use `test`; CREATE TABLE t1 (a INT, b VARCHAR(32))
+master-bin.000004 # Gtid # # BEGIN GTID #-#-#
+master-bin.000004 # Query # # use `test`; INSERT INTO t1 VALUES (10, 'b10')
+master-bin.000004 # Query # # COMMIT
+master-bin.000004 # Gtid # # GTID #-#-#
+master-bin.000004 # Query # # use `test`; CREATE TABLE t2 LIKE t1
+master-bin.000004 # Gtid # # GTID #-#-#
+master-bin.000004 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END
+master-bin.000004 # Gtid # # BEGIN GTID #-#-#
+master-bin.000004 # Query # # use `test`; INSERT INTO t2 VALUES ( NAME_CONST('rec1.a',10), NAME_CONST('rec1.b',_latin1'b10' COLLATE 'latin1_swedish_ci'))
+master-bin.000004 # Query # # COMMIT
+master-bin.000004 # Gtid # # GTID #-#-#
+master-bin.000004 # Query # # use `test`; DROP TABLE "t1" /* generated by server */
+master-bin.000004 # Gtid # # GTID #-#-#
+master-bin.000004 # Query # # use `test`; DROP TABLE "t2" /* generated by server */
+master-bin.000004 # Gtid # # GTID #-#-#
+master-bin.000004 # Query # # use `test`; DROP PROCEDURE p1
+FLUSH LOGS;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+CREATE PROCEDURE p1
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+10 b10
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000005 # Binlog_checkpoint # # master-bin.000005
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; CREATE TABLE t1 (a INT, b VARCHAR(32))
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t1 VALUES (10, 'b10')
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; CREATE TABLE t2 LIKE t1
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+SELECT * INTO rec1 FROM t1;
+INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END
+master-bin.000005 # Gtid # # BEGIN GTID #-#-#
+master-bin.000005 # Query # # use `test`; INSERT INTO t2 VALUES ( NAME_CONST('rec1.a',10), NAME_CONST('rec1.b',_latin1'b10' COLLATE 'latin1_swedish_ci'))
+master-bin.000005 # Query # # COMMIT
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; DROP TABLE "t1" /* generated by server */
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; DROP TABLE "t2" /* generated by server */
+master-bin.000005 # Gtid # # GTID #-#-#
+master-bin.000005 # Query # # use `test`; DROP PROCEDURE p1
+#
+# MDEV-16020 SP variables inside GROUP BY..WITH ROLLUP break replication
+#
+FLUSH LOGS;
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+CREATE TABLE t2 (d DATE, c BIGINT);
+DECLARE
+var INT;
+BEGIN
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var;
+INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var WITH ROLLUP;
+END;
+$$
+DROP TABLE t1,t2;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000006 # Binlog_checkpoint # # master-bin.000006
+master-bin.000006 # Gtid # # GTID #-#-#
+master-bin.000006 # Query # # use `test`; CREATE TABLE t1 (d DATE)
+master-bin.000006 # Gtid # # BEGIN GTID #-#-#
+master-bin.000006 # Query # # use `test`; INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24')
+master-bin.000006 # Query # # COMMIT
+master-bin.000006 # Gtid # # GTID #-#-#
+master-bin.000006 # Query # # use `test`; CREATE TABLE t2 (d DATE, c BIGINT)
+master-bin.000006 # Gtid # # BEGIN GTID #-#-#
+master-bin.000006 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('var',NULL)
+master-bin.000006 # Query # # COMMIT
+master-bin.000006 # Gtid # # BEGIN GTID #-#-#
+master-bin.000006 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, NAME_CONST('var',NULL) WITH ROLLUP
+master-bin.000006 # Query # # COMMIT
+master-bin.000006 # Gtid # # GTID #-#-#
+master-bin.000006 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */
diff --git a/mysql-test/suite/compat/oracle/r/binlog_stm_sp_package.result b/mysql-test/suite/compat/oracle/r/binlog_stm_sp_package.result
new file mode 100644
index 00000000000..8c1ee05686c
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/binlog_stm_sp_package.result
@@ -0,0 +1,268 @@
+SET sql_mode=ORACLE;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE IF NOT EXISTS p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+Warnings:
+Note 1304 PACKAGE p1 already exists
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+END;
+$$
+DROP PACKAGE BODY p1;
+DROP PACKAGE p1;
+DROP PACKAGE IF EXISTS p1;
+Warnings:
+Note 1305 PACKAGE test.p1 does not exist
+#
+# Creating a package with a COMMENT clause
+#
+CREATE PACKAGE p1 COMMENT 'package-p1-comment' AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 COMMENT 'package-body-p1-comment' AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+DROP PACKAGE p1;
+#
+# Creating a package with a different DEFINER
+#
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+DROP PACKAGE p1;
+#
+# Creating a package with a different DEFINER, with SQL SECURITY INVOKER
+#
+CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS
+PROCEDURE p1;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+DROP PACKAGE p1;
+#
+# Creating a new package in a remote database
+#
+CREATE DATABASE test2;
+CREATE PACKAGE test2.test2 COMMENT 'package-test2-comment' AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END
+$$
+CREATE PACKAGE BODY test2.test2 COMMENT 'package-body-test2-comment' AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+PROCEDURE p1 AS BEGIN SELECT f1(); END;
+END;
+$$
+DROP PACKAGE BODY test2.test2;
+DROP PACKAGE test2.test2;
+DROP DATABASE test2;
+#
+# MDEV-13139 Package-wide variables in CREATE PACKAGE
+#
+CREATE TABLE t1 (a INT);
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT:=0;
+PROCEDURE p1 AS
+BEGIN
+INSERT INTO t1 VALUES (a);
+a:=a+1;
+END;
+BEGIN
+a:=10;
+END;
+$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT * FROM t1;
+a
+10
+11
+# sp-cache-invalidate
+CALL p1.p1();
+CALL p1.p1();
+SELECT * FROM t1;
+a
+10
+11
+10
+11
+DROP PACKAGE p1;
+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`; CREATE DEFINER="root"@"localhost" PACKAGE "p1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE IF NOT EXISTS "p1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE BODY "p1" AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE BODY p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE IF EXISTS p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE "p1" COMMENT 'package-p1-comment'
+ AS
+PROCEDURE p1;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE BODY "p1" COMMENT 'package-body-p1-comment'
+ AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="xxx"@"localhost" PACKAGE "p1" AS
+PROCEDURE p1;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="xxx"@"localhost" PACKAGE BODY "p1" AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="xxx"@"localhost" PACKAGE "p1" SQL SECURITY INVOKER
+ AS
+PROCEDURE p1;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="xxx"@"localhost" PACKAGE BODY "p1" SQL SECURITY INVOKER
+ AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # CREATE DATABASE test2
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE "test2"."test2" COMMENT 'package-test2-comment'
+ AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE BODY "test2"."test2" COMMENT 'package-body-test2-comment'
+ AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+PROCEDURE p1 AS BEGIN SELECT f1(); END;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE BODY test2.test2
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE test2.test2
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE test2
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE "p1" AS
+PROCEDURE p1;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" PACKAGE BODY "p1" AS
+a INT:=0;
+PROCEDURE p1 AS
+BEGIN
+INSERT INTO t1 VALUES (a);
+a:=a+1;
+END;
+BEGIN
+a:=10;
+END
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('a',10))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('a',11))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER="root"@"localhost" FUNCTION "dummy"() RETURN int(11)
+AS
+BEGIN
+RETURN 1;
+END
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP FUNCTION dummy
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('a',10))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('a',11))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP PACKAGE p1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE "t1" /* generated by server */
diff --git a/mysql-test/suite/compat/oracle/r/column_compression.result b/mysql-test/suite/compat/oracle/r/column_compression.result
new file mode 100644
index 00000000000..7a12c7b8233
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/column_compression.result
@@ -0,0 +1,1333 @@
+SET sql_mode=ORACLE;
+SET column_compression_zlib_wrap=true;
+CREATE TABLE t1 (a BLOB COMPRESSED);
+INSERT INTO t1 VALUES (REPEAT('a',10000));
+SELECT DATA_LENGTH<100 AS c FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
+c
+1
+DROP TABLE t1;
+#
+# MDEV-17363 - Compressed columns cannot be restored from dump
+#
+CREATE TABLE t1(a INT NOT NULL COMPRESSED);
+ERROR 42000: Incorrect column specifier for column 'a'
+SHOW WARNINGS;
+Level Code Message
+Error 1063 Incorrect column specifier for column 'a'
+CREATE TABLE t1(
+a JSON COMPRESSED,
+b VARCHAR(1000) COMPRESSED BINARY,
+c NVARCHAR(1000) COMPRESSED BINARY,
+d TINYTEXT COMPRESSED BINARY
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ "b" varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
+ "c" varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ "d" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# VARCHAR and TEXT variants
+#
+#
+# The following statements run without warnings.
+# The `compressed opt_binary` grammar sequence is covered.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED UNICODE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a VARCHAR(10) BINARY COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) ASCII COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) BYTE COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+# The `compressed opt_binary` grammar sequence is covered.
+#
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED UNICODE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a VARCHAR2(10) BINARY COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) ASCII COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR2(10) BYTE COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+# The `compressed opt_binary` grammar sequence is covered.
+#
+CREATE TABLE t1 (a TINYTEXT COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED UNICODE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a TINYTEXT BINARY COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT ASCII COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinytext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT BYTE COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+# The `compressed opt_binary` grammar sequence is covered.
+#
+CREATE TABLE t1 (a TEXT COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED BINARY);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED BINARY ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED BYTE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" blob(65535) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED UNICODE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a TEXT COMPRESSED BYTE DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" blob(65535) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED BINARY DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED ASCII DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a TEXT BINARY COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT ASCII COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" text /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT BYTE COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" blob(65535) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a TEXT COMPRESSED BYTE COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TEXT COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TEXT COMPRESSED ASCII COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a TEXT COMPRESSED BYTE DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TEXT COMPRESSED BINARY DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TEXT COMPRESSED ASCII DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+# The `compressed opt_binary` grammar sequence is covered.
+#
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED UNICODE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a MEDIUMTEXT BINARY COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT ASCII COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT BYTE COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+# The `compressed opt_binary` grammar sequence is covered.
+#
+CREATE TABLE t1 (a LONGTEXT COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED UNICODE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a LONGTEXT BINARY COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT ASCII COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT BYTE COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# VARBINARY and BLOB variables
+#
+#
+# The following statements run without warnings.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a VARCHAR(10) DEFAULT '' COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) NULL COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a VARCHAR(10) COMPRESSED NULL COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+#
+CREATE TABLE t1 (a TINYBLOB COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a TINYBLOB COMPRESSED DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYBLOB COMPRESSED NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a TINYBLOB DEFAULT '' COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYBLOB NULL COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a TINYBLOB COMPRESSED COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a TINYBLOB COMPRESSED DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a TINYBLOB COMPRESSED NULL COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+#
+CREATE TABLE t1 (a BLOB COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a BLOB COMPRESSED DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB COMPRESSED NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a BLOB DEFAULT '' COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB NULL COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a BLOB COMPRESSED COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a BLOB COMPRESSED DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a BLOB COMPRESSED NULL COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+#
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a MEDIUMBLOB DEFAULT '' COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB NULL COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED NULL COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements run without warnings.
+#
+CREATE TABLE t1 (a LONGBLOB COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements run without warnings.
+# They have extra column attributes (or GENERATED) after COMPRESSED.
+#
+CREATE TABLE t1 (a LONGBLOB COMPRESSED DEFAULT '');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB COMPRESSED NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10)));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL
+)
+DROP TABLE t1;
+#
+# The following statements return deprecated syntax warnings
+#
+CREATE TABLE t1 (a LONGBLOB DEFAULT '' COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT ''
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB NULL COMPRESSED);
+Warnings:
+Warning 1287 '<data type> <character set clause> ... COMPRESSED...' is deprecated and will be removed in a future release. Please use '<data type> COMPRESSED... <character set clause> ...' instead
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# The following statements fail by the grammar,
+# because COMPRESSED immediately follows 'field_type'.
+#
+CREATE TABLE t1 (a LONGBLOB COMPRESSED COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# The following statements are not prohibited by the *.yy grammar,
+# because the sequence `field_type attribute COMPRESSED` is allowed
+# (notice there is at least one attribute after `field_type`).
+# The first COMPRESSED is parsed inside `field_type`.
+# The second COMPRESSED passes through the parser but then is caught
+# inside Column_definition::set_compressed_deprecated_with_type_check()
+# and a syntax error is raised.
+#
+CREATE TABLE t1 (a LONGBLOB COMPRESSED DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a LONGBLOB COMPRESSED NULL COMPRESSED);
+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 'COMPRESSED)' at line 1
+#
+# NVARCHAR
+#
+CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED);
+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 'COMPRESSED)' at line 1
+CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED);
+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 'COMPRESSED)' at line 1
diff --git a/mysql-test/suite/compat/oracle/r/empty_string_literal.result b/mysql-test/suite/compat/oracle/r/empty_string_literal.result
new file mode 100644
index 00000000000..4fac736367b
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/empty_string_literal.result
@@ -0,0 +1,181 @@
+USE test;
+#
+# MDEV-14013 : sql_mode=EMPTY_STRING_IS_NULL
+#
+set @mode='ORACLE,EMPTY_STRING_IS_NULL';
+SET SESSION character_set_connection=latin2;
+SET SESSION character_set_client=cp1250;
+#
+# Test litteral
+#
+SET sql_mode=@mode;
+select @@sql_mode;
+@@sql_mode
+PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,EMPTY_STRING_IS_NULL,SIMULTANEOUS_ASSIGNMENT
+SELECT '',CHARSET(''), null, CHARSET(null), CAST(null as char(10)), CHARSET(CAST(null as char(10))), 'x', CHARSET('x');
+NULL CHARSET('') NULL CHARSET(null) CAST(null as char(10)) CHARSET(CAST(null as char(10))) x CHARSET('x')
+NULL latin2 NULL binary NULL latin2 x latin2
+SELECT CHARSET(NULLIF('','')),NULLIF('','');
+CHARSET(NULLIF('','')) NULLIF('','')
+latin2 NULL
+SET sql_mode=default;
+SELECT '',CHARSET(''), null, CHARSET(null), CAST(null as char(10)), CHARSET(CAST(null as char(10))), 'x', CHARSET('x');
+ CHARSET('') NULL CHARSET(null) CAST(null as char(10)) CHARSET(CAST(null as char(10))) x CHARSET('x')
+ latin2 NULL binary NULL latin2 x latin2
+SELECT CHARSET(NULLIF('','')),NULLIF('','');
+CHARSET(NULLIF('','')) NULLIF('','')
+latin2 NULL
+#
+# Test NCHAR litteral
+#
+SET sql_mode=@mode;
+SELECT N'',CHARSET(N''), N'x', CHARSET(N'x');
+NULL CHARSET(N'') x CHARSET(N'x')
+NULL utf8 x utf8
+SELECT CHARSET(NULLIF(N'',N'')),NULLIF(N'',N'');
+CHARSET(NULLIF(N'',N'')) NULLIF(N'',N'')
+utf8 NULL
+SET sql_mode=default;
+SELECT N'',CHARSET(N''), N'x', CHARSET(N'x');
+ CHARSET(N'') x CHARSET(N'x')
+ utf8 x utf8
+SELECT CHARSET(NULLIF(N'',N'')),NULLIF(N'',N'');
+CHARSET(NULLIF(N'',N'')) NULLIF(N'',N'')
+utf8 NULL
+#
+# Test CHARSET prefix litteral
+#
+SET sql_mode=@mode;
+SELECT _cp1250 '',CHARSET(_cp1250 ''), _cp1250 'x', CHARSET(_cp1250 'x');
+NULL CHARSET(_cp1250 '') x CHARSET(_cp1250 'x')
+NULL cp1250 x cp1250
+SELECT CHARSET(NULLIF(_cp1250 '',_cp1250 '')),NULLIF(_cp1250 '',_cp1250 '');
+CHARSET(NULLIF(_cp1250 '',_cp1250 '')) NULLIF(_cp1250 '',_cp1250 '')
+cp1250 NULL
+SET sql_mode=default;
+SELECT _cp1250 '',CHARSET(_cp1250 ''), _cp1250 'x', CHARSET(_cp1250 'x');
+ CHARSET(_cp1250 '') x CHARSET(_cp1250 'x')
+ cp1250 x cp1250
+SELECT CHARSET(NULLIF(_cp1250 '',_cp1250 '')),NULLIF(_cp1250 '',_cp1250 '');
+CHARSET(NULLIF(_cp1250 '',_cp1250 '')) NULLIF(_cp1250 '',_cp1250 '')
+cp1250 NULL
+SET sql_mode=@mode;
+#
+# Test litteral concat
+#
+SELECT 'a' 'b';
+a
+ab
+SELECT 'a' '';
+a
+a
+SELECT '' 'b';
+b
+b
+SELECT '' '';
+NULL
+NULL
+SELECT '' 'b' 'c';
+b
+bc
+SELECT '' '' 'c';
+c
+c
+SELECT 'a' '' 'c';
+a
+ac
+SELECT 'a' '' '';
+a
+a
+SELECT '' '' '';
+NULL
+NULL
+SELECT '' '' '',CHARSET('' '' '');
+NULL CHARSET('' '' '')
+NULL latin2
+SELECT _latin1'' '' '',CHARSET(_latin1'' '' '');
+NULL CHARSET(_latin1'' '' '')
+NULL latin1
+SELECT N'' '' '',CHARSET(N'' '' '');
+NULL CHARSET(N'' '' '')
+NULL utf8
+#
+# UNION - implicit group by
+#
+SELECT 1, null
+UNION
+SELECT 1 , ''
+ORDER BY 1;
+1 NULL
+1 NULL
+SELECT 1, null
+UNION
+SELECT 1 , N''
+ORDER BY 1;
+1 NULL
+1 NULL
+SELECT 1, null
+UNION
+SELECT 1 , _cp1250 ''
+ORDER BY 1;
+1 NULL
+1 NULL
+SELECT NULLIF(_cp1250 '',_cp1250 '')
+UNION
+SELECT NULLIF(N'',N'');
+NULLIF(_cp1250 '',_cp1250 '')
+NULL
+SELECT 1 , _latin2 ''
+UNION
+SELECT 1 , _cp1250 '';
+ERROR HY000: Illegal mix of collations (latin2_general_ci,IGNORABLE) and (cp1250_general_ci,IGNORABLE) for operation 'UNION'
+SELECT 1, null
+UNION
+SELECT 1 , ''
+UNION
+SELECT 1 , N'';
+1 NULL
+1 NULL
+CREATE TABLE t1 (c1 INT,c2 VARCHAR(10));
+INSERT INTO t1 VALUES (1,'one');
+INSERT INTO t1 VALUES (1,'');
+INSERT INTO t1 VALUES (1,null);
+#
+# Test in a view
+#
+CREATE VIEW v1
+AS SELECT c1, c2
+FROM t1
+UNION
+SELECT c1 , ''
+ FROM t1
+ORDER BY 1,2;
+SELECT * FROM v1;
+c1 c2
+1 NULL
+1 one
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select "t1"."c1" AS "c1","t1"."c2" AS "c2" from "t1" union select "t1"."c1" AS "c1",NULL AS "NULL" from "t1" order by 1,2 cp1250 latin2_general_ci
+DROP VIEW v1;
+DROP TABLE t1;
+EXPLAIN EXTENDED SELECT '';
+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 NULL AS "NULL"
+EXPLAIN EXTENDED SELECT _latin1'';
+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 NULL AS "NULL"
+EXPLAIN EXTENDED SELECT N'';
+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 NULL AS "NULL"
+EXPLAIN EXTENDED SELECT '' '';
+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 NULL AS "NULL"
diff --git a/mysql-test/suite/compat/oracle/r/events.result b/mysql-test/suite/compat/oracle/r/events.result
new file mode 100644
index 00000000000..ef9c50115ae
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/events.result
@@ -0,0 +1,18 @@
+set sql_mode='ORACLE';
+#
+# MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to execute
+#
+SET GLOBAL event_scheduler=off;
+SET sql_mode='ORACLE';
+CREATE TABLE t1 (a TIMESTAMP);
+CREATE EVENT e1
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MICROSECOND
+DO INSERT INTO t1 VALUES(NOW());
+Warnings:
+Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
+SET GLOBAL event_scheduler=on;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+DROP TABLE t1;
+SET GLOBAL event_scheduler=off;
diff --git a/mysql-test/suite/compat/oracle/r/exception.result b/mysql-test/suite/compat/oracle/r/exception.result
new file mode 100644
index 00000000000..3bd239808bc
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/exception.result
@@ -0,0 +1,409 @@
+SET sql_mode=ORACLE;
+#
+# sql_mode=ORACLE: Predefined exceptions: TOO_MANY_ROWS, NO_DATA_FOUND, DUP_VAL_ON_INDEX
+#
+#
+# Testing NO_DATA_FOUND and TOO_MANY_ROWS
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1 LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN res:='--- too_many_rows cought ---';
+WHEN NO_DATA_FOUND THEN res:='--- no_data_found cought ---';
+END;
+$$
+SET @res='';
+CALL p1(0, @res);
+SELECT @res;
+@res
+--- no_data_found cought ---
+CALL p1(2, @res);
+SELECT @res;
+@res
+--- too_many_rows cought ---
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing DUP_VAL_ON_INDEX
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+BEGIN
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (10);
+EXCEPTION
+WHEN DUP_VAL_ON_INDEX THEN res:='--- dup_val_on_index cought ---';
+END;
+$$
+SET @res='';
+CALL p1(@res);
+SELECT @res;
+@res
+--- dup_val_on_index cought ---
+SELECT * FROM t1;
+a
+10
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptions
+#
+#
+# RAISE outside of an SP context
+#
+RAISE NO_DATA_FOUND;
+ERROR 42000: Undefined CONDITION: NO_DATA_FOUND
+RAISE INVALID_CURSOR;
+ERROR 42000: Undefined CONDITION: INVALID_CURSOR
+RAISE DUP_VAL_ON_INDEX;
+ERROR 42000: Undefined CONDITION: DUP_VAL_ON_INDEX
+RAISE TOO_MANY_ROWS;
+ERROR 42000: Undefined CONDITION: TOO_MANY_ROWS
+RAISE;
+ERROR 0K000: RESIGNAL when handler not active
+#
+# RAISE for an undefinite exception
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+RAISE xxx;
+END;
+$$
+ERROR 42000: Undefined CONDITION: xxx
+#
+# RAISE for predefined exceptions
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+RAISE no_data_found;
+END;
+$$
+CALL p1();
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+RAISE invalid_cursor;
+END;
+$$
+CALL p1();
+ERROR 24000: Cursor is not open
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+RAISE dup_val_on_index;
+END;
+$$
+CALL p1();
+ERROR 23000: Duplicate entry '%-.192T' for key %d
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+raise too_many_rows;
+END;
+$$
+CALL p1();
+ERROR 42000: Result consisted of more than one row
+DROP PROCEDURE p1;
+#
+# RAISE with no exception name (resignal)
+#
+CREATE PROCEDURE p1()
+AS
+BEGIN
+RAISE;
+END;
+$$
+CALL p1();
+ERROR 0K000: RESIGNAL when handler not active
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1(lim INT)
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1 LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN RAISE;
+WHEN NO_DATA_FOUND THEN RAISE;
+END;
+$$
+CALL p1(0);
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+CALL p1(2);
+ERROR 42000: Result consisted of more than one row
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1(lim INT)
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1 LIMIT lim;
+EXCEPTION
+WHEN OTHERS THEN RAISE;
+END;
+$$
+CALL p1(0);
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+CALL p1(2);
+ERROR 42000: Result consisted of more than one row
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1()
+AS
+a INT;
+CURSOR c IS SELECT a FROM t1;
+BEGIN
+FETCH c INTO a;
+EXCEPTION
+WHEN INVALID_CURSOR THEN RAISE;
+END;
+$$
+CALL p1();
+ERROR 24000: Cursor is not open
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1()
+AS
+a INT;
+CURSOR c IS SELECT a FROM t1;
+BEGIN
+FETCH c INTO a;
+EXCEPTION
+WHEN OTHERS THEN RAISE;
+END;
+$$
+CALL p1();
+ERROR 24000: Cursor is not open
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that warning-alike errors are caught by OTHERS
+#
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+a INT:=10;
+BEGIN
+SELECT a INTO a FROM t1;
+RETURN 'OK';
+EXCEPTION
+WHEN OTHERS THEN RETURN 'Exception';
+END;
+$$
+SELECT f1() FROM DUAL;
+f1()
+Exception
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# End of MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptions
+#
+#
+# MDEV-10587 sql_mode=ORACLE: User defined exceptions
+#
+#
+# Checking that duplicate WHEN clause is not allowed
+#
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+e EXCEPTION;
+BEGIN
+RETURN 'Got no exceptions';
+EXCEPTION
+WHEN e THEN RETURN 'Got exception e';
+WHEN e THEN RETURN 'Got exception e';
+END;
+$$
+ERROR 42000: Duplicate handler declared in the same block
+#
+# Checking that raised user exceptions are further caught by name
+#
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+e EXCEPTION;
+f EXCEPTION;
+BEGIN
+IF c = 'e' THEN RAISE e; END IF;
+IF c = 'f' THEN RAISE f; END IF;
+RETURN 'Got no exceptions';
+EXCEPTION
+WHEN e THEN RETURN 'Got exception e';
+END;
+$$
+SELECT f1('');
+f1('')
+Got no exceptions
+SELECT f1('e');
+f1('e')
+Got exception e
+SELECT f1('f');
+ERROR 45000: Unhandled user-defined exception condition
+DROP FUNCTION f1;
+#
+# Checking that raised user exceptions are further caught by OTHERS
+#
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+e EXCEPTION;
+f EXCEPTION;
+BEGIN
+IF c = 'e' THEN RAISE e; END IF;
+IF c = 'f' THEN RAISE f; END IF;
+RETURN 'Got no exceptions';
+EXCEPTION
+WHEN OTHERS THEN RETURN 'Got some exception';
+END;
+$$
+SELECT f1('');
+f1('')
+Got no exceptions
+SELECT f1('e');
+f1('e')
+Got some exception
+SELECT f1('f');
+f1('f')
+Got some exception
+DROP FUNCTION f1;
+#
+# Checking that 'WHEN e .. WHEN f' does not produce ER_SP_DUP_HANDLER
+#
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+e EXCEPTION;
+f EXCEPTION;
+a VARCHAR(64):='';
+BEGIN
+BEGIN
+IF c = 'e' THEN RAISE e; END IF;
+IF c = 'f' THEN RAISE f; END IF;
+EXCEPTION
+WHEN e THEN BEGIN a:='Got EXCEPTION1/e; '; RAISE e; END;
+WHEN f THEN BEGIN a:='Got EXCEPTION1/f; '; RAISE f; END;
+END;
+RETURN 'Got no exceptions';
+EXCEPTION
+WHEN OTHERS THEN RETURN a || 'Got EXCEPTION2/OTHERS;';
+END;
+$$
+SELECT f1('');
+f1('')
+Got no exceptions
+SELECT f1('e');
+f1('e')
+Got EXCEPTION1/e; Got EXCEPTION2/OTHERS;
+SELECT f1('f');
+f1('f')
+Got EXCEPTION1/f; Got EXCEPTION2/OTHERS;
+DROP FUNCTION f1;
+#
+# Checking that resignaled user exceptions are further caught by name
+#
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+e EXCEPTION;
+f EXCEPTION;
+a VARCHAR(64):='';
+BEGIN
+BEGIN
+IF c = 'e' THEN RAISE e; END IF;
+IF c = 'f' THEN RAISE f; END IF;
+EXCEPTION
+WHEN e THEN BEGIN a:='Got EXCEPTION1/e; '; RAISE; END;
+WHEN f THEN BEGIN a:='Got EXCEPTION1/f; '; RAISE; END;
+END;
+RETURN 'Got no exceptions';
+EXCEPTION
+WHEN e THEN RETURN a || 'Got EXCEPTION2/e;';
+END;
+$$
+SELECT f1('');
+f1('')
+Got no exceptions
+SELECT f1('e');
+f1('e')
+Got EXCEPTION1/e; Got EXCEPTION2/e;
+SELECT f1('f');
+ERROR 45000: Unhandled user-defined exception condition
+DROP FUNCTION f1;
+#
+# Checking that resignaled user exceptions are further caught by OTHERS
+#
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+e EXCEPTION;
+f EXCEPTION;
+a VARCHAR(64):='';
+BEGIN
+BEGIN
+IF c = 'e' THEN RAISE e; END IF;
+IF c = 'f' THEN RAISE f; END IF;
+EXCEPTION
+WHEN e THEN BEGIN a:='Got EXCEPTION1/e; '; RAISE; END;
+WHEN f THEN BEGIN a:='Got EXCEPTION1/f; '; RAISE; END;
+END;
+RETURN 'Got no exceptions';
+EXCEPTION
+WHEN OTHERS THEN RETURN a || 'Got EXCEPTION2/OTHERS;';
+END;
+$$
+SELECT f1('');
+f1('')
+Got no exceptions
+SELECT f1('e');
+f1('e')
+Got EXCEPTION1/e; Got EXCEPTION2/OTHERS;
+SELECT f1('f');
+f1('f')
+Got EXCEPTION1/f; Got EXCEPTION2/OTHERS;
+DROP FUNCTION f1;
+#
+# End of MDEV-10587 sql_mode=ORACLE: User defined exceptions
+#
+#
+# MDEV-12088 sql_mode=ORACLE: Do not require BEGIN..END in multi-statement exception handlers in THEN clause
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (10),(20),(30);
+CREATE PROCEDURE p1(a INT) AS
+BEGIN
+INSERT INTO t1 (a) VALUES (a);
+EXCEPTION
+WHEN DUP_VAL_ON_INDEX THEN
+a:= a+1;
+INSERT INTO t1 VALUES (a);
+WHEN OTHERS THEN
+NULL;
+NULL;
+END;
+$$
+CALL p1(30);
+SELECT * FROM t1;
+a
+10
+20
+30
+31
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/func_case.result b/mysql-test/suite/compat/oracle/r/func_case.result
new file mode 100644
index 00000000000..dfe2d165b88
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_case.result
@@ -0,0 +1,7 @@
+SET sql_mode=ORACLE;
+SELECT NVL(NULL, 'a'), NVL('a', 'b');
+NVL(NULL, 'a') NVL('a', 'b')
+a a
+SELECT NVL2(NULL, 'a', 'b'), NVL2('a', 'b', 'c');
+NVL2(NULL, 'a', 'b') NVL2('a', 'b', 'c')
+b b
diff --git a/mysql-test/suite/compat/oracle/r/func_concat.result b/mysql-test/suite/compat/oracle/r/func_concat.result
new file mode 100644
index 00000000000..392d579707a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_concat.result
@@ -0,0 +1,393 @@
+SET sql_mode=ORACLE;
+EXPLAIN EXTENDED SELECT 'a'||'b'||'c';
+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 concat_operator_oracle(concat_operator_oracle('a','b'),'c') AS "'a'||'b'||'c'"
+EXPLAIN EXTENDED SELECT CONCAT('a'||'b'||'c');
+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 concat_operator_oracle(concat_operator_oracle(concat_operator_oracle('a','b'),'c')) AS "CONCAT('a'||'b'||'c')"
+SELECT '' || '';
+'' || ''
+
+SELECT '' || 'b';
+'' || 'b'
+b
+SELECT '' || NULL;
+'' || NULL
+
+SELECT 'a' || '';
+'a' || ''
+a
+SELECT 'a' || 'b';
+'a' || 'b'
+ab
+SELECT 'a' || NULL;
+'a' || NULL
+a
+SELECT NULL || '';
+NULL || ''
+
+SELECT NULL || 'b';
+NULL || 'b'
+b
+SELECT NULL || NULL;
+NULL || NULL
+NULL
+SELECT '' || '' || '';
+'' || '' || ''
+
+SELECT '' || '' || 'c';
+'' || '' || 'c'
+c
+SELECT '' || '' || NULL;
+'' || '' || NULL
+
+SELECT '' || 'b' || '';
+'' || 'b' || ''
+b
+SELECT '' || 'b' || 'c';
+'' || 'b' || 'c'
+bc
+SELECT '' || 'b' || NULL;
+'' || 'b' || NULL
+b
+SELECT '' || NULL || '';
+'' || NULL || ''
+
+SELECT '' || NULL || 'c';
+'' || NULL || 'c'
+c
+SELECT '' || NULL || NULL;
+'' || NULL || NULL
+
+SELECT 'a' || '' || '';
+'a' || '' || ''
+a
+SELECT 'a' || '' || 'c';
+'a' || '' || 'c'
+ac
+SELECT 'a' || '' || NULL;
+'a' || '' || NULL
+a
+SELECT 'a' || 'b' || '';
+'a' || 'b' || ''
+ab
+SELECT 'a' || 'b' || 'c';
+'a' || 'b' || 'c'
+abc
+SELECT 'a' || 'b' || NULL;
+'a' || 'b' || NULL
+ab
+SELECT 'a' || NULL || '';
+'a' || NULL || ''
+a
+SELECT 'a' || NULL || 'c';
+'a' || NULL || 'c'
+ac
+SELECT 'a' || NULL || NULL;
+'a' || NULL || NULL
+a
+SELECT NULL || '' || '';
+NULL || '' || ''
+
+SELECT NULL || '' || 'c';
+NULL || '' || 'c'
+c
+SELECT NULL || '' || NULL;
+NULL || '' || NULL
+
+SELECT NULL || 'b' || '';
+NULL || 'b' || ''
+b
+SELECT NULL || 'b' || 'c';
+NULL || 'b' || 'c'
+bc
+SELECT NULL || 'b' || NULL;
+NULL || 'b' || NULL
+b
+SELECT NULL || NULL || '';
+NULL || NULL || ''
+
+SELECT NULL || NULL || 'c';
+NULL || NULL || 'c'
+c
+SELECT NULL || NULL || NULL;
+NULL || NULL || NULL
+NULL
+CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(10));
+INSERT INTO t1 VALUES ('', '', '');
+INSERT INTO t1 VALUES ('', '', 'c');
+INSERT INTO t1 VALUES ('', '', NULL);
+INSERT INTO t1 VALUES ('', 'b', '');
+INSERT INTO t1 VALUES ('', 'b', 'c');
+INSERT INTO t1 VALUES ('', 'b', NULL);
+INSERT INTO t1 VALUES ('', NULL, '');
+INSERT INTO t1 VALUES ('', NULL, 'c');
+INSERT INTO t1 VALUES ('', NULL, NULL);
+INSERT INTO t1 VALUES ('a', '', '');
+INSERT INTO t1 VALUES ('a', '', 'c');
+INSERT INTO t1 VALUES ('a', '', NULL);
+INSERT INTO t1 VALUES ('a', 'b', '');
+INSERT INTO t1 VALUES ('a', 'b', 'c');
+INSERT INTO t1 VALUES ('a', 'b', NULL);
+INSERT INTO t1 VALUES ('a', NULL, '');
+INSERT INTO t1 VALUES ('a', NULL, 'c');
+INSERT INTO t1 VALUES ('a', NULL, NULL);
+INSERT INTO t1 VALUES (NULL, '', '');
+INSERT INTO t1 VALUES (NULL, '', 'c');
+INSERT INTO t1 VALUES (NULL, '', NULL);
+INSERT INTO t1 VALUES (NULL, 'b', '');
+INSERT INTO t1 VALUES (NULL, 'b', 'c');
+INSERT INTO t1 VALUES (NULL, 'b', NULL);
+INSERT INTO t1 VALUES (NULL, NULL, '');
+INSERT INTO t1 VALUES (NULL, NULL, 'c');
+INSERT INTO t1 VALUES (NULL, NULL, NULL);
+SELECT LENGTH(a||b||c), a||b||c FROM t1 ORDER BY a,b,c;
+LENGTH(a||b||c) a||b||c
+NULL NULL
+0
+1 c
+0
+0
+1 c
+1 b
+1 b
+2 bc
+0
+0
+1 c
+0
+0
+1 c
+1 b
+1 b
+2 bc
+1 a
+1 a
+2 ac
+1 a
+1 a
+2 ac
+2 ab
+2 ab
+3 abc
+SELECT LENGTH(CONCAT(a||b||c)), CONCAT(a||b||c) FROM t1 ORDER BY a,b,c;
+LENGTH(CONCAT(a||b||c)) CONCAT(a||b||c)
+NULL NULL
+0
+1 c
+0
+0
+1 c
+1 b
+1 b
+2 bc
+0
+0
+1 c
+0
+0
+1 c
+1 b
+1 b
+2 bc
+1 a
+1 a
+2 ac
+1 a
+1 a
+2 ac
+2 ab
+2 ab
+3 abc
+DROP TABLE t1;
+#
+# MDEV-12478 CONCAT function inside view casts values incorrectly with Oracle sql_mode
+#
+SET sql_mode=ORACLE;
+CREATE VIEW v1 AS SELECT 'foo'||NULL||'bar' AS test;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select concat_operator_oracle(concat_operator_oracle('foo',NULL),'bar') AS "test" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+test
+foobar
+SET sql_mode=DEFAULT;
+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 concat_operator_oracle(concat_operator_oracle('foo',NULL),'bar') AS `test` latin1 latin1_swedish_ci
+SELECT * FROM v1;
+test
+foobar
+DROP VIEW v1;
+SET sql_mode=DEFAULT;
+CREATE VIEW v1 AS SELECT CONCAT('foo',NULL,'bar') AS 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 concat('foo',NULL,'bar') AS `test` latin1 latin1_swedish_ci
+SELECT * FROM v1;
+test
+NULL
+SET sql_mode=ORACLE;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select concat('foo',NULL,'bar') AS "test" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+test
+NULL
+DROP VIEW v1;
+SET sql_mode=DEFAULT;
+CREATE VIEW v1 AS SELECT '0'||'1' AS 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 '0' or '1' AS `test` latin1 latin1_swedish_ci
+SELECT * FROM v1;
+test
+1
+SET sql_mode=ORACLE;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select '0' or '1' AS "test" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+test
+1
+DROP VIEW v1;
+#
+# MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE
+#
+SELECT -1<<1||1 AS a FROM DUAL;
+a
+18446744073709549568
+SELECT -1||0<<1 AS a FROM DUAL;
+a
+18446744073709551596
+EXPLAIN EXTENDED SELECT -1<<1||1 AS a FROM DUAL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select -1 << concat_operator_oracle(1,1) AS "a"
+EXPLAIN EXTENDED SELECT -1||0<<1 AS a FROM DUAL;
+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 concat_operator_oracle(-1,0) << 1 AS "a"
+SELECT -1+1||1 AS a FROM DUAL;
+a
+01
+SELECT -1||0+1 AS a FROM DUAL;
+a
+-9
+EXPLAIN EXTENDED SELECT -1+1||1 AS a FROM DUAL;
+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 concat_operator_oracle(-1 + 1,1) AS "a"
+EXPLAIN EXTENDED SELECT -1||0+1 AS a FROM DUAL;
+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 concat_operator_oracle(-1,0) + 1 AS "a"
+SELECT 1*1||-1 AS a FROM DUAL;
+a
+1-1
+SELECT 1||1*-1 AS a FROM DUAL;
+a
+1-1
+EXPLAIN EXTENDED SELECT 1*1||-1 AS a FROM DUAL;
+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 concat_operator_oracle(1 * 1,-1) AS "a"
+EXPLAIN EXTENDED SELECT 1||1*-1 AS a FROM DUAL;
+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 concat_operator_oracle(1,1 * -1) AS "a"
+SELECT -1^1||1 AS a FROM DUAL;
+a
+184467440737095516141
+SELECT -1||0^1 AS a FROM DUAL;
+a
+-11
+EXPLAIN EXTENDED SELECT -1^1||1 AS a FROM DUAL;
+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 concat_operator_oracle(-1 ^ 1,1) AS "a"
+EXPLAIN EXTENDED SELECT -1||0^1 AS a FROM DUAL;
+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 concat_operator_oracle(-1,0 ^ 1) AS "a"
+#
+# MDEV-17359 Concatenation operator || in like expression failed in sql_mode=ORACLE
+#
+SELECT 'abc' LIKE 'a'||'%';
+'abc' LIKE 'a'||'%'
+1
+EXPLAIN EXTENDED SELECT 'abc' LIKE '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 No tables used
+Warnings:
+Note 1003 select 'abc' like concat_operator_oracle('a','%') AS "'abc' LIKE 'a'||'%'"
+SELECT 'x' FROM DUAL WHERE 11 LIKE 1||1;
+x
+x
+SELECT 'x' FROM DUAL WHERE 1||1 LIKE 11;
+x
+x
+SELECT 'x' FROM DUAL WHERE 1||1 LIKE 1||1;
+x
+x
+CREATE TABLE t1 (c1 VARCHAR(10),c2 VARCHAR(10), ord INTEGER);
+INSERT INTO t1 VALUES ('a', 'ab' ,1);
+INSERT INTO t1 VALUES ('ab', 'ab', 2);
+INSERT INTO t1 VALUES ('abc', 'ab', 3);
+SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord;
+c1
+ab
+EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord;
+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; Using filesort
+Warnings:
+Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like <cache>(concat_operator_oracle('%','b')) order by "test"."t1"."ord"
+SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord;
+c1
+abc
+EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord;
+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; Using filesort
+Warnings:
+Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like concat_operator_oracle(concat_operator_oracle("test"."t1"."c2",'%'),'c') order by "test"."t1"."ord"
+SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%';
+x
+x
+EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%';
+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 'x' AS "x" from "test"."t1" where concat_operator_oracle("test"."t1"."c1","test"."t1"."c2") like 'aa%'
+SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1;
+x
+x
+EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1;
+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 'x' AS "x" from "test"."t1" where concat_operator_oracle("test"."t1"."c1","test"."t1"."c2") like concat_operator_oracle("test"."t1"."c2","test"."t1"."c1")
+CREATE VIEW v1 AS SELECT c1, c2, c1 LIKE c2||'_' FROM t1 ORDER BY ord;
+SELECT * FROM v1;
+c1 c2 c1 LIKE c2||'_'
+a ab 0
+ab ab 0
+abc ab 1
+EXPLAIN EXTENDED SELECT * FROM v1;
+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 filesort
+Warnings:
+Note 1003 select "test"."t1"."c1" AS "c1","test"."t1"."c2" AS "c2","test"."t1"."c1" like concat_operator_oracle("test"."t1"."c2",'_') AS "c1 LIKE c2||'_'" from "test"."t1" order by "test"."t1"."ord"
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/func_decode.result b/mysql-test/suite/compat/oracle/r/func_decode.result
new file mode 100644
index 00000000000..b49bad93627
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_decode.result
@@ -0,0 +1,177 @@
+SET sql_mode=ORACLE;
+SELECT DECODE(10);
+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 DECODE(10,10);
+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 DECODE(10,10,'x10');
+DECODE(10,10,'x10')
+x10
+SELECT DECODE(11,10,'x10');
+DECODE(11,10,'x10')
+NULL
+SELECT DECODE(10,10,'x10','def');
+DECODE(10,10,'x10','def')
+x10
+SELECT DECODE(11,10,'x10','def');
+DECODE(11,10,'x10','def')
+def
+SELECT DECODE(10,10,'x10',11,'x11','def');
+DECODE(10,10,'x10',11,'x11','def')
+x10
+SELECT DECODE(11,10,'x10',11,'x11','def');
+DECODE(11,10,'x10',11,'x11','def')
+x11
+SELECT DECODE(12,10,'x10',11,'x11','def');
+DECODE(12,10,'x10',11,'x11','def')
+def
+EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11','def');
+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 decode_oracle(12,10,'x10',11,'x11','def') AS "DECODE(12,10,'x10',11,'x11','def')"
+CREATE TABLE decode (decode int);
+DROP TABLE decode;
+#
+# MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent
+#
+SELECT DECODE(10);
+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 DECODE(10,10);
+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 DECODE_ORACLE(10);
+ERROR 42000: Incorrect parameter count in the call to native function 'DECODE_ORACLE'
+SELECT DECODE_ORACLE(10,10);
+ERROR 42000: Incorrect parameter count in the call to native function 'DECODE_ORACLE'
+EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11');
+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 decode_oracle(12,10,'x10',11,'x11') AS "DECODE(12,10,'x10',11,'x11')"
+EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11','def');
+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 decode_oracle(12,10,'x10',11,'x11','def') AS "DECODE(12,10,'x10',11,'x11','def')"
+EXPLAIN EXTENDED SELECT DECODE_ORACLE(12,10,'x10',11,'x11');
+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 decode_oracle(12,10,'x10',11,'x11') AS "DECODE_ORACLE(12,10,'x10',11,'x11')"
+EXPLAIN EXTENDED SELECT DECODE_ORACLE(12,10,'x10',11,'x11','def');
+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 decode_oracle(12,10,'x10',11,'x11','def') AS "DECODE_ORACLE(12,10,'x10',11,'x11','def')"
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS
+SELECT
+DECODE(a,1,'x1',NULL,'xNULL') AS d1,
+DECODE(a,1,'x1',NULL,'xNULL','xELSE') AS d2,
+DECODE_ORACLE(a,1,'x1',NULL,'xNULL') AS d3,
+DECODE_ORACLE(a,1,'x1',NULL,'xNULL','xELSE') AS d4
+FROM t1;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select decode_oracle("t1"."a",1,'x1',NULL,'xNULL') AS "d1",decode_oracle("t1"."a",1,'x1',NULL,'xNULL','xELSE') AS "d2",decode_oracle("t1"."a",1,'x1',NULL,'xNULL') AS "d3",decode_oracle("t1"."a",1,'x1',NULL,'xNULL','xELSE') AS "d4" from "t1" latin1 latin1_swedish_ci
+DROP VIEW v1;
+DROP TABLE t1;
+SELECT DECODE(TIME'10:20:31','10:20:31','then1','10:20:32','then2','def');
+DECODE(TIME'10:20:31','10:20:31','then1','10:20:32','then2','def')
+then1
+SELECT DECODE(TIME'10:20:32','10:20:31','then1','10:20:32','then2','def');
+DECODE(TIME'10:20:32','10:20:31','then1','10:20:32','then2','def')
+then2
+SELECT DECODE(TIME'10:20:33','10:20:31','then1',NULL,'then2NULL','10:20:33','then3','def');
+DECODE(TIME'10:20:33','10:20:31','then1',NULL,'then2NULL','10:20:33','then3','def')
+then3
+SELECT DECODE(NULL,TIME'10:20:31','then1',NULL,'then2NULL','10:20:33','then3','def');
+DECODE(NULL,TIME'10:20:31','then1',NULL,'then2NULL','10:20:33','then3','def')
+then2NULL
+SELECT DECODE(TIMESTAMP'2001-01-01 10:20:31','2001-01-01 10:20:31','then1','2001-01-01 10:20:32','then2','def');
+DECODE(TIMESTAMP'2001-01-01 10:20:31','2001-01-01 10:20:31','then1','2001-01-01 10:20:32','then2','def')
+then1
+SELECT DECODE(TIMESTAMP'2001-01-01 10:20:32','2001-01-01 10:20:31','then1','2001-01-01 10:20:32','then2','def');
+DECODE(TIMESTAMP'2001-01-01 10:20:32','2001-01-01 10:20:31','then1','2001-01-01 10:20:32','then2','def')
+then2
+SELECT DECODE(TIMESTAMP'2001-01-01 10:20:33','2001-01-01 10:20:31','then1',NULL,'then2NULL','2001-01-01 10:20:33','then3','def');
+DECODE(TIMESTAMP'2001-01-01 10:20:33','2001-01-01 10:20:31','then1',NULL,'then2NULL','2001-01-01 10:20:33','then3','def')
+then3
+SELECT DECODE(NULL,TIMESTAMP'2001-01-01 10:20:31','then1',NULL,'then2NULL','2001-01-01 10:20:33','then3','def');
+DECODE(NULL,TIMESTAMP'2001-01-01 10:20:31','then1',NULL,'then2NULL','2001-01-01 10:20:33','then3','def')
+then2NULL
+SELECT DECODE('w1','w1','then1','w2','then2','def');
+DECODE('w1','w1','then1','w2','then2','def')
+then1
+SELECT DECODE('w2','w1','then1','w2','then2','def');
+DECODE('w2','w1','then1','w2','then2','def')
+then2
+SELECT DECODE('w3','w1','then1',NULL,'then2NULL','w3','then3','def');
+DECODE('w3','w1','then1',NULL,'then2NULL','w3','then3','def')
+then3
+SELECT DECODE(NULL,'w1','then1',NULL,'then2NULL','w3','then3','def');
+DECODE(NULL,'w1','then1',NULL,'then2NULL','w3','then3','def')
+then2NULL
+SELECT DECODE(1,1,'then1',2,'then2','def');
+DECODE(1,1,'then1',2,'then2','def')
+then1
+SELECT DECODE(2,1,'then1',2,'then2','def');
+DECODE(2,1,'then1',2,'then2','def')
+then2
+SELECT DECODE(3,1,'then1',NULL,'then2NULL',3,'then3','def');
+DECODE(3,1,'then1',NULL,'then2NULL',3,'then3','def')
+then3
+SELECT DECODE(NULL,1,'then1',NULL,'then2NULL',3,'then3','def');
+DECODE(NULL,1,'then1',NULL,'then2NULL',3,'then3','def')
+then2NULL
+SELECT DECODE(CAST(NULL AS SIGNED),1,'then1',NULL,'then2NULL',3,'then3','def');
+DECODE(CAST(NULL AS SIGNED),1,'then1',NULL,'then2NULL',3,'then3','def')
+then2NULL
+SELECT DECODE(1.0,1.0,'then1',2.0,'then2','def');
+DECODE(1.0,1.0,'then1',2.0,'then2','def')
+then1
+SELECT DECODE(2.0,1.0,'then1',2.0,'then2','def');
+DECODE(2.0,1.0,'then1',2.0,'then2','def')
+then2
+SELECT DECODE(3.0,1.0,'then1',NULL,'then2NULL',3.0,'then3','def');
+DECODE(3.0,1.0,'then1',NULL,'then2NULL',3.0,'then3','def')
+then3
+SELECT DECODE(NULL,1.0,'then1',NULL,'then2NULL',3.0,'then3','def');
+DECODE(NULL,1.0,'then1',NULL,'then2NULL',3.0,'then3','def')
+then2NULL
+SELECT DECODE(CAST(NULL AS DECIMAL),1.0,'then1',NULL,'then2NULL',3.0,'then3','def');
+DECODE(CAST(NULL AS DECIMAL),1.0,'then1',NULL,'then2NULL',3.0,'then3','def')
+then2NULL
+SELECT DECODE(1e0,1e0,'then1',2e0,'then2','def');
+DECODE(1e0,1e0,'then1',2e0,'then2','def')
+then1
+SELECT DECODE(2e0,1e0,'then1',2e0,'then2','def');
+DECODE(2e0,1e0,'then1',2e0,'then2','def')
+then2
+SELECT DECODE(3e0,1e0,'then1',NULL,'then2NULL',3e0,'then3','def');
+DECODE(3e0,1e0,'then1',NULL,'then2NULL',3e0,'then3','def')
+then3
+SELECT DECODE(NULL,1e0,'then1',NULL,'then2NULL',3e0,'then3','def');
+DECODE(NULL,1e0,'then1',NULL,'then2NULL',3e0,'then3','def')
+then2NULL
+SELECT DECODE(CAST(NULL AS DOUBLE),1e0,'then1',NULL,'then2NULL',3e0,'then3','def');
+DECODE(CAST(NULL AS DOUBLE),1e0,'then1',NULL,'then2NULL',3e0,'then3','def')
+then2NULL
+SELECT DECODE(NULL,NULL,1,2) FROM DUAL;
+DECODE(NULL,NULL,1,2)
+1
+SELECT DECODE(NULL,10,10,NULL,1,2) FROM DUAL;
+DECODE(NULL,10,10,NULL,1,2)
+1
+SELECT DECODE_ORACLE(NULL,NULL,1,2) FROM DUAL;
+DECODE_ORACLE(NULL,NULL,1,2)
+1
+SELECT DECODE_ORACLE(NULL,10,10,NULL,1,2) FROM DUAL;
+DECODE_ORACLE(NULL,10,10,NULL,1,2)
+1
+CREATE OR REPLACE TABLE t1 (a VARCHAR(10) DEFAULT NULL);
+INSERT INTO t1 VALUES (NULL),(1);
+SELECT a, DECODE(a,NULL,1,2) FROM t1;
+a DECODE(a,NULL,1,2)
+NULL 1
+1 2
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/func_length.result b/mysql-test/suite/compat/oracle/r/func_length.result
new file mode 100644
index 00000000000..e260f5ad6da
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_length.result
@@ -0,0 +1,21 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
+#
+SELECT LENGTH(null), LENGTH('a'), LENGTH(123);
+LENGTH(null) LENGTH('a') LENGTH(123)
+NULL 1 3
+SELECT LENGTHB(null), LENGTHB('a'), LENGTHB(123);
+LENGTHB(null) LENGTHB('a') LENGTHB(123)
+NULL 1 3
+SELECT LENGTH(_utf8 0xC39F), LENGTH(CHAR(14844588 USING utf8));
+LENGTH(_utf8 0xC39F) LENGTH(CHAR(14844588 USING utf8))
+1 1
+SELECT LENGTHB(_utf8 0xC39F), LENGTHB(CHAR(14844588 USING utf8));
+LENGTHB(_utf8 0xC39F) LENGTHB(CHAR(14844588 USING utf8))
+2 3
+EXPLAIN EXTENDED SELECT LENGTH('a'), LENGTHB('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 No tables used
+Warnings:
+Note 1003 select char_length('a') AS "LENGTH('a')",octet_length('a') AS "LENGTHB('a')"
diff --git a/mysql-test/suite/compat/oracle/r/func_misc.result b/mysql-test/suite/compat/oracle/r/func_misc.result
new file mode 100644
index 00000000000..ffb9e10110d
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_misc.result
@@ -0,0 +1,319 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10578 sql_mode=ORACLE: SP control functions SQLCODE, SQLERRM
+#
+#
+# Using SQLCODE and SQLERRM outside of an SP
+#
+SELECT SQLCODE;
+ERROR 42S22: Unknown column 'SQLCODE' in 'field list'
+SELECT SQLERRM;
+ERROR 42S22: Unknown column 'SQLERRM' in 'field list'
+CREATE TABLE t1 (SQLCODE INT, SQLERRM VARCHAR(10));
+INSERT INTO t1 VALUES (10, 'test');
+SELECT SQLCODE, SQLERRM FROM t1;
+SQLCODE SQLERRM
+10 test
+DROP TABLE t1;
+#
+# Normal SQLCODE and SQLERRM usage
+#
+CREATE PROCEDURE p1(stmt VARCHAR)
+AS
+BEGIN
+EXECUTE IMMEDIATE stmt;
+SELECT 'Error1: ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+WHEN OTHERS THEN
+SELECT 'Error2: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CALL p1('SELECT 1');
+1
+1
+'Error1: ' || SQLCODE || ' ' || SQLERRM
+Error1: 0 normal, successful completion
+CALL p1('xxx');
+'Error2: ' || SQLCODE || ' ' || SQLERRM
+Error2: 1064 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
+CALL p1('SELECT 1');
+1
+1
+'Error1: ' || SQLCODE || ' ' || SQLERRM
+Error1: 0 normal, successful completion
+DROP PROCEDURE p1;
+#
+# SQLCODE and SQLERRM hidden by local variables
+#
+CREATE PROCEDURE p1()
+AS
+sqlcode INT:= 10;
+sqlerrm VARCHAR(64) := 'test';
+BEGIN
+SELECT 'Error: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CALL p1;
+'Error: ' || SQLCODE || ' ' || SQLERRM
+Error: 10 test
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+sqlcode INT;
+sqlerrm VARCHAR(64);
+BEGIN
+SQLCODE:= 10;
+sqlerrm:= 'test';
+SELECT 'Error: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CALL p1;
+'Error: ' || SQLCODE || ' ' || SQLERRM
+Error: 10 test
+DROP PROCEDURE p1;
+#
+# SQLCODE and SQLERRM hidden by parameters
+#
+CREATE PROCEDURE p1(sqlcode INT, sqlerrm VARCHAR)
+AS
+BEGIN
+SELECT 'Error: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CALL p1(10, 'test');
+'Error: ' || SQLCODE || ' ' || SQLERRM
+Error: 10 test
+DROP PROCEDURE p1;
+#
+# SQLCODE and SQLERRM in CREATE..SELECT
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+CREATE TABLE t1 AS SELECT SQLCODE, SQLERRM;
+END;
+$$
+CALL p1;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "SQLCODE" int(11) NOT NULL,
+ "SQLERRM" varchar(512) CHARACTER SET utf8 NOT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# SQLCODE and SQLERRM in EXPLAIN EXTENDED SELECT
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+EXPLAIN EXTENDED SELECT SQLCode, SQLErrm;
+END;
+$$
+CALL p1;
+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 SQLCODE AS "SQLCode",SQLERRM AS "SQLErrm"
+DROP PROCEDURE p1;
+#
+# Warning-alike errors in stored functions
+#
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1;
+RETURN 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+WHEN NO_DATA_FOUND THEN
+RETURN 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+SELECT f1() FROM DUAL;
+f1()
+Exception 1329 No data - zero rows fetched, selected, or processed
+DROP FUNCTION f1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1;
+RETURN 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+WHEN OTHERS THEN
+RETURN 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+SELECT f1() FROM DUAL;
+f1()
+Exception 1329 No data - zero rows fetched, selected, or processed
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Warning-alike errors in stored procedures
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1;
+res:= 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+WHEN NO_DATA_FOUND THEN
+res:= 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CALL p1(@a);
+SELECT @a;
+@a
+Exception 1329 No data - zero rows fetched, selected, or processed
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+SELECT a INTO a FROM t1;
+res:= 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+WHEN OTHERS THEN
+res:= 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CALL p1(@a);
+SELECT @a;
+@a
+Exception 1329 No data - zero rows fetched, selected, or processed
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# SQLCODE and SQLERRM are cleared on RETURN
+#
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+a INT:=10;
+BEGIN
+SELECT a INTO a FROM t1;
+RETURN 'Value=' || a;
+EXCEPTION
+WHEN NO_DATA_FOUND THEN RETURN 'Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+a VARCHAR(128);
+BEGIN
+RETURN f1() || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+SELECT f1() FROM DUAL;
+f1()
+Exception|1329 No data - zero rows fetched, selected, or processed
+SELECT f2() FROM DUAL;
+f2()
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
+DROP TABLE t1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+a INT:=10;
+BEGIN
+SELECT a INTO a FROM t1;
+RETURN 'Value=' || a;
+EXCEPTION
+WHEN OTHERS THEN RETURN 'Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+a VARCHAR(128);
+BEGIN
+RETURN f1() || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+SELECT f1() FROM DUAL;
+f1()
+Exception|1329 No data - zero rows fetched, selected, or processed
+SELECT f2() FROM DUAL;
+f2()
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
+DROP TABLE t1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+#
+# SQLCODE and SQLERRM are cleared on a return from a PROCEDURE
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+a INT:=10;
+BEGIN
+SELECT a INTO a FROM t1;
+res:='Value=' || a;
+EXCEPTION
+WHEN NO_DATA_FOUND THEN res:='Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+res VARCHAR(128);
+BEGIN
+CALL p1(res);
+RETURN res || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+SELECT f2() FROM DUAL;
+f2()
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
+DROP FUNCTION f2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+a INT:=10;
+BEGIN
+SELECT a INTO a FROM t1;
+res:='Value=' || a;
+EXCEPTION
+WHEN OTHERS THEN res:='Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+res VARCHAR(128);
+BEGIN
+CALL p1(res);
+RETURN res || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+SELECT f2() FROM DUAL;
+f2()
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
+DROP FUNCTION f2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# End of MDEV-10578 sql_mode=ORACLE: SP control functions SQLCODE, SQLERRM
+#
+#
+# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+#
+BEGIN
+SELECT SQLCODE;
+END
+$$
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def SQLCODE 3 11 1 N 32897 0 63
+SQLCODE
+0
diff --git a/mysql-test/suite/compat/oracle/r/func_pad.result b/mysql-test/suite/compat/oracle/r/func_pad.result
new file mode 100644
index 00000000000..ca7d52cd542
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_pad.result
@@ -0,0 +1,71 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-15739 - sql_mode=ORACLE: Make LPAD and RPAD return NULL instead of empty string
+#
+SELECT RPAD('a',0), RPAD('abc',1), RPAD('abc',2) ;
+RPAD('a',0) RPAD('abc',1) RPAD('abc',2)
+NULL a ab
+SELECT RPAD('a',0,'.'), RPAD('abc',1,'.'), RPAD('abc',2,'.') ;
+RPAD('a',0,'.') RPAD('abc',1,'.') RPAD('abc',2,'.')
+NULL a ab
+SELECT LPAD('a',0), LPAD('abc',1), LPAD('abc',2) ;
+LPAD('a',0) LPAD('abc',1) LPAD('abc',2)
+NULL a ab
+SELECT LPAD('a',0,'.'), LPAD('abc',1,'.'), LPAD('abc',2,'.') ;
+LPAD('a',0,'.') LPAD('abc',1,'.') LPAD('abc',2,'.')
+NULL a ab
+CREATE TABLE t1 (c1 VARCHAR(10),c2 INTEGER, c3 VARCHAR(10), ord INTEGER);
+INSERT INTO t1 VALUES ('a',1,null,1);
+INSERT INTO t1 VALUES ('a',null,'.',2);
+INSERT INTO t1 VALUES (null,1,'.',3);
+INSERT INTO t1 VALUES ('a',-1,'.',4);
+INSERT INTO t1 VALUES ('a',0,'.',5);
+INSERT INTO t1 VALUES ('a',1,'.',6);
+INSERT INTO t1 VALUES ('a',2,'.',7);
+SELECT LPAD(c1,c2,c3), LPAD(c1,c2) FROM t1 ORDER BY ord;
+LPAD(c1,c2,c3) LPAD(c1,c2)
+NULL a
+NULL NULL
+NULL NULL
+NULL NULL
+NULL NULL
+a a
+.a a
+SELECT RPAD(c1,c2,c3), RPAD(c1,c2) FROM t1 ORDER BY ord;
+RPAD(c1,c2,c3) RPAD(c1,c2)
+NULL a
+NULL NULL
+NULL NULL
+NULL NULL
+NULL NULL
+a a
+a. a
+EXPLAIN EXTENDED SELECT RPAD('a',0,'.'), LPAD('a',0,'.'), LPAD(c1,c2,c3), LPAD(c1,c2), RPAD(c1,c2,c3), RPAD(c1,c2) FROM t1 ORDER BY ord;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using filesort
+Warnings:
+Note 1003 select rpad_oracle('a',0,'.') AS "RPAD('a',0,'.')",lpad_oracle('a',0,'.') AS "LPAD('a',0,'.')",lpad_oracle("test"."t1"."c1","test"."t1"."c2","test"."t1"."c3") AS "LPAD(c1,c2,c3)",lpad_oracle("test"."t1"."c1","test"."t1"."c2") AS "LPAD(c1,c2)",rpad_oracle("test"."t1"."c1","test"."t1"."c2","test"."t1"."c3") AS "RPAD(c1,c2,c3)",rpad_oracle("test"."t1"."c1","test"."t1"."c2") AS "RPAD(c1,c2)" from "test"."t1" order by "test"."t1"."ord"
+CREATE VIEW v1 AS SELECT RPAD('a',0,'.') AS "C1", LPAD('a',0,'.') AS "C2", LPAD(c1,c2,c3) AS "C3", LPAD(c1,c2) AS "C4", RPAD(c1,c2,c3) AS "C5", RPAD(c1,c2) AS "C6" FROM t1 ORDER BY ord;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select rpad_oracle('a',0,'.') AS "C1",lpad_oracle('a',0,'.') AS "C2",lpad_oracle("t1"."c1","t1"."c2","t1"."c3") AS "C3",lpad_oracle("t1"."c1","t1"."c2") AS "C4",rpad_oracle("t1"."c1","t1"."c2","t1"."c3") AS "C5",rpad_oracle("t1"."c1","t1"."c2") AS "C6" from "t1" order by "t1"."ord" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+C1 C2 C3 C4 C5 C6
+NULL NULL NULL a NULL a
+NULL NULL NULL NULL NULL NULL
+NULL NULL NULL NULL NULL NULL
+NULL NULL NULL NULL NULL NULL
+NULL NULL NULL NULL NULL NULL
+NULL NULL a a a a
+NULL NULL .a a a. a
+SELECT c1||'-'||c2||'-'||c3||'-'||c4||'-'||c5||'-'||c6 FROM v1;
+c1||'-'||c2||'-'||c3||'-'||c4||'-'||c5||'-'||c6
+---a--a
+-----
+-----
+-----
+-----
+--a-a-a-a
+--.a- a-a.-a
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/func_replace.result b/mysql-test/suite/compat/oracle/r/func_replace.result
new file mode 100644
index 00000000000..02516096286
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_replace.result
@@ -0,0 +1,32 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-13003 - Oracle compatibility : Replace function
+#
+SELECT REPLACE(null,'a','b') ;
+REPLACE(null,'a','b')
+NULL
+SELECT REPLACE('ab',null,'b') ;
+REPLACE('ab',null,'b')
+ab
+SELECT REPLACE('ab','a',null) ;
+REPLACE('ab','a',null)
+b
+SELECT REPLACE('ab',null,null) ;
+REPLACE('ab',null,null)
+ab
+SELECT REPLACE('aaa','a',null) ;
+REPLACE('aaa','a',null)
+NULL
+EXPLAIN EXTENDED SELECT REPLACE('ab','a',null) ;
+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 replace_oracle('ab','a',NULL) AS "REPLACE('ab','a',null)"
+CREATE VIEW v1 AS SELECT REPLACE('ab','a',null) ;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select replace_oracle('ab','a',NULL) AS "REPLACE('ab','a',null)" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+REPLACE('ab','a',null)
+b
+DROP VIEW v1;
diff --git a/mysql-test/suite/compat/oracle/r/func_substr.result b/mysql-test/suite/compat/oracle/r/func_substr.result
new file mode 100644
index 00000000000..5d9fdd5f2b9
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_substr.result
@@ -0,0 +1,87 @@
+#
+# MDEV-14012 - sql_mode=Oracle: substr(): treat position 0 as position 1
+# MDEV-10574 - sql_mode=Oracle: return null instead of empty string
+#
+SET sql_mode=ORACLE;
+SELECT SUBSTR('abc',2,1),SUBSTR('abc',1,1), SUBSTR('abc',0,1) FROM dual;
+SUBSTR('abc',2,1) SUBSTR('abc',1,1) SUBSTR('abc',0,1)
+b a a
+SELECT SUBSTR('abc',2),SUBSTR('abc',1), SUBSTR('abc',0) FROM dual;
+SUBSTR('abc',2) SUBSTR('abc',1) SUBSTR('abc',0)
+bc abc abc
+SELECT SUBSTR(null,2,1),SUBSTR(null,1), SUBSTR(null,0) FROM dual;
+SUBSTR(null,2,1) SUBSTR(null,1) SUBSTR(null,0)
+NULL NULL NULL
+SELECT SUBSTR('abc',-2),SUBSTR('abc',-1), SUBSTR('abc',-0) FROM dual;
+SUBSTR('abc',-2) SUBSTR('abc',-1) SUBSTR('abc',-0)
+bc c abc
+SELECT SUBSTR('abc',-2,1),SUBSTR('abc',-1,1), SUBSTR('abc',-0,1) FROM dual;
+SUBSTR('abc',-2,1) SUBSTR('abc',-1,1) SUBSTR('abc',-0,1)
+b c a
+SELECT SUBSTR('abc',null) FROM dual;
+SUBSTR('abc',null)
+NULL
+SELECT SUBSTR('abc',2,null),SUBSTR('abc',1,null), SUBSTR('abc',0,null) FROM dual;
+SUBSTR('abc',2,null) SUBSTR('abc',1,null) SUBSTR('abc',0,null)
+NULL NULL NULL
+SELECT SUBSTR('abc',2,0),SUBSTR('abc',1,0), SUBSTR('abc',0,0) FROM dual;
+SUBSTR('abc',2,0) SUBSTR('abc',1,0) SUBSTR('abc',0,0)
+NULL NULL NULL
+SELECT SUBSTR('abc',2,-1),SUBSTR('abc',1,-1), SUBSTR('abc',0,-1) FROM dual;
+SUBSTR('abc',2,-1) SUBSTR('abc',1,-1) SUBSTR('abc',0,-1)
+NULL NULL NULL
+SELECT SUBSTR(SPACE(0),1) FROM DUAL;
+SUBSTR(SPACE(0),1)
+NULL
+CREATE TABLE t1 (c1 VARCHAR(10),start INTEGER, length INTEGER);
+INSERT INTO t1 VALUES ('abc', 1, 1);
+INSERT INTO t1 VALUES ('abc', 0, 1);
+INSERT INTO t1 VALUES (null, 1, 1);
+INSERT INTO t1 VALUES (null, 0, 1);
+INSERT INTO t1 VALUES ('abc', 1, 0);
+INSERT INTO t1 VALUES ('abc', 0, 0);
+INSERT INTO t1 VALUES (null, 1, 0);
+INSERT INTO t1 VALUES (null, 0, 0);
+INSERT INTO t1 VALUES ('abc', 1, -1);
+INSERT INTO t1 VALUES ('abc', 0, -1);
+INSERT INTO t1 VALUES (null, 1, -1);
+INSERT INTO t1 VALUES (null, 0, -1);
+INSERT INTO t1 VALUES (SPACE(0), 0, 1);
+SELECT SUBSTR(c1,start,length) FROM t1;
+SUBSTR(c1,start,length)
+a
+a
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL);
+CREATE TABLE t2 AS SELECT SUBSTR(C1,1,1) AS C1 from t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "C1" varchar(1) DEFAULT NULL
+)
+DROP TABLE t2;
+DROP TABLE t1;
+EXPLAIN EXTENDED SELECT SUBSTR('abc',2,1) ;
+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 substr_oracle('abc',2,1) AS "SUBSTR('abc',2,1)"
+CREATE VIEW v1 AS SELECT SUBSTR('abc',2,1) ;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select substr_oracle('abc',2,1) AS "SUBSTR('abc',2,1)" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+SUBSTR('abc',2,1)
+b
+DROP VIEW v1;
diff --git a/mysql-test/suite/compat/oracle/r/func_time.result b/mysql-test/suite/compat/oracle/r/func_time.result
new file mode 100644
index 00000000000..063163400ca
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_time.result
@@ -0,0 +1,31 @@
+SET sql_mode=ORACLE;
+#
+# Start of 10.3 tests
+#
+#
+# MDEV-16152 Expressions with INTERVAL return bad results in some cases
+#
+SELECT TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1,
+-INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2;
+c1 c2
+1991-01-01 10:20:30 1991-01-01 10:20:30
+SELECT TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1,
+INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2,
++INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3;
+c1 c2 c3
+2011-01-01 10:20:30 2011-01-01 10:20:30 2011-01-01 10:20:30
+EXPLAIN EXTENDED SELECT
+TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1,
+-INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2;
+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 TIMESTAMP'2001-01-01 10:20:30' - interval '10' year AS "c1",TIMESTAMP'2001-01-01 10:20:30' - interval '10' year AS "c2"
+EXPLAIN EXTENDED SELECT
+TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1,
+INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2,
++INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3;
+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 TIMESTAMP'2001-01-01 10:20:30' + interval '10' year AS "c1",TIMESTAMP'2001-01-01 10:20:30' + interval '10' year AS "c2",TIMESTAMP'2001-01-01 10:20:30' + interval '10' year AS "c3"
diff --git a/mysql-test/suite/compat/oracle/r/func_trim.result b/mysql-test/suite/compat/oracle/r/func_trim.result
new file mode 100644
index 00000000000..bed8dadf97f
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_trim.result
@@ -0,0 +1,170 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-15664 sql_mode=ORACLE: Make TRIM return NULL instead of empty string
+#
+SELECT TRIM('abc'), TRIM('abc ')||'.', '.'||TRIM(' abc ')||'.', TRIM(' '), TRIM(NULL), TRIM(SPACE(0)),TRIM(SPACE(10)) FROM dual;
+TRIM('abc') TRIM('abc ')||'.' '.'||TRIM(' abc ')||'.' TRIM(' ') TRIM(NULL) TRIM(SPACE(0)) TRIM(SPACE(10))
+abc abc. .abc. NULL NULL NULL NULL
+SELECT TRIM(TRAILING 'abc' FROM 'abc');
+TRIM(TRAILING 'abc' FROM 'abc')
+NULL
+SELECT TRIM(TRAILING 'abc' FROM 'abc ');
+TRIM(TRAILING 'abc' FROM 'abc ')
+abc
+SELECT TRIM(TRAILING 'abc' FROM ' abc');
+TRIM(TRAILING 'abc' FROM ' abc')
+
+SELECT TRIM(LEADING 'abc' FROM 'abc');
+TRIM(LEADING 'abc' FROM 'abc')
+NULL
+SELECT TRIM(LEADING 'abc' FROM 'abc ');
+TRIM(LEADING 'abc' FROM 'abc ')
+
+SELECT TRIM(LEADING 'abc' FROM ' abc');
+TRIM(LEADING 'abc' FROM ' abc')
+ abc
+SELECT TRIM(BOTH 'abc' FROM 'abc');
+TRIM(BOTH 'abc' FROM 'abc')
+NULL
+SELECT TRIM(BOTH 'abc' FROM 'abc ');
+TRIM(BOTH 'abc' FROM 'abc ')
+
+SELECT TRIM(BOTH 'abc' FROM ' abc');
+TRIM(BOTH 'abc' FROM ' abc')
+
+SELECT RTRIM('abc'), RTRIM('abc ')||'.', RTRIM(' abc ')||'.', RTRIM(' '), RTRIM(NULL), RTRIM(SPACE(0)),RTRIM(SPACE(10)) FROM dual;
+RTRIM('abc') RTRIM('abc ')||'.' RTRIM(' abc ')||'.' RTRIM(' ') RTRIM(NULL) RTRIM(SPACE(0)) RTRIM(SPACE(10))
+abc abc. abc. NULL NULL NULL NULL
+SELECT LTRIM('abc'), LTRIM('abc '), LTRIM(' abc '), LTRIM(' '), LTRIM(NULL), LTRIM(SPACE(0)),LTRIM(SPACE(10)) FROM dual;
+LTRIM('abc') LTRIM('abc ') LTRIM(' abc ') LTRIM(' ') LTRIM(NULL) LTRIM(SPACE(0)) LTRIM(SPACE(10))
+abc abc abc NULL NULL NULL NULL
+CREATE TABLE t1 (c1 VARCHAR(10),ord INTEGER);
+INSERT INTO t1 VALUES ('abc',1);
+INSERT INTO t1 VALUES (SPACE(0),2);
+INSERT INTO t1 VALUES ('',3);
+INSERT INTO t1 VALUES (' ',4);
+INSERT INTO t1 VALUES (' ',5);
+INSERT INTO t1 VALUES (' a ',6);
+INSERT INTO t1 VALUES ('aa',7);
+INSERT INTO t1 VALUES ('aabb',8);
+INSERT INTO t1 VALUES ('bbaa',9);
+INSERT INTO t1 VALUES ('aabbaa',10);
+SELECT ord,'['||c1||']','.'||COALESCE(TRIM(LEADING 'a' FROM c1),'NULL')||'.' FROM t1 ORDER BY ord;
+ord '['||c1||']' '.'||COALESCE(TRIM(LEADING 'a' FROM c1),'NULL')||'.'
+1 [abc] .bc.
+2 [] .NULL.
+3 [] .NULL.
+4 [ ] . .
+5 [ ] . .
+6 [ a ] . a .
+7 [aa] .NULL.
+8 [aabb] .bb.
+9 [bbaa] .bbaa.
+10 [aabbaa] .bbaa.
+SELECT ord,'['||c1||']','.'||COALESCE(TRIM(TRAILING 'a' FROM c1),'NULL')||'.' FROM t1 ORDER BY ord;
+ord '['||c1||']' '.'||COALESCE(TRIM(TRAILING 'a' FROM c1),'NULL')||'.'
+1 [abc] .abc.
+2 [] .NULL.
+3 [] .NULL.
+4 [ ] . .
+5 [ ] . .
+6 [ a ] . a .
+7 [aa] .NULL.
+8 [aabb] .aabb.
+9 [bbaa] .bb.
+10 [aabbaa] .aabb.
+SELECT ord,'['||c1||']','.'||COALESCE(TRIM(BOTH 'a' FROM c1),'NULL')||'.' FROM t1 ORDER BY ord;
+ord '['||c1||']' '.'||COALESCE(TRIM(BOTH 'a' FROM c1),'NULL')||'.'
+1 [abc] .bc.
+2 [] .NULL.
+3 [] .NULL.
+4 [ ] . .
+5 [ ] . .
+6 [ a ] . a .
+7 [aa] .NULL.
+8 [aabb] .bb.
+9 [bbaa] .bb.
+10 [aabbaa] .bb.
+SELECT ord,'['||c1||']',COALESCE(LTRIM(c1),'NULL') FROM t1 ORDER BY ord;
+ord '['||c1||']' COALESCE(LTRIM(c1),'NULL')
+1 [abc] abc
+2 [] NULL
+3 [] NULL
+4 [ ] NULL
+5 [ ] NULL
+6 [ a ] a
+7 [aa] aa
+8 [aabb] aabb
+9 [bbaa] bbaa
+10 [aabbaa] aabbaa
+SELECT ord,'['||c1||']',COALESCE(RTRIM(c1),'NULL')||'.' FROM t1 ORDER BY ord;
+ord '['||c1||']' COALESCE(RTRIM(c1),'NULL')||'.'
+1 [abc] abc.
+2 [] NULL.
+3 [] NULL.
+4 [ ] NULL.
+5 [ ] NULL.
+6 [ a ] a.
+7 [aa] aa.
+8 [aabb] aabb.
+9 [bbaa] bbaa.
+10 [aabbaa] aabbaa.
+EXPLAIN EXTENDED SELECT TRIM('abc'),
+TRIM(BOTH 'a' FROM 'abc'),
+TRIM(LEADING 'a' FROM 'abc'),
+TRIM(TRAILING 'a' FROM 'abc') ;
+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 trim_oracle('abc') AS "TRIM('abc')",trim_oracle(both 'a' from 'abc') AS "TRIM(BOTH 'a' FROM 'abc')",trim_oracle(leading 'a' from 'abc') AS "TRIM(LEADING 'a' FROM 'abc')",trim_oracle(trailing 'a' from 'abc') AS "TRIM(TRAILING 'a' FROM 'abc')"
+EXPLAIN EXTENDED SELECT RTRIM('abc'),
+LTRIM('abc');
+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 rtrim_oracle('abc') AS "RTRIM('abc')",ltrim_oracle('abc') AS "LTRIM('abc')"
+CREATE VIEW v1 AS SELECT ord,TRIM('abc'),RTRIM('abc'),LTRIM('abc'),
+'['||c1||']',
+TRIM(LEADING 'a' FROM c1),
+TRIM(TRAILING 'a' FROM c1),
+TRIM(BOTH 'a' FROM c1),
+LTRIM(c1),
+RTRIM(c1)
+FROM t1 ORDER BY ord ;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select "t1"."ord" AS "ord",trim_oracle('abc') AS "TRIM('abc')",rtrim_oracle('abc') AS "RTRIM('abc')",ltrim_oracle('abc') AS "LTRIM('abc')",concat_operator_oracle(concat_operator_oracle('[',"t1"."c1"),']') AS "'['||c1||']'",trim_oracle(leading 'a' from "t1"."c1") AS "TRIM(LEADING 'a' FROM c1)",trim_oracle(trailing 'a' from "t1"."c1") AS "TRIM(TRAILING 'a' FROM c1)",trim_oracle(both 'a' from "t1"."c1") AS "TRIM(BOTH 'a' FROM c1)",ltrim_oracle("t1"."c1") AS "LTRIM(c1)",rtrim_oracle("t1"."c1") AS "RTRIM(c1)" from "t1" order by "t1"."ord" latin1 latin1_swedish_ci
+SELECT * FROM v1;
+ord TRIM('abc') RTRIM('abc') LTRIM('abc') '['||c1||']' TRIM(LEADING 'a' FROM c1) TRIM(TRAILING 'a' FROM c1) TRIM(BOTH 'a' FROM c1) LTRIM(c1) RTRIM(c1)
+1 abc abc abc [abc] bc abc bc abc abc
+2 abc abc abc [] NULL NULL NULL NULL NULL
+3 abc abc abc [] NULL NULL NULL NULL NULL
+4 abc abc abc [ ] NULL NULL
+5 abc abc abc [ ] NULL NULL
+6 abc abc abc [ a ] a a a a a
+7 abc abc abc [aa] NULL NULL NULL aa aa
+8 abc abc abc [aabb] bb aabb bb aabb aabb
+9 abc abc abc [bbaa] bbaa bb bb bbaa bbaa
+10 abc abc abc [aabbaa] bbaa aabb bb aabbaa aabbaa
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL);
+CREATE TABLE t2 AS SELECT TRIM(LEADING 'a' FROM c1) AS C1,
+TRIM(TRAILING 'a' FROM c1) AS C2,
+TRIM(BOTH 'a' FROM c1) AS C3,
+LTRIM(c1) AS C4,
+RTRIM(c1) AS C5
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "C1" varchar(10) DEFAULT NULL,
+ "C2" varchar(10) DEFAULT NULL,
+ "C3" varchar(10) DEFAULT NULL,
+ "C4" varchar(10) DEFAULT NULL,
+ "C5" varchar(10) DEFAULT NULL
+)
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE trim_oracle (trim_oracle int);
+DROP TABLE trim_oracle;
diff --git a/mysql-test/suite/compat/oracle/r/gis.result b/mysql-test/suite/compat/oracle/r/gis.result
new file mode 100644
index 00000000000..ebd56a089ad
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/gis.result
@@ -0,0 +1,6 @@
+SELECT WITHIN(POINT(1,1), POINT(1,1));
+WITHIN(POINT(1,1), POINT(1,1))
+1
+SELECT WITHIN(POINT(1,1), POINT(0,0));
+WITHIN(POINT(1,1), POINT(0,0))
+0
diff --git a/mysql-test/suite/compat/oracle/r/information_schema_parameters.result b/mysql-test/suite/compat/oracle/r/information_schema_parameters.result
new file mode 100644
index 00000000000..f7e9bfcafb9
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/information_schema_parameters.result
@@ -0,0 +1,854 @@
+#
+# MDEV-15416 Crash when reading I_S.PARAMETERS
+#
+# Create in sql_mode=ORACLE, display in sql_mode=ORACLE and sql_mode=DEFAULT
+SET sql_mode=ORACLE;
+CREATE PROCEDURE p1(a0 t1.a%TYPE,
+a1 test.t1.a%TYPE,
+b0 t1%ROWTYPE,
+b1 test.t1%ROWTYPE,
+d ROW(a INT,b DOUBLE))
+AS
+BEGIN
+NULL;
+END;
+$$
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"."a"%TYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"."a"%TYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"%ROWTYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"%ROWTYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"."a"%TYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"."a"%TYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"%ROWTYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"%ROWTYPE
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE PROCEDURE
+-------- --------
+DROP PROCEDURE p1;
+SET sql_mode=ORACLE;
+CREATE FUNCTION f1(a0 t1.a%TYPE,
+a1 test.t1.a%TYPE,
+b0 t1%ROWTYPE,
+b1 test.t1%ROWTYPE,
+d ROW(a INT,b DOUBLE))
+RETURN INT
+AS
+BEGIN
+RETURN 0;
+END;
+$$
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 0
+PARAMETER_MODE NULL
+PARAMETER_NAME NULL
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER int(11)
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"."a"%TYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"."a"%TYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"%ROWTYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"%ROWTYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE FUNCTION
+-------- --------
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 0
+PARAMETER_MODE NULL
+PARAMETER_NAME NULL
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER int(11)
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"."a"%TYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"."a"%TYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "t1"%ROWTYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER "test"."t1"%ROWTYPE
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE FUNCTION
+-------- --------
+DROP FUNCTION f1;
+# Create in sql_mode=DEFAULT, display in sql_mode=DEFAULT and sql_mode=ORACLE
+SET sql_mode=DEFAULT;
+CREATE PROCEDURE p1(a0 TYPE OF t1.a,
+a1 TYPE OF test.t1.a,
+b0 ROW TYPE OF t1,
+b1 ROW TYPE OF test.t1,
+d ROW(a INT,b DOUBLE))
+BEGIN
+END;
+$$
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `t1`.`a`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `test`.`t1`.`a`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `t1`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `test`.`t1`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `t1`.`a`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `test`.`t1`.`a`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `t1`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `test`.`t1`
+ROUTINE_TYPE PROCEDURE
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME p1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE PROCEDURE
+-------- --------
+DROP PROCEDURE p1;
+SET sql_mode=DEFAULT;
+CREATE FUNCTION f1(a0 TYPE OF t1.a,
+a1 TYPE OF test.t1.a,
+b0 ROW TYPE OF t1,
+b1 ROW TYPE OF test.t1,
+d ROW(a INT,b DOUBLE))
+RETURNS INT
+BEGIN
+RETURN 0;
+END;
+$$
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 0
+PARAMETER_MODE NULL
+PARAMETER_NAME NULL
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER int(11)
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `t1`.`a`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `test`.`t1`.`a`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `t1`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `test`.`t1`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE FUNCTION
+-------- --------
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 0
+PARAMETER_MODE NULL
+PARAMETER_NAME NULL
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER int(11)
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a0
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `t1`.`a`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 2
+PARAMETER_MODE IN
+PARAMETER_NAME a1
+DATA_TYPE TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER TYPE OF `test`.`t1`.`a`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 3
+PARAMETER_MODE IN
+PARAMETER_NAME b0
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `t1`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 4
+PARAMETER_MODE IN
+PARAMETER_NAME b1
+DATA_TYPE ROW TYPE OF
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW TYPE OF `test`.`t1`
+ROUTINE_TYPE FUNCTION
+-------- --------
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA test
+SPECIFIC_NAME f1
+ORDINAL_POSITION 5
+PARAMETER_MODE IN
+PARAMETER_NAME d
+DATA_TYPE ROW
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER ROW
+ROUTINE_TYPE FUNCTION
+-------- --------
+DROP FUNCTION f1;
+#
+# MDEV 18092 Query with the table I_S.PARAMETERS stop working
+# after a package is created
+#
+SET sql_mode=ORACLE;
+CREATE DATABASE db1_mdev18092;
+USE db1_mdev18092;
+CREATE PROCEDURE p1(a INT)
+AS BEGIN
+NULL;
+END;
+$$
+CREATE OR REPLACE PACKAGE employee_tools AS
+FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);
+PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));
+PROCEDURE raiseSalaryStd(eid INT);
+PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));
+END;
+$$
+SELECT *, '---------------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_SCHEMA='db1_mdev18092';
+SPECIFIC_CATALOG def
+SPECIFIC_SCHEMA db1_mdev18092
+SPECIFIC_NAME p1
+ORDINAL_POSITION 1
+PARAMETER_MODE IN
+PARAMETER_NAME a
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER int(11)
+ROUTINE_TYPE PROCEDURE
+--------------- ---------------
+DROP DATABASE db1_mdev18092;
diff --git a/mysql-test/suite/compat/oracle/r/keywords.result b/mysql-test/suite/compat/oracle/r/keywords.result
new file mode 100644
index 00000000000..bc9d3d9b6d6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/keywords.result
@@ -0,0 +1,26 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-17363 Compressed columns cannot be restored from dump
+# In sql_mode=ORACLE, COMPRESSED is still valid both as an SP label
+# and an SP variable name.
+#
+BEGIN
+IF TRUE THEN
+GOTO compressed;
+END IF;
+SELECT 'This should not be reached' AS warn;
+<<compressed>>
+BEGIN
+SELECT 1 AS a;
+END;
+END
+$$
+a
+1
+DECLARE compressed INT DEFAULT 1;
+BEGIN
+SELECT compressed;
+END
+$$
+compressed
+1
diff --git a/mysql-test/suite/compat/oracle/r/misc.result b/mysql-test/suite/compat/oracle/r/misc.result
new file mode 100644
index 00000000000..38f38bd07e6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/misc.result
@@ -0,0 +1,12 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-12086 sql_mode=ORACLE: allow SELECT UNIQUE as a synonym for SELECT DISTINCT
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20),(20),(30),(30),(30);
+SELECT UNIQUE a FROM t1;
+a
+10
+20
+30
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/mysqldump_restore.result b/mysql-test/suite/compat/oracle/r/mysqldump_restore.result
new file mode 100644
index 00000000000..f73fa3a3639
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/mysqldump_restore.result
@@ -0,0 +1,38 @@
+SET sql_mode=ORACLE;
+#
+# Start of 10.3 tests
+#
+#
+# MDEV-17363 Compressed columns cannot be restored from dump
+#
+CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL);
+INSERT INTO `t1` VALUES (REPEAT('a', 256));
+# Begin testing mysqldump output + restore
+# Create 'original table name - <table>_orig
+SET @orig_table_name = CONCAT('test.t1', '_orig');
+# Rename original table
+ALTER TABLE test.t1 RENAME to test.t1_orig;
+# Recreate table from mysqldump output
+# Compare original and recreated tables
+# Recreated table: test.t1
+# Original table: test.t1_orig
+include/diff_tables.inc [test.t1, test.t1_orig]
+# Cleanup
+DROP TABLE test.t1, test.t1_orig;
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL);
+INSERT INTO `t1` VALUES (REPEAT('a', 256));
+# Begin testing mysqldump output + restore
+# Create 'original table name - <table>_orig
+SET @orig_table_name = CONCAT('test.t1', '_orig');
+# Rename original table
+ALTER TABLE test.t1 RENAME to test.t1_orig;
+# Recreate table from mysqldump output
+# Compare original and recreated tables
+# Recreated table: test.t1
+# Original table: test.t1_orig
+include/diff_tables.inc [test.t1, test.t1_orig]
+# Cleanup
+DROP TABLE test.t1, test.t1_orig;
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/suite/compat/oracle/r/parser.result b/mysql-test/suite/compat/oracle/r/parser.result
new file mode 100644
index 00000000000..0b573027c6d
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/parser.result
@@ -0,0 +1,645 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
+#
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
+ERROR HY000: Unknown structured system variable or ROW routine variable 'NEW'
+DROP TABLE t1;
+#
+# MDEV-15615 Unexpected syntax error instead of "Unknown system variable" inside an SP
+#
+DECLARE
+a INT;
+BEGIN
+SET GLOBAL a=10;
+END;
+$$
+ERROR HY000: Unknown system variable 'a'
+#
+# MDEV-16202 Latest changes made erroneously some keywords reserved in sql_mode=ORACLE
+#
+CREATE PROCEDURE p1(name VARCHAR(64), pattern TEXT) AS
+query TEXT DEFAULT REPLACE(pattern, 'name', name);
+BEGIN
+SELECT query AS '';
+EXECUTE IMMEDIATE query;
+EXCEPTION
+WHEN OTHERS THEN
+BEGIN
+SHOW ERRORS;
+END;
+END;
+$$
+CREATE PROCEDURE p2(name VARCHAR(64)) AS
+BEGIN
+CALL p1(name, 'DECLARE name INT; BEGIN name:=10; SELECT name; END');
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (name INT)', 'name', name);
+CALL p1(name, 'SELECT name FROM t1');
+CALL p1(name, 'SELECT name ''alias'' FROM t1');
+CALL p1(name, 'SELECT name()');
+CALL p1(name, 'SELECT name.name()');
+CALL p1(name, 'SELECT name DATE FROM t1');
+CALL p1(name, 'SELECT name HISTORY FROM t1');
+CALL p1(name, 'SELECT name NEXT FROM t1');
+CALL p1(name, 'SELECT name PERIOD FROM t1');
+CALL p1(name, 'SELECT name PREVIOUS FROM t1');
+CALL p1(name, 'SELECT name SYSTEM FROM t1');
+CALL p1(name, 'SELECT name SYSTEM_TIME FROM t1');
+CALL p1(name, 'SELECT name TIME FROM t1');
+CALL p1(name, 'SELECT name TIMESTAMP FROM t1');
+CALL p1(name, 'SELECT name TRANSACTION FROM t1');
+CALL p1(name, 'SELECT name VALUE FROM t1');
+CALL p1(name, 'SELECT name VERSIONING FROM t1');
+CALL p1(name, 'SELECT name WITHOUT FROM t1');
+DROP TABLE t1;
+END;
+$$
+CALL p2('date');
+DECLARE date INT; BEGIN date:=10; SELECT date; END
+Error 1064 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 'INT; BEGIN date:=10; SELECT date; END' at line 1
+SELECT date FROM t1
+SELECT date 'alias' FROM t1
+Error 1525 Incorrect DATE value: 'alias'
+SELECT date()
+Error 1064 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 date.date()
+Error 1630 FUNCTION date.date does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT date DATE FROM t1
+SELECT date HISTORY FROM t1
+SELECT date NEXT FROM t1
+SELECT date PERIOD FROM t1
+SELECT date PREVIOUS FROM t1
+SELECT date SYSTEM FROM t1
+SELECT date SYSTEM_TIME FROM t1
+SELECT date TIME FROM t1
+SELECT date TIMESTAMP FROM t1
+SELECT date TRANSACTION FROM t1
+SELECT date VALUE FROM t1
+SELECT date VERSIONING FROM t1
+SELECT date WITHOUT FROM t1
+CALL p2('history');
+DECLARE history INT; BEGIN history:=10; SELECT history; END
+10
+SELECT history FROM t1
+SELECT history 'alias' FROM t1
+SELECT history()
+Error 1064 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 history.history()
+Error 1630 FUNCTION history.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT history DATE FROM t1
+SELECT history HISTORY FROM t1
+SELECT history NEXT FROM t1
+SELECT history PERIOD FROM t1
+SELECT history PREVIOUS FROM t1
+SELECT history SYSTEM FROM t1
+SELECT history SYSTEM_TIME FROM t1
+SELECT history TIME FROM t1
+SELECT history TIMESTAMP FROM t1
+SELECT history TRANSACTION FROM t1
+SELECT history VALUE FROM t1
+SELECT history VERSIONING FROM t1
+SELECT history WITHOUT FROM t1
+CALL p2('next');
+DECLARE next INT; BEGIN next:=10; SELECT next; END
+10
+SELECT next FROM t1
+SELECT next 'alias' FROM t1
+SELECT next()
+Error 1064 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 next.next()
+Error 1630 FUNCTION next.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT next DATE FROM t1
+SELECT next HISTORY FROM t1
+SELECT next NEXT FROM t1
+SELECT next PERIOD FROM t1
+SELECT next PREVIOUS FROM t1
+SELECT next SYSTEM FROM t1
+SELECT next SYSTEM_TIME FROM t1
+SELECT next TIME FROM t1
+SELECT next TIMESTAMP FROM t1
+SELECT next TRANSACTION FROM t1
+SELECT next VALUE FROM t1
+Error 1064 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
+SELECT next VERSIONING FROM t1
+SELECT next WITHOUT FROM t1
+CALL p2('period');
+DECLARE period INT; BEGIN period:=10; SELECT period; END
+10
+SELECT period FROM t1
+SELECT period 'alias' FROM t1
+SELECT period()
+Error 1064 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 period.period()
+Error 1630 FUNCTION period.period does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT period DATE FROM t1
+SELECT period HISTORY FROM t1
+SELECT period NEXT FROM t1
+SELECT period PERIOD FROM t1
+SELECT period PREVIOUS FROM t1
+SELECT period SYSTEM FROM t1
+SELECT period SYSTEM_TIME FROM t1
+SELECT period TIME FROM t1
+SELECT period TIMESTAMP FROM t1
+SELECT period TRANSACTION FROM t1
+SELECT period VALUE FROM t1
+SELECT period VERSIONING FROM t1
+SELECT period WITHOUT FROM t1
+CALL p2('previous');
+DECLARE previous INT; BEGIN previous:=10; SELECT previous; END
+10
+SELECT previous FROM t1
+SELECT previous 'alias' FROM t1
+SELECT previous()
+Error 1064 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 previous.previous()
+Error 1630 FUNCTION previous.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT previous DATE FROM t1
+SELECT previous HISTORY FROM t1
+SELECT previous NEXT FROM t1
+SELECT previous PERIOD FROM t1
+SELECT previous PREVIOUS FROM t1
+SELECT previous SYSTEM FROM t1
+SELECT previous SYSTEM_TIME FROM t1
+SELECT previous TIME FROM t1
+SELECT previous TIMESTAMP FROM t1
+SELECT previous TRANSACTION FROM t1
+SELECT previous VALUE FROM t1
+Error 1064 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
+SELECT previous VERSIONING FROM t1
+SELECT previous WITHOUT FROM t1
+CALL p2('system');
+DECLARE system INT; BEGIN system:=10; SELECT system; END
+10
+SELECT system FROM t1
+SELECT system 'alias' FROM t1
+SELECT system()
+Error 1064 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 system.system()
+Error 1630 FUNCTION system.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT system DATE FROM t1
+SELECT system HISTORY FROM t1
+SELECT system NEXT FROM t1
+SELECT system PERIOD FROM t1
+SELECT system PREVIOUS FROM t1
+SELECT system SYSTEM FROM t1
+SELECT system SYSTEM_TIME FROM t1
+SELECT system TIME FROM t1
+SELECT system TIMESTAMP FROM t1
+SELECT system TRANSACTION FROM t1
+SELECT system VALUE FROM t1
+SELECT system VERSIONING FROM t1
+SELECT system WITHOUT FROM t1
+CALL p2('system_time');
+DECLARE system_time INT; BEGIN system_time:=10; SELECT system_time; END
+10
+SELECT system_time FROM t1
+SELECT system_time 'alias' FROM t1
+SELECT system_time()
+Error 1064 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 system_time.system_time()
+Error 1630 FUNCTION system_time.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT system_time DATE FROM t1
+SELECT system_time HISTORY FROM t1
+SELECT system_time NEXT FROM t1
+SELECT system_time PERIOD FROM t1
+SELECT system_time PREVIOUS FROM t1
+SELECT system_time SYSTEM FROM t1
+SELECT system_time SYSTEM_TIME FROM t1
+SELECT system_time TIME FROM t1
+SELECT system_time TIMESTAMP FROM t1
+SELECT system_time TRANSACTION FROM t1
+SELECT system_time VALUE FROM t1
+SELECT system_time VERSIONING FROM t1
+SELECT system_time WITHOUT FROM t1
+CALL p2('time');
+DECLARE time INT; BEGIN time:=10; SELECT time; END
+Error 1064 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 'INT; BEGIN time:=10; SELECT time; END' at line 1
+SELECT time FROM t1
+SELECT time 'alias' FROM t1
+Error 1525 Incorrect TIME value: 'alias'
+SELECT time()
+Error 1064 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 time.time()
+Error 1630 FUNCTION time.time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT time DATE FROM t1
+SELECT time HISTORY FROM t1
+SELECT time NEXT FROM t1
+SELECT time PERIOD FROM t1
+SELECT time PREVIOUS FROM t1
+SELECT time SYSTEM FROM t1
+SELECT time SYSTEM_TIME FROM t1
+SELECT time TIME FROM t1
+SELECT time TIMESTAMP FROM t1
+SELECT time TRANSACTION FROM t1
+SELECT time VALUE FROM t1
+SELECT time VERSIONING FROM t1
+SELECT time WITHOUT FROM t1
+CALL p2('timestamp');
+DECLARE timestamp INT; BEGIN timestamp:=10; SELECT timestamp; END
+Error 1064 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 'INT; BEGIN timestamp:=10; SELECT timestamp; END' at line 1
+SELECT timestamp FROM t1
+SELECT timestamp 'alias' FROM t1
+Error 1525 Incorrect DATETIME value: 'alias'
+SELECT timestamp()
+Error 1064 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 timestamp.timestamp()
+Error 1630 FUNCTION timestamp.timestamp does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT timestamp DATE FROM t1
+SELECT timestamp HISTORY FROM t1
+SELECT timestamp NEXT FROM t1
+SELECT timestamp PERIOD FROM t1
+SELECT timestamp PREVIOUS FROM t1
+SELECT timestamp SYSTEM FROM t1
+SELECT timestamp SYSTEM_TIME FROM t1
+SELECT timestamp TIME FROM t1
+SELECT timestamp TIMESTAMP FROM t1
+SELECT timestamp TRANSACTION FROM t1
+SELECT timestamp VALUE FROM t1
+SELECT timestamp VERSIONING FROM t1
+SELECT timestamp WITHOUT FROM t1
+CALL p2('transaction');
+DECLARE transaction INT; BEGIN transaction:=10; SELECT transaction; END
+10
+SELECT transaction FROM t1
+SELECT transaction 'alias' FROM t1
+SELECT transaction()
+Error 1064 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 transaction.transaction()
+Error 1630 FUNCTION transaction.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT transaction DATE FROM t1
+SELECT transaction HISTORY FROM t1
+SELECT transaction NEXT FROM t1
+SELECT transaction PERIOD FROM t1
+SELECT transaction PREVIOUS FROM t1
+SELECT transaction SYSTEM FROM t1
+SELECT transaction SYSTEM_TIME FROM t1
+SELECT transaction TIME FROM t1
+SELECT transaction TIMESTAMP FROM t1
+SELECT transaction TRANSACTION FROM t1
+SELECT transaction VALUE FROM t1
+SELECT transaction VERSIONING FROM t1
+SELECT transaction WITHOUT FROM t1
+CALL p2('value');
+DECLARE value INT; BEGIN value:=10; SELECT value; END
+10
+SELECT value FROM t1
+SELECT value 'alias' FROM t1
+SELECT value()
+Error 1064 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 value.value()
+Error 1630 FUNCTION value.value does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT value DATE FROM t1
+SELECT value HISTORY FROM t1
+SELECT value NEXT FROM t1
+SELECT value PERIOD FROM t1
+SELECT value PREVIOUS FROM t1
+SELECT value SYSTEM FROM t1
+SELECT value SYSTEM_TIME FROM t1
+SELECT value TIME FROM t1
+SELECT value TIMESTAMP FROM t1
+SELECT value TRANSACTION FROM t1
+SELECT value VALUE FROM t1
+SELECT value VERSIONING FROM t1
+SELECT value WITHOUT FROM t1
+CALL p2('versioning');
+DECLARE versioning INT; BEGIN versioning:=10; SELECT versioning; END
+10
+SELECT versioning FROM t1
+SELECT versioning 'alias' FROM t1
+SELECT versioning()
+Error 1064 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 versioning.versioning()
+Error 1630 FUNCTION versioning.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT versioning DATE FROM t1
+SELECT versioning HISTORY FROM t1
+SELECT versioning NEXT FROM t1
+SELECT versioning PERIOD FROM t1
+SELECT versioning PREVIOUS FROM t1
+SELECT versioning SYSTEM FROM t1
+SELECT versioning SYSTEM_TIME FROM t1
+SELECT versioning TIME FROM t1
+SELECT versioning TIMESTAMP FROM t1
+SELECT versioning TRANSACTION FROM t1
+SELECT versioning VALUE FROM t1
+SELECT versioning VERSIONING FROM t1
+SELECT versioning WITHOUT FROM t1
+CALL p2('without');
+DECLARE without INT; BEGIN without:=10; SELECT without; END
+10
+SELECT without FROM t1
+SELECT without 'alias' FROM t1
+SELECT without()
+Error 1064 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 without.without()
+Error 1630 FUNCTION without.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT without DATE FROM t1
+SELECT without HISTORY FROM t1
+SELECT without NEXT FROM t1
+SELECT without PERIOD FROM t1
+SELECT without PREVIOUS FROM t1
+SELECT without SYSTEM FROM t1
+SELECT without SYSTEM_TIME FROM t1
+SELECT without TIME FROM t1
+SELECT without TIMESTAMP FROM t1
+SELECT without TRANSACTION FROM t1
+SELECT without VALUE FROM t1
+SELECT without VERSIONING FROM t1
+SELECT without WITHOUT FROM t1
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+#
+# MDEV-16244 sql_mode=ORACLE: Some keywords do not work in variable declarations
+#
+SET sql_mode=ORACLE;
+DECLARE
+do INT;
+BEGIN
+SELECT do INTO do FROM DUAL;
+END;
+/
+DECLARE
+handler INT;
+BEGIN
+SELECT handler INTO handler FROM DUAL;
+END;
+/
+DECLARE
+repair INT;
+BEGIN
+SELECT repair INTO repair FROM DUAL;
+END;
+/
+DECLARE
+shutdown INT;
+BEGIN
+SELECT shutdown INTO shutdown FROM DUAL;
+END;
+/
+DECLARE
+truncate INT;
+BEGIN
+SELECT truncate INTO truncate FROM DUAL;
+END;
+/
+DECLARE
+close INT;
+BEGIN
+SELECT close INTO close FROM DUAL;
+END;
+/
+DECLARE
+commit INT;
+BEGIN
+SELECT commit INTO commit FROM DUAL;
+END;
+/
+DECLARE
+open INT;
+BEGIN
+SELECT open INTO open FROM DUAL;
+END;
+/
+DECLARE
+rollback INT;
+BEGIN
+SELECT rollback INTO rollback FROM DUAL;
+END;
+/
+DECLARE
+savepoint INT;
+BEGIN
+SELECT savepoint INTO savepoint FROM DUAL;
+END;
+/
+DECLARE
+contains INT;
+BEGIN
+SELECT contains INTO contains FROM DUAL;
+END;
+/
+DECLARE
+language INT;
+BEGIN
+SELECT language INTO language FROM DUAL;
+END;
+/
+DECLARE
+no INT;
+BEGIN
+SELECT no INTO no FROM DUAL;
+END;
+/
+DECLARE
+charset INT;
+BEGIN
+SELECT charset INTO charset FROM DUAL;
+END;
+/
+DECLARE
+follows INT;
+BEGIN
+SELECT follows INTO follows FROM DUAL;
+END;
+/
+DECLARE
+precedes INT;
+BEGIN
+SELECT precedes INTO precedes FROM DUAL;
+END;
+/
+#
+# MDEV-16464 Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc"
+#
+SET sql_mode=ORACLE;
+SELECT name, comment FROM mysql.proc WHERE db='test';
+name comment
+CREATE TABLE comment (comment INT);
+SELECT comment FROM comment;
+comment
+SELECT comment comment FROM comment comment;
+comment
+SELECT comment AS comment FROM comment AS comment;
+comment
+DROP TABLE comment;
+DECLARE
+comment INT;
+BEGIN
+SELECT comment INTO comment FROM DUAL;
+END;
+/
+CREATE PROCEDURE comment COMMENT 'test' AS
+BEGIN
+SELECT 1;
+END;
+/
+BEGIN
+comment;
+END;
+/
+1
+1
+CALL comment();
+1
+1
+CALL comment;
+1
+1
+DROP PROCEDURE comment;
+CREATE FUNCTION comment RETURN INT COMMENT 'test' AS
+BEGIN
+RETURN 1;
+END;
+/
+Warnings:
+Note 1585 This function 'comment' has the same name as a native function
+SELECT test.comment() FROM DUAL;
+test.comment()
+1
+Warnings:
+Note 1585 This function 'comment' has the same name as a native function
+DROP FUNCTION comment;
+#
+# MDEV-17660 sql_mode=ORACLE: Some keywords do not work as label names: history, system, versioning, without
+#
+BEGIN
+<<date_format>>
+NULL;
+END;
+/
+BEGIN
+<<decode>>
+NULL;
+END;
+/
+BEGIN
+<<history>>
+NULL;
+END;
+/
+BEGIN
+<<system>>
+NULL;
+END;
+/
+BEGIN
+<<versioning>>
+NULL;
+END;
+/
+BEGIN
+<<without>>
+NULL;
+END;
+/
+#
+# MDEV-17666 sql_mode=ORACLE: Keyword ELSEIF should not be reserved
+#
+DECLARE
+ELSEIF INT;
+BEGIN
+ELSEIF:=1;
+END;
+/
+BEGIN
+<<ELSEIF>>
+NULL;
+END;
+/
+#
+# MDEV-17693 Shift/reduce conflicts for NAMES,ROLE,PASSWORD in the option_value_no_option_type grammar
+#
+CREATE TABLE names (names INT);
+SELECT names FROM names AS names;
+names
+DROP TABLE names;
+CREATE TABLE password (password INT);
+SELECT password FROM password AS password;
+password
+DROP TABLE password;
+CREATE TABLE role (role INT);
+SELECT role FROM role AS role;
+role
+DROP TABLE role;
+DECLARE
+names VARCHAR(32) DEFAULT '[names]';
+password VARCHAR(32) DEFAULT '[password]';
+role VARCHAR(32) DEFAULT '[role]';
+BEGIN
+<<names>>
+SELECT names;
+<<password>>
+SELECT password;
+<<role>>
+SELECT role;
+END;
+$$
+names
+[names]
+password
+[password]
+role
+[role]
+DECLARE
+names VARCHAR(32);
+BEGIN
+SET names='[names]';
+END;
+$$
+ERROR 42000: Variable 'names' must be quoted with `...`, or renamed
+DECLARE
+password VARCHAR(32);
+BEGIN
+SET password='[password]';
+END;
+$$
+ERROR 42000: Variable 'password' must be quoted with `...`, or renamed
+DECLARE
+role VARCHAR(32);
+BEGIN
+SET role='[role]';
+END;
+$$
+SELECT @@GLOBAL.names;
+ERROR HY000: Unknown system variable 'names'
+SELECT @@GLOBAL.password;
+ERROR HY000: Unknown system variable 'password'
+SELECT @@GLOBAL.role;
+ERROR HY000: Unknown system variable 'role'
+#
+# MDEV-22822 sql_mode="oracle" cannot declare without variable errors
+#
+# It's OK to have no declarations between DECLARE and BEGIN.
+#
+BEGIN
+DECLARE
+BEGIN
+NULL;
+END;
+EXCEPTION
+WHEN OTHERS THEN
+NULL;
+END;
+//
+DECLARE
+BEGIN
+NULL;
+EXCEPTION
+WHEN OTHERS THEN
+NULL;
+END;
+//
+BEGIN
+<<lab>>
+DECLARE
+BEGIN
+NULL;
+END;
+EXCEPTION
+WHEN OTHERS THEN
+NULL;
+END;
+//
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/suite/compat/oracle/r/ps.result b/mysql-test/suite/compat/oracle/r/ps.result
new file mode 100644
index 00000000000..158d15e9f90
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/ps.result
@@ -0,0 +1,264 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10801 sql_mode: dynamic SQL placeholders
+#
+SET @a=10, @b=20;
+PREPARE stmt FROM 'SELECT ?,?';
+EXECUTE stmt USING @a, @b;
+? ?
+10 20
+PREPARE stmt FROM 'SELECT :a,:b';
+EXECUTE stmt USING @a, @b;
+:a :b
+10 20
+PREPARE stmt FROM 'SELECT :aaa,:bbb';
+EXECUTE stmt USING @a, @b;
+:aaa :bbb
+10 20
+PREPARE stmt FROM 'SELECT :"a",:"b"';
+EXECUTE stmt USING @a, @b;
+:"a" :"b"
+10 20
+PREPARE stmt FROM 'SELECT :"aaa",:"bbb"';
+EXECUTE stmt USING @a, @b;
+:"aaa" :"bbb"
+10 20
+PREPARE stmt FROM 'SELECT :1,:2';
+EXECUTE stmt USING @a, @b;
+:1 :2
+10 20
+PREPARE stmt FROM 'SELECT :222,:111';
+EXECUTE stmt USING @a, @b;
+:222 :111
+10 20
+PREPARE stmt FROM 'SELECT :0,:65535';
+EXECUTE stmt USING @a, @b;
+:0 :65535
+10 20
+PREPARE stmt FROM 'SELECT :65535,:0';
+EXECUTE stmt USING @a, @b;
+:65535 :0
+10 20
+#
+# MDEV-10709 Expressions as parameters to Dynamic SQL
+#
+#
+# Testing disallowed expressions in USING
+#
+PREPARE stmt FROM 'SELECT :1 FROM DUAL';
+EXECUTE stmt USING (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 'SELECT 1)' at line 1
+DEALLOCATE PREPARE stmt;
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+BEGIN
+RETURN 'test';
+END;
+$$
+PREPARE stmt FROM 'SELECT ? FROM DUAL';
+EXECUTE stmt USING f1();
+ERROR 42000: EXECUTE..USING does not support subqueries or stored functions
+DEALLOCATE PREPARE stmt;
+DROP FUNCTION f1;
+#
+# Using a user variable as a EXECUTE..USING out parameter
+#
+CREATE PROCEDURE p1(a OUT INT)
+AS
+BEGIN
+a:= 10;
+END;
+/
+SET @a=1;
+CALL p1(@a);
+SELECT @a;
+@a
+10
+SET @a=2;
+PREPARE stmt FROM 'CALL p1(?)';
+EXECUTE stmt USING @a;
+SELECT @a;
+@a
+10
+DROP PROCEDURE p1;
+#
+# Using an SP variable as a EXECUTE..USING out parameter
+#
+CREATE PROCEDURE p1 (a OUT INT)
+AS
+BEGIN
+a:=10;
+END;
+/
+CREATE PROCEDURE p2 (a OUT INT)
+AS
+BEGIN
+PREPARE stmt FROM 'CALL p1(?)';
+EXECUTE stmt USING a;
+END;
+/
+SET @a= 1;
+CALL p2(@a);
+SELECT @a;
+@a
+10
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+#
+# Using a trigger field as a EXECUTE..USING out parameter
+#
+CREATE PROCEDURE p1 (a OUT INT)
+AS
+BEGIN
+a:= 10;
+END;
+/
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1(:NEW.a);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+10
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Testing re-prepare on a table metadata update between PREPARE and EXECUTE
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1(a IN INT)
+AS
+BEGIN
+INSERT INTO t1 VALUES (a);
+END;
+/
+PREPARE stmt FROM 'CALL p1(?)';
+EXECUTE stmt USING 10;
+SELECT * FROM t1;
+a
+10
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW NEW.a:=NEW.a+1;
+EXECUTE stmt USING 20;
+SELECT * FROM t1;
+a
+10
+21
+DEALLOCATE PREPARE stmt;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# End of MDEV-10709 Expressions as parameters to Dynamic SQL
+#
+#
+# MDEV-10585 EXECUTE IMMEDIATE statement
+#
+#
+# Testing disallowed expressions in USING
+#
+EXECUTE IMMEDIATE 'SELECT :1 FROM DUAL' USING (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 'SELECT 1)' at line 1
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+BEGIN
+RETURN 'test';
+END;
+$$
+EXECUTE IMMEDIATE 'SELECT ? FROM DUAL' USING f1();
+ERROR 42000: EXECUTE..USING does not support subqueries or stored functions
+DROP FUNCTION f1;
+#
+# Testing simple expressions
+#
+EXECUTE IMMEDIATE 'SELECT :1 FROM DUAL' USING 10;
+:1
+10
+#
+# MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
+#
+#
+# Testing erroneous and diallowed prepare source
+#
+EXECUTE IMMEDIATE _latin1'SELECT 1 AS c FROM ' || _latin2 'DUAL';
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_operator_oracle'
+PREPARE stmt FROM _latin1'SELECT 1 AS c FROM ' || _latin2 'DUAL';
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_operator_oracle'
+EXECUTE IMMEDIATE (SELECT '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 'SELECT 'SELECT 1')' at line 1
+PREPARE stmt FROM (SELECT '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 'SELECT 'SELECT 1')' at line 1
+EXECUTE IMMEDIATE a;
+ERROR 42S22: Unknown column 'a' in 'field list'
+PREPARE stmt FROM a;
+ERROR 42S22: Unknown column 'a' in 'field list'
+EXECUTE IMMEDIATE NULL;
+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 'NULL' at line 1
+PREPARE stmt FROM NULL;
+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 'NULL' at line 1
+EXECUTE IMMEDIATE COALESCE(NULL);
+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 'NULL' at line 1
+PREPARE stmt FROM COALESCE(NULL);
+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 'NULL' at line 1
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+BEGIN
+RETURN 't1';
+END;
+$$
+EXECUTE IMMEDIATE f1();
+ERROR 42000: EXECUTE IMMEDIATE does not support subqueries or stored functions
+PREPARE stmt FROM f1();
+ERROR 42000: PREPARE..FROM does not support subqueries or stored functions
+DROP FUNCTION f1;
+#
+# Testing user variables in prepare source
+#
+SET @table_name='DUAL';
+EXECUTE IMMEDIATE 'SELECT 1 AS a FROM ' || @table_name;
+a
+1
+PREPARE stmt FROM 'SELECT 1 AS a FROM ' || @table_name;
+EXECUTE stmt;
+a
+1
+DEALLOCATE PREPARE stmt;
+#
+# Testing SP parameters and variables in prepare source
+#
+CREATE PROCEDURE p1(table_name VARCHAR)
+AS
+BEGIN
+EXECUTE IMMEDIATE 'SELECT 1 AS c FROM '|| table_name;
+END;
+$$
+CALL p1('DUAL');
+c
+1
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+table_name VARCHAR(64):='DUAL';
+BEGIN
+EXECUTE IMMEDIATE 'SELECT 1 AS c FROM ' || table_name;
+END;
+$$
+CALL p1();
+c
+1
+DROP PROCEDURE p1;
+#
+# End of MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
+#
+#
+# MDEV-12846 sql_mode=ORACLE: using Oracle-style placeholders in direct query execution makes the server crash
+#
+SELECT ? FROM DUAL;
+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 DUAL' at line 1
+SELECT :a FROM DUAL;
+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 ':a FROM DUAL' at line 1
+SELECT :1 FROM DUAL;
+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 FROM DUAL' at line 1
+SELECT 1+? FROM DUAL;
+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 DUAL' at line 1
+SELECT 1+:a FROM DUAL;
+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 ':a FROM DUAL' at line 1
+SELECT 1+:1 FROM DUAL;
+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 FROM DUAL' at line 1
diff --git a/mysql-test/suite/compat/oracle/r/rpl_mariadb_date.result b/mysql-test/suite/compat/oracle/r/rpl_mariadb_date.result
new file mode 100644
index 00000000000..9aca6fa3542
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/rpl_mariadb_date.result
@@ -0,0 +1,86 @@
+include/master-slave.inc
+[connection master]
+SET SQL_MODE=DEFAULT;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('2001-01-01');
+SET SQL_MODE= ORACLE;
+CREATE TABLE t2 SELECT * FROM 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`; CREATE TABLE t1 (a DATE)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (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 # Annotate_rows # # INSERT INTO t1 VALUES ('2001-01-01')
+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 TABLE "t2" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+master-bin.000001 # Annotate_rows # # CREATE TABLE t2 SELECT * FROM t1
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+SET SQL_MODE= DEFAULT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET SQL_MODE= ORACLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+connection slave;
+SELECT * FROM t1;
+a
+NULL
+2001-01-01
+SELECT * FROM t2;
+a
+NULL
+2001-01-01
+SET SQL_MODE= DEFAULT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET SQL_MODE= ORACLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+connection master;
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/compat/oracle/r/rpl_sp_package.result b/mysql-test/suite/compat/oracle/r/rpl_sp_package.result
new file mode 100644
index 00000000000..2f10ec8ccd9
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/rpl_sp_package.result
@@ -0,0 +1,183 @@
+include/master-slave.inc
+[connection master]
+connection master;
+SET sql_mode=ORACLE;
+CREATE PACKAGE pack AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pack AS
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT f1();
+END;
+END pack;
+$$
+connection slave;
+connection slave;
+SELECT * FROM mysql.proc WHERE db='test' AND name='pack';
+db test
+name pack
+type PACKAGE
+specific_name pack
+language SQL
+sql_data_access CONTAINS_SQL
+is_deterministic NO
+security_type DEFINER
+param_list
+returns
+body AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END
+definer root@localhost
+created #
+modified #
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+db_collation latin1_swedish_ci
+body_utf8
+aggregate NONE
+db test
+name pack
+type PACKAGE BODY
+specific_name pack
+language SQL
+sql_data_access CONTAINS_SQL
+is_deterministic NO
+security_type DEFINER
+param_list
+returns
+body AS
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT f1();
+END;
+END
+definer root@localhost
+created #
+modified #
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+db_collation latin1_swedish_ci
+body_utf8
+aggregate NONE
+SELECT * FROM mysql.proc WHERE db='test' AND name LIKE 'pack.%';
+SET @@sql_mode=ORACLE;
+SELECT pack.f1();
+pack.f1()
+10
+CALL pack.p1();
+f1()
+10
+SET @@sql_mode=DEFAULT;
+connection master;
+DROP PACKAGE pack;
+connection slave;
+connection slave;
+SELECT COUNT(*) FROM mysql.proc WHERE db='test' AND name='pack';
+COUNT(*)
+0
+#
+# Creating a package with a COMMENT
+#
+connection master;
+CREATE PACKAGE p1 COMMENT 'package-p1-comment' AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 COMMENT 'package-body-p1-comment' AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+SELECT definer, name, security_type, type, `comment` FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type comment
+root@localhost p1 DEFINER PACKAGE package-p1-comment
+root@localhost p1 DEFINER PACKAGE BODY package-body-p1-comment
+connection slave;
+SELECT definer, name, security_type, type, `comment` FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type comment
+root@localhost p1 DEFINER PACKAGE package-p1-comment
+root@localhost p1 DEFINER PACKAGE BODY package-body-p1-comment
+connection master;
+DROP PACKAGE p1;
+connection slave;
+#
+# Creating a package with a different DEFINER
+#
+connection master;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type
+xxx@localhost p1 DEFINER PACKAGE
+xxx@localhost p1 DEFINER PACKAGE BODY
+connection slave;
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type
+xxx@localhost p1 DEFINER PACKAGE
+xxx@localhost p1 DEFINER PACKAGE BODY
+connection master;
+DROP PACKAGE p1;
+connection slave;
+#
+# Creating a package with a different DEFINER + SQL SECURITY INVOKER
+#
+connection master;
+CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS
+PROCEDURE p1;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+Warnings:
+Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type
+xxx@localhost p1 INVOKER PACKAGE
+xxx@localhost p1 INVOKER PACKAGE BODY
+connection slave;
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type
+xxx@localhost p1 INVOKER PACKAGE
+xxx@localhost p1 INVOKER PACKAGE BODY
+connection master;
+DROP PACKAGE p1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/compat/oracle/r/rpl_sp_package_variables.result b/mysql-test/suite/compat/oracle/r/rpl_sp_package_variables.result
new file mode 100644
index 00000000000..764686e4118
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/rpl_sp_package_variables.result
@@ -0,0 +1,38 @@
+include/master-slave.inc
+[connection master]
+connection master;
+SET sql_mode=ORACLE;
+#
+# MDEV-13139 Package-wide variables in CREATE PACKAGE
+#
+connection master;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+va INT:=10;
+PROCEDURE p1 AS
+BEGIN
+INSERT INTO t1 VALUES (va);
+END;
+BEGIN
+CREATE OR REPLACE TABLE t1 (a INT);
+END;
+$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT * FROM t1;
+a
+10
+10
+connection slave;
+SELECT * FROM t1;
+a
+10
+10
+connection master;
+DROP PACKAGE p1;
+DROP TABLE t1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/compat/oracle/r/sequence.result b/mysql-test/suite/compat/oracle/r/sequence.result
new file mode 100644
index 00000000000..dbbabc36683
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sequence.result
@@ -0,0 +1,77 @@
+SET sql_mode=ORACLE;
+CREATE SEQUENCE s1;
+SHOW CREATE SEQUENCE s1;
+Table Create Table
+s1 CREATE SEQUENCE "s1" start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle
+SELECT s1.currval;
+s1.currval
+NULL
+SELECT s1.nextval;
+s1.nextval
+1
+SELECT s1.nextval;
+s1.nextval
+2
+SELECT s1.nextval;
+s1.nextval
+3
+EXPLAIN EXTENDED SELECT s1.nextval;
+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 nextval("test"."s1") AS "s1.nextval"
+SELECT nextval(s1);
+nextval(s1)
+4
+EXPLAIN EXTENDED SELECT s1.currval;
+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 lastval("test"."s1") AS "s1.currval"
+SELECT lastval(s1);
+lastval(s1)
+4
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1;
+CREATE VIEW v1 AS SELECT s1.nextval AS a;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+VIEW_DEFINITION
+select nextval(`test`.`s1`) AS `a`
+SELECT * FROM v1;
+a
+1
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select nextval("test"."s1") AS "a" latin1 latin1_swedish_ci
+DROP VIEW v1;
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1;
+CREATE VIEW v1 AS SELECT s1.currval AS a;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+VIEW_DEFINITION
+select lastval(`test`.`s1`) AS `a`
+SELECT * FROM v1;
+a
+NULL
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select lastval("test"."s1") AS "a" latin1 latin1_swedish_ci
+DROP VIEW v1;
+DROP SEQUENCE s1;
+#
+# MDEV-12533 sql_mode=ORACLE: Add support for database qualified sequence names in NEXTVAL and CURRVAL
+#
+CREATE SEQUENCE s1;
+SELECT test.s1.nextval;
+test.s1.nextval
+1
+SELECT test.s1.currval;
+test.s1.currval
+1
+SELECT .s1.nextval;
+.s1.nextval
+2
+SELECT .s1.currval;
+.s1.currval
+2
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result b/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
new file mode 100644
index 00000000000..9edec669908
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
@@ -0,0 +1,131 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-13581 ROW TYPE OF t1 and t1%ROWTYPE for routine parameters
+#
+CREATE TABLE t1 (a INT, b TEXT, c ENUM('a','b','c'));
+CREATE PROCEDURE p1 (a t1%ROWTYPE) AS
+BEGIN
+CREATE TABLE t2 AS SELECT a.a AS a, a.b AS b, a.c AS c;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CREATE PROCEDURE p2 AS
+a t1%ROWTYPE;
+BEGIN
+CALL p1(a);
+END;
+$$
+CALL p2();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL,
+ "b" text DEFAULT NULL,
+ "c" char(1) DEFAULT NULL
+)
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b TEXT);
+CREATE PROCEDURE p1 (a OUT t1%ROWTYPE) AS
+BEGIN
+SET a.a=10;
+SET a.b='text';
+END;
+$$
+CREATE PROCEDURE p2 AS
+a t1%ROWTYPE;
+BEGIN
+CALL p1(a);
+SELECT a.a, a.b;
+END;
+$$
+CREATE FUNCTION f1(a t1%ROWTYPE) RETURN TEXT AS
+BEGIN
+RETURN CONCAT(a.a, ' ', a.b);
+END;
+$$
+CREATE FUNCTION f2 RETURN TEXT AS
+a t1%ROWTYPE;
+BEGIN
+CALL p1(a);
+RETURN f1(a);
+END;
+$$
+CALL p2();
+a.a a.b
+10 text
+SELECT f2();
+f2()
+10 text
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT, b TEXT);
+CREATE PROCEDURE p1 (a OUT db1.t1%ROWTYPE) AS
+BEGIN
+SET a.a=10;
+SET a.b='text';
+END;
+$$
+CREATE PROCEDURE p2 AS
+a db1.t1%ROWTYPE;
+BEGIN
+CALL p1(a);
+SELECT a.a, a.b;
+END;
+$$
+CREATE FUNCTION f1(a db1.t1%ROWTYPE) RETURN TEXT AS
+BEGIN
+RETURN CONCAT(a.a, ' ', a.b);
+END;
+$$
+CREATE FUNCTION f2() RETURN TEXT AS
+a db1.t1%ROWTYPE;
+BEGIN
+CALL p1(a);
+RETURN f1(a);
+END;
+$$
+CALL p2();
+a.a a.b
+10 text
+SELECT f2();
+f2()
+10 text
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP DATABASE db1;
+#
+# MDEV-14139 Anchored data types for variables
+#
+CREATE TABLE t1 (int11 INT, text0 TEXT);
+DECLARE
+row1 t1%ROWTYPE;
+a_row1 row1%TYPE;
+aa_row1 a_row1%TYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT a_row1.int11 AS int11, a_row1.text0 AS text0;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT aa_row1.int11 AS int11, aa_row1.text0 AS text0;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "int11" int(11) DEFAULT NULL,
+ "text0" text DEFAULT NULL
+)
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "int11" int(11) DEFAULT NULL,
+ "text0" text DEFAULT NULL
+)
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-anonymous.result b/mysql-test/suite/compat/oracle/r/sp-anonymous.result
new file mode 100644
index 00000000000..26bce0f435f
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-anonymous.result
@@ -0,0 +1,220 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10655 Anonymous blocks
+#
+# Testing BEGIN NOT ATOMIC with no declarations
+BEGIN NOT ATOMIC
+SELECT 1 AS a;
+END
+/
+a
+1
+# Testing BEGIN NOT ATOMIC with declarations
+# DECLARE starts a new block and thus must be followed by BEGIN .. END
+BEGIN NOT ATOMIC
+DECLARE
+i INT DEFAULT 5;
+x INT DEFAULT 10;
+BEGIN
+<<label>>
+WHILE i > 3 LOOP
+i:= i - 1;
+SELECT i;
+END LOOP label;
+END;
+END
+/
+i
+4
+i
+3
+# Anonymous blocks with no declarations and no exceptions
+BEGIN
+SELECT 1 AS a;
+END
+$$
+a
+1
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+BEGIN
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(30);
+ROLLBACK;
+END;
+$$
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+BEGIN
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(30);
+END;
+$$
+ROLLBACK;
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+BEGIN
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(30);
+COMMIT;
+END;
+$$
+SELECT * FROM t1;
+a
+10
+20
+30
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+BEGIN
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(30);
+END;
+$$
+COMMIT;
+SELECT * FROM t1;
+a
+10
+20
+30
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+BEGIN
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(20);
+END;
+$$
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+COMMIT;
+SELECT * FROM t1;
+a
+10
+20
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+# Anonymous blocks with no declarations, with exceptions
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+BEGIN
+INSERT INTO t1 VALUES(20);
+INSERT INTO t1 VALUES(20);
+EXCEPTION
+WHEN DUP_VAL_ON_INDEX THEN NULL;
+END;
+$$
+COMMIT;
+SELECT * FROM t1;
+a
+10
+20
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+# Anonymous blocks with declarations, with no exceptions
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DECLARE
+a20 INT:=20;
+a30 INT:=30;
+BEGIN
+INSERT INTO t1 VALUES(a20);
+INSERT INTO t1 VALUES(a30);
+ROLLBACK;
+END;
+$$
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DECLARE
+a20 INT:=20;
+a30 INT:=30;
+BEGIN
+INSERT INTO t1 VALUES(a20);
+INSERT INTO t1 VALUES(a30);
+END;
+$$
+ROLLBACK;
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DECLARE
+a20 INT:=20;
+a30 INT:=30;
+BEGIN
+INSERT INTO t1 VALUES(a20);
+INSERT INTO t1 VALUES(a30);
+COMMIT;
+END;
+$$
+SELECT * FROM t1;
+a
+10
+20
+30
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DECLARE
+a20 INT:=20;
+a30 INT:=30;
+BEGIN
+INSERT INTO t1 VALUES(a20);
+INSERT INTO t1 VALUES(a30);
+END;
+$$
+COMMIT;
+SELECT * FROM t1;
+a
+10
+20
+30
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+# Anonymous blocks with declarations, with exceptions
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DECLARE
+a20 INT:=20;
+BEGIN
+INSERT INTO t1 VALUES(a20);
+INSERT INTO t1 VALUES(a20);
+EXCEPTION
+WHEN DUP_VAL_ON_INDEX THEN NULL;
+END;
+$$
+COMMIT;
+SELECT * FROM t1;
+a
+10
+20
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
diff --git a/mysql-test/suite/compat/oracle/r/sp-code.result b/mysql-test/suite/compat/oracle/r/sp-code.result
new file mode 100644
index 00000000000..1c6aacc8743
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-code.result
@@ -0,0 +1,1489 @@
+SET sql_mode=ORACLE;
+#
+# Testing exceptions in the top-level blocks
+#
+# No HANDLER declarations, no exceptions
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+RETURN 10;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 freturn int 10
+SELECT f1();
+f1()
+10
+DROP FUNCTION f1;
+# No HANDLER declarations, no code, no exceptions
+CREATE PROCEDURE p1 ()
+IS
+BEGIN
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump 2
+CALL p1;
+DROP PROCEDURE p1;
+# No HANDLER declarations, no code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+EXCEPTION
+WHEN 1002 THEN v:=225;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump 1
+1 hpush_jump 4 1 EXIT
+2 set v@0 225
+3 hreturn 0 4
+4 hpop 1
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+@v
+10
+DROP PROCEDURE p1;
+# No HANDLER declarations, some code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=224;
+EXCEPTION
+WHEN 1002 THEN v:=225;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump 3
+1 set v@0 224
+2 jump 6
+3 hpush_jump 1 1 EXIT
+4 set v@0 225
+5 hreturn 0 6
+6 hpop 1
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+@v
+224
+DROP PROCEDURE p1;
+# Some HANDLER declarations, no code, no exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+EXIT HANDLER FOR 1000
+BEGIN
+v:=123;
+END;
+BEGIN
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 hpush_jump 3 1 EXIT
+1 set v@0 123
+2 hreturn 0 3
+3 hpop 1
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+@v
+10
+DROP PROCEDURE p1;
+# Some HANDLER declarations, no code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+EXIT HANDLER FOR 1000
+BEGIN
+v:=123;
+END;
+BEGIN
+EXCEPTION
+WHEN 1002 THEN v:=225;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 hpush_jump 3 1 EXIT
+1 set v@0 123
+2 hreturn 0 6
+3 hpush_jump 6 1 EXIT
+4 set v@0 225
+5 hreturn 0 6
+6 hpop 2
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+@v
+10
+DROP PROCEDURE p1;
+# Some HANDLER declarations, some code, no exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+EXIT HANDLER FOR 1000
+BEGIN
+v:=123;
+END;
+BEGIN
+v:=223;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 hpush_jump 3 1 EXIT
+1 set v@0 123
+2 hreturn 0 4
+3 set v@0 223
+4 hpop 1
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+@v
+223
+DROP PROCEDURE p1;
+# Some HANDLER declarations, some code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT VARCHAR2(20))
+IS
+EXIT HANDLER FOR 1000
+BEGIN
+v:=123;
+END;
+CONTINUE HANDLER FOR 1001
+BEGIN
+SET v=223;
+END;
+BEGIN
+v:= 1;
+EXCEPTION
+WHEN 1002 THEN SET v=225;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 hpush_jump 3 1 EXIT
+1 set v@0 123
+2 hreturn 0 12
+3 hpush_jump 8 1 CONTINUE
+4 set v@0 223
+5 hreturn 1
+6 set v@0 1
+7 jump 12
+8 hpush_jump 6 1 EXIT
+9 set v@0 225
+10 hreturn 0 12
+11 jump 6
+12 hpop 3
+DROP PROCEDURE p1;
+#
+# Testing EXCEPTIONS in internal blocks
+#
+# No HANDLER declarations, no code, no exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+BEGIN
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 jump 5
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+123
+DROP PROCEDURE p1;
+# No HANDLER declarations, no code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+BEGIN
+EXCEPTION
+WHEN 20002 THEN v:=335;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 jump 2
+2 hpush_jump 5 1 EXIT
+3 set v@0 335
+4 hreturn 0 5
+5 hpop 1
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+123
+DROP PROCEDURE p1;
+# No HANDLER declarations, some code, no exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+BEGIN
+v:=223;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 set v@0 223
+2 jump 6
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+223
+DROP PROCEDURE p1;
+# No HANDLER declarations, some code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+BEGIN
+v:=223;
+EXCEPTION
+WHEN 20002 THEN v:=335;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 jump 4
+2 set v@0 223
+3 jump 7
+4 hpush_jump 2 1 EXIT
+5 set v@0 335
+6 hreturn 0 7
+7 hpop 1
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+223
+DROP PROCEDURE p1;
+# Some HANDLER declarations, no code, no exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+DECLARE
+EXIT HANDLER FOR 1000
+BEGIN
+v:=323;
+END;
+BEGIN
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 hpush_jump 4 1 EXIT
+2 set v@0 323
+3 hreturn 0 4
+4 hpop 1
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+123
+DROP PROCEDURE p1;
+# Some HANDLER declarations, no code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+DECLARE
+EXIT HANDLER FOR 1000
+BEGIN
+v:=323;
+END;
+BEGIN
+EXCEPTION
+WHEN 20002 THEN v:=335;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 hpush_jump 4 1 EXIT
+2 set v@0 323
+3 hreturn 0 7
+4 hpush_jump 7 1 EXIT
+5 set v@0 335
+6 hreturn 0 7
+7 hpop 2
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+123
+DROP PROCEDURE p1;
+# Some HANDLER declarations, some code, no exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+DECLARE
+EXIT HANDLER FOR 1000
+BEGIN
+v:=323;
+END;
+BEGIN
+v:= 324;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 hpush_jump 4 1 EXIT
+2 set v@0 323
+3 hreturn 0 5
+4 set v@0 324
+5 hpop 1
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+324
+DROP PROCEDURE p1;
+# Some HANDLER declarations, some code, some exceptions
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+v:=123;
+DECLARE
+EXIT HANDLER FOR 1000
+BEGIN
+v:=323;
+END;
+BEGIN
+v:= 324;
+EXCEPTION WHEN 2002 THEN v:= 325;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v@0 123
+1 hpush_jump 6 1 EXIT
+2 set v@0 323
+3 hreturn 0 9
+4 set v@0 324
+5 jump 9
+6 hpush_jump 4 1 EXIT
+7 set v@0 325
+8 hreturn 0 9
+9 hpop 2
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+324
+DROP PROCEDURE p1;
+#
+# Testing EXIT statement
+#
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+LOOP
+i:= i + 1;
+IF i >= 5 THEN
+EXIT;
+END IF;
+END LOOP;
+RETURN i;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set i@0 0
+1 set i@0 i@0 + 1
+2 jump_if_not 1(1) i@0 >= 5
+3 jump 4
+4 freturn int i@0
+SELECT f1() FROM DUAL;
+f1()
+5
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+LOOP
+i:= i + 1;
+EXIT WHEN i >=5;
+END LOOP;
+RETURN i;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set i@0 0
+1 set i@0 i@0 + 1
+2 jump_if_not 1(0) i@0 >= 5
+3 jump 4
+4 freturn int i@0
+SELECT f1() FROM DUAL;
+f1()
+5
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+LOOP
+BEGIN
+i:= i + 1;
+IF i >= 5 THEN
+EXIT;
+END IF;
+EXCEPTION
+WHEN OTHERS THEN i:= 1000;
+END;
+END LOOP;
+RETURN i;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set i@0 0
+1 jump 5
+2 set i@0 i@0 + 1
+3 jump_if_not 8(8) i@0 >= 5
+4 jump 10
+5 hpush_jump 2 1 EXIT
+6 set i@0 1000
+7 hreturn 0 8
+8 hpop 1
+9 jump 5
+10 freturn int i@0
+SELECT f1() FROM DUAL;
+f1()
+5
+DROP FUNCTION f1;
+CREATE PROCEDURE p1(a IN OUT INT)
+IS
+i INT := 0;
+BEGIN
+LOOP
+LOOP
+BEGIN
+i:= i + 1;
+IF i >=5 THEN
+EXIT;
+END IF;
+EXCEPTION
+WHEN OTHERS THEN a:=1000;
+END;
+END LOOP;
+i:= i + 100;
+EXIT;
+END LOOP;
+a:= i;
+EXCEPTION
+WHEN OTHERS THEN a:=11;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set i@1 0
+1 jump 14
+2 set i@1 i@1 + 1
+3 jump_if_not 8(8) i@1 >= 5
+4 jump 10
+5 hpush_jump 2 2 EXIT
+6 set a@0 1000
+7 hreturn 0 8
+8 hpop 1
+9 jump 5
+10 set i@1 i@1 + 100
+11 jump 12
+12 set a@0 i@1
+13 jump 17
+14 hpush_jump 5 2 EXIT
+15 set a@0 11
+16 hreturn 0 17
+17 hpop 1
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+@v
+105
+DROP PROCEDURE p1;
+# Testing RETURN in procedures
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+IF a < 10 THEN
+BEGIN
+a:= a + 1;
+RETURN;
+END;
+END IF;
+a:= 200;
+EXCEPTION
+WHEN OTHERS THEN
+BEGIN
+a:= 100;
+RETURN;
+END;
+END;
+/
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump 6
+1 jump_if_not 4(4) a@0 < 10
+2 set a@0 a@0 + 1
+3 preturn
+4 set a@0 200
+5 jump 9
+6 hpush_jump 1 1 EXIT
+7 set a@0 100
+8 preturn
+9 hpop 1
+DROP PROCEDURE p1;
+# Testing FOR loop statement
+CREATE FUNCTION f1 (a INT, b INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+FOR i IN 1 .. a
+LOOP
+total:= total + i;
+IF i = b THEN
+EXIT;
+END IF;
+END LOOP;
+RETURN total;
+END
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@2 0
+1 set i@3 1
+2 set [target_bound]@4 a@0
+3 jump_if_not 9(9) i@3 <= [target_bound]@4
+4 set total@2 total@2 + i@3
+5 jump_if_not 7(7) i@3 = b@1
+6 jump 9
+7 set i@3 i@3 + 1
+8 jump 3
+9 freturn int total@2
+SELECT f1(3, 100) FROM DUAL;
+f1(3, 100)
+6
+SELECT f1(3, 2) FROM DUAL;
+f1(3, 2)
+3
+DROP FUNCTION f1;
+CREATE FUNCTION f1 (a INT, b INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+FOR i IN REVERSE 1..a
+LOOP
+total:= total + i;
+IF i = b THEN
+EXIT;
+END IF;
+END LOOP;
+RETURN total;
+END
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@2 0
+1 set i@3 a@0
+2 set [target_bound]@4 1
+3 jump_if_not 9(9) i@3 >= [target_bound]@4
+4 set total@2 total@2 + i@3
+5 jump_if_not 7(7) i@3 = b@1
+6 jump 9
+7 set i@3 i@3 + -1
+8 jump 3
+9 freturn int total@2
+SELECT f1(3, 100) FROM DUAL;
+f1(3, 100)
+6
+SELECT f1(3, 2) FROM DUAL;
+f1(3, 2)
+5
+DROP FUNCTION f1;
+# Testing labeled FOR LOOP statement
+CREATE FUNCTION f1 (a INT, limita INT, b INT, limitb INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+<<la>>
+FOR ia IN 1 .. a
+LOOP
+total:= total + 1000;
+<<lb>>
+FOR ib IN 1 .. b
+LOOP
+total:= total + 1;
+EXIT lb WHEN ib = limitb;
+EXIT la WHEN ia = limita;
+END LOOP lb;
+END LOOP la;
+RETURN total;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@4 0
+1 set ia@5 1
+2 set [target_bound]@6 a@0
+3 jump_if_not 17(17) ia@5 <= [target_bound]@6
+4 set total@4 total@4 + 1000
+5 set ib@7 1
+6 set [target_bound]@8 b@2
+7 jump_if_not 15(15) ib@7 <= [target_bound]@8
+8 set total@4 total@4 + 1
+9 jump_if_not 11(0) ib@7 = limitb@3
+10 jump 15
+11 jump_if_not 13(0) ia@5 = limita@1
+12 jump 17
+13 set ib@7 ib@7 + 1
+14 jump 7
+15 set ia@5 ia@5 + 1
+16 jump 3
+17 freturn int total@4
+SELECT f1(2, 1, 2, 2) FROM DUAL;
+f1(2, 1, 2, 2)
+1001
+SELECT f1(2, 2, 2, 2) FROM DUAL;
+f1(2, 2, 2, 2)
+2003
+SELECT f1(2, 3, 2, 3) FROM DUAL;
+f1(2, 3, 2, 3)
+2004
+DROP FUNCTION f1;
+# Testing labeled ITERATE in a labeled FOR LOOP
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+<<li>>
+FOR i IN 1 .. a
+LOOP
+total:= total + 1000;
+IF i = 5 THEN
+ITERATE li;
+END IF;
+total:= total + 1;
+END LOOP;
+RETURN total;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@1 0
+1 set i@2 1
+2 set [target_bound]@3 a@0
+3 jump_if_not 11(11) i@2 <= [target_bound]@3
+4 set total@1 total@1 + 1000
+5 jump_if_not 8(8) i@2 = 5
+6 set i@2 i@2 + 1
+7 jump 3
+8 set total@1 total@1 + 1
+9 set i@2 i@2 + 1
+10 jump 3
+11 freturn int total@1
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+f1(3) f1(4) f1(5) f1(6)
+3003 4004 5004 6005
+DROP FUNCTION f1;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+<<li>>
+FOR i IN 1 .. a
+LOOP
+FOR j IN 1 .. 2
+LOOP
+total:= total + 1000;
+IF i = 5 THEN
+ITERATE li;
+END IF;
+total:= total + 1;
+END LOOP;
+END LOOP;
+RETURN total;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@1 0
+1 set i@2 1
+2 set [target_bound]@3 a@0
+3 jump_if_not 16(16) i@2 <= [target_bound]@3
+4 set j@4 1
+5 set [target_bound]@5 2
+6 jump_if_not 14(14) j@4 <= [target_bound]@5
+7 set total@1 total@1 + 1000
+8 jump_if_not 11(11) i@2 = 5
+9 set i@2 i@2 + 1
+10 jump 3
+11 set total@1 total@1 + 1
+12 set j@4 j@4 + 1
+13 jump 6
+14 set i@2 i@2 + 1
+15 jump 3
+16 freturn int total@1
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+f1(3) f1(4) f1(5) f1(6)
+6006 8008 9008 11010
+DROP FUNCTION f1;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+<<lj>>
+FOR j IN 1 .. 2
+LOOP
+<<li>>
+FOR i IN 1 .. a
+LOOP
+total:= total + 1000;
+IF i = 5 THEN
+ITERATE li;
+END IF;
+total:= total + 1;
+END LOOP;
+END LOOP;
+RETURN total;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@1 0
+1 set j@2 1
+2 set [target_bound]@3 2
+3 jump_if_not 16(16) j@2 <= [target_bound]@3
+4 set i@4 1
+5 set [target_bound]@5 a@0
+6 jump_if_not 14(14) i@4 <= [target_bound]@5
+7 set total@1 total@1 + 1000
+8 jump_if_not 11(11) i@4 = 5
+9 set i@4 i@4 + 1
+10 jump 6
+11 set total@1 total@1 + 1
+12 set i@4 i@4 + 1
+13 jump 6
+14 set j@2 j@2 + 1
+15 jump 3
+16 freturn int total@1
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+f1(3) f1(4) f1(5) f1(6)
+6006 8008 10008 12010
+DROP FUNCTION f1;
+# Testing CONTINUE statement
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+FOR i IN 1 .. a
+LOOP
+CONTINUE WHEN i=5;
+total:= total + 1;
+END LOOP;
+RETURN total;
+END;
+/
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set total@1 0
+1 set i@2 1
+2 set [target_bound]@3 a@0
+3 jump_if_not 10(10) i@2 <= [target_bound]@3
+4 jump_if_not 7(0) i@2 = 5
+5 set i@2 i@2 + 1
+6 jump 3
+7 set total@1 total@1 + 1
+8 set i@2 i@2 + 1
+9 jump 3
+10 freturn int total@1
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+f1(3) f1(4) f1(5) f1(6)
+3 4 4 5
+DROP FUNCTION f1;
+#
+# Start of MDEV-10597 Cursors with parameters
+#
+CREATE PROCEDURE p1(arg_value_a VARCHAR, arg_value_b VARCHAR,
+arg_pattern_a VARCHAR, arg_pattern_b VARCHAR)
+AS
+v_a VARCHAR(10);
+v_b VARCHAR(20);
+CURSOR c (p_value_a VARCHAR,
+p_value_b VARCHAR,
+p_pattern_a VARCHAR,
+p_pattern_b VARCHAR,
+p_limit_a INT,
+p_limit_b INT,
+p_unused TEXT) IS
+(SELECT p_value_a, p_value_b FROM DUAL
+WHERE p_value_a LIKE p_pattern_a LIMIT p_limit_a)
+UNION
+(SELECT p_value_b, p_value_a FROM DUAL
+WHERE p_value_b LIKE p_pattern_b LIMIT p_limit_b);
+BEGIN
+OPEN c(arg_value_a, (SELECT arg_value_b),
+arg_pattern_a, arg_pattern_b, 100, 101, 'x');
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+SELECT v_a, v_b;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1('aaa','bbb','aaa','bbb');
+v_a v_b
+aaa bbb
+v_a v_b
+bbb aaa
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set v_a@4 NULL
+1 set v_b@5 NULL
+2 cpush c@0
+3 set p_value_a@6 arg_value_a@0
+4 set p_value_b@7 (select arg_value_b@1)
+5 set p_pattern_a@8 arg_pattern_a@2
+6 set p_pattern_b@9 arg_pattern_b@3
+7 set p_limit_a@10 100
+8 set p_limit_b@11 101
+9 set p_unused@12 'x'
+10 copen c@0
+11 cfetch c@0 v_a@4 v_b@5
+12 jump_if_not 14(0) "c"%NOTFOUND
+13 jump 16
+14 stmt 0 "SELECT v_a, v_b"
+15 jump 11
+16 cclose c@0
+17 cpop 1
+DROP PROCEDURE p1;
+#
+# End of MDEV-10597 Cursors with parameters
+#
+#
+# MDEV-10914 ROW data type for stored routine variables
+#
+CREATE FUNCTION f1() RETURN INT
+AS
+a ROW(a INT, b INT);
+BEGIN
+a.b:= 200;
+RETURN a.b;
+END;
+$$
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 set a@0 NULL
+1 set a.b@0[1] 200
+2 freturn int a.b@0[1]
+SELECT f1();
+f1()
+200
+DROP FUNCTION f1;
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10));
+BEGIN
+rec:= ROW(10,20.123456,30.123,'test');
+SELECT rec.a, rec.b, rec.c, rec.d;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set rec@0 NULL
+1 set rec@0 (10,20.123456,30.123,'test')
+2 stmt 0 "SELECT rec.a, rec.b, rec.c, rec.d"
+CALL p1;
+rec.a rec.b rec.c rec.d
+10 20.123456 30.123 test
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10)) :=
+ROW(10,20.123456,30.123,'test');
+BEGIN
+SELECT rec.a, rec.b, rec.c, rec.d;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set rec@0 (10,20.123456,30.123,'test')
+1 stmt 0 "SELECT rec.a, rec.b, rec.c, rec.d"
+CALL p1;
+rec.a rec.b rec.c rec.d
+10 20.123456 30.123 test
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+rec1 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10));
+rec2 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10));
+BEGIN
+rec1:= ROW(10,20.123456,30.123,'test');
+rec2:= rec1;
+SELECT rec2.a, rec2.b, rec2.c, rec2.d;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set rec1@0 NULL
+1 set rec2@1 NULL
+2 set rec1@0 (10,20.123456,30.123,'test')
+3 set rec2@1 rec1@0
+4 stmt 0 "SELECT rec2.a, rec2.b, rec2.c, rec2.d"
+CALL p1;
+rec2.a rec2.b rec2.c rec2.d
+10 20.123456 30.123 test
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+rec1 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10)) :=
+ROW(10,20.123456,30.123,'test');
+rec2 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10)) := rec1;
+BEGIN
+SELECT rec2.a, rec2.b, rec2.c, rec2.d;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set rec1@0 (10,20.123456,30.123,'test')
+1 set rec2@1 rec1@0
+2 stmt 0 "SELECT rec2.a, rec2.b, rec2.c, rec2.d"
+CALL p1;
+rec2.a rec2.b rec2.c rec2.d
+10 20.123456 30.123 test
+DROP PROCEDURE p1;
+#
+# End of MDEV-10914 ROW data type for stored routine variables
+#
+#
+# MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+rec1.b:= 'bbb';
+rec1.c:= 10e2;
+rec1.d:= 10.12;
+rec1.c:= rec1.d;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set rec1@0 NULL
+1 set rec1.a@0["a"] 10
+2 set rec1.b@0["b"] 'bbb'
+3 set rec1.c@0["c"] 10e2
+4 set rec1.d@0["d"] 10.12
+5 set rec1.c@0["c"] rec1.d@0["d"]
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1,rec2 cur1%ROWTYPE;
+rec3 cur2%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+rec1.b:= 'bbb';
+END;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 cpush cur1@0
+1 cpush cur2@1
+2 cursor_copy_struct cur1 rec1@0
+3 cursor_copy_struct cur1 rec2@1
+4 set rec1@0 NULL
+5 set rec2@1 NULL
+6 cursor_copy_struct cur2 rec3@2
+7 set rec3@2 NULL
+8 set rec1.a@0["a"] 10
+9 set rec1.b@0["b"] 'bbb'
+10 jump 11
+11 cpop 2
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP
+#
+CREATE PROCEDURE p1
+AS
+CURSOR cur0 IS SELECT 10 AS a, 'b0' AS b;
+CURSOR cur1 IS SELECT 10 AS a, 'b0' AS b;
+CURSOR cur2 IS SELECT 10 AS a, 'b0' AS b;
+BEGIN
+FOR rec1 IN cur1
+LOOP
+SELECT rec1.a, rec1.b;
+rec1.a:= 11;
+rec1.b:= 'b1';
+SELECT rec1.a, rec1.b;
+END LOOP;
+FOR rec0 IN cur0
+LOOP
+rec0.a:= 10;
+rec0.b:='b0';
+END LOOP;
+FOR rec2 IN cur2
+LOOP
+rec2.a:= 10;
+rec2.b:='b0';
+END LOOP;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 cpush cur0@0
+1 cpush cur1@1
+2 cpush cur2@2
+3 cursor_copy_struct cur1 rec1@0
+4 copen cur1@1
+5 cfetch cur1@1 rec1@0
+6 jump_if_not 13(13) "cur1"%FOUND
+7 stmt 0 "SELECT rec1.a, rec1.b"
+8 set rec1.a@0["a"] 11
+9 set rec1.b@0["b"] 'b1'
+10 stmt 0 "SELECT rec1.a, rec1.b"
+11 cfetch cur1@1 rec1@0
+12 jump 6
+13 cclose cur1@1
+14 cursor_copy_struct cur0 rec0@1
+15 copen cur0@0
+16 cfetch cur0@0 rec0@1
+17 jump_if_not 22(22) "cur0"%FOUND
+18 set rec0.a@1["a"] 10
+19 set rec0.b@1["b"] 'b0'
+20 cfetch cur0@0 rec0@1
+21 jump 17
+22 cclose cur0@0
+23 cursor_copy_struct cur2 rec2@2
+24 copen cur2@2
+25 cfetch cur2@2 rec2@2
+26 jump_if_not 31(31) "cur2"%FOUND
+27 set rec2.a@2["a"] 10
+28 set rec2.b@2["b"] 'b0'
+29 cfetch cur2@2 rec2@2
+30 jump 26
+31 cclose cur2@2
+32 cpop 3
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+CURSOR cur0 IS SELECT 10 AS a, 'b0' AS b;
+BEGIN
+FOR rec0 IN cur0
+LOOP
+DECLARE
+CURSOR cur1 IS SELECT 11 AS a, 'b1' AS b;
+BEGIN
+rec0.a:= 11;
+rec0.b:= 'b0';
+FOR rec1 IN cur1
+LOOP
+rec1.a:= 11;
+rec1.b:= 'b1';
+DECLARE
+CURSOR cur2 IS SELECT 12 AS a, 'b2' AS b;
+BEGIN
+FOR rec2 IN cur2
+LOOP
+rec2.a:=12;
+rec2.b:='b2';
+END LOOP;
+END;
+END LOOP;
+END;
+END LOOP;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 cpush cur0@0
+1 cursor_copy_struct cur0 rec0@0
+2 copen cur0@0
+3 cfetch cur0@0 rec0@0
+4 jump_if_not 31(31) "cur0"%FOUND
+5 cpush cur1@1
+6 set rec0.a@0["a"] 11
+7 set rec0.b@0["b"] 'b0'
+8 cursor_copy_struct cur1 rec1@1
+9 copen cur1@1
+10 cfetch cur1@1 rec1@1
+11 jump_if_not 27(27) "cur1"%FOUND
+12 set rec1.a@1["a"] 11
+13 set rec1.b@1["b"] 'b1'
+14 cpush cur2@2
+15 cursor_copy_struct cur2 rec2@2
+16 copen cur2@2
+17 cfetch cur2@2 rec2@2
+18 jump_if_not 23(23) "cur2"%FOUND
+19 set rec2.a@2["a"] 12
+20 set rec2.b@2["b"] 'b2'
+21 cfetch cur2@2 rec2@2
+22 jump 18
+23 cclose cur2@2
+24 cpop 1
+25 cfetch cur1@1 rec1@1
+26 jump 11
+27 cclose cur1@1
+28 cpop 1
+29 cfetch cur0@0 rec0@0
+30 jump 4
+31 cclose cur0@0
+32 cpop 1
+DROP PROCEDURE p1;
+#
+# MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+FOR rec1 IN (SELECT 11 AS a, 'b1' AS b)
+LOOP
+SELECT rec1.a, rec1.b;
+rec1.a:= 11;
+rec1.b:= 'b1';
+SELECT rec1.a, rec1.b;
+END LOOP;
+FOR rec0 IN (SELECT 10 AS a, 'b0' AS b)
+LOOP
+rec0.a:= 10;
+rec0.b:='b0';
+END LOOP;
+FOR rec2 IN (SELECT 12 AS a, 'b2' AS b)
+LOOP
+rec2.a:= 10;
+rec2.b:='b0';
+END LOOP;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 cpush [implicit_cursor]@0
+1 cursor_copy_struct [implicit_cursor] rec1@0
+2 copen [implicit_cursor]@0
+3 cfetch [implicit_cursor]@0 rec1@0
+4 jump_if_not 11(11) "[implicit_cursor]"%FOUND
+5 stmt 0 "SELECT rec1.a, rec1.b"
+6 set rec1.a@0["a"] 11
+7 set rec1.b@0["b"] 'b1'
+8 stmt 0 "SELECT rec1.a, rec1.b"
+9 cfetch [implicit_cursor]@0 rec1@0
+10 jump 4
+11 cpop 1
+12 cpush [implicit_cursor]@0
+13 cursor_copy_struct [implicit_cursor] rec0@1
+14 copen [implicit_cursor]@0
+15 cfetch [implicit_cursor]@0 rec0@1
+16 jump_if_not 21(21) "[implicit_cursor]"%FOUND
+17 set rec0.a@1["a"] 10
+18 set rec0.b@1["b"] 'b0'
+19 cfetch [implicit_cursor]@0 rec0@1
+20 jump 16
+21 cpop 1
+22 cpush [implicit_cursor]@0
+23 cursor_copy_struct [implicit_cursor] rec2@2
+24 copen [implicit_cursor]@0
+25 cfetch [implicit_cursor]@0 rec2@2
+26 jump_if_not 31(31) "[implicit_cursor]"%FOUND
+27 set rec2.a@2["a"] 10
+28 set rec2.b@2["b"] 'b0'
+29 cfetch [implicit_cursor]@0 rec2@2
+30 jump 26
+31 cpop 1
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+FOR rec0 IN (SELECT 10 AS a, 'b0' AS b)
+LOOP
+rec0.a:= 11;
+rec0.b:= 'b0';
+FOR rec1 IN (SELECT 11 AS a, 'b1' AS b)
+LOOP
+rec1.a:= 11;
+rec1.b:= 'b1';
+FOR rec2 IN (SELECT 12 AS a, 'b2' AS b)
+LOOP
+rec2.a:=12;
+rec2.b:='b2';
+END LOOP;
+END LOOP;
+END LOOP;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 cpush [implicit_cursor]@0
+1 cursor_copy_struct [implicit_cursor] rec0@0
+2 copen [implicit_cursor]@0
+3 cfetch [implicit_cursor]@0 rec0@0
+4 jump_if_not 29(29) "[implicit_cursor]"%FOUND
+5 set rec0.a@0["a"] 11
+6 set rec0.b@0["b"] 'b0'
+7 cpush [implicit_cursor]@1
+8 cursor_copy_struct [implicit_cursor] rec1@1
+9 copen [implicit_cursor]@1
+10 cfetch [implicit_cursor]@1 rec1@1
+11 jump_if_not 26(26) "[implicit_cursor]"%FOUND
+12 set rec1.a@1["a"] 11
+13 set rec1.b@1["b"] 'b1'
+14 cpush [implicit_cursor]@2
+15 cursor_copy_struct [implicit_cursor] rec2@2
+16 copen [implicit_cursor]@2
+17 cfetch [implicit_cursor]@2 rec2@2
+18 jump_if_not 23(23) "[implicit_cursor]"%FOUND
+19 set rec2.a@2["a"] 12
+20 set rec2.b@2["b"] 'b2'
+21 cfetch [implicit_cursor]@2 rec2@2
+22 jump 18
+23 cpop 1
+24 cfetch [implicit_cursor]@1 rec1@1
+25 jump 11
+26 cpop 1
+27 cfetch [implicit_cursor]@0 rec0@0
+28 jump 4
+29 cpop 1
+DROP PROCEDURE p1;
+#
+# MDEV-10598 sql_mode=ORACLE: Variable declarations can go after cursor declarations
+#
+#
+# Cursor declaration and cursor%ROWTYPE declaration in the same block
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'a');
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT a FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 cursor_copy_struct cur1 rec1@0
+1 set rec1@0 NULL
+2 cpush cur1@0
+3 set rec1.a@0["a"] 10
+4 cpop 1
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Recursive cursor and cursor%ROWTYPE declarations in the same block
+#
+CREATE PROCEDURE p1
+AS
+a INT:=10;
+CURSOR cur1 IS SELECT a;
+rec1 cur1%ROWTYPE;
+CURSOR cur2 IS SELECT rec1.a + 1 "a";
+rec2 cur2%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec1;
+CLOSE cur1;
+SELECT rec1.a;
+open cur2;
+FETCH cur2 INTO rec2;
+CLOSE cur2;
+SELECT rec2.a;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set a@0 10
+1 cursor_copy_struct cur1 rec1@1
+2 set rec1@1 NULL
+3 cursor_copy_struct cur2 rec2@2
+4 set rec2@2 NULL
+5 cpush cur1@0
+6 cpush cur2@1
+7 copen cur1@0
+8 cfetch cur1@0 rec1@1
+9 cclose cur1@0
+10 stmt 0 "SELECT rec1.a"
+11 copen cur2@1
+12 cfetch cur2@1 rec2@2
+13 cclose cur2@1
+14 stmt 0 "SELECT rec2.a"
+15 cpop 2
+CALL p1();
+rec1.a
+10
+rec2.a
+11
+DROP PROCEDURE p1;
+#
+# MDEV-12441 Variables declared after cursors with parameters lose values
+#
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 INT:=101;
+BEGIN
+OPEN cur(10,11);
+CLOSE cur;
+SELECT x0, x1;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set x0@0 100
+1 set x1@3 101
+2 cpush cur@0
+3 set cp1@1 10
+4 set cp2@2 11
+5 copen cur@0
+6 cclose cur@0
+7 stmt 0 "SELECT x0, x1"
+8 cpop 1
+CALL p1();
+x0 x1
+100 101
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur0(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 INT:=101;
+CURSOR cur1(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x2 INT:=102;
+CURSOR cur2(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x3 INT:=103;
+BEGIN
+OPEN cur0(0,1);
+CLOSE cur0;
+SELECT x0, x1, x2, x3;
+OPEN cur1(10,11);
+CLOSE cur1;
+SELECT x0, x1, x2, x3;
+OPEN cur2(20,21);
+CLOSE cur2;
+SELECT x0, x1, x2, x3;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set x0@0 100
+1 set x1@3 101
+2 set x2@6 102
+3 set x3@9 103
+4 cpush cur0@0
+5 cpush cur1@1
+6 cpush cur2@2
+7 set cp1@1 0
+8 set cp2@2 1
+9 copen cur0@0
+10 cclose cur0@0
+11 stmt 0 "SELECT x0, x1, x2, x3"
+12 set cp1@4 10
+13 set cp2@5 11
+14 copen cur1@1
+15 cclose cur1@1
+16 stmt 0 "SELECT x0, x1, x2, x3"
+17 set cp1@7 20
+18 set cp2@8 21
+19 copen cur2@2
+20 cclose cur2@2
+21 stmt 0 "SELECT x0, x1, x2, x3"
+22 cpop 3
+CALL p1();
+x0 x1 x2 x3
+100 101 102 103
+x0 x1 x2 x3
+100 101 102 103
+x0 x1 x2 x3
+100 101 102 103
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 t1.a%TYPE:=101;
+BEGIN
+OPEN cur(10,11);
+CLOSE cur;
+SELECT x0, x1;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set x0@0 100
+1 set x1@3 101
+2 cpush cur@0
+3 set cp1@1 10
+4 set cp2@2 11
+5 copen cur@0
+6 cclose cur@0
+7 stmt 0 "SELECT x0, x1"
+8 cpop 1
+CALL p1();
+x0 x1
+100 101
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 ROW(a INT,b INT):=ROW(101,102);
+BEGIN
+OPEN cur(10,11);
+CLOSE cur;
+SELECT x0, x1.a, x1.b;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set x0@0 100
+1 set x1@3 (101,102)
+2 cpush cur@0
+3 set cp1@1 10
+4 set cp2@2 11
+5 copen cur@0
+6 cclose cur@0
+7 stmt 0 "SELECT x0, x1.a, x1.b"
+8 cpop 1
+CALL p1();
+x0 x1.a x1.b
+100 101 102
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result b/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result
new file mode 100644
index 00000000000..275e575620b
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result
@@ -0,0 +1,290 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10598 sql_mode=ORACLE: Variable declarations can go after cursor declarations
+#
+#
+# Variable after cursor declaration
+#
+CREATE TABLE t1 (a INT);
+insert into t1 values (1);
+insert into t1 values (2);
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT a FROM t1;
+var1 varchar(10);
+BEGIN
+OPEN c;
+fetch c into var1;
+SELECT c%ROWCOUNT,var1;
+close c;
+END;
+$$
+CALL p1;
+c%ROWCOUNT var1
+1 1
+DROP PROCEDURE p1;
+drop table t1;
+#
+# Variable after condition declaration
+#
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+CREATE PROCEDURE p1
+AS
+dup_key CONDITION FOR SQLSTATE '23000';
+var1 varchar(40);
+CONTINUE HANDLER FOR dup_key
+BEGIN
+var1:='duplicate key in index';
+END;
+BEGIN
+var1:='';
+insert into t1 values (1);
+select var1;
+END;
+$$
+CALL p1;
+var1
+duplicate key in index
+DROP PROCEDURE p1;
+drop table t1;
+#
+# Condition after cursor declaration
+#
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+CREATE PROCEDURE p1
+AS
+var1 varchar(40);
+var2 integer;
+CURSOR c IS SELECT col1 FROM t1;
+dup_key CONDITION FOR SQLSTATE '23000';
+CONTINUE HANDLER FOR dup_key
+BEGIN
+var1:='duplicate key in index';
+END;
+BEGIN
+var1:='';
+insert into t1 values (1);
+SELECT var1;
+END;
+$$
+CALL p1;
+var1
+duplicate key in index
+DROP PROCEDURE p1;
+drop table t1;
+#
+# Cursor after handler declaration
+#
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+CREATE PROCEDURE p1
+AS
+var1 varchar(40);
+var2 integer;
+dup_key CONDITION FOR SQLSTATE '23000';
+CONTINUE HANDLER FOR dup_key
+BEGIN
+var1:='duplicate key in index';
+END;
+CURSOR c IS SELECT col1 FROM t1;
+BEGIN
+var1:='';
+insert into t1 values (1);
+SELECT var1;
+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 'CURSOR c IS SELECT col1 FROM t1;
+BEGIN
+var1:='';
+insert into t1 values (1);
+S...' at line 10
+drop table t1;
+#
+# Condition after handler declaration
+#
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+CREATE PROCEDURE p1
+AS
+var1 varchar(40);
+var2 integer;
+dup_key CONDITION FOR SQLSTATE '23000';
+CURSOR c IS SELECT col1 FROM t1;
+CONTINUE HANDLER FOR dup_key
+BEGIN
+var1:='duplicate key in index';
+END;
+divide_by_zero CONDITION FOR SQLSTATE '22012';
+BEGIN
+var1:='';
+insert into t1 values (1);
+SELECT var1;
+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 'divide_by_zero CONDITION FOR SQLSTATE '22012';
+BEGIN
+var1:='';
+insert into t1...' at line 11
+drop table t1;
+#
+# Variable after handler declaration
+#
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+CREATE PROCEDURE p1
+AS
+var1 varchar(40);
+var2 integer;
+dup_key CONDITION FOR SQLSTATE '23000';
+CURSOR c IS SELECT col1 FROM t1;
+CONTINUE HANDLER FOR dup_key
+BEGIN
+var1:='duplicate key in index';
+END;
+divide_by_zero CONDITION FOR SQLSTATE '22012';
+BEGIN
+var1:='';
+insert into t1 values (1);
+SELECT var1;
+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 'divide_by_zero CONDITION FOR SQLSTATE '22012';
+BEGIN
+var1:='';
+insert into t1...' at line 11
+drop table t1;
+#
+# Variable after cursor (inner block)
+#
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+insert into t1 values (2);
+create unique index t1_col1 on t1 (col1);
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT col1 FROM t1;
+var1 varchar(40);
+BEGIN
+OPEN c;
+begin
+declare
+CURSOR c IS SELECT col1 FROM t1 where col1=2;
+var2 integer;
+dup_key CONDITION FOR SQLSTATE '23000';
+CONTINUE HANDLER FOR dup_key
+BEGIN
+var1:='duplicate key in index';
+END;
+begin
+OPEN c;
+fetch c into var1;
+SELECT 'inner cursor',var1;
+insert into t1 values (2);
+close c;
+end;
+end;
+SELECT var1;
+fetch c into var1;
+SELECT c%ROWCOUNT,var1;
+begin
+insert into t1 values (2);
+exception when 1062 then
+begin
+SELECT 'dup key caugth';
+end;
+end;
+close c;
+END;
+$$
+CALL p1;
+inner cursor var1
+inner cursor 2
+var1
+duplicate key in index
+c%ROWCOUNT var1
+1 1
+dup key caugth
+dup key caugth
+DROP PROCEDURE p1;
+drop table t1;
+#
+# Cursor declaration and row type declaration in same block
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+insert into t1 values(1,'a');
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT a FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+END;
+$$
+call p1;
+DROP PROCEDURE p1;
+drop table t1;
+#
+# Recursive cursor and cursor%ROWTYPE declarations in the same block
+#
+CREATE PROCEDURE p1
+AS
+a INT:=10;
+b VARCHAR(10):='b0';
+c DOUBLE:=0.1;
+CURSOR cur1 IS SELECT a, b, c;
+rec1 cur1%ROWTYPE;
+CURSOR cur2 IS SELECT rec1.a + 1 "a", rec1.b||'0' AS b, rec1.c AS c;
+rec2 cur2%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec1;
+CLOSE cur1;
+SELECT rec1.a;
+OPEN cur2;
+FETCH cur2 INTO rec2;
+CLOSE cur2;
+SELECT rec2.a;
+CREATE TABLE t2 AS SELECT rec2.a AS a, rec2.b AS b, rec2.c AS c;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+rec1.a
+10
+rec2.a
+11
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" bigint(20) DEFAULT NULL,
+ "b" varchar(11) DEFAULT NULL,
+ "c" double DEFAULT NULL
+)
+DROP PROCEDURE p1;
+#
+# MDEV-12916 Wrong column data type for an INT field of a cursor-anchored ROW variable
+#
+CREATE PROCEDURE p1
+AS
+a INT DEFAULT 10;
+CURSOR cur1 IS SELECT a;
+rec1 cur1%ROWTYPE;
+BEGIN
+CREATE TABLE t1 AS SELECT rec1.a;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+END;
+$$
+CALL p1();
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "rec1.a" int(11) DEFAULT NULL
+)
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
new file mode 100644
index 00000000000..a60bbc38883
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
@@ -0,0 +1,1506 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations
+#
+#
+# A complete working example
+#
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'b10');
+INSERT INTO t1 VALUES (20,'b20');
+INSERT INTO t1 VALUES (30,'b30');
+CREATE PROCEDURE p1 AS
+CURSOR c IS SELECT a,b FROM t1;
+BEGIN
+DECLARE
+rec c%ROWTYPE;
+BEGIN
+OPEN c;
+LOOP
+FETCH c INTO rec;
+EXIT WHEN c%NOTFOUND;
+SELECT 'rec=(' || rec.a ||','|| rec.b||')' AS c FROM dual;
+INSERT INTO t2 VALUES (rec.a, rec.b);
+END LOOP;
+CLOSE c;
+END;
+END;
+$$
+CALL p1();
+c
+rec=(10,b10)
+c
+rec=(20,b20)
+c
+rec=(30,b30)
+SELECT * FROM t2;
+a b
+10 b10
+20 b20
+30 b30
+DROP PROCEDURE p1;
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# cursor%ROWTYPE referring to a table in a non-existing database
+#
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM tes2.t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+NULL;
+END;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'tes2.t1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+ERROR 42S02: Table 'tes2.t1' doesn't exist
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# cursor%ROWTYPE referring to a table in the current database
+#
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP TABLE t1;
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+DROP PROCEDURE p1;
+#
+# cursor%ROWTYPE referring to a table in an explicitly specified database
+#
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM test.t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Cursor%ROWTYPE referring to a view in the current database
+#
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM v1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.v1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# cursor%ROWTYPE referring to a view in an explicitly specified database
+#
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM test.v1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.v1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Checking that all cursor%ROWTYPE fields are NULL by default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+BEGIN
+SELECT rec1.a, rec1.b, rec1.c, rec1.d;
+END;
+END;
+$$
+CALL p1();
+rec1.a rec1.b rec1.c rec1.d
+NULL NULL NULL NULL
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A cursor%ROWTYPE variable with a ROW expression as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE := ROW(10,'bbb');
+BEGIN
+SELECT rec1.a, rec1.b;
+END;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 bbb
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A cursor%ROWTYPE variable with an incompatible ROW expression as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE := ROW(10,'bbb','ccc');
+BEGIN
+SELECT rec1.a, rec1.b;
+END;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A cursor%ROWTYPE variable with a ROW variable as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 ROW(a INT, b VARCHAR(10)):= ROW(10,'bbb');
+rec2 cur%ROWTYPE := rec1;
+BEGIN
+SELECT rec2.a, rec2.b;
+END;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+10 bbb
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A ROW variable using a cursor%ROWTYPE variable as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE := ROW(10,'bbb');
+rec2 ROW(a INT, b VARCHAR(10)):= rec1;
+BEGIN
+SELECT rec2.a, rec2.b;
+END;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+10 bbb
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning cursor%ROWTYPE variables with a different column count
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE);
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+rec2 cur2%ROWTYPE;
+BEGIN
+rec2:=rec1;
+END;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+rec2 cur2%ROWTYPE;
+BEGIN
+rec1:=rec2;
+END;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 3 column(s)
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning compatible cursor%ROWTYPE variables (equal number of fields)
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+rec2 cur2%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+rec1.b:= 'bbb';
+rec2:=rec1;
+SELECT rec2.x, rec2.y;
+END;
+END;
+$$
+CALL p1();
+rec2.x rec2.y
+10 bbb
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning between incompatible cursor%ROWTYPE and explicit ROW variables
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+rec2 ROW(x INT,y INT,z INT);
+BEGIN
+rec2.x:= 10;
+rec2.y:= 20;
+rec2.z:= 30;
+rec1:= rec2;
+END;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning between compatible cursor%ROWTYPE and explicit ROW variables
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+rec2 ROW(x INT,y INT);
+BEGIN
+rec2.x:= 10;
+rec2.y:= 20;
+rec1:= rec2;
+SELECT rec1.a, rec1.b;
+rec1.a:= 11;
+rec1.b:= 21;
+rec2:= rec1;
+SELECT rec2.x, rec2.y;
+END;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 20
+rec2.x rec2.y
+11 21
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning cursor%ROWTYPE from a ROW expression
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+BEGIN
+rec1:= ROW(10,20);
+SELECT rec1.a, rec1.b;
+END;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 20
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a cursor%ROWTYPE variable with a wrong field count
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+DECLARE
+rec2 cur2%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec2;
+CLOSE cur1;
+END;
+END;
+$$
+CALL p1();
+ERROR HY000: Incorrect number of FETCH variables
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a cursor%ROWTYPE variable
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+INSERT INTO t1 VALUES (20,'bb2',222.222e2, 12.32);
+INSERT INTO t1 VALUES (30,'bb3',333.333e2, 12.33);
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+OPEN cur;
+LOOP
+FETCH cur INTO rec;
+EXIT WHEN cur%NOTFOUND;
+SELECT rec.a, rec.b, rec.c, rec.d;
+INSERT INTO t2 VALUES (rec.a, rec.b, rec.c, rec.d);
+END LOOP;
+CLOSE cur;
+END;
+END;
+$$
+CALL p1();
+rec.a rec.b rec.c rec.d
+10 bb1 11111.1 12.31
+rec.a rec.b rec.c rec.d
+20 bb2 22222.2 12.32
+rec.a rec.b rec.c rec.d
+30 bb3 33333.3 12.33
+SELECT * FROM t2;
+a b c d
+10 bb1 11111.1 12.31
+20 bb2 22222.2 12.32
+30 bb3 33333.3 12.33
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a cursor%ROWTYPE variable, cur%ROWTYPE declared inside the LOOP
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+INSERT INTO t1 VALUES (20,'bb2',222.222e2, 12.32);
+INSERT INTO t1 VALUES (30,'bb3',333.333e2, 12.33);
+CREATE PROCEDURE p1()
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+OPEN cur;
+LOOP
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+FETCH cur INTO rec;
+EXIT WHEN cur%NOTFOUND;
+SELECT rec.a, rec.b, rec.c, rec.d;
+INSERT INTO t2 VALUES (rec.a, rec.b, rec.c, rec.d);
+END;
+END LOOP;
+CLOSE cur;
+END;
+$$
+CALL p1();
+rec.a rec.b rec.c rec.d
+10 bb1 11111.1 12.31
+rec.a rec.b rec.c rec.d
+20 bb2 22222.2 12.32
+rec.a rec.b rec.c rec.d
+30 bb3 33333.3 12.33
+SELECT * FROM t2;
+a b c d
+10 bb1 11111.1 12.31
+20 bb2 22222.2 12.32
+30 bb3 33333.3 12.33
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a cursor%ROWTYPE variable with different column names
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bbb');
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+DECLARE
+rec2 cur2%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec2;
+SELECT rec2.x, rec2.y;
+CLOSE cur1;
+END;
+END;
+$$
+CALL p1();
+rec2.x rec2.y
+10 bbb
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a cursor%ROWTYPE variable, with truncation
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t1 VALUES (10,'11x');
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+DECLARE
+rec2 cur2%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec2;
+SELECT rec2.a, rec2.b;
+CLOSE cur1;
+END;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+10 11
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# cursor%ROWTYPE variables are not allowed in LIMIT
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2);
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE:=(1,2);
+BEGIN
+SELECT * FROM t1 LIMIT rec1.a;
+END;
+END;
+$$
+ERROR HY000: A variable of a non-integer based type in LIMIT clause
+DROP TABLE t1;
+#
+# cursor%ROWTYPE variable fields as OUT parameters
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a OUT INT,b OUT VARCHAR(10))
+AS
+BEGIN
+a:=10;
+b:='bb';
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+BEGIN
+CALL p1(rec1.a, rec1.b);
+SELECT rec1.a, rec1.b;
+END;
+END;
+$$
+CALL p2();
+rec1.a rec1.b
+10 bb
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Passing the entire cursor%ROWTYPE variable
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+SELECT a.a, a.b;
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur%ROWTYPE:= ROW(10,'bb');
+BEGIN
+CALL p1(rec1);
+END;
+END;
+$$
+CALL p2();
+a.a a.b
+10 bb
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Passing the entire cursor%ROWTYPE variable as an OUT parameter
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a OUT ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+a:= ROW(10,'bb');
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec1 cur%ROWTYPE;
+BEGIN
+CALL p1(rec1);
+SELECT rec1.a, rec1.b;
+END;
+END;
+$$
+CALL p2();
+rec1.a rec1.b
+10 bb
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Assigning a cursor%ROWTYPE field to an OUT parameter
+#
+CREATE PROCEDURE p1 (res IN OUT INTEGER)
+AS
+a INT:=10;
+CURSOR cur1 IS SELECT a FROM DUAL;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec1;
+CLOSE cur1;
+res:=rec1.a;
+END;
+END;
+$$
+CALL p1(@res);
+SELECT @res;
+@res
+10
+SET @res=NULL;
+DROP PROCEDURE p1;
+#
+# Testing Item_splocal_row_field_by_name::print
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+EXPLAIN EXTENDED SELECT rec.a, rec.b;
+END;
+END;
+$$
+CALL p1();
+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 rec.a@0["a"] AS "rec.a",rec.b@0["b"] AS "rec.b"
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Run time error in the cursor statement
+#
+CREATE PROCEDURE p1
+AS
+CURSOR cur1 IS SELECT
+10 AS a,
+CONCAT(_latin1'a' COLLATE latin1_bin,
+_latin1'a' COLLATE latin1_swedish_ci) AS b;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec1;
+CLOSE cur1;
+SELECT a,b;
+END;
+END;
+$$
+CALL p1();
+ERROR HY000: Illegal mix of collations (latin1_bin,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat_operator_oracle'
+DROP PROCEDURE p1;
+#
+# Non-existing field
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur1%ROWTYPE;
+BEGIN
+SELECT rec.c;
+END;
+END;
+$$
+CALL p1();
+ERROR HY000: Row variable 'rec' does not have a field 'c'
+ALTER TABLE t1 ADD c INT;
+ALTER PROCEDURE p1 COMMENT 'test';
+CALL p1();
+rec.c
+NULL
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that field names are case insensitive
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE:=ROW(10,'bb');
+BEGIN
+SELECT rec.A, rec.B;
+END;
+END;
+$$
+CALL p1();
+rec.A rec.B
+10 bb
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that cursor%ROWTYPE uses temporary tables vs shadowed real tables
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TEMPORARY TABLE t1 (x INT, y VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE:=ROW(10,'bb');
+BEGIN
+SELECT rec.A, rec.B;
+END;
+END;
+$$
+CALL p1();
+ERROR HY000: Row variable 'rec' does not have a field 'A'
+DROP TEMPORARY TABLE t1;
+ALTER PROCEDURE p1 COMMENT 'test';
+CALL p1();
+rec.A rec.B
+10 bb
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that the structure of cursor%ROWTYPE variables is determined at the CURSOR instantiation time
+#
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(32), c INT);
+DECLARE
+rec cur%ROWTYPE; -- This has a column "c"
+ BEGIN
+rec.c:=10;
+END;
+END;
+$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE; -- This does not have a column "c"
+ BEGIN
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(32), c INT);
+rec.c:=10;
+END;
+END;
+$$
+CALL p1();
+ERROR HY000: Row variable 'rec' does not have a field 'c'
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Duplicate field nams in a cursor referenced by %ROWTYPE
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+CREATE PROCEDURE p1 AS
+CURSOR cur IS SELECT * FROM t1, t2;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+SELECT rec.a;
+rec.a:=10;
+END;
+END;
+$$
+CALL p1();
+ERROR 42S21: Duplicate column name 'a'
+DROP PROCEDURE p1;
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# Tricky field names a cursor referenced by %ROWTYPE
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a');
+CREATE PROCEDURE p1 AS
+CURSOR cur IS SELECT a, CONCAT(a,'a'), CONCAT(a,'ö') FROM t1;
+BEGIN
+DECLARE
+rec cur%ROWTYPE;
+BEGIN
+OPEN cur;
+FETCH cur INTO rec;
+CLOSE cur;
+SELECT rec.a, rec."CONCAT(a,'a')", rec."CONCAT(a,'ö')";
+END;
+END;
+$$
+CALL p1();
+rec.a rec."CONCAT(a,'a')" rec."CONCAT(a,'ö')"
+a aa aö
+DROP PROCEDURE p1;
+DROP TABLE t1;
+SET NAMES latin1;
+#
+# Using definitions recursively (cursor%ROWTYPE variables in another cursor SELECT)
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b1'),(20,'b2'),(30,'b3');
+CREATE PROCEDURE p1 AS
+CURSOR cur1 IS SELECT a,b FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE:=ROW(0,'b0');
+CURSOR cur2 IS SELECT rec1.a AS a, rec1.b AS b FROM t1;
+BEGIN
+DECLARE
+rec2 cur2%ROWTYPE;
+BEGIN
+OPEN cur2;
+LOOP
+FETCH cur2 INTO rec2;
+EXIT WHEN cur2%NOTFOUND;
+SELECT rec2.a, rec2.b;
+END LOOP;
+CLOSE cur2;
+END;
+END;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+0 b0
+rec2.a rec2.b
+0 b0
+rec2.a rec2.b
+0 b0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing queries with auto-generated Items.
+# An instance of Item_func_conv_charset is created during the below SELECT query.
+# We check here that during an implicit cursor OPEN
+# done in sp_instr_cursor_copy_struct::exec_core()
+# all temporary Items are created on a proper memory root and are safely destroyed.
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8);
+INSERT INTO t1 VALUES (0xFF, 'a');
+CREATE PROCEDURE p1
+AS
+CURSOR cur1 IS SELECT CONCAT(a,b) AS c FROM t1;
+BEGIN
+DECLARE
+rec1 cur1%ROWTYPE;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec1;
+CLOSE cur1;
+SELECT HEX(rec1.c);
+END;
+END;
+$$
+CALL p1();
+HEX(rec1.c)
+C3BF61
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP
+#
+# IN followed by a non-identifier
+CREATE PROCEDURE p1 AS
+CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+FOR rec IN 10
+LOOP
+NULL;
+END LOOP;
+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 'LOOP
+NULL;
+END LOOP;
+END' at line 6
+# IN followed by a quoted identifier: table.column
+CREATE PROCEDURE p1 AS
+CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+FOR rec IN c1.c2
+LOOP
+NULL;
+END LOOP;
+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 'LOOP
+NULL;
+END LOOP;
+END' at line 6
+# IN followed by a quoted identifier: .table.column
+CREATE PROCEDURE p1 AS
+CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+FOR rec IN .c1.c2
+LOOP
+NULL;
+END LOOP;
+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 'LOOP
+NULL;
+END LOOP;
+END' at line 6
+# IN followed by a quoted identifier: schema.table.column
+CREATE PROCEDURE p1 AS
+CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+FOR rec IN c1.c2.c3
+LOOP
+NULL;
+END LOOP;
+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 'LOOP
+NULL;
+END LOOP;
+END' at line 6
+# IN followed by an unknown cursor name
+CREATE PROCEDURE p1 AS
+CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+FOR rec IN c2
+LOOP
+NULL;
+END LOOP;
+END;
+$$
+ERROR 42000: Undefined CURSOR: c2
+# Make sure "rec" shadows other declarations outside the loop
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10, 'b0');
+CREATE PROCEDURE p1 AS
+rec INT:=10;
+CURSOR c1 IS SELECT a,b FROM t1;
+BEGIN
+FOR rec IN c1
+LOOP
+SELECT rec.a;
+END LOOP;
+SELECT rec;
+END;
+$$
+CALL p1;
+rec.a
+10
+rec
+10
+DROP PROCEDURE p1;
+DROP TABLE t1;
+# Make sure "rec" is not visible after END LOOP
+CREATE PROCEDURE p1 AS
+CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+FOR rec IN c1
+LOOP
+NULL;
+END LOOP;
+rec.a:= 10;
+END;
+$$
+ERROR HY000: Unknown structured system variable or ROW routine variable 'rec'
+# Make sure that duplicate column names are not allowed
+CREATE PROCEDURE p1 AS
+CURSOR cur IS SELECT 'a' AS a, 'A' as a;
+BEGIN
+FOR rec IN cur
+LOOP
+NULL;
+END LOOP;
+END;
+$$
+CALL p1;
+ERROR 42S21: Duplicate column name 'a'
+DROP PROCEDURE p1;
+# A complete working example
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b0');
+INSERT INTO t1 VALUES (11,'b1');
+INSERT INTO t1 VALUES (12,'b2');
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+CREATE PROCEDURE p1 AS
+CURSOR cur IS SELECT a, b FROM t1;
+BEGIN
+FOR rec IN cur
+LOOP
+SELECT rec.a, rec.b;
+INSERT INTO t2 VALUES (rec.a, rec.b);
+rec.a:= rec.a + 1000;
+rec.b:= 'b' || rec.b;
+INSERT INTO t3 VALUES (rec.a, rec.b);
+END LOOP;
+END;
+$$
+CALL p1();
+rec.a rec.b
+10 b0
+rec.a rec.b
+11 b1
+rec.a rec.b
+12 b2
+SELECT * FROM t2;
+a b
+10 b0
+11 b1
+12 b2
+SELECT * FROM t3;
+a b
+1010 bb0
+1011 bb1
+1012 bb2
+DROP PROCEDURE p1;
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# MDEV-12314 Implicit cursor FOR LOOP for cursors with parameters
+#
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b0');
+INSERT INTO t1 VALUES (11,'b1');
+INSERT INTO t1 VALUES (12,'b2');
+CREATE PROCEDURE p1(pa INT, pb VARCHAR(32)) AS
+CURSOR cur(va INT, vb VARCHAR(32)) IS
+SELECT a, b FROM t1 WHERE a=va AND b=vb;
+BEGIN
+FOR rec IN cur(pa,pb)
+LOOP
+SELECT rec.a, rec.b;
+END LOOP;
+END;
+$$
+CALL p1(10,'B0');
+rec.a rec.b
+10 b0
+CALL p1(11,'B1');
+rec.a rec.b
+11 b1
+CALL p1(12,'B2');
+rec.a rec.b
+12 b2
+CALL p1(12,'non-existing');
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop
+#
+# Parse error in the cursor SELECT statement
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT a, b FROM)
+LOOP
+SELECT rec.a, rec.b;
+END LOOP;
+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 ')
+LOOP
+SELECT rec.a, rec.b;
+END LOOP;
+END' at line 3
+# Make sure "rec" is not visible after END LOOP
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT 'test' AS a)
+LOOP
+NULL;
+END LOOP;
+rec.a:= 10;
+END;
+$$
+ERROR HY000: Unknown structured system variable or ROW routine variable 'rec'
+# Make sure "rec" is not visible inside the SELECT statement
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT rec)
+LOOP
+NULL;
+END LOOP;
+END;
+$$
+CALL p1;
+ERROR 42S22: Unknown column 'rec' in 'field list'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT rec.a)
+LOOP
+NULL;
+END LOOP;
+END;
+$$
+CALL p1;
+ERROR 42S02: Unknown table 'rec' in field list
+DROP PROCEDURE p1;
+# Totally confusing name mixture
+CREATE TABLE rec (rec INT);
+INSERT INTO rec VALUES (10);
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT rec FROM rec)
+LOOP
+SELECT rec.rec;
+END LOOP;
+END;
+$$
+CALL p1;
+rec.rec
+10
+DROP PROCEDURE p1;
+DROP TABLE rec;
+# Make sure that duplicate column names are not allowed
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT 'a' AS a, 'A' as a)
+LOOP
+NULL;
+END LOOP;
+END;
+$$
+CALL p1;
+ERROR 42S21: Duplicate column name 'a'
+DROP PROCEDURE p1;
+# A complete working example
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b0');
+INSERT INTO t1 VALUES (11,'b1');
+INSERT INTO t1 VALUES (12,'b2');
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec IN (SELECT a, b FROM t1)
+LOOP
+SELECT rec.a, rec.b;
+INSERT INTO t2 VALUES (rec.a, rec.b);
+rec.a:= rec.a + 1000;
+rec.b:= 'b'|| rec.b;
+INSERT INTO t3 VALUES (rec.a, rec.b);
+END LOOP;
+END;
+$$
+CALL p1();
+rec.a rec.b
+10 b0
+rec.a rec.b
+11 b1
+rec.a rec.b
+12 b2
+SELECT * FROM t2;
+a b
+10 b0
+11 b1
+12 b2
+SELECT * FROM t3;
+a b
+1010 bb0
+1011 bb1
+1012 bb2
+DROP PROCEDURE p1;
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+# A combination of explicit and implicit cursors
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b1');
+INSERT INTO t1 VALUES (11,'b2');
+INSERT INTO t1 VALUES (12,'b3');
+CREATE PROCEDURE p1 AS
+BEGIN
+FOR rec1 IN (SELECT a, b FROM t1)
+LOOP
+DECLARE
+CURSOR cur2 IS SELECT a+1000 AS a, 'bb'||b AS b FROM t1 WHERE a=rec1.a AND b=rec1.b;
+BEGIN
+SELECT rec1.a, rec1.b;
+FOR rec2 IN cur2
+LOOP
+SELECT rec2.a, rec2.b;
+END LOOP;
+END;
+END LOOP;
+FOR rec1 IN (SELECT a,b FROM t1)
+LOOP
+FOR rec2 IN (SELECT a+2000 AS a,'bbb'||b AS b FROM t1 WHERE a=rec1.a AND b=rec1.b)
+LOOP
+SELECT rec2.a, rec2.b;
+END LOOP;
+END LOOP;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 b1
+rec2.a rec2.b
+1010 bbb1
+rec1.a rec1.b
+11 b2
+rec2.a rec2.b
+1011 bbb2
+rec1.a rec1.b
+12 b3
+rec2.a rec2.b
+1012 bbb3
+rec2.a rec2.b
+2010 bbbb1
+rec2.a rec2.b
+2011 bbbb2
+rec2.a rec2.b
+2012 bbbb3
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-15941 Explicit cursor FOR loop does not close the cursor
+#
+DECLARE
+CURSOR cur IS SELECT 1 AS a FROM DUAL;
+v INT;
+BEGIN
+FOR rec IN cur
+LOOP
+NULL;
+END LOOP;
+FETCH cur INTO v;
+END;
+$$
+ERROR 24000: Cursor is not open
+DECLARE
+CURSOR cur IS SELECT 1 AS a FROM DUAL;
+v INT;
+BEGIN
+<<label>>
+FOR rec IN cur
+LOOP
+NULL;
+END LOOP label;
+FETCH cur INTO v;
+END;
+$$
+ERROR 24000: Cursor is not open
+DECLARE
+CURSOR cur IS SELECT 1 AS a FROM DUAL;
+BEGIN
+OPEN cur;
+FOR rec IN cur
+LOOP
+NULL;
+END LOOP;
+END;
+$$
+ERROR 24000: Cursor is already open
+DECLARE
+CURSOR cur IS SELECT 1 AS a FROM DUAL;
+BEGIN
+FOR rec IN cur
+LOOP
+SELECT rec.a;
+END LOOP;
+SELECT cur%ISOPEN;
+FOR rec IN cur
+LOOP
+SELECT rec.a;
+END LOOP;
+SELECT cur%ISOPEN;
+END;
+$$
+rec.a
+1
+cur%ISOPEN
+0
+rec.a
+1
+cur%ISOPEN
+0
+DECLARE
+CURSOR cur IS SELECT 1 AS a FROM DUAL;
+BEGIN
+<<label1>>
+FOR rec IN cur
+LOOP
+SELECT rec.a;
+END LOOP label1;
+SELECT cur%ISOPEN;
+<<label2>>
+FOR rec IN cur
+LOOP
+SELECT rec.a;
+END LOOP;
+SELECT cur%ISOPEN;
+END;
+$$
+rec.a
+1
+cur%ISOPEN
+0
+rec.a
+1
+cur%ISOPEN
+0
+#
+# MDEV-14139 Anchored data types for variables
+#
+DECLARE
+CURSOR c1 IS SELECT 10 AS a, 'bbb' AS b, TIME'10:20:30' AS c;
+row1 c1%ROWTYPE;
+a_row1 row1%TYPE;
+aa_row1 a_row1%TYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT a_row1.a AS a, a_row1.b AS b, a_row1.c AS c;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT aa_row1.a AS a, aa_row1.b AS b, aa_row1.c AS c;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL,
+ "b" varchar(3) DEFAULT NULL,
+ "c" time DEFAULT NULL
+)
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL,
+ "b" varchar(3) DEFAULT NULL,
+ "c" time DEFAULT NULL
+)
+#
+# MDEV-14388 Server crashes in handle_select / val_uint in ORACLE mode
+#
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (0),(1),(2),(3);
+CREATE FUNCTION f1() RETURN INT is
+BEGIN
+FOR v1 in (SELECT id FROM t1)
+LOOP
+NULL;
+END LOOP;
+RETURN 1;
+END;
+$$
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+DROP TABLE t1;
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+CREATE FUNCTION f1() RETURN INT IS
+CURSOR cur IS SELECT id FROM t1;
+rec cur%ROWTYPE;
+BEGIN
+RETURN 1;
+END;
+$$
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes (SERVER CRASH)
+#
+CREATE TABLE t1 (id2 int, id int, en1 enum('aaa','a','b','c'));
+INSERT INTO t1 VALUES(1,1,'aaa'),(2,2,'a'),(3,3,'b'),(4,4,'c');
+CREATE PROCEDURE p1()
+AS
+BEGIN
+FOR rec IN (SELECT en1 FROM t1)
+LOOP
+SELECT rec.en1;
+END LOOP;
+END;
+$$
+CALL p1();
+rec.en1
+aaa
+rec.en1
+a
+rec.en1
+b
+rec.en1
+c
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor.result b/mysql-test/suite/compat/oracle/r/sp-cursor.result
new file mode 100644
index 00000000000..2e0c43c8b87
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor.result
@@ -0,0 +1,979 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10582 sql_mode=ORACLE: explicit cursor attributes %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND
+#
+#
+# Cursor attributes outside of an SP context
+#
+SELECT c%ISOPEN;
+ERROR 42000: Undefined CURSOR: c
+SELECT c%FOUND;
+ERROR 42000: Undefined CURSOR: c
+SELECT c%NOTFOUND;
+ERROR 42000: Undefined CURSOR: c
+SELECT c%ROWCOUNT;
+ERROR 42000: Undefined CURSOR: c
+#
+# Undefinite cursor attributes
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+SELECT c%ISOPEN;
+END;
+$$
+ERROR 42000: Undefined CURSOR: c
+CREATE PROCEDURE p1
+AS
+BEGIN
+SELECT c%ROWCOUNT;
+END;
+$$
+ERROR 42000: Undefined CURSOR: c
+CREATE PROCEDURE p1
+AS
+BEGIN
+SELECT c%FOUND;
+END;
+$$
+ERROR 42000: Undefined CURSOR: c
+CREATE PROCEDURE p1
+AS
+BEGIN
+SELECT c%NOTFOUND;
+END;
+$$
+ERROR 42000: Undefined CURSOR: c
+#
+# Not opened cursor attributes %FOUND, %NOTFOUND, %ROWCOUNT
+#
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+SELECT c%ROWCOUNT;
+END;
+$$
+CALL p1;
+ERROR 24000: Cursor is not open
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+SELECT c%FOUND;
+END;
+$$
+CALL p1;
+ERROR 24000: Cursor is not open
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+SELECT c%NOTFOUND;
+END;
+$$
+CALL p1;
+ERROR 24000: Cursor is not open
+DROP PROCEDURE p1;
+#
+# Not opened cursor attributes %FOUND, %NOTFOUND, %ROWCOUNT with INVALID_CURSOR exception
+#
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+SELECT c%ROWCOUNT;
+EXCEPTION
+WHEN INVALID_CURSOR THEN SELECT 'INVALID_CURSOR caught' AS msg;
+END;
+$$
+CALL p1;
+c%ROWCOUNT
+msg
+INVALID_CURSOR caught
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+SELECT c%FOUND;
+EXCEPTION
+WHEN INVALID_CURSOR THEN SELECT 'INVALID_CURSOR caught' AS msg;
+END;
+$$
+CALL p1;
+c%FOUND
+msg
+INVALID_CURSOR caught
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+SELECT c%NOTFOUND;
+EXCEPTION
+WHEN INVALID_CURSOR THEN SELECT 'INVALID_CURSOR caught' AS msg;
+END;
+$$
+CALL p1;
+c%NOTFOUND
+msg
+INVALID_CURSOR caught
+DROP PROCEDURE p1;
+#
+# print()
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+EXPLAIN EXTENDED SELECT c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+END;
+$$
+CALL p1();
+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 "c"%ISOPEN AS "c%ISOPEN","c"%ROWCOUNT AS "c%ROWCOUNT","c"%FOUND AS "c%FOUND","c"%NOTFOUND AS "c%NOTFOUND"
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Declared data type of the attributes
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+CREATE PROCEDURE p1
+AS
+CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+OPEN c;
+CREATE TABLE t2 AS SELECT c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CLOSE c;
+END;
+$$
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "c%ISOPEN" int(1) NOT NULL,
+ "c%ROWCOUNT" bigint(21) DEFAULT NULL,
+ "c%FOUND" int(1) DEFAULT NULL,
+ "c%NOTFOUND" int(1) DEFAULT NULL
+)
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Core functionality
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t1 VALUES (30);
+CREATE PROCEDURE p1
+AS
+a INT:=0;
+CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+SELECT a, c%ISOPEN;
+OPEN c;
+/*
+After OPEN and before FETCH:
+- %ROWCOUNT returns 0
+- %FOUND and %NOTFOUND return NULL
+*/
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+FETCH c INTO a;
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+FETCH c INTO a;
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+FETCH c INTO a;
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+FETCH c INTO a;
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+CLOSE c;
+SELECT a, c%ISOPEN;
+/*
+After reopen and before FETCH:
+- %ROWCOUNT returns 0
+- %FOUND and %NOTFOUND return NULL
+*/
+OPEN c;
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+FETCH c INTO a;
+SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+CLOSE c;
+END;
+$$
+CALL p1();
+a c%ISOPEN
+0 0
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+0 1 0 NULL NULL
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+10 1 1 1 0
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+20 1 2 1 0
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+30 1 3 1 0
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+30 1 3 0 1
+a c%ISOPEN
+30 0
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+30 1 0 NULL NULL
+a c%ISOPEN c%ROWCOUNT c%FOUND c%NOTFOUND
+10 1 1 1 0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# %NOTFOUND as a loop exit condition
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t1 VALUES (30);
+CREATE PROCEDURE p1
+AS
+a INT:=0;
+CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+OPEN c;
+LOOP
+FETCH c INTO a;
+EXIT WHEN c%NOTFOUND;
+SELECT a;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1();
+a
+10
+a
+20
+a
+30
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# %FOUND as a loop exit condition
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t1 VALUES (30);
+CREATE PROCEDURE p1
+AS
+a INT:=0;
+CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+OPEN c;
+LOOP
+FETCH c INTO a;
+EXIT WHEN NOT c%FOUND;
+SELECT a;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1();
+a
+10
+a
+20
+a
+30
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# End of MDEV-10582 sql_mode=ORACLE: explicit cursor attributes %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND
+#
+#
+# MDEV-10597 Cursors with parameters
+#
+#
+# OPEN with a wrong number of parameters
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a_a INT,a_b VARCHAR)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR c (p_a INT, p_b VARCHAR) IS SELECT * FROM t1 WHERE a=p_a;
+BEGIN
+OPEN c(a_a);
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+DBMS_OUTPUT.PUT_LINE('Fetched a record a='||TO_CHAR(v_a)||' b='||v_b);
+END LOOP;
+CLOSE c;
+END;
+$$
+ERROR 42000: Incorrect parameter count to cursor 'c'
+DROP TABLE t1;
+#
+# Cursor parameters are not visible outside of the cursor
+#
+CREATE PROCEDURE p1(a_a INT)
+AS
+v_a INT;
+CURSOR c (p_a INT) IS SELECT a FROM t1 WHERE a=p_a;
+BEGIN
+OPEN c(a_a);
+p_a:=10;
+END;
+$$
+ERROR HY000: Unknown system variable 'p_a'
+CREATE PROCEDURE p1(a_a INT)
+AS
+v_a INT;
+CURSOR c (p_a INT) IS SELECT a FROM t1 WHERE a=p_a;
+BEGIN
+p_a:=10;
+OPEN c(a_a);
+END;
+$$
+ERROR HY000: Unknown system variable 'p_a'
+#
+# Cursor parameter shadowing a local variable
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+CREATE PROCEDURE p1(a INT)
+AS
+v_a INT:=NULL;
+p_a INT:=NULL;
+CURSOR c (p_a VARCHAR2) IS SELECT a FROM t1 WHERE p_a IS NOT NULL;
+BEGIN
+OPEN c(a);
+FETCH c INTO v_a;
+IF c%NOTFOUND THEN
+BEGIN
+SELECT 'No records found' AS msg;
+RETURN;
+END;
+END IF;
+CLOSE c;
+SELECT 'Fetched a record a='||v_a AS msg;
+INSERT INTO t1 VALUES (v_a);
+END;
+$$
+CALL p1(1);
+msg
+Fetched a record a=1
+SELECT * FROM t1;
+a
+1
+1
+CALL p1(NULL);
+msg
+No records found
+SELECT * FROM t1;
+a
+1
+1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Parameters in SELECT list
+#
+CREATE PROCEDURE p1(a_a INT, a_b VARCHAR)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR c (p_a INT, p_b VARCHAR) IS SELECT p_a,p_b FROM DUAL;
+BEGIN
+FOR i IN 0..1
+LOOP
+OPEN c(a_a + i,a_b);
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+SELECT 'Fetched a record a=' || v_a || ' b=' || v_b AS msg;
+END LOOP;
+CLOSE c;
+END LOOP;
+END;
+$$
+CALL p1(1,'b1');
+msg
+Fetched a record a=1 b=b1
+msg
+Fetched a record a=2 b=b1
+DROP PROCEDURE p1;
+#
+# Parameters in SELECT list + UNION
+#
+CREATE PROCEDURE p1(a_a INT, a_b VARCHAR)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR c (p_a INT, p_b VARCHAR) IS
+SELECT p_a,p_b FROM DUAL
+UNION ALL
+SELECT p_a+1,p_b||'b' FROM DUAL;
+BEGIN
+OPEN c(a_a,a_b);
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+SELECT 'Fetched a record a=' || v_a || ' b=' || v_b AS msg;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1(1,'b1');
+msg
+Fetched a record a=1 b=b1
+msg
+Fetched a record a=2 b=b1b
+DROP PROCEDURE p1;
+#
+# Parameters in SELECT list + type conversion + warnings
+#
+CREATE PROCEDURE p1(a_a VARCHAR)
+AS
+v_a INT;
+CURSOR c (p_a INT) IS SELECT p_a FROM DUAL;
+BEGIN
+OPEN c(a_a);
+LOOP
+FETCH c INTO v_a;
+EXIT WHEN c%NOTFOUND;
+SELECT 'Fetched a record a=' || v_a AS msg;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1('1b');
+msg
+Fetched a record a=1
+Warnings:
+Warning 1265 Data truncated for column 'p_a' at row 1
+CALL p1('b1');
+msg
+Fetched a record a=0
+Warnings:
+Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 1
+DROP PROCEDURE p1;
+#
+# One parameter in SELECT list + subselect
+#
+CREATE PROCEDURE p1(a_a VARCHAR)
+AS
+v_a VARCHAR(10);
+CURSOR c (p_a VARCHAR) IS
+SELECT p_a FROM DUAL UNION SELECT REVERSE(p_a) FROM DUAL;
+BEGIN
+OPEN c((SELECT a_a));
+LOOP
+FETCH c INTO v_a;
+EXIT WHEN c%NOTFOUND;
+SELECT v_a;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1('ab');
+v_a
+ab
+v_a
+ba
+DROP PROCEDURE p1;
+#
+# Two parameters in SELECT list + subselect
+#
+SET sql_mode=ORACLE;
+CREATE PROCEDURE p1()
+AS
+v_a VARCHAR(10);
+v_b VARCHAR(20);
+CURSOR c (p_a VARCHAR, p_b VARCHAR) IS
+SELECT p_a, p_b FROM DUAL
+UNION
+SELECT p_b, p_a FROM DUAL;
+BEGIN
+OPEN c((SELECT 'aaa'),(SELECT 'bbb'));
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+SELECT v_a, v_b;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1();
+v_a v_b
+aaa bbb
+v_a v_b
+bbb aaa
+DROP PROCEDURE p1;
+#
+# Two parameters in SELECT list + two parameters in WHERE + subselects
+#
+SET sql_mode=ORACLE;
+CREATE PROCEDURE p1(a_a VARCHAR, a_b VARCHAR)
+AS
+v_a VARCHAR(10);
+v_b VARCHAR(20);
+CURSOR c (value_a VARCHAR, value_b VARCHAR,
+pattern_a VARCHAR, pattern_b VARCHAR) IS
+SELECT value_a, value_b FROM DUAL WHERE value_a LIKE pattern_a
+UNION
+SELECT value_b, value_a FROM DUAL WHERE value_b LIKE pattern_b;
+BEGIN
+OPEN c((SELECT 'aaa'),(SELECT 'bbb'),(SELECT a_a),(SELECT a_b));
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+SELECT v_a, v_b;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1('%','%');
+v_a v_b
+aaa bbb
+v_a v_b
+bbb aaa
+CALL p1('aaa','xxx');
+v_a v_b
+aaa bbb
+CALL p1('xxx','bbb');
+v_a v_b
+bbb aaa
+CALL p1('xxx','xxx');
+DROP PROCEDURE p1;
+#
+# Parameters in SELECT list + stored function
+#
+CREATE FUNCTION f1 (a VARCHAR) RETURN VARCHAR
+AS
+BEGIN
+RETURN a || 'y';
+END;
+$$
+CREATE PROCEDURE p1(a_a VARCHAR)
+AS
+v_a VARCHAR(10);
+v_b VARCHAR(10);
+CURSOR c (p_sel_a VARCHAR, p_cmp_a VARCHAR) IS
+SELECT p_sel_a, p_cmp_a FROM DUAL;
+BEGIN
+OPEN c(f1(a_a), f1(a_a));
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+SELECT v_a;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1('x');
+v_a
+xy
+CALL p1(f1(COALESCE(NULL, f1('x'))));
+v_a
+xyyy
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+#
+# One parameter in WHERE clause
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'11');
+INSERT INTO t1 VALUES (1,'12');
+INSERT INTO t1 VALUES (2,'21');
+INSERT INTO t1 VALUES (2,'22');
+INSERT INTO t1 VALUES (3,'31');
+INSERT INTO t1 VALUES (3,'32');
+CREATE PROCEDURE p1(a_a INT)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR c (p_a INT) IS SELECT a,b FROM t1 WHERE a=p_a;
+BEGIN
+OPEN c(a_a);
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+INSERT INTO t2 VALUES (v_a,v_b);
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1(1);
+SELECT * FROM t2;
+a b
+1 11
+1 12
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+#
+# Two parameters in WHERE clause
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'11');
+INSERT INTO t1 VALUES (1,'12');
+INSERT INTO t1 VALUES (2,'21');
+INSERT INTO t1 VALUES (2,'22');
+INSERT INTO t1 VALUES (3,'31');
+INSERT INTO t1 VALUES (3,'32');
+CREATE PROCEDURE p1(a_a INT, a_b VARCHAR)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR c (p_a INT, p_b VARCHAR) IS SELECT a,b FROM t1 WHERE a=p_a AND b=p_b;
+BEGIN
+OPEN c(a_a, a_b);
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+INSERT INTO t2 VALUES (v_a,v_b);
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1(1,'11');
+SELECT * FROM t2;
+a b
+1 11
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+#
+# Parameters in WHERE and HAVING clauses
+#
+CREATE TABLE t1 (name VARCHAR(10), value INT);
+INSERT INTO t1 VALUES ('but',1);
+INSERT INTO t1 VALUES ('but',1);
+INSERT INTO t1 VALUES ('but',1);
+INSERT INTO t1 VALUES ('bin',1);
+INSERT INTO t1 VALUES ('bin',1);
+INSERT INTO t1 VALUES ('bot',1);
+CREATE PROCEDURE p1 (arg_name_limit VARCHAR, arg_total_limit INT)
+AS
+v_name VARCHAR(10);
+v_total INT;
+-- +0 is needed to work around the bug MDEV-11081
+CURSOR c(p_v INT) IS
+SELECT name, SUM(value + p_v) + 0 AS total FROM t1
+WHERE name LIKE arg_name_limit
+GROUP BY name HAVING total>=arg_total_limit;
+BEGIN
+FOR i IN 0..1
+LOOP
+OPEN c(i);
+LOOP
+FETCH c INTO v_name, v_total;
+EXIT WHEN c%NOTFOUND;
+SELECT v_name, v_total;
+END LOOP;
+CLOSE c;
+END LOOP;
+END;
+$$
+CALL p1('%', 2);
+v_name v_total
+bin 2
+v_name v_total
+but 3
+v_name v_total
+bin 4
+v_name v_total
+bot 2
+v_name v_total
+but 6
+CALL p1('b_t', 0);
+v_name v_total
+bot 1
+v_name v_total
+but 3
+v_name v_total
+bot 2
+v_name v_total
+but 6
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# One parameter in LIMIT clause
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'b1');
+INSERT INTO t1 VALUES (2,'b2');
+INSERT INTO t1 VALUES (3,'b3');
+INSERT INTO t1 VALUES (4,'b4');
+INSERT INTO t1 VALUES (5,'b5');
+INSERT INTO t1 VALUES (6,'b6');
+CREATE PROCEDURE p1(a_a INT)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR c (p_a INT) IS SELECT a,b FROM t1 ORDER BY a LIMIT p_a;
+BEGIN
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+OPEN c(a_a);
+LOOP
+FETCH c INTO v_a, v_b;
+EXIT WHEN c%NOTFOUND;
+INSERT INTO t2 VALUES (v_a,v_b);
+END LOOP;
+CLOSE c;
+SELECT * FROM t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1(1);
+a b
+1 b1
+CALL p1(3);
+a b
+1 b1
+2 b2
+3 b3
+CALL p1(6);
+a b
+1 b1
+2 b2
+3 b3
+4 b4
+5 b5
+6 b6
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# End of MDEV-10597 Cursors with parameters
+#
+#
+# MDEV-12209 sql_mode=ORACLE: Syntax error in a OPEN cursor with parameters makes the server crash
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'A');
+CREATE PROCEDURE p1(a INT,b VARCHAR)
+AS
+CURSOR c (p_a INT, p_b VARCHAR) IS SELECT * FROM t1 WHERE a=p_a;
+BEGIN
+OPEN c(a+, b);
+LOOP
+FETCH c INTO a, b;
+EXIT WHEN c%NOTFOUND;
+SELECT a, b;
+END LOOP;
+CLOSE c;
+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 ' b);
+LOOP
+FETCH c INTO a, b;
+EXIT WHEN c%NOTFOUND;
+SELECT a, b;
+END LOOP;
+CLO...' at line 5
+DROP TABLE t1;
+#
+# MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10),c DATETIME(3));
+INSERT INTO t1 VALUES (1,'b1','2001-01-01 10:20:30.123');
+INSERT INTO t1 VALUES (2,'b2','2001-01-02 10:20:30.123');
+CREATE TABLE t2 LIKE t1;
+CREATE PROCEDURE p1()
+AS
+v_a t1.a%TYPE;
+v_b t1.b%TYPE;
+v_c t1.c%TYPE;
+CURSOR c IS SELECT a,b,c FROM t1;
+BEGIN
+OPEN c;
+LOOP
+FETCH c INTO v_a, v_b, v_c;
+EXIT WHEN c%NOTFOUND;
+INSERT INTO t2 (a,b,c) VALUES (v_a, v_b, v_c);
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1();
+SELECT * FROM t2;
+a b c
+1 b1 2001-01-01 10:20:30.123
+2 b2 2001-01-02 10:20:30.123
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-12007 Allow ROW variables as a cursor FETCH target
+#
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+INSERT INTO t1 VALUES (20,'b20');
+INSERT INTO t1 VALUES (30,'b30');
+CREATE PROCEDURE p1 AS
+rec ROW(a INT, b VARCHAR(32));
+CURSOR c IS SELECT a,b FROM t1;
+BEGIN
+OPEN c;
+LOOP
+FETCH c INTO rec;
+EXIT WHEN c%NOTFOUND;
+SELECT ('rec=(' || rec.a ||','|| rec.b||')') AS c;
+END LOOP;
+CLOSE c;
+END;
+$$
+CALL p1();
+c
+rec=(10,b10)
+c
+rec=(20,b20)
+c
+rec=(30,b30)
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-12441 Variables declared after cursors with parameters lose values
+#
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 INT:=101;
+BEGIN
+OPEN cur(10,11);
+CLOSE cur;
+SELECT x0, x1;
+END;
+$$
+CALL p1();
+x0 x1
+100 101
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 t1.a%TYPE:=101;
+BEGIN
+OPEN cur(10,11);
+CLOSE cur;
+SELECT x0, x1;
+END;
+$$
+CALL p1();
+x0 x1
+100 101
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+x1 ROW(a INT,b INT):=ROW(101,102);
+BEGIN
+OPEN cur(10,11);
+CLOSE cur;
+SELECT x0, x1.a, x1.b;
+END;
+$$
+CALL p1();
+x0 x1.a x1.b
+100 101 102
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'Tbl-t1.b0');
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT a,b FROM t1;
+x1 t1%ROWTYPE:=ROW(101,'Var-x1.b0');
+BEGIN
+SELECT x0, x1.a, x1.b;
+OPEN cur(10,11);
+FETCH cur INTO x1;
+CLOSE cur;
+SELECT x0, x1.a, x1.b;
+END;
+$$
+CALL p1();
+x0 x1.a x1.b
+100 101 Var-x1.b0
+x0 x1.a x1.b
+100 10 Tbl-t1.b0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'Tbl-t1.b0');
+CREATE PROCEDURE p1() AS
+x0 INT:=100;
+CURSOR cur(cp1 INT, cp2 INT) IS SELECT a,b FROM t1;
+x1 cur%ROWTYPE:=ROW(101,'Var-x1.b0');
+BEGIN
+SELECT x0, x1.a, x1.b;
+OPEN cur(10,11);
+FETCH cur INTO x1;
+CLOSE cur;
+SELECT x0, x1.a, x1.b;
+END;
+$$
+CALL p1();
+x0 x1.a x1.b
+100 101 Var-x1.b0
+x0 x1.a x1.b
+100 10 Tbl-t1.b0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+#
+DECLARE
+CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+OPEN c;
+SELECT
+c%ISOPEN,
+c%NOTFOUND,
+c%FOUND,
+c%ROWCOUNT;
+CLOSE c;
+END;
+$$
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c%ISOPEN 3 1 1 N 32897 0 63
+def c%NOTFOUND 3 1 0 Y 32896 0 63
+def c%FOUND 3 1 0 Y 32896 0 63
+def c%ROWCOUNT 8 21 1 Y 32896 0 63
+c%ISOPEN c%NOTFOUND c%FOUND c%ROWCOUNT
+1 NULL NULL 0
+#
+# MDEV-17387 MariaDB Server giving wrong error while executing select query from procedure
+#
+CREATE TABLE t1
+(
+JOBN varchar(18) NOT NULL,
+pk int(11) NOT NULL,
+PRIMARY KEY (pk),
+KEY (JOBN)
+);
+CREATE PROCEDURE p1
+AS
+lS NUMBER(10) :=0;
+CURSOR cBPD IS SELECT * FROM t1 WHERE JOBN='x';
+BEGIN
+FOR lbpd IN cBPD LOOP
+lS:=lS+1;
+END LOOP;
+EXCEPTION
+WHEN OTHERS THEN
+BEGIN
+SELECT SQLERRM;
+END;
+END;
+$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-expr.result b/mysql-test/suite/compat/oracle/r/sp-expr.result
new file mode 100644
index 00000000000..bb0c1a5c5c8
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-expr.result
@@ -0,0 +1,158 @@
+SET sql_mode=ORACLE;
+#
+# Start of 10.3 tests
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+BEGIN
+CASE ((1) IN (SELECT a FROM t1)) WHEN 1 THEN SELECT 1;
+ELSE SELECT NULL;
+END CASE;
+END;
+$$
+1
+1
+BEGIN
+CASE (EXISTS (SELECT a FROM t1)) WHEN 1 THEN SELECT 1;
+ELSE SELECT NULL;
+END CASE;
+END;
+$$
+1
+1
+BEGIN
+IF ((1) IN (SELECT a FROM t1)) THEN SELECT 1;
+ELSE SELECT NULL;
+END IF;
+END;
+$$
+1
+1
+BEGIN
+IF (EXISTS (SELECT a FROM t1)) THEN SELECT 1;
+ELSE SELECT NULL;
+END IF;
+END;
+$$
+1
+1
+BEGIN
+WHILE ((1234) IN (SELECT * FROM t1)) LOOP
+SELECT 1;
+END LOOP;
+END;
+$$
+BEGIN
+WHILE (EXISTS (SELECT * FROM t1 WHERE a=1234)) LOOP
+SELECT 1;
+END LOOP;
+END;
+$$
+BEGIN
+REPEAT
+SELECT 1;
+UNTIL (1 IN (SELECT * FROM t1))
+END REPEAT;
+END;
+$$
+1
+1
+BEGIN
+REPEAT
+SELECT 1;
+UNTIL EXISTS (SELECT * FROM t1 WHERE a=1)
+END REPEAT;
+END;
+$$
+1
+1
+BEGIN
+FOR i IN 0..(1 IN (SELECT * FROM t1))
+LOOP
+SELECT i;
+END LOOP;
+END;
+$$
+i
+0
+i
+1
+BEGIN
+FOR i IN 0..EXISTS (SELECT * FROM t1 WHERE a=1)
+LOOP
+SELECT i;
+END LOOP;
+END;
+$$
+i
+0
+i
+1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+DECLARE
+a INT DEFAULT ((10) IN (SELECT * FROM t1));
+BEGIN
+SELECT a;
+END;
+$$
+a
+1
+DECLARE
+a INT DEFAULT EXISTS (SELECT * FROM t1);
+BEGIN
+SELECT a;
+END;
+$$
+a
+1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1() RETURN INT AS
+BEGIN
+RETURN ((1) IN (SELECT * FROM t1));
+END;
+$$
+CREATE FUNCTION f2() RETURN INT AS
+BEGIN
+RETURN EXISTS (SELECT * FROM t1 WHERE a=1);
+END;
+$$
+SELECT f1();
+f1()
+1
+SELECT f2();
+f2()
+1
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+DECLARE
+va INT;
+CURSOR cur(amin INT) IS SELECT a FROM t1 WHERE a>amin ORDER BY a;
+BEGIN
+OPEN cur(1 IN (SELECT * FROM t1));
+FETCH cur INTO va;
+SELECT va;
+CLOSE cur;
+END;
+$$
+va
+2
+DECLARE
+va INT;
+CURSOR cur(amin INT) IS SELECT a FROM t1 WHERE a>amin ORDER BY a;
+BEGIN
+OPEN cur(EXISTS (SELECT * FROM t1));
+FETCH cur INTO va;
+SELECT va;
+CLOSE cur;
+END;
+$$
+va
+2
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-goto-debug.result b/mysql-test/suite/compat/oracle/r/sp-goto-debug.result
new file mode 100644
index 00000000000..3660bfa2d84
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-goto-debug.result
@@ -0,0 +1,236 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-20667 Server crash on pop_cursor
+#
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 5(5) 1 = 2
+1 cpush cur1@0
+2 jump 3
+3 cpop 1
+4 jump 7
+5 jump_if_not 7(7) 1 = 1
+6 jump 7
+7 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN ;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 5(5) 1 = 2
+1 cpush cur1@0
+2 jump 3
+3 cpop 1
+4 jump 7
+5 jump_if_not 7(7) 1 = 1
+6 jump 7
+7 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+GOTO iac_err;
+<< iac_err >>
+RETURN ;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 5(5) 1 = 2
+1 cpush cur1@0
+2 jump 3
+3 cpop 1
+4 jump 5
+5 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+BEGIN
+SELECT 'cur2';
+IF 1=1 THEN
+DECLARE
+CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+BEGIN
+SELECT 'cur3';
+IF 1=1 THEN
+DECLARE
+CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+BEGIN
+SELECT 'cur4';
+GOTO ret;
+END;
+END IF;
+GOTO ret;
+END;
+END IF;
+GOTO ret;
+END;
+END IF;
+<<ret>>
+RETURN;
+END;
+//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 15(15) 1 = 1
+1 cpush cur2@0
+2 stmt 0 "SELECT 'cur2'"
+3 jump_if_not 13(13) 1 = 1
+4 cpush cur3@1
+5 stmt 0 "SELECT 'cur3'"
+6 jump_if_not 11(11) 1 = 1
+7 cpush cur4@2
+8 stmt 0 "SELECT 'cur4'"
+9 cpop 3
+10 jump 15
+11 cpop 2
+12 jump 15
+13 cpop 1
+14 jump 15
+15 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(lab VARCHAR(32)) IS
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+BEGIN
+IF lab = 'cur4' THEN
+SELECT 'goto from cur4' AS comment;
+GOTO ret;
+END IF;
+END;
+END IF;
+IF lab = 'cur3' THEN
+SELECT 'goto from cur3' AS comment;
+GOTO ret;
+END IF;
+END;
+END IF;
+IF lab = 'cur2' THEN
+SELECT 'goto from cur2' AS comment;
+GOTO ret;
+END IF;
+END;
+END IF;
+<<ret>>
+RETURN;
+END;
+//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 21(21) 1 = 1
+1 cpush cur2@0
+2 jump_if_not 16(16) 1 = 1
+3 cpush cur3@1
+4 jump_if_not 11(11) 1 = 1
+5 cpush cur4@2
+6 jump_if_not 10(10) lab@0 = 'cur4'
+7 stmt 0 "SELECT 'goto from cur4' AS comment"
+8 cpop 3
+9 jump 21
+10 cpop 1
+11 jump_if_not 15(15) lab@0 = 'cur3'
+12 stmt 0 "SELECT 'goto from cur3' AS comment"
+13 cpop 2
+14 jump 21
+15 cpop 1
+16 jump_if_not 20(20) lab@0 = 'cur2'
+17 stmt 0 "SELECT 'goto from cur2' AS comment"
+18 cpop 1
+19 jump 21
+20 cpop 1
+21 preturn
+CALL p1('');
+CALL p1('cur2');
+comment
+goto from cur2
+CALL p1('cur3');
+comment
+goto from cur3
+CALL p1('cur4');
+comment
+goto from cur4
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<<iac_err >>
+RETURN;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 9(9) 1 = 2
+1 hpush_jump 4 0 CONTINUE
+2 stmt 31 "SET @x2 = 1"
+3 hreturn 0
+4 hpop 1
+5 jump 11
+6 jump 11
+7 hpop 1
+8 jump 9
+9 jump_if_not 11(11) 1 = 1
+10 jump 11
+11 preturn
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-goto.result b/mysql-test/suite/compat/oracle/r/sp-goto.result
new file mode 100644
index 00000000000..badda507ee4
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-goto.result
@@ -0,0 +1,913 @@
+set sql_mode=oracle;
+#
+# MDEV-10697 sql_mode=ORACLE: GOTO statement
+#
+# matrice of tests in procedure
+# |--------------------------------------------------------
+# | | Same | Outside | to sub | No |
+# | | block | one block | block | matching |
+# | | | | | label |
+# |--------------------------------------------------------
+# | Forward jump | F1 | F3 | F5 | F7 |
+# |--------------------------------------------------------
+# | Backward jump | F2 | F4 | F6 | F8 |
+# |--------------------------------------------------------
+# Jump from handler to outside handling code block : F9
+# Jump from handler to handling code block : F10 (forbidden)
+# Jump inside handler : F21
+# Jump between handler : F22 (forbidden)
+# Jump from cascaded block with handler : F11
+# Duplicate label in same block : F12 (forbidden)
+# Duplicate label in different block : F13
+# Jump outside unlabeled block : F14
+# Jump inside/outside labeled block : F15
+# Jump from if / else : F16
+# Jump with cursors : F17
+# Jump outside case : F18
+# Jump inside/outside case block : F19
+# Jump outside labeled loop : F20
+# Jump (continue) labeled loop : F23
+# Two consecutive label : P24
+# Two consecutive label (backward and forward jump) : P25
+# Two consecutive label, continue to wrong label : P26
+# Consecutive goto label and block label : P27
+# Test in function
+# backward jump : func1
+# forward jump : func2
+# Test in trigger
+# forward jump : trg1
+#
+# Forward jump in same block
+#
+CREATE or replace procedure f1(p2 IN OUT VARCHAR)
+AS
+BEGIN
+p2:='a';
+goto lab1;
+<<lab1>>
+goto lab2;
+p2:='b';
+<<lab2>>
+return ;
+END;
+$$
+call f1(@wp1);
+select 'f1',@wp1;
+f1 @wp1
+f1 a
+DROP PROCEDURE f1;
+#
+# Backward jump in same block
+#
+CREATE or replace procedure f2(p2 IN OUT VARCHAR)
+AS
+BEGIN
+p2:='a';
+<<lab1>>
+if (p2='b') then
+return ;
+end if;
+p2:='b';
+goto lab1;
+END;
+$$
+call f2(@wp1);
+select 'f2',@wp1;
+f2 @wp1
+f2 b
+DROP PROCEDURE f2;
+#
+# Forward jump outside one block
+#
+CREATE or replace procedure f3(p2 IN OUT VARCHAR)
+AS
+BEGIN
+p2:='a';
+if (p2='a') then
+goto lab1;
+end if;
+p2:='c';
+<<lab1>>
+return ;
+END;
+$$
+call f3(@wp1);
+select 'f3',@wp1;
+f3 @wp1
+f3 a
+DROP PROCEDURE f3;
+#
+# Backward jump outside one block
+#
+CREATE or replace procedure f4(p2 IN OUT VARCHAR)
+AS
+BEGIN
+p2:='a';
+<<lab1>>
+if (p2='a') then
+p2:=p2||'b';
+goto lab1;
+end if;
+if (p2='ab') then
+p2:=p2||'c';
+end if;
+return ;
+END;
+$$
+call f4(@wp1);
+select 'f4',@wp1;
+f4 @wp1
+f4 abc
+DROP PROCEDURE f4;
+#
+# Forward jump inside sub block
+CREATE or replace procedure f5(p2 IN OUT VARCHAR)
+AS
+BEGIN
+p2:='a';
+goto lab5 ;
+if (p2='a') then
+<<lab5>>
+p2:=p2||'b';
+end if;
+return ;
+END;
+$$
+ERROR 42000: GOTO with no matching label: lab5
+#
+# Backward jump inside sub block
+CREATE or replace procedure f6(p2 IN OUT VARCHAR)
+AS
+BEGIN
+p2:='a';
+if (p2='a') then
+<<lab6>>
+p2:=p2||'b';
+return ;
+end if;
+goto lab6 ;
+END;
+$$
+ERROR 42000: GOTO with no matching label: lab6
+#
+# Backward jump - missing label
+CREATE or replace procedure f7(p2 IN OUT VARCHAR)
+AS
+BEGIN
+<<lab>>
+goto lab7 ;
+return ;
+END;
+$$
+ERROR 42000: GOTO with no matching label: lab7
+#
+# Forward jump - missing label
+CREATE or replace procedure f8(p2 IN OUT VARCHAR)
+AS
+BEGIN
+goto lab8 ;
+<<lab>>
+return ;
+END;
+$$
+ERROR 42000: GOTO with no matching label: lab8
+#
+# Jump from handler to procedure code
+#
+CREATE or replace procedure f9(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+<<lab9>>
+if lim=-1 then
+res:=res||' -- goto end limit -1 --';
+goto lab9_end;
+end if;
+begin
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+begin
+res:=res||'--- too_many_rows cought ---';
+lim:=0;
+goto lab9;
+end;
+WHEN NO_DATA_FOUND THEN
+begin
+res:=res||'--- no_data_found cought ---';
+lim:=-1;
+goto lab9;
+end;
+end;
+res:=res||'error';
+<<lab9_end>>
+return ;
+END;
+$$
+SET @res='';
+CALL f9(2, @res);
+SELECT 'f9',@res;
+f9 @res
+f9 --- too_many_rows cought ------ no_data_found cought --- -- goto end limit -1 --
+CALL f9(0, @res);
+SELECT 'f9',@res;
+f9 @res
+f9 --- no_data_found cought --- -- goto end limit -1 --
+DROP PROCEDURE f9;
+#
+# Jump from handler to handling bloc
+CREATE or replace procedure f10(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+begin
+<<lab10>>
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+begin
+res:='--- too_many_rows cought ---';
+goto lab10;
+end;
+WHEN NO_DATA_FOUND THEN res:='--- no_data_found cought ---';
+end;
+return ;
+END;
+$$
+ERROR 42000: GOTO with no matching label: lab10
+#
+# Jump from cascaded block with handler
+#
+CREATE or replace procedure f11(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+<<lab11a>>
+begin
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+begin
+res:=res||'--- too_many_rows cought 1 ---';
+goto lab11b;
+end;
+WHEN NO_DATA_FOUND THEN
+begin
+res:=res||'--- no_data_found cought 1 ---';
+lim:=2;
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+begin
+res:=res||'--- too_many_rows cought 2 ---';
+goto lab11a;
+end;
+WHEN NO_DATA_FOUND THEN res:='--- no_data_found cought 2 ---';
+end;
+end;
+set res:=res||' error ';
+<<lab11b>>
+return ;
+END;
+$$
+SET @res='';
+CALL f11(0, @res);
+SELECT 'f11',@res;
+f11 @res
+f11 --- no_data_found cought 1 ------ too_many_rows cought 2 ------ too_many_rows cought 1 ---
+DROP PROCEDURE f11;
+#
+# Jump inside handler
+#
+CREATE or replace procedure f21(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+begin
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+begin
+<<retry>>
+lim:=lim-1;
+loop
+begin
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+begin
+lim:=lim-1;
+goto retry;
+end;
+end;
+exit ;
+end loop;
+end;
+end;
+res:=lim;
+return ;
+END;
+$$
+SET @res='';
+CALL f21(10, @res);
+SELECT 'f21',@res;
+f21 @res
+f21 1
+drop procedure f21;
+#
+# Jump beetween handler
+CREATE or replace procedure f22(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+res:='ok';
+begin
+SELECT a INTO a FROM information_schema.tables LIMIT lim;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN
+goto nodata ;
+WHEN NO_DATA_FOUND THEN
+begin
+<<nodata>>
+res:='error';
+end;
+end;
+return ;
+END;
+$$
+ERROR 42000: GOTO with no matching label: nodata
+#
+# Duplicate label in same bloc
+CREATE or replace procedure f12(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+<<lab12>>
+res:='error';
+<<lab12>>
+return ;
+END;
+$$
+ERROR 42000: Redefining label lab12
+#
+# Duplicate label in different block
+#
+CREATE or replace procedure f13(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+a:=0;
+<<lab13>>
+a:=a+1;
+begin
+<<lab13>>
+a:=a+1;
+if (a<10) then
+goto lab13;
+end if;
+end;
+res:=a;
+if (a=10) then
+goto lab13;
+end if;
+return ;
+END;
+$$
+SET @res='';
+CALL f13(0, @res);
+SELECT 'f13',@res;
+f13 @res
+f13 12
+DROP PROCEDURE f13;
+#
+# Jump outside unlabeled block
+#
+CREATE or replace procedure f14(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+a:=0;
+loop
+a:=a+1;
+if (a<10) then
+continue;
+end if;
+if (a>=lim) then
+goto lab14;
+end if;
+if (a>=20) then
+exit;
+end if;
+end loop;
+<<lab14>>
+res:=a;
+return ;
+END;
+$$
+SET @res='';
+CALL f14(15, @res);
+SELECT 'f14',@res;
+f14 @res
+f14 15
+CALL f14(8, @res);
+SELECT 'f14',@res;
+f14 @res
+f14 10
+CALL f14(25, @res);
+SELECT 'f14',@res;
+f14 @res
+f14 20
+DROP PROCEDURE f14;
+#
+# Jump inside/outside labeled block
+#
+CREATE or replace procedure f15(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+a:=0;
+<<looplabel>> loop
+<<beginlooplabel>>
+a:=a+1;
+if (a<10) then
+continue looplabel;
+end if;
+if (a>=lim) then
+goto lab15;
+end if;
+if (a>=20) then
+exit looplabel;
+end if;
+goto beginlooplabel;
+end loop;
+<<lab15>>
+res:=a;
+return ;
+END;
+$$
+SET @res='';
+CALL f15(15, @res);
+SELECT 'f15',@res;
+f15 @res
+f15 15
+CALL f15(8, @res);
+SELECT 'f15',@res;
+f15 @res
+f15 10
+CALL f15(25, @res);
+SELECT 'f15',@res;
+f15 @res
+f15 20
+DROP PROCEDURE f15;
+#
+# Jump from if / else
+#
+CREATE or replace procedure f16(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+if (lim<10) then
+goto lab16_1;
+else
+goto lab16_2;
+end if;
+<<lab16_1>>
+res:='if lab16_1';
+goto lab16_3;
+<<lab16_2>>
+res:='else lab16_2';
+goto lab16_3;
+res:='error lab16_3';
+<<lab16_3>>
+return ;
+END;
+$$
+SET @res='';
+CALL f16(15, @res);
+SELECT 'f16',@res;
+f16 @res
+f16 else lab16_2
+CALL f16(8, @res);
+SELECT 'f16',@res;
+f16 @res
+f16 if lab16_1
+DROP PROCEDURE f16;
+#
+# Jump with cursors
+#
+CREATE or replace procedure f17(lim INT, res OUT VARCHAR)
+AS
+v_a INT;
+v_b VARCHAR(10);
+CURSOR cur1 IS SELECT 1 FROM dual where 1=2;
+BEGIN
+OPEN cur1;
+LOOP
+FETCH cur1 INTO v_a;
+EXIT WHEN cur1%NOTFOUND;
+END LOOP;
+CLOSE cur1;
+<<lab17>>
+lim:=lim-1;
+begin
+declare
+CURSOR cur1 IS SELECT 1 FROM dual;
+CURSOR cur2 IS SELECT 1 FROM dual where 1=2;
+begin
+LOOP
+OPEN cur1;
+FETCH cur1 INTO v_a;
+EXIT WHEN cur1%NOTFOUND;
+res:=res||'-'||lim ;
+close cur1;
+if (lim>0) then
+goto lab17;
+else
+goto lab17_end;
+end if;
+END LOOP;
+end;
+<<lab17_end>>
+null;
+end;
+END;
+$$
+SET @res='';
+CALL f17(5, @res);
+SELECT 'f17',@res;
+f17 @res
+f17 -4-3-2-1-0
+DROP PROCEDURE f17;
+#
+# Jump outside case
+#
+CREATE or replace procedure f18(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+case lim
+when 1 then
+res:='case branch 18_1';
+goto lab18_1;
+res:='error';
+when 2 then
+res:='case branch 18_2';
+goto lab18_2;
+res:='error';
+else
+res:='default branch 18';
+end case;
+<<lab18_1>>
+null;
+<<lab18_2>>
+return ;
+END;
+$$
+SET @res='';
+CALL f18(0, @res);
+SELECT 'f18',@res;
+f18 @res
+f18 default branch 18
+CALL f18(1, @res);
+SELECT 'f18',@res;
+f18 @res
+f18 case branch 18_1
+CALL f18(2, @res);
+SELECT 'f18',@res;
+f18 @res
+f18 case branch 18_2
+DROP PROCEDURE f18;
+#
+# Jump inside/outside case block
+#
+CREATE or replace procedure f19(lim INT, res OUT VARCHAR)
+AS
+a INT;
+BEGIN
+a:=1;
+case lim
+when 1 then
+<<lab19_0>>
+a:=a+1;
+if (a<10) then
+goto lab19_0;
+else
+goto lab19_1;
+end if;
+res:='case branch 19_1';
+else
+res:='default branch 18';
+end case;
+goto lab19_end;
+<<lab19_1>>
+res:=a;
+<<lab19_end>>
+return ;
+END;
+$$
+SET @res='';
+CALL f19(1, @res);
+SELECT 'f19',@res;
+f19 @res
+f19 10
+DROP PROCEDURE f19;
+#
+# Jump outside labeled loop
+#
+CREATE OR REPLACE PROCEDURE f20(res OUT VARCHAR)
+AS
+a INT := 1;
+BEGIN
+<<lab>>
+FOR i IN a..10 LOOP
+IF i = 5 THEN
+a:= a+1;
+goto lab;
+END IF;
+END LOOP;
+res:=a;
+END;
+$$
+CALL f20(@res);
+SELECT 'f20',@res;
+f20 @res
+f20 6
+DROP PROCEDURE f20;
+#
+# Jump (continue) labeled loop
+#
+CREATE OR REPLACE PROCEDURE f23(res OUT VARCHAR)
+AS
+a INT := 1;
+BEGIN
+<<lab>>
+FOR i IN a..10 LOOP
+IF i = 5 THEN
+a:= a+1;
+continue lab;
+END IF;
+END LOOP;
+res:=a;
+END;
+$$
+CALL f23(@res);
+SELECT 'f23',@res;
+f23 @res
+f23 2
+DROP PROCEDURE f23;
+#
+# Two consecutive label (backward jump)
+#
+CREATE OR REPLACE PROCEDURE p24(action IN INT, res OUT varchar) AS
+a integer;
+BEGIN
+<<lab1>>
+<<lab2>>
+if (action = 1) then
+res:=res||' '||action;
+action:=2;
+goto lab1;
+end if;
+if (action = 2) then
+res:=res||' '||action;
+action:=3;
+goto lab2;
+end if;
+END;
+$$
+call p24(1,@res);
+select 'p24',@res;
+p24 @res
+p24 1 2
+DROP PROCEDURE p24;
+#
+# Two consecutive label (backward and forward jump)
+#
+CREATE OR REPLACE PROCEDURE p25(action IN INT, res OUT varchar) AS
+a integer;
+BEGIN
+if (action = 1) then
+res:=res||' '||action;
+action:=2;
+goto lab2;
+end if;
+goto lab_end;
+<<lab1>>
+<<lab2>>
+res:=res||' '||action;
+if (action = 2) then
+res:=res||' '||action;
+action:=3;
+goto lab1;
+end if;
+<<lab_end>>
+null;
+END;
+$$
+call p25(1,@res);
+select 'p25',@res;
+p25 @res
+p25 1 2 2 3
+DROP PROCEDURE p25;
+#
+# Two consecutive label, continue to wrong label
+CREATE OR REPLACE PROCEDURE p26(action IN INT, res OUT varchar) AS
+BEGIN
+<<lab1>>
+<<lab2>>
+FOR i IN 1..10 LOOP
+continue lab1;
+END LOOP;
+END;
+$$
+ERROR 42000: CONTINUE with no matching label: lab1
+#
+# Consecutive goto label and block label
+#
+CREATE OR REPLACE PROCEDURE p27(action IN INT, res OUT varchar) AS
+BEGIN
+res:='';
+<<lab1>>
+<<lab2>>
+FOR i IN 1..10 LOOP
+if (action = 1) then
+res:=res||' '||action||'-'||i;
+action:=2;
+continue lab2;
+end if;
+if (action = 2) then
+res:=res||' '||action||'-'||i;
+action:='3';
+goto lab2;
+end if;
+if (action = 3) then
+res:=res||' '||action||'-'||i;
+action:='4';
+goto lab1;
+end if;
+if (action = 4) then
+res:=res||' '||action||'-'||i;
+exit lab2;
+end if;
+END LOOP;
+END;
+$$
+call p27(1,@res);
+select 'p27',@res;
+p27 @res
+p27 1-1 2-2 3-1 4-1
+DROP PROCEDURE p27;
+# ----------------------
+# -- TEST IN FUNCTION --
+# ----------------------
+#
+# FUNCTION : Backward jump
+#
+CREATE or replace function func1()
+return varchar
+AS
+p2 varchar(10);
+BEGIN
+p2:='a';
+<<lab1>>
+if (p2='a') then
+p2:=p2||'b';
+goto lab1;
+end if;
+if (p2='ab') then
+p2:=p2||'c';
+end if;
+return p2;
+END;
+$$
+select 'func1',func1();
+func1 func1()
+func1 abc
+DROP function func1;
+#
+# FUNCTION : forward jump
+#
+CREATE or replace function func2()
+return varchar
+AS
+p2 varchar(10);
+BEGIN
+p2:='a';
+if (p2='a') then
+goto lab1;
+end if;
+p2:='b';
+<<lab1>>
+return p2;
+END;
+$$
+select 'func2',func2();
+func2 func2()
+func2 a
+DROP function func2;
+# ---------------------
+# -- TEST IN TRIGGER --
+# ---------------------
+#
+# TRIGGER : forward jump
+#
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+IF :NEW.a IS NULL
+THEN
+:NEW.a:= 15;
+goto end_trg;
+END IF;
+:NEW.a:= 10;
+<<end_trg>>
+null;
+END;
+$$
+insert into t1 values (1);
+insert into t1 values (null);
+SELECT * FROM t1;
+a
+10
+15
+DROP TRIGGER trg1;
+DROP TABLE t1;
+#
+# MDEV-20667 Server crash on pop_cursor
+#
+CREATE TABLE t1 (a VARCHAR(6));
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN;
+END//
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN ;
+END//
+CALL p1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+GOTO iac_err;
+<< iac_err >>
+RETURN ;
+END//
+CALL p1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<<iac_err >>
+RETURN;
+END//
+CALL p1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-code.result b/mysql-test/suite/compat/oracle/r/sp-package-code.result
new file mode 100644
index 00000000000..0dea72dba89
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-code.result
@@ -0,0 +1,245 @@
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+PROCEDURE p2show;
+PROCEDURE p2public;
+FUNCTION f2public RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+a INT:=10;
+PROCEDURE p1 AS
+b INT:=20;
+BEGIN
+b:=a;
+b:=a+1;
+a:=b;
+a:=b+1;
+a:=a+1;
+SET @a:=@a+2;
+SELECT f1() FROM DUAL;
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN a;
+END;
+PROCEDURE p2private AS
+BEGIN
+SELECT 'This is p2private';
+END;
+PROCEDURE p2public AS
+BEGIN
+SELECT 'This is p2public';
+END;
+FUNCTION f2private RETURN TEXT AS
+BEGIN
+RETURN 'This is f2private';
+END;
+FUNCTION f2public RETURN TEXT AS
+BEGIN
+RETURN 'This is f2public';
+END;
+PROCEDURE p2show AS
+BEGIN
+SHOW FUNCTION CODE f2public;
+SHOW FUNCTION CODE f2private;
+SHOW PROCEDURE CODE p2public;
+SHOW PROCEDURE CODE p2private;
+SHOW PROCEDURE CODE p2show;
+END;
+BEGIN
+a:=a+1;
+DECLARE
+b INT;
+BEGIN
+b:=a;
+b:=a+1;
+a:=b;
+a:=b+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 20
+1 set b@0 PACKAGE_BODY.a@0
+2 set b@0 PACKAGE_BODY.a@0 + 1
+3 set PACKAGE_BODY.a@0 b@0
+4 set PACKAGE_BODY.a@0 b@0 + 1
+5 set PACKAGE_BODY.a@0 PACKAGE_BODY.a@0 + 1
+6 stmt 31 "SET @a:=@a+2"
+7 stmt 0 "SELECT f1() FROM DUAL"
+SHOW FUNCTION CODE pkg1.f1;
+Pos Instruction
+0 freturn int PACKAGE_BODY.a@0
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 10
+1 set a@0 a@0 + 1
+2 set b@1 NULL
+3 set b@1 a@0
+4 set b@1 a@0 + 1
+5 set a@0 b@1
+6 set a@0 b@1 + 1
+7 jump 11
+CALL pkg1.p2show;
+Pos Instruction
+0 freturn blob 'This is f2public'
+Pos Instruction
+0 freturn blob 'This is f2private'
+Pos Instruction
+0 stmt 0 "SELECT 'This is p2public'"
+Pos Instruction
+0 stmt 0 "SELECT 'This is p2private'"
+Pos Instruction
+0 stmt 110 "SHOW FUNCTION CODE f2public"
+1 stmt 110 "SHOW FUNCTION CODE f2private"
+2 stmt 109 "SHOW PROCEDURE CODE p2public"
+3 stmt 109 "SHOW PROCEDURE CODE p2private"
+4 stmt 109 "SHOW PROCEDURE CODE p2show"
+DROP PACKAGE pkg1;
+CREATE TABLE t1 (a INT);
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+a t1.a%TYPE:=10;
+PROCEDURE p1 AS
+b t1.a%TYPE:=20;
+BEGIN
+b:=a;
+b:=a+1;
+b:=b+1;
+a:=b;
+a:=b+1;
+a:=a+1;
+END;
+BEGIN
+a:=a+1;
+DECLARE
+b t1.a%TYPE;
+BEGIN
+b:=a;
+b:=a+1;
+a:=b;
+a:=b+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 20
+1 set b@0 PACKAGE_BODY.a@0
+2 set b@0 PACKAGE_BODY.a@0 + 1
+3 set b@0 b@0 + 1
+4 set PACKAGE_BODY.a@0 b@0
+5 set PACKAGE_BODY.a@0 b@0 + 1
+6 set PACKAGE_BODY.a@0 PACKAGE_BODY.a@0 + 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 10
+1 set a@0 a@0 + 1
+2 set b@1 NULL
+3 set b@1 a@0
+4 set b@1 a@0 + 1
+5 set a@0 b@1
+6 set a@0 b@1 + 1
+7 jump 11
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+a ROW(a INT,b TEXT):=ROW(10,'x10');
+PROCEDURE p1 AS
+b ROW(a INT,b TEXT):=ROW(20,'x20');
+BEGIN
+b:=a;
+a:=b;
+b.a:=a.a+1;
+a.a:=b.a+1;
+a.a:=a.a+1;
+END;
+BEGIN
+a.a:=a.a+1;
+DECLARE
+b ROW(a INT,b TEXT):=ROW(30,'x30');
+BEGIN
+b:=a;
+b.a:=a.a+1;
+a:=b;
+a.a:=b.a+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 (20,'x20')
+1 set b@0 PACKAGE_BODY.a@0
+2 set PACKAGE_BODY.a@0 b@0
+3 set b.a@0[0] PACKAGE_BODY.a.a@0[0] + 1
+4 set PACKAGE_BODY.a.a@0[0] b.a@0[0] + 1
+5 set PACKAGE_BODY.a.a@0[0] PACKAGE_BODY.a.a@0[0] + 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 (10,'x10')
+1 set a.a@0[0] a.a@0[0] + 1
+2 set b@1 (30,'x30')
+3 set b@1 a@0
+4 set b.a@1[0] a.a@0[0] + 1
+5 set a@0 b@1
+6 set a.a@0[0] b.a@1[0] + 1
+7 jump 11
+DROP PACKAGE pkg1;
+CREATE TABLE t1 (a INT, b TEXT);
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+a t1%ROWTYPE:=ROW(10,'x10');
+PROCEDURE p1 AS
+b t1%ROWTYPE:=ROW(20,'x20');
+BEGIN
+b:=a;
+a:=b;
+b.a:=a.a+1;
+a.a:=b.a+1;
+a.a:=a.a+1;
+END;
+BEGIN
+a.a:=a.a+1;
+DECLARE
+b t1%ROWTYPE:=ROW(30,'x30');
+BEGIN
+b:=a;
+b.a:=a.a+1;
+a:=b;
+a.a:=b.a+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 (20,'x20')
+1 set b@0 PACKAGE_BODY.a@0
+2 set PACKAGE_BODY.a@0 b@0
+3 set b.a@0["a"] PACKAGE_BODY.a.a@0["a"] + 1
+4 set PACKAGE_BODY.a.a@0["a"] b.a@0["a"] + 1
+5 set PACKAGE_BODY.a.a@0["a"] PACKAGE_BODY.a.a@0["a"] + 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 (10,'x10')
+1 set a.a@0["a"] a.a@0["a"] + 1
+2 set b@1 (30,'x30')
+3 set b@1 a@0
+4 set b.a@1["a"] a.a@0["a"] + 1
+5 set a@0 b@1
+6 set a.a@0["a"] b.a@1["a"] + 1
+7 jump 11
+DROP PACKAGE pkg1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-db.result b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-db.result
new file mode 100644
index 00000000000..95f45c25314
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-db.result
@@ -0,0 +1,43 @@
+#
+# MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+#
+SET @object_type='db';
+#
+# Start of sp-package-concurrent-dml.inc
+#
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p2 AS
+BEGIN
+SELECT 'This is p2' AS msg;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+DO GET_LOCK('mdev15070',120);
+CALL p2();
+DO RELEASE_LOCK('mdev15070');
+END;
+END;
+$$
+connect con2,localhost,root;
+connection con2;
+DO GET_LOCK('mdev15070', 120);
+connection default;
+CALL pkg1.p1;
+connection con2;
+CREATE DATABASE test1;
+CREATE FUNCTION test1.f1() RETURNS INT RETURN 10;
+DROP DATABASE test1;
+DO RELEASE_LOCK('mdev15070');
+disconnect con2;
+connection default;
+msg
+This is p1
+msg
+This is p2
+DROP PACKAGE IF EXISTS pkg1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-package.result b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-package.result
new file mode 100644
index 00000000000..eb7d38a8f67
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-package.result
@@ -0,0 +1,96 @@
+#
+# MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+#
+SET @object_type='package_replace_pkg1';
+#
+# Start of sp-package-concurrent-dml.inc
+#
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p2 AS
+BEGIN
+SELECT 'This is p2' AS msg;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+DO GET_LOCK('mdev15070',120);
+CALL p2();
+DO RELEASE_LOCK('mdev15070');
+END;
+END;
+$$
+connect con2,localhost,root;
+connection con2;
+DO GET_LOCK('mdev15070', 120);
+connection default;
+CALL pkg1.p1;
+connection con2;
+SET sql_mode=ORACLE;
+CREATE OR REPLACE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+DROP PACKAGE pkg1;
+DO RELEASE_LOCK('mdev15070');
+disconnect con2;
+connection default;
+msg
+This is p1
+msg
+This is p2
+DROP PACKAGE IF EXISTS pkg1;
+Warnings:
+Note 1305 PACKAGE test.pkg1 does not exist
+SET @object_type='package_body_replace_pkg1';
+#
+# Start of sp-package-concurrent-dml.inc
+#
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p2 AS
+BEGIN
+SELECT 'This is p2' AS msg;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+DO GET_LOCK('mdev15070',120);
+CALL p2();
+DO RELEASE_LOCK('mdev15070');
+END;
+END;
+$$
+connect con2,localhost,root;
+connection con2;
+DO GET_LOCK('mdev15070', 120);
+connection default;
+CALL pkg1.p1;
+connection con2;
+SET sql_mode=ORACLE;
+CREATE OR REPLACE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1 version 2' AS msg;
+END;
+END;
+$$
+DROP PACKAGE pkg1;
+DO RELEASE_LOCK('mdev15070');
+disconnect con2;
+connection default;
+msg
+This is p1
+msg
+This is p2
+DROP PACKAGE IF EXISTS pkg1;
+Warnings:
+Note 1305 PACKAGE test.pkg1 does not exist
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-trigger.result b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-trigger.result
new file mode 100644
index 00000000000..8181714f59c
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-trigger.result
@@ -0,0 +1,44 @@
+#
+# MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+#
+SET @object_type='trigger';
+#
+# Start of sp-package-concurrent-dml.inc
+#
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p2 AS
+BEGIN
+SELECT 'This is p2' AS msg;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+DO GET_LOCK('mdev15070',120);
+CALL p2();
+DO RELEASE_LOCK('mdev15070');
+END;
+END;
+$$
+connect con2,localhost,root;
+connection con2;
+DO GET_LOCK('mdev15070', 120);
+connection default;
+CALL pkg1.p1;
+connection con2;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+DO RELEASE_LOCK('mdev15070');
+disconnect con2;
+connection default;
+msg
+This is p1
+msg
+This is p2
+DROP PACKAGE IF EXISTS pkg1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-view.result b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-view.result
new file mode 100644
index 00000000000..b0ceec608a6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-concurrent-dml-view.result
@@ -0,0 +1,42 @@
+#
+# MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+#
+SET @object_type='view';
+#
+# Start of sp-package-concurrent-dml.inc
+#
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p2 AS
+BEGIN
+SELECT 'This is p2' AS msg;
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+DO GET_LOCK('mdev15070',120);
+CALL p2();
+DO RELEASE_LOCK('mdev15070');
+END;
+END;
+$$
+connect con2,localhost,root;
+connection con2;
+DO GET_LOCK('mdev15070', 120);
+connection default;
+CALL pkg1.p1;
+connection con2;
+CREATE VIEW v1 AS SELECT 1 AS c;
+DROP VIEW v1;
+DO RELEASE_LOCK('mdev15070');
+disconnect con2;
+connection default;
+msg
+This is p1
+msg
+This is p2
+DROP PACKAGE IF EXISTS pkg1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-innodb.result b/mysql-test/suite/compat/oracle/r/sp-package-innodb.result
new file mode 100644
index 00000000000..50eb2dc6cd0
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-innodb.result
@@ -0,0 +1,75 @@
+SET default_storage_engine=InnoDB;
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (a INT, routine TEXT);
+SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+ENGINE
+InnoDB
+INSERT INTO t1 VALUES (10,'none');
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+a INT;
+PROCEDURE p1 AS
+BEGIN
+a:=a+1;
+INSERT INTO t1 VALUES (a,'p1');
+END;
+BEGIN
+SELECT MAX(t1.a) FROM t1 INTO a;
+a:=a+1;
+INSERT INTO t1 VALUES (a,'pkg1 initialization');
+END;
+$$
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+a routine
+10 none
+11 pkg1 initialization
+12 p1
+DELETE FROM t1;
+# sp-cache-invalidate
+START TRANSACTION;
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+a routine
+NULL pkg1 initialization
+NULL p1
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+a routine
+DELETE FROM t1;
+# sp-cache-invalidate
+INSERT INTO t1 VALUES (20,'none');
+START TRANSACTION;
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+a routine
+20 none
+21 pkg1 initialization
+22 p1
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a routine
+20 none
+21 pkg1 initialization
+22 p1
+DELETE FROM t1;
+# sp-cache-invalidate
+INSERT INTO t1 VALUES (20,'none');
+START TRANSACTION;
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+a routine
+20 none
+21 pkg1 initialization
+22 p1
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+a routine
+20 none
+DELETE FROM t1;
+DROP PACKAGE pkg1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-mdl.result b/mysql-test/suite/compat/oracle/r/sp-package-mdl.result
new file mode 100644
index 00000000000..18cc834461c
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-mdl.result
@@ -0,0 +1,80 @@
+SET sql_mode=ORACLE;
+DO GET_LOCK('lock',300);
+connect conn1,localhost,root,,;
+SET sql_mode=ORACLE;
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS
+BEGIN
+DO GET_LOCK('lock',300);
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+CALL p1;
+RETURN 1;
+END;
+END;
+$$
+SELECT pkg1.f1();
+connection default;
+connect conn2,localhost,root,,;
+SET sql_mode=ORACLE;
+DROP PACKAGE pkg1;
+connection default;
+SELECT ID-CONNECTION_ID() AS CONN,INFO,STATE,LOCK_MODE,LOCK_TYPE,TABLE_NAME
+FROM INFORMATION_SCHEMA.PROCESSLIST
+LEFT JOIN INFORMATION_SCHEMA.METADATA_LOCK_INFO
+ON (ID=THREAD_ID)
+ORDER BY ID,TABLE_NAME,LOCK_MODE,LOCK_TYPE;
+CONN 0
+INFO SELECT ID-CONNECTION_ID() AS CONN,INFO,STATE,LOCK_MODE,LOCK_TYPE,TABLE_NAME
+FROM INFORMATION_SCHEMA.PROCESSLIST
+LEFT JOIN INFORMATION_SCHEMA.METADATA_LOCK_INFO
+ON (ID=THREAD_ID)
+ORDER BY ID,TABLE_NAME,LOCK_MODE,LOCK_TYPE
+STATE Filling schema table
+LOCK_MODE MDL_SHARED_NO_WRITE
+LOCK_TYPE User lock
+TABLE_NAME
+CONN 1
+INFO DO GET_LOCK('lock',300)
+STATE User lock
+LOCK_MODE MDL_SHARED
+LOCK_TYPE Stored package body metadata lock
+TABLE_NAME pkg1
+CONN 1
+INFO DO GET_LOCK('lock',300)
+STATE User lock
+LOCK_MODE MDL_SHARED
+LOCK_TYPE Stored function metadata lock
+TABLE_NAME pkg1.f1
+CONN 1
+INFO DO GET_LOCK('lock',300)
+STATE User lock
+LOCK_MODE MDL_SHARED
+LOCK_TYPE Stored procedure metadata lock
+TABLE_NAME pkg1.p1
+CONN 2
+INFO DROP PACKAGE pkg1
+STATE Waiting for stored package body metadata lock
+LOCK_MODE MDL_INTENTION_EXCLUSIVE
+LOCK_TYPE Global read lock
+TABLE_NAME
+CONN 2
+INFO DROP PACKAGE pkg1
+STATE Waiting for stored package body metadata lock
+LOCK_MODE MDL_INTENTION_EXCLUSIVE
+LOCK_TYPE Schema metadata lock
+TABLE_NAME
+DO RELEASE_LOCK('lock');
+connection conn1;
+pkg1.f1()
+1
+disconnect conn1;
+connection conn2;
+disconnect conn2;
+connection default;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result b/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result
new file mode 100644
index 00000000000..21bead42b0a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result
@@ -0,0 +1,261 @@
+SET sql_mode=ORACLE;
+CREATE PROCEDURE p1 AS
+BEGIN
+SELECT pkg1.f1(); -- a standalone routine calls a package routine
+END;
+$$
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS
+BEGIN
+CALL test.p1; -- a package routine calls a standalone routine
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+END;
+$$
+CALL p1;
+pkg1.f1()
+10
+CALL pkg1.p1;
+pkg1.f1()
+10
+SELECT pkg1.f1();
+pkg1.f1()
+10
+CREATE PACKAGE pkg2 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*!50003 DROP PROCEDURE IF EXISTS `p1` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ;
+DELIMITER ;;
+CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+BEGIN
+SELECT pkg1.f1(); -- a standalone routine calls a package routine
+END ;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PACKAGE IF EXISTS `pkg1` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ;
+DELIMITER ;;
+CREATE DEFINER="root"@"localhost" PACKAGE "pkg1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END ;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PACKAGE IF EXISTS `pkg2` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ;
+DELIMITER ;;
+CREATE DEFINER="root"@"localhost" PACKAGE "pkg2" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END ;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PACKAGE BODY IF EXISTS `pkg1` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ;
+DELIMITER ;;
+CREATE DEFINER="root"@"localhost" PACKAGE BODY "pkg1" AS
+PROCEDURE p1 AS
+BEGIN
+CALL test.p1; -- a package routine calls a standalone routine
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+END ;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="test">
+ <routines>
+ <routine Procedure="p1" sql_mode="PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+BEGIN
+SELECT pkg1.f1(); -- a standalone routine calls a package routine
+END
+]]>
+ </routine>
+ <routine Package="pkg1" sql_mode="PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER="root"@"localhost" PACKAGE "pkg1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END
+]]>
+ </routine>
+ <routine Package="pkg2" sql_mode="PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER="root"@"localhost" PACKAGE "pkg2" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END
+]]>
+ </routine>
+ <routine Package_body="pkg1" sql_mode="PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER="root"@"localhost" PACKAGE BODY "pkg1" AS
+PROCEDURE p1 AS
+BEGIN
+CALL test.p1; -- a package routine calls a standalone routine
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+END
+]]>
+ </routine>
+ </routines>
+</database>
+</mysqldump>
+DROP PACKAGE pkg1;
+DROP PACKAGE pkg2;
+DROP PROCEDURE p1;
+SHOW PACKAGE STATUS;
+Db test
+Name pkg1
+Type PACKAGE
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+Db test
+Name pkg2
+Type PACKAGE
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW PACKAGE BODY STATUS;
+Db test
+Name pkg1
+Type PACKAGE BODY
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkg1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE pkg2;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg2 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkg2" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg1;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pkg1" AS
+PROCEDURE p1 AS
+BEGIN
+CALL test.p1;
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1;
+pkg1.f1()
+10
+CALL pkg1.p1;
+pkg1.f1()
+10
+SELECT pkg1.f1();
+pkg1.f1()
+10
+DROP PACKAGE pkg1;
+DROP PACKAGE pkg2;
+DROP PROCEDURE p1;
+# removing the dump file
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-security.result b/mysql-test/suite/compat/oracle/r/sp-package-security.result
new file mode 100644
index 00000000000..c08b78cb8cf
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package-security.result
@@ -0,0 +1,322 @@
+SET sql_mode=ORACLE;
+CREATE DATABASE db1;
+CREATE USER u1@localhost IDENTIFIED BY '';
+GRANT SELECT ON db1.* TO u1@localhost;
+connect conn1,localhost,u1,,db1;
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+SET sql_mode=ORACLE;
+#
+# User u1 cannot drop PROCEDURE, PACKAGE, PACKAGE BODY by default
+#
+DROP PROCEDURE p1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.p1'
+DROP PACKAGE pkg1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+DROP PACKAGE BODY pkg1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+#
+# User u1 cannot create PROCEDURE, PACKAGE, PACKAGE BODY by default
+#
+CREATE PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+$$
+ERROR 42000: Access denied for user 'u1'@'localhost' to database 'db1'
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+ERROR 42000: Access denied for user 'u1'@'localhost' to database 'db1'
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+ERROR 42000: PACKAGE db1.pkg1 does not exist
+#
+# Now create a PACKAGE by root
+#
+connection default;
+USE db1;
+CREATE PROCEDURE p1root AS
+BEGIN
+SELECT 1;
+END;
+$$
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkg1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+#
+# u1 cannot SHOW yet:
+# - the standalone procedure earlier created by root
+# - the package specifications earlier create by root
+#
+connection conn1;
+SHOW CREATE PROCEDURE p1root;
+ERROR 42000: PROCEDURE p1root does not exist
+SHOW CREATE PACKAGE pkg1;
+ERROR 42000: PACKAGE pkg1 does not exist
+#
+# User u1 still cannot create a PACKAGE BODY
+#
+connection conn1;
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is f1'; END;
+END;
+$$
+ERROR 42000: Access denied for user 'u1'@'localhost' to database 'db1'
+#
+# Now grant EXECUTE:
+# - on the standalone procedure earlier created by root
+# - on the package specification earlier created by root
+#
+connection default;
+GRANT EXECUTE ON PROCEDURE db1.p1root TO u1@localhost;
+GRANT EXECUTE ON PACKAGE db1.pkg1 TO u1@localhost;
+#
+# Now u1 can do SHOW for:
+# - the standalone procedure earlier created by root
+# - the package specification earlier created by root
+#
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+SET sql_mode=ORACLE;
+SHOW CREATE PROCEDURE db1.p1root;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1root PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE db1.pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+#
+# Now revoke EXECUTE and grant CREATE ROUTINE instead
+#
+connection default;
+REVOKE EXECUTE ON PROCEDURE db1.p1root FROM u1@localhost;
+REVOKE EXECUTE ON PACKAGE db1.pkg1 FROM u1@localhost;
+GRANT CREATE ROUTINE ON db1.* TO u1@localhost;
+#
+# Reconnect u1 to make new grants have effect
+#
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+SET sql_mode=ORACLE;
+#
+# Now u1 can SHOW:
+# - standalone routines earlier created by root
+# - package specifications earlier created by root
+#
+SHOW CREATE PROCEDURE p1root;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1root PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+#
+# Now u1 can CREATE, DROP and EXECUTE its own standalone procedures
+#
+CREATE PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+$$
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE "db1"."p1" TO "u1"@"localhost"
+CALL p1;
+DROP PROCEDURE p1;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+#
+# Now u1 can also CREATE, DROP its own package specifications
+#
+CREATE PACKAGE pkg2 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+SHOW CREATE PACKAGE pkg2;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg2 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="u1"@"localhost" PACKAGE "pkg2" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE, ALTER ROUTINE ON PACKAGE "db1"."pkg2" TO "u1"@"localhost"
+DROP PACKAGE pkg2;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+#
+# Now u1 can also CREATE, DROP package bodies and EXECUTE package body routines
+#
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
+END;
+$$
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg1;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="u1"@"localhost" PACKAGE BODY "pkg1" AS
+PROCEDURE p1 AS BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE, ALTER ROUTINE ON PACKAGE BODY "db1"."pkg1" TO "u1"@"localhost"
+CALL pkg1.p1;
+comment
+This is pkg1.p1
+SELECT pkg1.f1();
+pkg1.f1()
+This is pkg1.f1
+DROP PACKAGE BODY pkg1;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+#
+# Now create a PACKAGE BODY by root.
+# u1 does not have EXECUTE access by default.
+#
+connection default;
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
+END;
+$$
+connection conn1;
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg1;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+CALL pkg1.p1;
+ERROR 42000: execute command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+SELECT pkg1.f1();
+ERROR 42000: execute command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+#
+# Now grant EXECUTE to u1 on the PACKAGE BODY created by root
+#
+connection default;
+GRANT EXECUTE ON PACKAGE BODY db1.pkg1 TO u1@localhost;
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+SET sql_mode=ORACLE;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE ON PACKAGE BODY "db1"."pkg1" TO "u1"@"localhost"
+CALL pkg1.p1;
+comment
+This is pkg1.p1
+SELECT pkg1.f1();
+pkg1.f1()
+This is pkg1.f1
+connection default;
+DROP PACKAGE BODY pkg1;
+#
+# u1 still cannot DROP the package specification earlier created by root.
+#
+connection conn1;
+DROP PACKAGE pkg1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+#
+# Grant ALTER ROUTINE to u1
+#
+connection default;
+GRANT ALTER ROUTINE ON db1.* TO u1@localhost;
+#
+# Now u1 can DROP:
+# - the standalone procedure earlier created by root
+# - the package specification earlier created by root
+#
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+SET sql_mode=ORACLE;
+DROP PACKAGE pkg1;
+DROP PROCEDURE p1root;
+disconnect conn1;
+connection default;
+DROP USER u1@localhost;
+DROP DATABASE db1;
+USE test;
+#
+# Creator=root, definer=xxx
+#
+CREATE USER xxx@localhost;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+PROCEDURE p1 AS
+BEGIN
+SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+END;
+BEGIN
+SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+CALL p1.p1;
+ERROR 42000: execute command denied to user 'xxx'@'localhost' for routine 'test.p1'
+GRANT EXECUTE ON PACKAGE BODY test.p1 TO xxx@localhost;
+CALL p1.p1;
+SESSION_USER() CURRENT_USER() msg
+root@localhost xxx@localhost package body p1
+SESSION_USER() CURRENT_USER() msg
+root@localhost xxx@localhost p1.p1
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+#
+# Creator=root, definer=xxx, SQL SECURITY INVOKER
+#
+CREATE USER xxx@localhost;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+PROCEDURE p1 AS
+BEGIN
+SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+END;
+BEGIN
+SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+CALL p1.p1;
+SESSION_USER() CURRENT_USER() msg
+root@localhost root@localhost package body p1
+SESSION_USER() CURRENT_USER() msg
+root@localhost root@localhost p1.p1
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package.result b/mysql-test/suite/compat/oracle/r/sp-package.result
new file mode 100644
index 00000000000..9a53b04d4ad
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-package.result
@@ -0,0 +1,2919 @@
+SET sql_mode=ORACLE;
+#
+# Creating a body of a non-existing package
+#
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+ERROR 42000: PACKAGE test.test2 does not exist
+#
+# Dropping a non-existing package
+#
+DROP PACKAGE test2;
+ERROR 42000: PACKAGE test.test2 does not exist
+DROP PACKAGE IF EXISTS test2;
+Warnings:
+Note 1305 PACKAGE test.test2 does not exist
+DROP PACKAGE BODY test2;
+ERROR 42000: PACKAGE BODY test.test2 does not exist
+#
+# Bad combinations of OR REPLACE and IF EXISTS
+#
+CREATE OR REPLACE PACKAGE IF NOT EXISTS pkg AS
+PROCEDURE p1;
+END;
+$$
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+CREATE OR REPLACE PACKAGE BODY IF NOT EXISTS pkg AS
+PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+#
+# PACKAGE and PS
+#
+PREPARE stmt FROM 'CREATE PACKAGE test2 AS FUNCTION f1 RETURN INT; END test2';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+PREPARE stmt FROM 'CREATE PACKAGE BODY test2 AS'
+ ' FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;'
+ 'END test2';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+DROP PACKAGE test2;
+#
+# Package and READ ONLY transactions
+#
+SET SESSION TRANSACTION READ ONLY;
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END
+$$
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+SET SESSION TRANSACTION READ WRITE;
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION f2 RETURN INT;
+END;
+$$
+SET SESSION TRANSACTION READ ONLY
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+FUNCTION f2 RETURN INT AS BEGIN RETURN f1(); END;
+PROCEDURE p1 AS
+BEGIN
+SELECT f2();
+END;
+END;
+$$
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+SET SESSION TRANSACTION READ WRITE;
+DROP PACKAGE test2;
+SET SESSION TRANSACTION READ ONLY;
+DROP PACKAGE test2;
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+DROP PACKAGE BODY test2;
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+SET SESSION TRANSACTION READ WRITE;
+#
+# Syntax error inside a CREATE PACKAGE, inside a routine definition
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION f2 RETURN INT;
+FUNCTION f3;
+FUNCTION f4 RETURN INT;
+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 ';
+FUNCTION f4 RETURN INT;
+END' at line 4
+#
+# Syntax error inside a CREATE PACKAGE, outside of a routine definition
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION f2 RETURN INT;
+FUNCTION f3 RETURN INT AS BEGIN RETURN 10; END;
+FUNCTION f4 RETURN INT;
+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 'AS BEGIN RETURN 10; END;
+FUNCTION f4 RETURN INT;
+END' at line 4
+#
+# Syntax error inside a CREATE PACKAGE BODY, inside a routine definition
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION f2 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+FUNCTION f2 RETURN INT SA BEGIN RETURN 10; END; -- Notice "SA" vs "AS"
+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 'SA BEGIN RETURN 10; END; -- Notice "SA" vs "AS"
+END' at line 3
+DROP PACKAGE test2;
+#
+# Syntax error inside a CREATE PACKAGE BODY, outside a routine definition
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION f2 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+SOME SYNTAX ERROR;
+FUNCTION f2 RETURN INT AS BEGIN RETURN 10; END;
+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 'SOME SYNTAX ERROR;
+FUNCTION f2 RETURN INT AS BEGIN RETURN 10; END;
+END' at line 3
+DROP PACKAGE test2;
+#
+# Syntax error inside a CREATE PACKAGE BODY executable section
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+BEGIN
+SOME SYNTAX ERROR;
+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 'SYNTAX ERROR;
+END' at line 4
+DROP PACKAGE test2;
+#
+# CREATE PROCEDURE inside a package PROCEDURE is not allowed
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS
+BEGIN
+CREATE PROCEDURE p1 AS BEGIN NULL; END;
+END;
+END;
+$$
+ERROR 2F003: Can't create a PROCEDURE from within another stored routine
+DROP PACKAGE test2;
+#
+# CREATE PACKAGE inside a package PROCEDURE is not allowed
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS
+BEGIN
+CREATE PACKAGE p1 AS PROCEDURE p1; END;
+END;
+END;
+$$
+ERROR 2F003: Can't create a PACKAGE from within another stored routine
+DROP PACKAGE test2;
+#
+# CREATE PROCEDURE inside a package executable section is not allowed
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+BEGIN
+CREATE PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+ERROR 2F003: Can't create a PROCEDURE from within another stored routine
+DROP PACKAGE test2;
+#
+# CREATE FUNCTION inside a package executable section is not allowed
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+BEGIN
+CREATE FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+END;
+$$
+ERROR 2F003: Can't create a FUNCTION from within another stored routine
+DROP PACKAGE test2;
+#
+# CREATE PACKAGE inside a package executable section is not allowed
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+BEGIN
+CREATE PACKAGE p1 AS PROCEDURE p1; END;
+END;
+$$
+ERROR 2F003: Can't create a PACKAGE from within another stored routine
+DROP PACKAGE test2;
+#
+# Broken CREATE PACKAGE at CREATE PACKAGE BODY time
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+UPDATE mysql.proc SET `body`='garbage'
+ WHERE db='test' AND name='test2' AND type='PACKAGE';
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT
+AS BEGIN
+RETURN f2();
+END;
+END;
+$$
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+DROP PACKAGE test2;
+#
+# Broken CREATE PACKAGE at a package function call time
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT
+AS BEGIN
+RETURN f2();
+END;
+END;
+$$
+SELECT test2.f1();
+ERROR 42000: FUNCTION test.f2 does not exist
+UPDATE mysql.proc SET `body`='garbage'
+ WHERE db='test' AND name='test2' AND type='PACKAGE';
+# sp-cache-invalidate
+SELECT test2.f1();
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+SELECT test2.f1();
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+SELECT test2.f1();
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+DROP PACKAGE test2;
+#
+# Broken CREATE PACKAGE at a package procedure call time
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1
+AS BEGIN
+CALL p2;
+END;
+END;
+$$
+CALL test2.f1();
+ERROR 42000: PROCEDURE test2.f1 does not exist
+UPDATE mysql.proc SET `body`='garbage'
+ WHERE db='test' AND name='test2' AND type='PACKAGE';
+# sp-cache-invalidate
+CALL test2.p1();
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+CALL test2.p1();
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+CALL test2.p1();
+ERROR HY000: Failed to load routine test.test2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
+DROP PACKAGE test2;
+#
+# Bad routine names
+#
+CREATE PACKAGE p1 AS
+PROCEDURE pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp1;
+END;
+$$
+ERROR 42000: Identifier name 'pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp1' is too long
+CREATE PACKAGE p1 AS
+FUNCTION fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1
+RETURN INT;
+END;
+$$
+ERROR 42000: Identifier name 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1' is too long
+CREATE PACKAGE p1 AS
+PROCEDURE "p1 ";
+END;
+$$
+ERROR 42000: Incorrect routine name 'p1 '
+CREATE PACKAGE p1 AS
+FUNCTION "f1 " RETURN INT;
+END;
+$$
+ERROR 42000: Incorrect routine name 'f1 '
+CREATE PACKAGE p1 AS
+PROCEDURE "p1.p1";
+END;
+$$
+ERROR 42000: Incorrect routine name 'p1.p1'
+CREATE PACKAGE p1 AS
+FUNCTION "f1.f1" RETURN INT;
+END;
+$$
+ERROR 42000: Incorrect routine name 'f1.f1'
+#
+# Duplicate PROCEDURE in CREATE PACKAGE
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+PROCEDURE p1;
+END;
+$$
+ERROR 42000: PROCEDURE test2.p1 already exists
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+PROCEDURE P1;
+END;
+$$
+ERROR 42000: PROCEDURE test2.P1 already exists
+#
+# Duplicate FUNCTION in CREATE PACKAGE
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION f1 RETURN INT;
+END;
+$$
+ERROR 42000: FUNCTION test2.f1 already exists
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+FUNCTION F1 RETURN INT;
+END;
+$$
+ERROR 42000: FUNCTION test2.F1 already exists
+#
+# Duplicate PROCEDURE in CREATE PACKAGE BODY
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+ERROR 42000: PROCEDURE test2.p1 already exists
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+PROCEDURE P1 AS BEGIN NULL; END;
+END;
+$$
+ERROR 42000: PROCEDURE test2.P1 already exists
+DROP PACKAGE test2;
+#
+# Duplicate FUNCTION in CREATE PACKAGE BODY
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+END;
+$$
+ERROR 42000: FUNCTION test2.f1 already exists
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+FUNCTION F1 RETURN INT AS BEGIN RETURN 0; END;
+END;
+$$
+ERROR 42000: FUNCTION test2.F1 already exists
+DROP PACKAGE test2;
+#
+# Routines declared in CREATE PACKAGE missing in CREATE PACKAGE BODY
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p2 AS BEGIN NULL; END;
+END;
+$$
+ERROR HY000: Subroutine 'test.test2.p1' is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f2 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+ERROR HY000: Subroutine 'test.test2.f1' is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION p1 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+ERROR HY000: Subroutine 'test.test2.p1' is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1(a INT) AS BEGIN NULL; END; -- Notice different prototype
+END;
+$$
+ERROR HY000: Subroutine 'test.test2.p1' is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+#
+# Forward declarations in CREATE PACKAGE BODY with missing implementations
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS BEGIN NULL; END;
+PROCEDURE p2;
+END;
+$$
+ERROR HY000: Subroutine 'test.test2.p2' has a forward declaration but is not defined
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+ERROR HY000: Subroutine 'test.test2.f1' has a forward declaration but is not defined
+DROP PACKAGE test2;
+#
+# Creating a new package
+#
+CREATE PACKAGE test2 COMMENT 'package-test2-comment' AS
+FUNCTION f1 RETURN INT DETERMINISTIC;
+FUNCTION f2(a INT) RETURN INT;
+FUNCTION concat RETURN INT;
+PROCEDURE p1;
+PROCEDURE p2(a INT);
+END
+$$
+Warnings:
+Note 1585 This function 'concat' has the same name as a native function
+SELECT * FROM mysql.proc WHERE db='test' AND name='test2';
+db test
+name test2
+type PACKAGE
+specific_name test2
+language SQL
+sql_data_access CONTAINS_SQL
+is_deterministic NO
+security_type DEFINER
+param_list
+returns
+body AS
+FUNCTION f1 RETURN INT DETERMINISTIC;
+FUNCTION f2(a INT) RETURN INT;
+FUNCTION concat RETURN INT;
+PROCEDURE p1;
+PROCEDURE p2(a INT);
+END
+definer root@localhost
+created #
+modified #
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+comment package-test2-comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+db_collation latin1_swedish_ci
+body_utf8
+aggregate NONE
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='test2';
+SPECIFIC_NAME test2
+ROUTINE_CATALOG def
+ROUTINE_SCHEMA test
+ROUTINE_NAME test2
+ROUTINE_TYPE PACKAGE
+DATA_TYPE
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED #
+LAST_ALTERED #
+SQL_MODE PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+ROUTINE_COMMENT package-test2-comment
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+CREATE PACKAGE IF NOT EXISTS test2 AS
+FUNCTION f1 RETURN INT;
+END test2
+$$
+Warnings:
+Note 1304 PACKAGE test2 already exists
+CREATE PACKAGE BODY test2 COMMENT 'package-body-test2-comment' AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+FUNCTION f2(a INT) RETURN INT AS BEGIN RETURN f1()+a; END;
+FUNCTION concat RETURN INT AS BEGIN RETURN 1; END;
+PROCEDURE p1 AS
+BEGIN
+SELECT f2(0);
+END;
+PROCEDURE p2(a INT) AS
+BEGIN
+SELECT f2(a);
+END;
+END;
+$$
+Warnings:
+Note 1585 This function 'concat' has the same name as a native function
+Note 1585 This function 'concat' has the same name as a native function
+CREATE PACKAGE BODY IF NOT EXISTS test2 AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 20; END;
+FUNCTION f2(a INT) RETURN INT AS BEGIN RETURN f1()+a; END;
+FUNCTION concat RETURN INT AS BEGIN RETURN 1; END;
+PROCEDURE p1 AS
+BEGIN
+SELECT f2(0);
+END;
+PROCEDURE p2(a INT) AS
+BEGIN
+SELECT f2(a);
+END;
+END;
+$$
+Warnings:
+Note 1585 This function 'concat' has the same name as a native function
+Note 1585 This function 'concat' has the same name as a native function
+Note 1304 PACKAGE BODY test2 already exists
+SELECT test2.f1();
+test2.f1()
+10
+SELECT test2.f2(1);
+test2.f2(1)
+11
+CALL test2.p1();
+f2(0)
+10
+CALL test2.p2(1);
+f2(a)
+11
+SELECT * FROM mysql.proc WHERE db='test' AND name LIKE 'test2.%';
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='test2';
+SPECIFIC_NAME test2
+ROUTINE_CATALOG def
+ROUTINE_SCHEMA test
+ROUTINE_NAME test2
+ROUTINE_TYPE PACKAGE
+DATA_TYPE
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED #
+LAST_ALTERED #
+SQL_MODE PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+ROUTINE_COMMENT package-test2-comment
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SPECIFIC_NAME test2
+ROUTINE_CATALOG def
+ROUTINE_SCHEMA test
+ROUTINE_NAME test2
+ROUTINE_TYPE PACKAGE BODY
+DATA_TYPE
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+DTD_IDENTIFIER NULL
+ROUTINE_BODY SQL
+ROUTINE_DEFINITION
+EXTERNAL_NAME NULL
+EXTERNAL_LANGUAGE NULL
+PARAMETER_STYLE SQL
+IS_DETERMINISTIC NO
+SQL_DATA_ACCESS CONTAINS SQL
+SQL_PATH NULL
+SECURITY_TYPE DEFINER
+CREATED #
+LAST_ALTERED #
+SQL_MODE PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+ROUTINE_COMMENT package-body-test2-comment
+DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME LIKE 'test2.%';
+SHOW PACKAGE STATUS;
+Db test
+Name test2
+Type PACKAGE
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment package-test2-comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW PACKAGE BODY STATUS;
+Db test
+Name test2
+Type PACKAGE BODY
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment package-body-test2-comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW CREATE PACKAGE test2;
+Package test2
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+Create Package CREATE DEFINER="root"@"localhost" PACKAGE "test2" COMMENT 'package-test2-comment'
+ AS
+FUNCTION f1 RETURN INT DETERMINISTIC;
+FUNCTION f2(a INT) RETURN INT;
+FUNCTION concat RETURN INT;
+PROCEDURE p1;
+PROCEDURE p2(a INT);
+END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW CREATE PACKAGE BODY test2;
+Package body test2
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+Create Package Body CREATE DEFINER="root"@"localhost" PACKAGE BODY "test2" COMMENT 'package-body-test2-comment'
+ AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+FUNCTION f2(a INT) RETURN INT AS BEGIN RETURN f1()+a; END;
+FUNCTION concat RETURN INT AS BEGIN RETURN 1; END;
+PROCEDURE p1 AS
+BEGIN
+SELECT f2(0);
+END;
+PROCEDURE p2(a INT) AS
+BEGIN
+SELECT f2(a);
+END;
+END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+DROP PACKAGE BODY test2;
+SELECT test2.f1();
+ERROR 42000: FUNCTION test.test2.f1 does not exist
+SELECT test2.f2();
+ERROR 42000: FUNCTION test.test2.f2 does not exist
+CALL test2.p1();
+ERROR 42000: PROCEDURE test.test2.p1 does not exist
+DROP PACKAGE BODY IF EXISTS test2;
+Warnings:
+Note 1305 PACKAGE BODY test.test2 does not exist
+DROP PACKAGE BODY test2;
+ERROR 42000: PACKAGE BODY test.test2 does not exist
+DROP PACKAGE test2;
+#
+# Creating a new package in a remote database
+#
+CREATE DATABASE test2;
+CREATE PACKAGE test2.test2 COMMENT 'package-test2-comment' AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END
+$$
+CREATE PACKAGE BODY test2.test2 COMMENT 'package-body-test2-comment' AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+PROCEDURE p1 AS BEGIN SELECT f1(); END;
+END;
+$$
+SHOW PACKAGE STATUS;
+Db test2
+Name test2
+Type PACKAGE
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment package-test2-comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SHOW PACKAGE BODY STATUS;
+Db test2
+Name test2
+Type PACKAGE BODY
+Definer root@localhost
+Modified 0000-00-00 00:00:00
+Created 0000-00-00 00:00:00
+Security_type DEFINER
+Comment package-body-test2-comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+USE test2;
+SELECT test2.f1();
+test2.f1()
+10
+CALL test2.p1();
+f1()
+10
+USE test;
+DROP PACKAGE BODY test2.test2;
+DROP PACKAGE test2.test2;
+DROP DATABASE test2;
+#
+# Only public routines are available outside
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+-- Public routines
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN 'This is test2.f1';
+END;
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is test2.p1';
+END;
+-- Private routines
+FUNCTION f2 RETURN TEXT AS
+BEGIN
+RETURN 'This is test2.f2';
+END;
+PROCEDURE p2 AS
+BEGIN
+SELECT 'This is test2.p2';
+END;
+END;
+$$
+SELECT test2.f1();
+test2.f1()
+This is test2.f1
+CALL test2.p1();
+This is test2.p1
+This is test2.p1
+SELECT test2.f2();
+ERROR 42000: FUNCTION test2.f2 does not exist
+CALL test2.p2();
+ERROR 42000: PROCEDURE test2.p2 does not exist
+DROP PACKAGE test2;
+#
+# PACKAGE BODY with forward declarations
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+-- Forward declarations
+FUNCTION f2private RETURN TEXT;
+PROCEDURE p2private;
+-- Public routines
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN f2private();
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL p2private;
+END;
+-- Definitions for the forward declarations
+FUNCTION f2private RETURN TEXT AS
+BEGIN
+RETURN 'This is f2private';
+END;
+PROCEDURE p2private AS
+BEGIN
+SELECT 'This is p2private';
+END;
+END;
+$$
+SELECT test2.f1();
+test2.f1()
+This is f2private
+CALL test2.p1();
+This is p2private
+This is p2private
+DROP PACKAGE test2;
+#
+# Calling private routines with forward declarations,
+# using qualified notation, e.g. "CALL pkg.proc"
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+-- Forward declarations
+FUNCTION f2private RETURN TEXT;
+PROCEDURE p2private;
+-- Public routines
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN test2.f2private();
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL test2.p2private;
+END;
+-- Definitions for the forward declarations
+FUNCTION f2private RETURN TEXT AS
+BEGIN
+RETURN 'This is f2private';
+END;
+PROCEDURE p2private AS
+BEGIN
+SELECT 'This is p2private' AS msg;
+END;
+END;
+$$
+SELECT test2.f1();
+test2.f1()
+This is f2private
+CALL test2.p1();
+msg
+This is p2private
+DROP PACKAGE test2;
+#
+# Calling private routines, using qualified notation, e.g. "pkg.proc"
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+-- Private routines
+FUNCTION f2private RETURN TEXT AS
+BEGIN
+RETURN 'This is f2private';
+END;
+PROCEDURE p2private AS
+BEGIN
+SELECT 'This is p2private' AS msg;
+END;
+-- Public routines
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN test2.f2private();
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL test2.p2private;
+END;
+END;
+$$
+SELECT test2.f1();
+test2.f1()
+This is f2private
+CALL test2.p1();
+msg
+This is p2private
+DROP PACKAGE test2;
+#
+# Calling private routines from the package initialization section,
+# using qualified notation, e.g. "pkg.proc"
+#
+CREATE PACKAGE test2 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+-- Private routines
+FUNCTION f2private RETURN TEXT AS
+BEGIN
+RETURN 'This is f2private';
+END;
+PROCEDURE p2private AS
+BEGIN
+SELECT 'This is p2private' AS msg;
+END;
+-- Public routines
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+END;
+BEGIN
+SELECT test2.f2private();
+CALL test2.p2private();
+END;
+$$
+CALL test2.p1();
+test2.f2private()
+This is f2private
+msg
+This is p2private
+msg
+This is p1
+DROP PACKAGE test2;
+#
+# Testing OR REPLACE
+#
+CREATE OR REPLACE PACKAGE pkg AS
+FUNCTION f0 RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE pkg AS
+FUNCTION f1 RETURN INT;
+END;
+$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+name type body
+pkg PACKAGE AS
+FUNCTION f1 RETURN INT;
+END
+CREATE OR REPLACE PACKAGE BODY pkg AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+name type body
+pkg PACKAGE AS
+FUNCTION f1 RETURN INT;
+END
+pkg PACKAGE BODY AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+END
+SELECT pkg.f1();
+pkg.f1()
+10
+CREATE OR REPLACE PACKAGE BODY pkg AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 20; END;
+END;
+$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+name type body
+pkg PACKAGE AS
+FUNCTION f1 RETURN INT;
+END
+pkg PACKAGE BODY AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 20; END;
+END
+SELECT pkg.f1();
+pkg.f1()
+20
+CREATE OR REPLACE PACKAGE pkg AS
+FUNCTION f1 RETURN BIGINT;
+END;
+$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+name type body
+pkg PACKAGE AS
+FUNCTION f1 RETURN BIGINT;
+END
+SELECT pkg.f1();
+ERROR 42000: FUNCTION test.pkg.f1 does not exist
+CREATE OR REPLACE PACKAGE BODY pkg AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 30; END;
+END;
+$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+name type body
+pkg PACKAGE AS
+FUNCTION f1 RETURN BIGINT;
+END
+pkg PACKAGE BODY AS
+FUNCTION f1 RETURN INT AS BEGIN RETURN 30; END;
+END
+SELECT pkg.f1();
+pkg.f1()
+30
+DROP PACKAGE pkg;
+#
+# Package routines accessing tables
+#
+CREATE TABLE t1 (a INT);
+CREATE PACKAGE test2 AS
+PROCEDURE p1(a INT);
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1(a INT) AS
+BEGIN
+INSERT INTO t1 VALUES (10);
+END;
+END;
+$$
+CALL test2.p1(10);
+SELECT * FROM t1;
+a
+10
+DROP PACKAGE test2;
+DROP TABLE t1;
+#
+# CREATE PACKAGE: Optional package name after the "END" keyword
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END test2.test2
+$$
+ERROR HY000: END identifier 'test2.test2' does not match 'test.test2'
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END test3
+$$
+ERROR HY000: END identifier 'test3' does not match 'test2'
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END test2
+$$
+DROP PACKAGE test2;
+#
+# MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN INT;
+PROCEDURE p1;
+END test2;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END f1.f1;
+END test2;
+$$
+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 '.f1;
+END test2' at line 5
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END f2;
+END test2;
+$$
+ERROR HY000: END identifier 'f2' does not match 'f1'
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END p1.p1;
+END test2;
+$$
+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 '.p1;
+END test2' at line 5
+CREATE PACKAGE BODY test2 AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END p2;
+END test2;
+$$
+ERROR HY000: END identifier 'p2' does not match 'p1'
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END f1;
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END p1;
+END test2;
+$$
+DROP PACKAGE test2;
+#
+# Package and package routine name and end name are case insensitive
+#
+CREATE PACKAGE test2 AS
+FUNCTION f1 RETURN TEXT;
+PROCEDURE p1;
+END TEST2;
+$$
+CREATE PACKAGE BODY test2 AS
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN 'This is f1';
+END F1;
+PROCEDURE P1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+END p1;
+END TEST2;
+$$
+SELECT TEST2.F1();
+TEST2.F1()
+This is f1
+SELECT test2.f1();
+test2.f1()
+This is f1
+CALL TEST2.p1();
+msg
+This is p1
+CALL test2.P1();
+msg
+This is p1
+DROP PACKAGE BODY TEST2;
+DROP PACKAGE TEST2;
+#
+# Testing various qualified/non-qualified db/package SP call chains
+#
+CREATE FUNCTION f3() RETURN TEXT AS
+BEGIN
+SET @track= @track || ' ' || 'test.f3()';
+RETURN '';
+END;
+$$
+CREATE PROCEDURE p3() AS
+BEGIN
+SET @track= @track || ' ' || 'test.p3()';
+END;
+$$
+CREATE FUNCTION ff2(task TEXT) RETURN TEXT AS
+step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+rc TEXT;
+BEGIN
+SET @track= @track || ' ' || 'test.ff2()';
+CASE step
+WHEN '' THEN NULL;
+WHEN 'p3' THEN CALL p3();
+WHEN 'f3' THEN rc:= f3();
+WHEN 'pack.p2' THEN CALL pack.p2(tail);
+WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+WHEN 'pack.p3' THEN CALL pack.p3();
+WHEN 'pack.f3' THEN rc:= pack.f3();
+WHEN 'test.p3' THEN CALL test.p3();
+WHEN 'test.f3' THEN rc:= test.f3();
+WHEN 'test.pp2' THEN CALL test.pp2(tail);
+WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+END CASE;
+RETURN '';
+END;
+$$
+CREATE PROCEDURE pp2(task TEXT) AS
+step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+rc TEXT;
+BEGIN
+SET @track= @track || ' ' || 'test.pp2()';
+CASE step
+WHEN '' THEN NULL;
+WHEN 'p3' THEN CALL p3();
+WHEN 'f3' THEN rc:= f3();
+WHEN 'pack.p2' THEN CALL pack.p2(tail);
+WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+WHEN 'pack.p3' THEN CALL pack.p3();
+WHEN 'pack.f3' THEN rc:= pack.f3();
+WHEN 'test.p3' THEN CALL test.p3();
+WHEN 'test.f3' THEN rc:= test.f3();
+WHEN 'test.pp2' THEN CALL test.pp2(tail);
+WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+END CASE;
+END;
+$$
+CREATE PACKAGE pack AS
+PROCEDURE p1(task TEXT);
+PROCEDURE p2(task TEXT);
+FUNCTION f1(task TEXT) RETURN TEXT;
+FUNCTION f2(step2 TEXT) RETURN TEXT;
+FUNCTION f3 RETURN TEXT;
+PROCEDURE p3;
+END;
+$$
+CREATE PACKAGE BODY pack AS
+PROCEDURE p1(task TEXT) AS
+step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+rc TEXT;
+BEGIN
+SET @track= 'test.pack.p1()';
+CASE step
+WHEN '' THEN NULL;
+WHEN 'p2' THEN CALL p2(tail);
+WHEN 'f2' THEN rc:= f2(tail);
+WHEN 'p3' THEN CALL p3();
+WHEN 'f3' THEN rc:= f3();
+WHEN 'px' THEN CALL px();
+WHEN 'fx' THEN rc:= fx();
+WHEN 'pp2' THEN CALL pp2(tail);
+WHEN 'ff2' THEN rc:= ff2(tail);
+WHEN 'pack.p2' THEN CALL pack.p2(tail);
+WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+WHEN 'pack.p3' THEN CALL pack.p3();
+WHEN 'pack.f3' THEN rc:= pack.f3();
+WHEN 'pack.px' THEN CALL pack.px();
+WHEN 'pack.fx' THEN rc:= pack.fx();
+WHEN 'test.p3' THEN CALL test.p3();
+WHEN 'test.f3' THEN rc:= test.f3();
+WHEN 'test.pp2' THEN CALL test.pp2(tail);
+WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+END CASE;
+SELECT @track;
+END;
+FUNCTION f1(task TEXT) RETURN TEXT AS
+step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+rc TEXT;
+BEGIN
+SET @track= 'test.pack.f1()';
+CASE step
+WHEN '' THEN NULL;
+WHEN 'p2' THEN CALL p2(tail);
+WHEN 'f2' THEN rc:= f2(tail);
+WHEN 'p3' THEN CALL p3();
+WHEN 'f3' THEN rc:= f3();
+WHEN 'px' THEN CALL px();
+WHEN 'fx' THEN rc:= fx();
+WHEN 'pp2' THEN CALL pp2(tail);
+WHEN 'ff2' THEN rc:= ff2(tail);
+WHEN 'pack.p2' THEN CALL pack.p2(tail);
+WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+WHEN 'pack.p3' THEN CALL pack.p3();
+WHEN 'pack.f3' THEN rc:= pack.f3();
+WHEN 'pack.px' THEN CALL pack.px();
+WHEN 'pack.fx' THEN rc:= pack.fx();
+WHEN 'test.p3' THEN CALL test.p3();
+WHEN 'test.f3' THEN rc:= test.f3();
+WHEN 'test.pp2' THEN CALL test.pp2(tail);
+WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+END CASE;
+SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT=@track;
+RETURN '';
+END;
+PROCEDURE p2(task TEXT) AS
+step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+rc TEXT;
+BEGIN
+SET @track= @track || ' ' || 'test.pack.p2()';
+CASE step
+WHEN '' THEN NULL;
+WHEN 'p2' THEN CALL p2(tail);
+WHEN 'f2' THEN rc:= f2(tail);
+WHEN 'p3' THEN CALL p3();
+WHEN 'f3' THEN rc:= f3();
+WHEN 'px' THEN CALL px();
+WHEN 'fx' THEN rc:= fx();
+WHEN 'pp2' THEN CALL pp2(tail);
+WHEN 'ff2' THEN rc:= ff2(tail);
+WHEN 'pack.p2' THEN CALL pack.p2(tail);
+WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+WHEN 'pack.p3' THEN CALL pack.p3();
+WHEN 'pack.f3' THEN rc:= pack.f3();
+WHEN 'pack.px' THEN CALL pack.px();
+WHEN 'pack.fx' THEN rc:= pack.fx();
+WHEN 'test.p3' THEN CALL test.p3();
+WHEN 'test.f3' THEN rc:= test.f3();
+WHEN 'test.pp2' THEN CALL test.pp2(tail);
+WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+END CASE;
+END;
+FUNCTION f2(task TEXT) RETURN TEXT AS
+step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+rc TEXT;
+BEGIN
+SET @track= @track || ' ' || 'test.pack.f2()';
+CASE step
+WHEN '' THEN NULL;
+WHEN 'p2' THEN CALL p2(tail);
+WHEN 'f2' THEN rc:= f2(tail);
+WHEN 'p3' THEN CALL p3();
+WHEN 'f3' THEN rc:= f3();
+WHEN 'px' THEN CALL px();
+WHEN 'fx' THEN rc:= fx();
+WHEN 'pp2' THEN CALL pp2(tail);
+WHEN 'ff2' THEN rc:= ff2(tail);
+WHEN 'pack.p2' THEN CALL pack.p2(tail);
+WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+WHEN 'pack.p3' THEN CALL pack.p3();
+WHEN 'pack.f3' THEN rc:= pack.f3();
+WHEN 'pack.px' THEN CALL pack.px();
+WHEN 'pack.fx' THEN rc:= pack.fx();
+WHEN 'test.p3' THEN CALL test.p3();
+WHEN 'test.f3' THEN rc:= test.f3();
+WHEN 'test.pp2' THEN CALL test.pp2(tail);
+WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+END CASE;
+RETURN '';
+END;
+PROCEDURE p3 AS
+BEGIN
+SET @track= @track || ' ' || 'test.pack.p3()';
+END;
+FUNCTION f3 RETURN TEXT AS
+BEGIN
+SET @track= @track || ' ' || 'test.pack.f3()';
+RETURN '';
+END;
+END pack;
+$$
+SET max_sp_recursion_depth=10;
+# pack.routine -> *
+CALL pack.p1('p2');
+@track
+test.pack.p1() test.pack.p2()
+CALL pack.p1('f2');
+@track
+test.pack.p1() test.pack.f2()
+CALL pack.p1('px');
+ERROR 42000: PROCEDURE test.px does not exist
+CALL pack.p1('fx');
+ERROR 42000: FUNCTION test.fx does not exist
+CALL pack.p1('pp2');
+@track
+test.pack.p1() test.pp2()
+CALL pack.p1('ff2');
+@track
+test.pack.p1() test.ff2()
+CALL pack.p1('pack.p2');
+@track
+test.pack.p1() test.pack.p2()
+CALL pack.p1('pack.f2');
+@track
+test.pack.p1() test.pack.f2()
+CALL pack.p1('pack.px');
+ERROR 42000: PROCEDURE pack.px does not exist
+CALL pack.p1('pack.fx');
+ERROR 42000: FUNCTION pack.fx does not exist
+CALL pack.p1('test.pp2');
+@track
+test.pack.p1() test.pp2()
+CALL pack.p1('test.ff2');
+@track
+test.pack.p1() test.ff2()
+DO pack.f1('p2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2()
+DO pack.f1('f2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2()
+DO pack.p1('px');
+ERROR 42000: FUNCTION pack.p1 does not exist
+DO pack.p1('fx');
+ERROR 42000: FUNCTION pack.p1 does not exist
+DO pack.f1('pp2');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2()
+DO pack.f1('ff2');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2()
+DO pack.f1('pack.p2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2()
+DO pack.f1('pack.f2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2()
+SELECT pack.f1('pack.px');
+ERROR 42000: PROCEDURE pack.px does not exist
+SELECT pack.f1('pack.fx');
+ERROR 42000: FUNCTION pack.fx does not exist
+DO pack.f1('test.pp2');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2()
+DO pack.f1('test.ff2');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2()
+#
+# Qualified_package_routine -> Non_qualified_package_routine
+#
+# pack.routine -> [pack.]routine -> pack.routine
+CALL pack.p1('p2 pack.p3');
+@track
+test.pack.p1() test.pack.p2() test.pack.p3()
+CALL pack.p1('p2 pack.f3');
+@track
+test.pack.p1() test.pack.p2() test.pack.f3()
+CALL pack.p1('f2 pack.p3');
+@track
+test.pack.p1() test.pack.f2() test.pack.p3()
+CALL pack.p1('f2 pack.f3');
+@track
+test.pack.p1() test.pack.f2() test.pack.f3()
+DO pack.f1('p2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.p3()
+DO pack.f1('p2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.f3()
+DO pack.f1('f2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.p3()
+DO pack.f1('f2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.f3()
+# pack.routine -> [pack.]routine -> [pack]routine
+CALL pack.p1('p2 p3');
+@track
+test.pack.p1() test.pack.p2() test.pack.p3()
+CALL pack.p1('p2 f3');
+@track
+test.pack.p1() test.pack.p2() test.pack.f3()
+CALL pack.p1('f2 p3');
+@track
+test.pack.p1() test.pack.f2() test.pack.p3()
+CALL pack.p1('f2 f3');
+@track
+test.pack.p1() test.pack.f2() test.pack.f3()
+DO pack.f1('p2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.p3()
+DO pack.f1('p2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.f3()
+DO pack.f1('f2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.p3()
+DO pack.f1('f2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.f3()
+# pack.routine -> [pack.]routine -> test.routine
+CALL pack.p1('p2 test.p3');
+@track
+test.pack.p1() test.pack.p2() test.p3()
+CALL pack.p1('p2 test.f3');
+@track
+test.pack.p1() test.pack.p2() test.f3()
+CALL pack.p1('f2 test.p3');
+@track
+test.pack.p1() test.pack.f2() test.p3()
+CALL pack.p1('f2 test.f3');
+@track
+test.pack.p1() test.pack.f2() test.f3()
+DO pack.f1('p2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.p3()
+DO pack.f1('p2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.f3()
+DO pack.f1('f2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.p3()
+DO pack.f1('f2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.f3()
+# pack.routine -> [pack.]routine -> [test.]routine
+CALL pack.p1('p2 pp2');
+@track
+test.pack.p1() test.pack.p2() test.pp2()
+CALL pack.p1('p2 ff2');
+@track
+test.pack.p1() test.pack.p2() test.ff2()
+CALL pack.p1('f2 pp2');
+@track
+test.pack.p1() test.pack.f2() test.pp2()
+CALL pack.p1('f2 ff2');
+@track
+test.pack.p1() test.pack.f2() test.ff2()
+DO pack.f1('p2 pp2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pp2()
+DO pack.f1('p2 ff2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.ff2()
+DO pack.f1('f2 pp2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pp2()
+DO pack.f1('f2 ff2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.ff2()
+#
+# Qualified_package_routine -> Non_qualified_database_routine
+#
+# pack.routine -> [test.]routine -> pack.routine
+CALL pack.p1('pp2 pack.p3');
+@track
+test.pack.p1() test.pp2() test.pack.p3()
+CALL pack.p1('pp2 pack.f3');
+@track
+test.pack.p1() test.pp2() test.pack.f3()
+CALL pack.p1('ff2 pack.p3');
+@track
+test.pack.p1() test.ff2() test.pack.p3()
+CALL pack.p1('ff2 pack.f3');
+@track
+test.pack.p1() test.ff2() test.pack.f3()
+DO pack.f1('pp2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.pack.p3()
+DO pack.f1('pp2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.pack.f3()
+DO pack.f1('ff2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.pack.p3()
+DO pack.f1('ff2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.pack.f3()
+# pack.routine -> [test.]routine -> test.routine
+CALL pack.p1('pp2 test.p3');
+@track
+test.pack.p1() test.pp2() test.p3()
+CALL pack.p1('pp2 test.f3');
+@track
+test.pack.p1() test.pp2() test.f3()
+CALL pack.p1('ff2 test.p3');
+@track
+test.pack.p1() test.ff2() test.p3()
+CALL pack.p1('ff2 test.f3');
+@track
+test.pack.p1() test.ff2() test.f3()
+DO pack.f1('pp2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.p3()
+DO pack.f1('pp2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.f3()
+DO pack.f1('ff2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.p3()
+DO pack.f1('ff2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.f3()
+# pack.routine -> [test.]routine -> [test.]routine
+CALL pack.p1('pp2 p3');
+@track
+test.pack.p1() test.pp2() test.p3()
+CALL pack.p1('pp2 f3');
+@track
+test.pack.p1() test.pp2() test.f3()
+CALL pack.p1('ff2 p3');
+@track
+test.pack.p1() test.ff2() test.p3()
+CALL pack.p1('ff2 f3');
+@track
+test.pack.p1() test.ff2() test.f3()
+DO pack.f1('pp2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.p3()
+DO pack.f1('pp2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.f3()
+DO pack.f1('ff2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.p3()
+DO pack.f1('ff2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.f3()
+#
+# Qualified_package_routine -> Qualified_package_routine
+#
+# pack.routine -> pack.routine -> pack.routine
+CALL pack.p1('pack.p2 pack.p3');
+@track
+test.pack.p1() test.pack.p2() test.pack.p3()
+CALL pack.p1('pack.p2 pack.f3');
+@track
+test.pack.p1() test.pack.p2() test.pack.f3()
+CALL pack.p1('pack.f2 pack.p3');
+@track
+test.pack.p1() test.pack.f2() test.pack.p3()
+CALL pack.p1('pack.f2 pack.f3');
+@track
+test.pack.p1() test.pack.f2() test.pack.f3()
+DO pack.f1('pack.p2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.p3()
+DO pack.f1('pack.p2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.f3()
+DO pack.f1('pack.f2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.p3()
+DO pack.f1('pack.f2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.f3()
+# pack.routine -> pack.routine -> [pack.]routine
+CALL pack.p1('pack.p2 p3');
+@track
+test.pack.p1() test.pack.p2() test.pack.p3()
+CALL pack.p1('pack.p2 f3');
+@track
+test.pack.p1() test.pack.p2() test.pack.f3()
+CALL pack.p1('pack.f2 p3');
+@track
+test.pack.p1() test.pack.f2() test.pack.p3()
+CALL pack.p1('pack.f2 f3');
+@track
+test.pack.p1() test.pack.f2() test.pack.f3()
+DO pack.f1('pack.p2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.p3()
+DO pack.f1('pack.p2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pack.f3()
+DO pack.f1('pack.f2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.p3()
+DO pack.f1('pack.f2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pack.f3()
+# pack.routine -> pack.routine -> test.routine
+CALL pack.p1('pack.p2 test.p3');
+@track
+test.pack.p1() test.pack.p2() test.p3()
+CALL pack.p1('pack.p2 test.f3');
+@track
+test.pack.p1() test.pack.p2() test.f3()
+CALL pack.p1('pack.f2 test.p3');
+@track
+test.pack.p1() test.pack.f2() test.p3()
+CALL pack.p1('pack.f2 test.f3');
+@track
+test.pack.p1() test.pack.f2() test.f3()
+DO pack.f1('pack.p2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.p3()
+DO pack.f1('pack.p2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.f3()
+DO pack.f1('pack.f2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.p3()
+DO pack.f1('pack.f2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.f3()
+# pack.routine -> pack.routine -> [test.]routine
+CALL pack.p1('pack.p2 pp2');
+@track
+test.pack.p1() test.pack.p2() test.pp2()
+CALL pack.p1('pack.p2 ff2');
+@track
+test.pack.p1() test.pack.p2() test.ff2()
+CALL pack.p1('pack.f2 pp2');
+@track
+test.pack.p1() test.pack.f2() test.pp2()
+CALL pack.p1('pack.f2 ff2');
+@track
+test.pack.p1() test.pack.f2() test.ff2()
+DO pack.f1('pack.p2 pp2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.pp2()
+DO pack.f1('pack.p2 ff2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.p2() test.ff2()
+DO pack.f1('pack.f2 pp2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.pp2()
+DO pack.f1('pack.f2 ff2');
+Warnings:
+Warning 1642 test.pack.f1() test.pack.f2() test.ff2()
+#
+# Qualified_package_routine -> Qualified_database_routine
+#
+pack.routine -> test.routine -> pack.routine
+CALL pack.p1('test.pp2 pack.p3');
+@track
+test.pack.p1() test.pp2() test.pack.p3()
+CALL pack.p1('test.pp2 pack.f3');
+@track
+test.pack.p1() test.pp2() test.pack.f3()
+CALL pack.p1('test.ff2 pack.p3');
+@track
+test.pack.p1() test.ff2() test.pack.p3()
+CALL pack.p1('test.ff2 pack.f3');
+@track
+test.pack.p1() test.ff2() test.pack.f3()
+DO pack.f1('test.pp2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.pack.p3()
+DO pack.f1('test.pp2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.pack.f3()
+DO pack.f1('test.ff2 pack.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.pack.p3()
+DO pack.f1('test.ff2 pack.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.pack.f3()
+pack.routine -> test.routine -> test.routine
+CALL pack.p1('test.pp2 test.p3');
+@track
+test.pack.p1() test.pp2() test.p3()
+CALL pack.p1('test.pp2 test.f3');
+@track
+test.pack.p1() test.pp2() test.f3()
+CALL pack.p1('test.ff2 test.p3');
+@track
+test.pack.p1() test.ff2() test.p3()
+CALL pack.p1('test.ff2 test.f3');
+@track
+test.pack.p1() test.ff2() test.f3()
+DO pack.f1('test.pp2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.p3()
+DO pack.f1('test.pp2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.f3()
+DO pack.f1('test.ff2 test.p3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.p3()
+DO pack.f1('test.ff2 test.f3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.f3()
+pack.routine -> test.routine -> [test.]routine
+CALL pack.p1('test.pp2 p3');
+@track
+test.pack.p1() test.pp2() test.p3()
+CALL pack.p1('test.pp2 f3');
+@track
+test.pack.p1() test.pp2() test.f3()
+CALL pack.p1('test.ff2 p3');
+@track
+test.pack.p1() test.ff2() test.p3()
+CALL pack.p1('test.ff2 f3');
+@track
+test.pack.p1() test.ff2() test.f3()
+DO pack.f1('test.pp2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.p3()
+DO pack.f1('test.pp2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.pp2() test.f3()
+DO pack.f1('test.ff2 p3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.p3()
+DO pack.f1('test.ff2 f3');
+Warnings:
+Warning 1642 test.pack.f1() test.ff2() test.f3()
+# Longer chains
+CALL pack.p1('p2 f2 p2 test.pp2 test.ff2 pack.p3');
+@track
+test.pack.p1() test.pack.p2() test.pack.f2() test.pack.p2() test.pp2() test.ff2() test.pack.p3()
+CALL pack.p1('p2 test.pp2 pack.p2 pack.f2 test.ff2 pack.p3');
+@track
+test.pack.p1() test.pack.p2() test.pp2() test.pack.p2() test.pack.f2() test.ff2() test.pack.p3()
+DROP PACKAGE pack;
+DROP FUNCTION f3;
+DROP PROCEDURE p3;
+DROP FUNCTION ff2;
+DROP PROCEDURE pp2;
+#
+# Calling a standalone function from a non-current database,
+# which calls a package routine from the same non-current database.
+#
+CREATE PROCEDURE p1 AS
+BEGIN
+CALL pkg1.p1;
+END;
+$$
+CREATE PACKAGE pkg1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1 AS
+BEGIN
+SELECT database();
+END;
+END;
+$$
+CALL p1;
+database()
+test
+CREATE DATABASE test2;
+USE test2;
+CALL test.p1;
+database()
+test
+DROP DATABASE test2;
+CALL test.p1;
+database()
+test
+USE test;
+DROP PACKAGE pkg1;
+DROP PROCEDURE p1;
+#
+# Creating a package with a different DEFINER
+#
+CREATE USER xxx@localhost;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type
+xxx@localhost p1 DEFINER PACKAGE
+xxx@localhost p1 DEFINER PACKAGE BODY
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+#
+# Creating a package with a different DEFINER, with SQL SECURITY INVOKER
+#
+CREATE USER xxx@localhost;
+CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS
+PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+END;
+$$
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+definer name security_type type
+xxx@localhost p1 INVOKER PACKAGE
+xxx@localhost p1 INVOKER PACKAGE BODY
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+#
+# A package with an initialization section
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS BEGIN SET @a=@a+1; SELECT @a; END;
+FUNCTION f1 RETURN INT AS BEGIN SET @a=@a+1; RETURN @a; END;
+BEGIN
+SET @a:=10;
+END;
+$$
+CALL p1.p1();
+@a
+11
+CALL p1.p1();
+@a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+CALL p1.p1();
+@a
+12
+SELECT p1.f1();
+p1.f1()
+13
+CALL p1.p1();
+@a
+14
+DROP PACKAGE p1;
+#
+# A package with an initialization section calling
+# routines from the same package, and standalone routines.
+#
+CREATE PROCEDURE init20 AS
+BEGIN
+SET @msg= @msg || '[init20]';
+END;
+$$
+CREATE PACKAGE p1 AS
+PROCEDURE init1;
+PROCEDURE init2;
+FUNCTION init3 RETURN INT;
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE init1 AS
+BEGIN
+SET @msg= @msg || '[p1.init1]';
+END;
+PROCEDURE init2 AS
+BEGIN
+SET @msg= @msg || '[p1.init2]';
+END;
+FUNCTION init3 RETURN INT AS
+BEGIN
+SET @msg= @msg || '[p1.init3]';
+RETURN 0;
+END;
+PROCEDURE p1 AS
+BEGIN
+SET @msg= @msg || '[p1.p1]';
+SELECT @msg;
+END;
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+SET @msg= @msg || '[p1.f1]';
+RETURN @msg;
+END;
+BEGIN
+SET @msg= '';
+init1();
+init2();
+DO init3();
+init20();
+END;
+$$
+CALL p1.p1();
+@msg
+[p1.init1][p1.init2][p1.init3][init20][p1.p1]
+CALL p1.p1();
+@msg
+[p1.init1][p1.init2][p1.init3][init20][p1.p1][p1.p1]
+SELECT p1.f1();
+p1.f1()
+[p1.init1][p1.init2][p1.init3][init20][p1.p1][p1.p1][p1.f1]
+SELECT p1.f1();
+p1.f1()
+[p1.init1][p1.init2][p1.init3][init20][p1.p1][p1.p1][p1.f1][p1.f1]
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+[p1.init1][p1.init2][p1.init3][init20][p1.f1]
+CALL p1.p1();
+@msg
+[p1.init1][p1.init2][p1.init3][init20][p1.f1][p1.p1]
+SELECT p1.f1();
+p1.f1()
+[p1.init1][p1.init2][p1.init3][init20][p1.f1][p1.p1][p1.f1]
+CALL p1.p1();
+@msg
+[p1.init1][p1.init2][p1.init3][init20][p1.f1][p1.p1][p1.f1][p1.p1]
+DROP PACKAGE p1;
+DROP PROCEDURE init20;
+#
+# EXECUTE IMMEDIATE in the package initialization section
+#
+SET @a=1000;
+CREATE TABLE t1 AS SELECT 10 AS a;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS BEGIN SET @a=@a+1; SELECT @a; END;
+FUNCTION f1 RETURN INT AS BEGIN SET @a=@a+1; RETURN @a; END;
+BEGIN
+EXECUTE IMMEDIATE 'SELECT MAX(a) FROM t1 INTO @a';
+END;
+$$
+CALL p1.p1();
+@a
+11
+CALL p1.p1();
+@a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# A package with an initialization section, loading table data into a user variable
+#
+SET @a=1000;
+CREATE TABLE t1 AS SELECT 10 AS a;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS BEGIN SET @a=@a+1; SELECT @a; END;
+FUNCTION f1 RETURN INT AS BEGIN SET @a=@a+1; RETURN @a; END;
+BEGIN
+SELECT MAX(a) FROM t1 INTO @a;
+END;
+$$
+CALL p1.p1();
+@a
+11
+CALL p1.p1();
+@a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# A package with an initialization section producing an error
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS BEGIN SELECT 'This is p1' AS msg; END;
+FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is f1'; END;
+BEGIN
+SELECT 1 FROM t1 INTO @a;
+END;
+$$
+CALL p1.p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+SELECT p1.f1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+# sp-cache-invalidate
+SELECT p1.f1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CALL p1.p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+SELECT p1.f1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (a INT) AS SELECT 1;
+CALL p1.p1();
+msg
+This is p1
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+This is f1
+# sp-cache-invalidate
+CALL p1.p1();
+msg
+This is p1
+DROP TABLE t1;
+DROP PACKAGE p1;
+#
+# A package with SF-unsafe statements in the initialization section
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS BEGIN SELECT 'This is p1' AS msg; END;
+FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is f1'; END;
+BEGIN
+CREATE TABLE IF NOT EXISTS t1 (a INT);
+DROP TABLE IF EXISTS t1;
+END;
+$$
+CALL p1.p1();
+msg
+This is p1
+SELECT p1.f1();
+p1.f1()
+This is f1
+# sp-cache-invalidate
+SELECT p1.f1();
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger
+CALL p1.p1();
+msg
+This is p1
+SELECT p1.f1();
+p1.f1()
+This is f1
+DROP PACKAGE p1;
+#
+# MDEV-13139 Package-wide variables in CREATE PACKAGE
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT;
+a INT;
+PROCEDURE p1 AS
+BEGIN
+CREATE VIEW v1 AS SELECT a;
+END;
+END;
+$$
+ERROR 42000: Duplicate variable: a
+CREATE PACKAGE BODY p1 AS
+a INT;
+PROCEDURE p1 AS
+BEGIN
+NULL;
+END;
+b INT; -- Variables cannot go after routine definitions
+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 'b INT; -- Variables cannot go after routine definitions
+END' at line 7
+CREATE PACKAGE BODY p1 AS
+a INT;
+PROCEDURE p1 AS
+BEGIN
+CREATE VIEW v1 AS SELECT a;
+END;
+END;
+$$
+ERROR HY000: View's SELECT contains a variable or parameter
+CREATE PACKAGE BODY p1 AS
+a INT:=NULL;
+PROCEDURE p1 AS
+BEGIN
+SELECT a;
+a:=COALESCE(a,0)+100;
+SET a=a+1;
+END;
+FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN a;
+END;
+END;
+$$
+CALL p1.p1;
+a
+NULL
+CALL p1.p1;
+a
+101
+CALL p1.p1;
+a
+202
+SELECT p1.f1();
+p1.f1()
+303
+DROP PACKAGE p1;
+#
+# One package variable with a default value
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT:=10;
+PROCEDURE p1 AS BEGIN a:=a+1; SELECT a; END;
+FUNCTION f1 RETURN INT AS BEGIN a:=a+1; RETURN a; END;
+END;
+$$
+CALL p1.p1();
+a
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+CALL p1.p1();
+a
+14
+DROP PACKAGE p1;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a ROW (a INT, b TEXT):=ROW(10,'bbb');
+PROCEDURE p1 AS
+BEGIN
+a.a:= a.a+1;
+a.b:= a.b || 'B';
+SELECT a.a, a.b;
+END;
+FUNCTION f1 RETURN INT AS BEGIN a.a:= a.a+1; RETURN a.a; END;
+END;
+$$
+CALL p1.p1();
+a.a a.b
+11 bbbB
+CALL p1.p1();
+a.a a.b
+12 bbbBB
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+CALL p1.p1();
+a.a a.b
+12 bbbB
+SELECT p1.f1();
+p1.f1()
+13
+CALL p1.p1();
+a.a a.b
+14 bbbBB
+DROP PACKAGE p1;
+CREATE TABLE t1 (a INT);
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a t1.a%TYPE:=10;
+PROCEDURE p1 AS BEGIN a:=a+1; SELECT a; END;
+FUNCTION f1 RETURN INT AS BEGIN a:=a+1; RETURN a; END;
+END;
+$$
+CALL p1.p1();
+a
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+CALL p1.p1();
+a
+14
+DROP PACKAGE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b TEXT);
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a t1%ROWTYPE:=ROW(10,'bbb');
+PROCEDURE p1 AS
+BEGIN
+a.a:= a.a+1;
+a.b:= a.b || 'B';
+SELECT a.a, a.b;
+END;
+FUNCTION f1 RETURN INT AS BEGIN a.a:= a.a+1; RETURN a.a; END;
+END;
+$$
+CALL p1.p1();
+a.a a.b
+11 bbbB
+CALL p1.p1();
+a.a a.b
+12 bbbBB
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+CALL p1.p1();
+a.a a.b
+12 bbbB
+SELECT p1.f1();
+p1.f1()
+13
+CALL p1.p1();
+a.a a.b
+14 bbbBB
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# One package variable, set in the package initialization section
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT;
+PROCEDURE p1 AS BEGIN a:=a+1; SELECT a; END;
+FUNCTION f1 RETURN INT AS BEGIN a:=a+1; RETURN a; END;
+BEGIN
+a:=10;
+END;
+$$
+CALL p1.p1();
+a
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+CALL p1.p1();
+a
+14
+DROP PACKAGE p1;
+#
+# A package with an initialization section,
+# loading table data into a package variable
+#
+CREATE TABLE t1 AS SELECT 10 AS a;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT;
+PROCEDURE p1 AS BEGIN SET a=a+1; SELECT a; END;
+FUNCTION f1 RETURN INT AS BEGIN SET a=a+1; RETURN a; END;
+BEGIN
+a:=(SELECT MAX(t1.a) FROM t1);
+END;
+$$
+CALL p1.p1();
+a
+11
+CALL p1.p1();
+a
+12
+SELECT p1.f1();
+p1.f1()
+13
+SELECT p1.f1();
+p1.f1()
+14
+# sp-cache-invalidate
+SELECT p1.f1();
+p1.f1()
+11
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# Package variables and XPath
+#
+CREATE PACKAGE p1 AS
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+i INT:=0;
+xml TEXT:= '<a><b>b1</b><b>b2</b><b>b3</b></a>';
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+SET i=i+1;
+RETURN ExtractValue(xml, '/a/b[$i]');
+END;
+END;
+$$
+SELECT p1.f1();
+p1.f1()
+b1
+SELECT p1.f1();
+p1.f1()
+b2
+SELECT p1.f1();
+p1.f1()
+b3
+DROP PACKAGE p1;
+#
+# Package variables as OUT routine parameter
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT;
+b INT;
+c INT:=10;
+PROCEDURE p2(a OUT INT) AS
+BEGIN
+a:=c;
+c:=c+1;
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL p2(b);
+SELECT a,b;
+END;
+BEGIN
+CALL p2(a);
+END;
+$$
+CALL p1.p1;
+a b
+10 11
+DROP PACKAGE p1;
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a ROW(a INT, b TEXT);
+b ROW(a INT, b TEXT);
+c ROW(a INT, b TEXT):=ROW(1,'b');
+PROCEDURE p2(x OUT ROW(a INT,b TEXT)) AS
+BEGIN
+x:=c;
+x.a:=c.a+100;
+x.b:=c.b||'X';
+c.a:=c.a+1;
+c.b:=c.b||'B';
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL p2(b);
+SELECT a.a,a.b,b.a,b.b;
+END;
+BEGIN
+CALL p2(a);
+END;
+$$
+CALL p1.p1;
+a.a a.b b.a b.b
+101 bX 102 bBX
+DROP PACKAGE p1;
+CREATE TABLE t1 (a INT,b TEXT);
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a t1%ROWTYPE;
+b t1%ROWTYPE;
+c t1%ROWTYPE:=ROW(1,'b');
+PROCEDURE p2(x OUT t1%ROWTYPE) AS
+BEGIN
+x:=c;
+x.a:=c.a+100;
+x.b:=c.b||'X';
+c.a:=c.a+1;
+c.b:=c.b||'B';
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL p2(b);
+SELECT a.a,a.b,b.a,b.b;
+END;
+BEGIN
+CALL p2(a);
+END;
+$$
+CALL p1.p1;
+a.a a.b b.a b.b
+101 bX 102 bBX
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# Package variable fields as OUT routine parameters
+#
+CREATE TABLE t1 (a INT,b TEXT);
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a t1%ROWTYPE;
+x t1%ROWTYPE:=ROW(10,'b');
+PROCEDURE p2(a OUT INT,b OUT TEXT) AS
+BEGIN
+a:=x.a;
+b:=x.b;
+x.a:=x.a+1;
+x.b:=x.b||'B';
+END;
+PROCEDURE p1 AS
+BEGIN
+CALL p2(a.a, a.b);
+SELECT a.a,a.b;
+END;
+BEGIN
+CALL p2(a.a, a.b);
+SELECT a.a, a.b;
+END;
+$$
+CALL p1.p1;
+a.a a.b
+10 b
+a.a a.b
+11 bB
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# Package variables as SELECT INTO targets
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a INT;
+b INT;
+PROCEDURE p1 AS
+BEGIN
+SELECT 2 INTO b;
+SELECT a,b;
+END;
+BEGIN
+SELECT 1 INTO a;
+END;
+$$
+CALL p1.p1;
+a b
+1 2
+DROP PACKAGE p1;
+CREATE TABLE t1 (a INT, b TEXT);
+INSERT INTO t1 VALUES (10,'b');
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a t1%ROWTYPE;
+b t1%ROWTYPE;
+PROCEDURE p1 AS
+BEGIN
+SELECT * FROM t1 INTO a;
+SELECT a.a,a.b;
+END;
+BEGIN
+SELECT * FROM t1 INTO b;
+SELECT b.a, b.b;
+END;
+$$
+CALL p1.p1;
+b.a b.b
+10 b
+a.a a.b
+10 b
+DROP PACKAGE p1;
+DROP TABLE t1;
+#
+# Package variable fields as SELECT INTO targets
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+a ROW(a INT, b TEXT);
+b ROW(a INT, b TEXT);
+PROCEDURE p1 AS
+BEGIN
+SELECT 20,'x2' INTO b.a,b.b;
+SELECT a.a,a.b,b.a,b.b;
+END;
+BEGIN
+SELECT 10,'x1' INTO a.a,a.b;
+END;
+$$
+CALL p1.p1;
+a.a a.b b.a b.b
+10 x1 20 x2
+DROP PACKAGE p1;
+#
+# Recursive package procedure calls
+# Makes sure that the non-top sp_head instances created by
+# sp_clone_and_link_routine() correctly reproduce the package context:
+# package variables, package routines.
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1(c INT);
+END p1;
+$$
+CREATE PACKAGE BODY p1 AS
+pv1 INT:=10;
+FUNCTION f1 RETURN INT AS BEGIN RETURN pv1+100; END;
+PROCEDURE p1(c INT) AS
+BEGIN
+SELECT c, pv1, f1();
+IF c>0 THEN
+pv1:=pv1+1;
+CALL p1(c-1);
+END IF;
+END;
+END;
+$$
+SET max_sp_recursion_depth=5;
+CALL p1.p1(5);
+c pv1 f1()
+5 10 110
+c pv1 f1()
+4 11 111
+c pv1 f1()
+3 12 112
+c pv1 f1()
+2 13 113
+c pv1 f1()
+1 14 114
+c pv1 f1()
+0 15 115
+SET max_sp_recursion_depth=0;
+CALL p1.p1(0);
+c pv1 f1()
+0 15 115
+CALL p1.p1(1);
+c pv1 f1()
+1 15 115
+ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine p1.p1
+DROP PACKAGE p1;
+#
+# Non-reserved keywords as package body variable names
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+END p1;
+$$
+CREATE PACKAGE BODY p1 AS
+ascii INT:=10;
+action INT:=20;
+PROCEDURE p1 AS
+BEGIN
+SELECT ascii, action;
+END;
+BEGIN
+ascii := ascii + 1;
+action := action + 1;
+END;
+$$
+CALL p1.p1;
+ascii action
+11 21
+DROP PACKAGE p1;
+#
+# Package routines calling routines of another package
+#
+CREATE PACKAGE p1 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE p2 AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1.p1' AS msg;
+END;
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN 'This is p1.f1';
+END;
+END;
+$$
+CREATE PACKAGE BODY p2 AS
+PROCEDURE p1 AS
+BEGIN
+CALL p1.p1;
+END;
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN p1.f1();
+END;
+END;
+$$
+CALL p1.p1;
+msg
+This is p1.p1
+CALL p2.p1;
+msg
+This is p1.p1
+SELECT p1.f1(), p2.f1();
+p1.f1() p2.f1()
+This is p1.f1 This is p1.f1
+DROP PACKAGE p2;
+DROP PACKAGE p1;
+#
+# Package names with dot characters
+#
+CREATE PACKAGE "p1.p1" AS
+PROCEDURE p1;
+FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY "p1.p1" AS
+PROCEDURE p1 AS
+BEGIN
+SELECT 'This is p1' AS msg;
+END;
+FUNCTION f1 RETURN TEXT AS
+BEGIN
+RETURN 'This is f1';
+END;
+END;
+$$
+CALL "p1.p1"."p1";
+msg
+This is p1
+SELECT "p1.p1"."f1"();
+"p1.p1"."f1"()
+This is f1
+DROP PACKAGE "p1.p1";
+#
+# MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+#
+SET sql_mode=ORACLE;
+CREATE OR REPLACE PACKAGE pkg1 AS
+PROCEDURE p00();
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg1 AS
+PROCEDURE p01() AS
+BEGIN
+SELECT 'This is p01' AS msg;
+END;
+PROCEDURE p00() AS
+BEGIN
+CREATE OR REPLACE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+CALL p01();
+END;
+END;
+$$
+CALL pkg1.p00;
+msg
+This is p01
+DROP PACKAGE pkg1;
+CREATE OR REPLACE TABLE t1 (a INT);
+CREATE OR REPLACE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1;
+CREATE OR REPLACE PACKAGE pkg1 AS
+PROCEDURE p00();
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg1 AS
+PROCEDURE p01() AS
+BEGIN
+SELECT 'This is p01' AS msg;
+END;
+PROCEDURE p00() AS
+BEGIN
+DROP TRIGGER tr1;
+CALL p01();
+END;
+END;
+$$
+CALL pkg1.p00;
+msg
+This is p01
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+#
+# MDEV-17387 MariaDB Server giving wrong error while executing select query from procedure
+#
+CREATE TABLE t1 (
+CTR varchar(2) NOT NULL,
+COR varchar(3) NOT NULL,
+DATE datetime NOT NULL,
+CHAN varchar(4) NOT NULL,
+CNO varchar(20) NOT NULL,
+JOBN varchar(18) NOT NULL,
+C1 varchar(30) DEFAULT NULL,
+C2 varchar(30) DEFAULT NULL,
+TIME datetime DEFAULT NULL,
+AMT decimal(12,2) DEFAULT NULL,
+DT datetime NOT NULL,
+pk int(11) NOT NULL,
+PRIMARY KEY (pk),
+KEY Indx1 (JOBN)
+);
+CREATE PACKAGE xyz IS
+PROCEDURE xyz123(ctr IN VARCHAR2,Jn IN VARCHAR2,R OUT VARCHAR2);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY xyz IS
+PROCEDURE xyz123(
+ctr IN VARCHAR2,
+Jn IN VARCHAR2,
+R OUT VARCHAR2)
+AS
+lS NUMBER(10) :=0;
+CURSOR cBPD IS
+SELECT CTR, COR, DATE, CHAN, CNO, C1, C2, TIME, AMT
+FROM t1 WHERE JOBN=Jn;
+BEGIN
+FOR lbpd IN cBPD
+LOOP
+lS:=lS+1;
+END LOOP;
+EXCEPTION
+WHEN OTHERS THEN
+BEGIN
+SELECT SQLERRM;
+END;
+END;
+END $$
+CALL xyz.xyz123(17,18,@R);
+DROP PACKAGE xyz;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-param.result b/mysql-test/suite/compat/oracle/r/sp-param.result
new file mode 100644
index 00000000000..aab1811ef67
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-param.result
@@ -0,0 +1,423 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10596 Allow VARCHAR and VARCHAR2 without length as a data type of routine parameters and in RETURN clause
+#
+CREATE FUNCTION f1(param CHAR) RETURN CHAR AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param CHAR) RETURN varchar(2000) CHARSET latin1
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',2000)));;
+LENGTH(f1(REPEAT('a',2000)))
+2000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',2000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(2000) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param NCHAR) RETURN NCHAR AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param NCHAR) RETURN varchar(2000) CHARSET utf8
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',2000)));;
+LENGTH(f1(REPEAT('a',2000)))
+2000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',2000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(2000) CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param BINARY) RETURN BINARY AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param BINARY) RETURN varbinary(2000)
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',2000)));;
+LENGTH(f1(REPEAT('a',2000)))
+2000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',2000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(2000) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param VARCHAR) RETURN VARCHAR AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param VARCHAR) RETURN varchar(4000) CHARSET latin1
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',4000)));;
+LENGTH(f1(REPEAT('a',4000)))
+4000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',4000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(4000) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param VARCHAR2) RETURN VARCHAR2 AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param VARCHAR2) RETURN varchar(4000) CHARSET latin1
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',4000)));;
+LENGTH(f1(REPEAT('a',4000)))
+4000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',4000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(4000) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param NVARCHAR) RETURN NVARCHAR AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param NVARCHAR) RETURN varchar(4000) CHARSET utf8
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',4000)));;
+LENGTH(f1(REPEAT('a',4000)))
+4000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',4000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(4000) CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param VARBINARY) RETURN VARBINARY AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param VARBINARY) RETURN varbinary(4000)
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',4000)));;
+LENGTH(f1(REPEAT('a',4000)))
+4000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',4000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(4000) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(param RAW) RETURN RAW AS BEGIN RETURN param; END;;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "f1"(param RAW) RETURN varbinary(4000)
+AS BEGIN RETURN param; END latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT LENGTH(f1(REPEAT('a',4000)));;
+LENGTH(f1(REPEAT('a',4000)))
+4000
+CREATE TABLE t1 AS SELECT f1(REPEAT('a',4000)) AS a;;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(4000) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP FUNCTION f1;
+
+MDEV-13919 sql_mode=ORACLE: Derive length of VARCHAR SP parameters with no length from actual parameters
+
+set sql_mode= 'oracle,strict_trans_tables';
+CREATE OR REPLACE PROCEDURE p1(pinout INOUT varchar, pin IN varchar)
+AS
+BEGIN
+pinout:=pin;
+END;
+/
+call p1(@w,'0123456789')
+/
+declare w varchar(10);
+begin
+call p1(w,'0123456789');
+end;
+/
+declare w varchar(5);
+begin
+call p1(w,'0123456789');
+end;
+/
+ERROR 22001: Data too long for column 'pinout' at row 1
+declare w varchar(20);
+begin
+w:='aaa';
+call p1(w,'0123456789');
+end;
+/
+declare w varchar(8);
+begin
+w:='aaa';
+call p1(w,'0123456789');
+end;
+/
+ERROR 22001: Data too long for column 'pinout' at row 1
+declare str varchar(6000);
+pout varchar(6000);
+begin
+str:=lpad('x',6000,'y');
+call p1(pout,str);
+select length(pout);
+end;
+/
+length(pout)
+6000
+declare str varchar(6000);
+pout varchar(4000);
+begin
+str:=lpad('x',6000,'y');
+call p1(pout,str);
+select length(pout);
+end;
+/
+ERROR 22001: Data too long for column 'pinout' at row 1
+declare str varchar(40000);
+pout varchar(60000);
+begin
+str:=lpad('x',40000,'y');
+call p1(pout,str);
+select length(pout);
+end;
+/
+length(pout)
+40000
+declare str text(80000);
+pout text(80000);
+begin
+str:=lpad('x',80000,'y');
+call p1(pout,str);
+select length(pout);
+end;
+/
+ERROR 22001: Data too long for column 'pin' at row 1
+declare str text(80000);
+pout text(80000);
+begin
+str:=lpad('x',60000,'y');
+call p1(pout,str);
+select length(pout);
+end;
+/
+length(pout)
+60000
+drop procedure p1
+/
+SET sql_mode=ORACLE;
+CREATE PROCEDURE p1(pinout INOUT varchar, pin IN varchar)
+AS
+BEGIN
+pinout:=pin;
+END;
+/
+CREATE PROCEDURE p2(len INT)
+AS
+pinout VARCHAR(10);
+pin VARCHAR(30);
+BEGIN
+pin:= REPEAT('x', len);
+p1(pinout, pin);
+SELECT LENGTH(pinout);
+END;
+/
+CALL p2(10);
+LENGTH(pinout)
+10
+CALL p2(11);
+LENGTH(pinout)
+10
+Warnings:
+Warning 1265 Data truncated for column 'pinout' at row 1
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+SET sql_mode=ORACLE;
+CREATE FUNCTION f1(pin VARCHAR, padlen INT) RETURN TEXT
+AS
+BEGIN
+pin:=LPAD(pin, padlen);
+RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str TEXT :='x';
+BEGIN
+SELECT LENGTH(f1(str,padlen));
+END;
+/
+CALL p2(65535);
+LENGTH(f1(str,padlen))
+65532
+Warnings:
+Warning 1265 Data truncated for column 'pin' at row 1
+CALL p2(65536);
+LENGTH(f1(str,padlen))
+65532
+Warnings:
+Warning 1265 Data truncated for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+CREATE PROCEDURE p1(pinout INOUT VARCHAR CHARACTER SET utf8,
+pin IN VARCHAR CHARACTER SET utf8)
+AS
+BEGIN
+pinout:=pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str VARCHAR(40000) CHARACTER SET latin1;
+pout VARCHAR(60000) CHARACTER SET latin1;
+BEGIN
+str:=lpad('x',padlen,'y');
+p1(pout,str);
+SELECT length(pout);
+END;
+/
+CALL p2(21844);
+length(pout)
+21844
+CALL p2(21845);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(21846);
+ERROR 22001: Data too long for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+CREATE PROCEDURE p1(pinout INOUT VARCHAR CHARACTER SET utf8,
+pin IN VARCHAR CHARACTER SET utf8)
+AS
+BEGIN
+pinout:=pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str TEXT CHARACTER SET utf8;
+pout TEXT CHARACTER SET utf8;
+BEGIN
+str:=lpad('x',padlen,'y');
+p1(pout,str);
+SELECT length(pout);
+END;
+/
+CALL p2(21844);
+length(pout)
+21844
+CALL p2(21845);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(21846);
+ERROR 22001: Data too long for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET latin1, padlen INT) RETURN TEXT
+AS
+BEGIN
+pin:=LPAD(pin, padlen);
+RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str TEXT CHARACTER SET latin1 :='x';
+BEGIN
+SELECT LENGTH(f1(str,padlen));
+END;
+/
+CALL p2(65532);
+LENGTH(f1(str,padlen))
+65532
+CALL p2(65533);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(65534);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(65535);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(65536);
+ERROR 22001: Data too long for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET utf8, padlen INT) RETURN TEXT
+AS
+BEGIN
+pin:=LPAD(pin, padlen);
+RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str TEXT CHARACTER SET utf8 := 'x';
+BEGIN
+SELECT LENGTH(f1(str,padlen));
+END;
+/
+CALL p2(21844);
+LENGTH(f1(str,padlen))
+21844
+CALL p2(21845);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(21846);
+ERROR 22001: Data too long for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET utf8, padlen INT) RETURN TEXT
+AS
+BEGIN
+pin:=LPAD(pin, padlen);
+RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str TEXT CHARACTER SET latin1 := 'x';
+BEGIN
+SELECT LENGTH(f1(str,padlen));
+END;
+/
+CALL p2(21844);
+LENGTH(f1(str,padlen))
+21844
+CALL p2(21845);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(21846);
+ERROR 22001: Data too long for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET latin1, padlen INT) RETURN TEXT
+AS
+BEGIN
+pin:=LPAD(pin, padlen);
+RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+str TEXT CHARACTER SET utf8 := 'x';
+BEGIN
+SELECT LENGTH(f1(str,padlen));
+END;
+/
+CALL p2(65532);
+LENGTH(f1(str,padlen))
+65532
+CALL p2(65533);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(65534);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(65535);
+ERROR 22001: Data too long for column 'pin' at row 1
+CALL p2(65536);
+ERROR 22001: Data too long for column 'pin' at row 1
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-row.result b/mysql-test/suite/compat/oracle/r/sp-row.result
new file mode 100644
index 00000000000..72b33768864
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-row.result
@@ -0,0 +1,3109 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10914 ROW data type for stored routine variables
+#
+#
+# ROW of ROWs is not supported yet
+#
+CREATE PROCEDURE p1()
+AS
+a ROW(a ROW(a INT));
+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 'ROW(a INT));
+BEGIN
+END' at line 3
+#
+# Returning the entire ROW parameter from a function
+#
+CREATE FUNCTION f1(a ROW(a INT, b INT)) RETURN INT
+AS
+BEGIN
+RETURN a;
+END;
+$$
+SELECT f1(ROW(10,20));
+ERROR 21000: Operand should contain 1 column(s)
+DROP FUNCTION f1;
+#
+# ROW as an SP parameter
+#
+CREATE FUNCTION f1(a ROW(a INT,b INT)) RETURN INT
+AS
+BEGIN
+RETURN a.b;
+END;
+$$
+CREATE PROCEDURE p1()
+AS
+a ROW(a INT,b INT):=(11,21);
+BEGIN
+SELECT f1(a);
+END;
+$$
+SELECT f1(ROW(10,20));
+f1(ROW(10,20))
+20
+SELECT f1(10);
+ERROR 21000: Operand should contain 2 column(s)
+SELECT f1(ROW(10,20,30));
+ERROR 21000: Operand should contain 2 column(s)
+CALL p1();
+f1(a)
+21
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+CREATE PROCEDURE p1(a ROW(a INT,b INT))
+AS
+BEGIN
+SELECT a.a, a.b;
+END;
+$$
+CALL p1(ROW(10,20));
+a.a a.b
+10 20
+CALL p1(10);
+ERROR 21000: Operand should contain 2 column(s)
+CALL p1(ROW(10,20,30));
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+#
+# ROW as an SP OUT parameter
+#
+CREATE PROCEDURE p1(a OUT ROW(a INT,b INT))
+AS
+BEGIN
+a.a:=10;
+a.b:=20;
+END;
+$$
+CREATE PROCEDURE p2
+AS
+a ROW(a INT,b INT):=(11,21);
+BEGIN
+CALL p1(a);
+SELECT a.a,a.b;
+END;
+$$
+CALL p2();
+a.a a.b
+10 20
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+#
+# ROW as an SP return value is not supported yet
+#
+CREATE FUNCTION p1() RETURN ROW(a INT)
+AS
+BEGIN
+RETURN NULL;
+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 'ROW(a INT)
+AS
+BEGIN
+RETURN NULL;
+END' at line 1
+#
+# Diplicate row field
+#
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT, a DOUBLE);
+BEGIN
+SELECT a.a;
+END;
+$$
+ERROR 42S21: Duplicate column name 'a'
+#
+# Bad scalar default value
+#
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT, b DOUBLE):= 1;
+BEGIN
+SELECT a.a;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+#
+# Bad ROW default value with a wrong number of fields
+#
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT, b DOUBLE):= ROW(1,2,3);
+BEGIN
+SELECT a.a;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+#
+# Scalar variable vs table alias cause no ambiguity
+#
+CREATE PROCEDURE p1()
+AS
+a INT;
+BEGIN
+-- a.x is a table column here (not a row variable field)
+SELECT a.x FROM a;
+SELECT a.x FROM t1 a;
+END;
+$$
+DROP PROCEDURE p1;
+#
+# Using the entire ROW variable in select list
+#
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT);
+BEGIN
+SELECT a;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT,b INT);
+BEGIN
+SELECT a;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+#
+# Using the entire ROW variable in functions
+#
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT);
+BEGIN
+SELECT COALESCE(a);
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT,b INT);
+BEGIN
+SELECT COALESCE(a);
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT);
+BEGIN
+SELECT a+1;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT,b INT);
+BEGIN
+SELECT a+1;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+#
+# Comparing the entire ROW to a scalar value
+#
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT,b INT);
+BEGIN
+SELECT a=1;
+END;
+$$
+CALL p1();
+ERROR HY000: Illegal parameter data types row and int for operation '='
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT,b INT);
+BEGIN
+SELECT 1=a;
+END;
+$$
+CALL p1();
+ERROR HY000: Illegal parameter data types int and row for operation '='
+DROP PROCEDURE p1;
+#
+# Passing the entire ROW to a stored function
+#
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+BEGIN
+RETURN a;
+END;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT,b INT);
+BEGIN
+SELECT f1(a);
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+BEGIN
+RETURN a;
+END;
+CREATE PROCEDURE p1()
+AS
+a ROW (a INT);
+BEGIN
+SELECT f1(a);
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+#
+# Assigning a scalar value to a ROW variable with 1 column
+#
+CREATE OR REPLACE PROCEDURE p1
+AS
+rec ROW(a INT);
+BEGIN
+rec:=1;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+#
+# Assigning a scalar value to a ROW variable with 2 columns
+#
+CREATE OR REPLACE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec:=1;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+#
+# Assigning a ROW value to a ROW variable with different number of columns
+#
+CREATE OR REPLACE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec:=ROW(1,2,3);
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+#
+# Returning the entire ROW from a function is not supported yet
+# This syntax would be needed: SELECT f1().x FROM DUAL;
+#
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+rec ROW(a INT);
+BEGIN
+RETURN rec;
+END;
+$$
+SELECT f1(10);
+ERROR 21000: Operand should contain 1 column(s)
+DROP FUNCTION f1;
+#
+# Using the entire ROW in SELECT..CREATE
+#
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+CREATE TABLE t1 AS SELECT rec;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+DROP PROCEDURE p1;
+#
+# Using the entire ROW in LIMIT
+#
+CREATE PROCEDURE p1()
+AS
+rec ROW(a INT);
+BEGIN
+rec.a:= '10';
+SELECT * FROM t1 LIMIT rec;
+END;
+$$
+ERROR HY000: A variable of a non-integer based type in LIMIT clause
+#
+# Setting ROW fields using a SET command
+#
+CREATE OR REPLACE PROCEDURE p1
+AS
+rec ROW(a INT,b DOUBLE,c VARCHAR(10));
+a INT;
+BEGIN
+SET @a= 10, rec.a=10, rec.b=20, rec.c= 'test', a= 5;
+SELECT rec.a, rec.b, rec.c, a;
+END;
+$$
+CALL p1();
+rec.a rec.b rec.c a
+10 20 test 5
+DROP PROCEDURE p1;
+#
+# Assigning a ROW variable from a ROW value
+#
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec:=ROW(1,2);
+SELECT rec.a, rec.b;
+END;
+$$
+CALL p1();
+rec.a rec.b
+1 2
+DROP PROCEDURE p1;
+#
+# Assigning a ROW variable from another ROW value
+#
+CREATE PROCEDURE p1
+AS
+rec1 ROW(a INT,b INT);
+rec2 ROW(a INT,b INT);
+BEGIN
+rec1:=ROW(1,2);
+rec2:=rec1;
+SELECT rec2.a, rec2.b;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+1 2
+DROP PROCEDURE p1;
+#
+# Comparing a ROW variable to a ROW() function
+#
+CREATE OR REPLACE PROCEDURE p1
+AS
+rec ROW(a INT,b INT);
+BEGIN
+rec.a:= 1;
+rec.b:= 2;
+SELECT rec=(0,0), rec=ROW(0,0), (0,0)=rec, ROW(0,0)=rec;
+SELECT rec=(1,2), rec=ROW(1,2), (1,2)=rec, ROW(1,2)=rec;
+SELECT rec=(NULL,0), rec=ROW(NULL,0);
+SELECT rec=(NULL,2), rec=ROW(NULL,2);
+SELECT rec<>(0,0), rec<>ROW(0,0);
+SELECT rec<>(1,2), rec<>ROW(1,2);
+SELECT rec<>(NULL,0), rec<>ROW(NULL,0);
+SELECT rec<>(NULL,2), rec<>ROW(NULL,2);
+SELECT rec IN ((0,0)), rec IN (ROW(0,0));
+SELECT rec IN ((1,2)), rec IN (ROW(1,2));
+SELECT rec IN ((0,NULL),(1,2));
+SELECT rec NOT IN ((0,NULL),(1,1));
+SELECT rec NOT IN ((1,NULL),(1,1));
+END;
+$$
+CALL p1();
+rec=(0,0) rec=ROW(0,0) (0,0)=rec ROW(0,0)=rec
+0 0 0 0
+rec=(1,2) rec=ROW(1,2) (1,2)=rec ROW(1,2)=rec
+1 1 1 1
+rec=(NULL,0) rec=ROW(NULL,0)
+0 0
+rec=(NULL,2) rec=ROW(NULL,2)
+NULL NULL
+rec<>(0,0) rec<>ROW(0,0)
+1 1
+rec<>(1,2) rec<>ROW(1,2)
+0 0
+rec<>(NULL,0) rec<>ROW(NULL,0)
+1 1
+rec<>(NULL,2) rec<>ROW(NULL,2)
+NULL NULL
+rec IN ((0,0)) rec IN (ROW(0,0))
+0 0
+rec IN ((1,2)) rec IN (ROW(1,2))
+1 1
+rec IN ((0,NULL),(1,2))
+1
+rec NOT IN ((0,NULL),(1,1))
+1
+rec NOT IN ((1,NULL),(1,1))
+NULL
+DROP PROCEDURE p1;
+#
+# Comparing a ROW variable to another ROW variable
+#
+CREATE OR REPLACE PROCEDURE p1
+AS
+rec1,rec2,rec3 ROW(a INT,b INT);
+BEGIN
+rec1.a:= 1;
+rec1.b:= 2;
+rec2.a:= 11;
+rec2.b:= 12;
+rec3.a:= 11;
+rec3.b:= 12;
+SELECT rec1=rec2, rec2=rec1, rec2=rec3, rec3=rec2;
+END;
+$$
+CALL p1();
+rec1=rec2 rec2=rec1 rec2=rec3 rec3=rec2
+0 0 1 1
+DROP PROCEDURE p1;
+#
+# Referencing a non-existing row variable
+#
+CREATE PROCEDURE p1()
+AS
+BEGIN
+SET a.b=1;
+END;
+$$
+ERROR HY000: Unknown structured system variable or ROW routine variable 'a'
+CREATE PROCEDURE p1()
+AS
+BEGIN
+a.b:=1;
+END;
+$$
+ERROR HY000: Unknown structured system variable or ROW routine variable 'a'
+#
+# Referencing a non-existing row field
+#
+CREATE PROCEDURE p1()
+AS
+a ROW(a INT,b INT);
+BEGIN
+SELECT a.c FROM t1;
+END;
+$$
+ERROR HY000: Row variable 'a' does not have a field 'c'
+#
+# ROW and scalar variables with the same name shadowing each other
+#
+CREATE PROCEDURE p1()
+AS
+a ROW(a INT);
+BEGIN
+a.a:=100;
+DECLARE
+a INT:= 200;
+BEGIN
+SELECT a;
+DECLARE
+a ROW(a INT);
+BEGIN
+a.a:=300;
+SELECT a.a;
+END;
+SELECT a;
+END;
+SELECT a.a;
+END;
+$$
+CALL p1();
+a
+200
+a.a
+300
+a
+200
+a.a
+100
+DROP PROCEDURE p1;
+#
+# ROW with good default values
+#
+CREATE PROCEDURE p1()
+AS
+a ROW(a INT,b INT):= (10,20);
+b ROW(a INT,b INT):= (11,21);
+c ROW(a INT,b INT):= a;
+BEGIN
+SELECT a.a, a.b, b.a, b.b, c.a, c.b FROM DUAL;
+END;
+$$
+CALL p1;
+a.a a.b b.a b.b c.a c.b
+10 20 11 21 10 20
+DROP PROCEDURE p1;
+#
+# ROW in WHERE clause
+#
+CREATE TABLE t1 (a INT,b INT);
+INSERT INTO t1 VALUES (10,20);
+CREATE PROCEDURE p1()
+AS
+rec ROW(a INT,b INT):=ROW(10,20);
+BEGIN
+SELECT * FROM t1 WHERE rec=ROW(a,b);
+SELECT * FROM t1 WHERE ROW(a,b)=rec;
+SELECT * FROM t1 WHERE rec=ROW(10,20);
+SELECT * FROM t1 WHERE ROW(10,20)=rec;
+END;
+$$
+CALL p1();
+a b
+10 20
+a b
+10 20
+a b
+10 20
+a b
+10 20
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# ROW fields in WHERE clause
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1()
+AS
+rec ROW(a INT);
+BEGIN
+rec.a:= 10;
+SELECT * FROM t1 WHERE a=rec.a;
+END;
+$$
+CALL p1();
+a
+10
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# ROW fields in HAVING clause
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1()
+AS
+rec ROW(a INT);
+BEGIN
+rec.a:= 10;
+SELECT * FROM t1 HAVING a=rec.a;
+SELECT * FROM t1 HAVING MIN(a)=rec.a;
+END;
+$$
+CALL p1();
+a
+10
+a
+10
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# ROW fields in LIMIT clause
+#
+CREATE TABLE t1 (a INT);
+SELECT 1 FROM t1 LIMIT t1.a;
+ERROR 42000: Undeclared variable: t1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1()
+AS
+rec ROW(a INT);
+BEGIN
+rec.a:= 10;
+SELECT * FROM t1 LIMIT rec.a;
+END;
+$$
+CALL p1();
+a
+10
+20
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+rec ROW(a VARCHAR(10));
+BEGIN
+rec.a:= '10';
+SELECT * FROM t1 LIMIT rec.a;
+END;
+$$
+ERROR HY000: A variable of a non-integer based type in LIMIT clause
+#
+# ROW fields in select list
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+CREATE PROCEDURE p1()
+AS
+t1 ROW(a INT);
+BEGIN
+t1.a:= 10;
+SELECT t1.a, 'This is the variable t1.a value, rather than the column t1.a' AS comm FROM t1;
+SELECT t1.a, t2.a, t1.a+t2.a FROM t1 t2;
+END;
+$$
+CALL p1();
+t1.a comm
+10 This is the variable t1.a value, rather than the column t1.a
+10 This is the variable t1.a value, rather than the column t1.a
+t1.a a t1.a+t2.a
+10 10 20
+10 20 30
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# ROW fields as insert values
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec ROW(a INT, b VARCHAR(10));
+BEGIN
+rec.a:= 10;
+rec.b:= 'test';
+INSERT INTO t1 VALUES (rec.a, rec.b);
+END;
+$$
+CALL p1();
+SELECT * FROM t1;
+a b
+10 test
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# ROW fields as SP out parameters
+#
+CREATE PROCEDURE p1(a OUT INT, b OUT VARCHAR)
+AS
+BEGIN
+a:= 10;
+b:= 'test';
+END;
+$$
+CREATE PROCEDURE p2
+AS
+rec ROW(a INT, b VARCHAR(10));
+BEGIN
+CALL p1(rec.a, rec.b);
+SELECT rec.a, rec.b;
+END;
+$$
+CALL p2;
+rec.a rec.b
+10 test
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+#
+# ROW fields as dynamic SQL out parameters
+#
+CREATE PROCEDURE p1(a OUT INT, b OUT VARCHAR)
+AS
+BEGIN
+a:= 20;
+b:= 'test-dynamic-sql';
+END;
+$$
+CREATE PROCEDURE p2
+AS
+rec ROW(a INT, b VARCHAR(30));
+BEGIN
+EXECUTE IMMEDIATE 'CALL p1(?,?)' USING rec.a, rec.b;
+SELECT rec.a, rec.b;
+END;
+$$
+CALL p2;
+rec.a rec.b
+20 test-dynamic-sql
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+#
+# ROW fields as SELECT..INTO targets
+#
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT, b VARCHAR(10));
+BEGIN
+SELECT 10,'test' INTO rec.a,rec.b;
+SELECT rec.a, rec.b;
+END;
+$$
+CALL p1;
+rec.a rec.b
+10 test
+DROP PROCEDURE p1;
+#
+# Implicit default NULL handling
+#
+CREATE PROCEDURE p1
+AS
+rec ROW(a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,0), e TIME, f DATETIME);
+BEGIN
+SELECT rec.a, rec.b, rec.c, rec.d, rec.e, rec.f FROM DUAL;
+END;
+$$
+CALL p1();
+rec.a rec.b rec.c rec.d rec.e rec.f
+NULL NULL NULL NULL NULL NULL
+DROP PROCEDURE p1;
+#
+# NULL handling
+#
+CREATE PROCEDURE p1
+AS
+rec1 ROW(a INT, b VARCHAR(10)):=(NULL,NULL);
+rec2 ROW(a INT, b VARCHAR(10)):=rec1;
+BEGIN
+SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+rec1:= (10,20);
+rec2:= rec1;
+SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+rec1:= (NULL,20);
+rec2:= rec1;
+SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+rec1:= (10,NULL);
+rec2:= rec1;
+SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+rec1:= (NULL,NULL);
+rec2:= rec1;
+SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+END;
+$$
+CALL p1;
+rec1.a rec1.b rec2.a rec2.b
+NULL NULL NULL NULL
+rec1.a rec1.b rec2.a rec2.b
+10 20 10 20
+rec1.a rec1.b rec2.a rec2.b
+NULL 20 NULL 20
+rec1.a rec1.b rec2.a rec2.b
+10 NULL 10 NULL
+rec1.a rec1.b rec2.a rec2.b
+NULL NULL NULL NULL
+DROP PROCEDURE p1;
+#
+# Testing multiple ROW variable declarations
+# This makes sure that fill_field_definitions() is called only once
+# per a ROW field, so create length is not converted to internal length
+# multiple times.
+#
+CREATE PROCEDURE p1
+AS
+rec1, rec2, rec3 ROW(a VARCHAR(10) CHARACTER SET utf8);
+BEGIN
+CREATE TABLE t1 AS SELECT rec1.a, rec2.a, rec3.a;
+END;
+$$
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "rec1.a" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
+ "rec2.a" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
+ "rec3.a" varchar(10) CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# INT
+#
+CREATE PROCEDURE p1() AS var INT; rec ROW(var INT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(1); rec ROW(var INT(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(2); rec ROW(var INT(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(3); rec ROW(var INT(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(4); rec ROW(var INT(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(5); rec ROW(var INT(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(6); rec ROW(var INT(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(7); rec ROW(var INT(7)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(8); rec ROW(var INT(8)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(9); rec ROW(var INT(9)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(10); rec ROW(var INT(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(11); rec ROW(var INT(11)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(11) DEFAULT NULL,
+ "rec.var" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(12); rec ROW(var INT(12)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(12) DEFAULT NULL,
+ "rec.var" int(12) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(13); rec ROW(var INT(13)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(13) DEFAULT NULL,
+ "rec.var" int(13) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(14); rec ROW(var INT(14)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(14) DEFAULT NULL,
+ "rec.var" int(14) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(20); rec ROW(var INT(20)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(20) DEFAULT NULL,
+ "rec.var" int(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var INT(21); rec ROW(var INT(21)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" int(21) DEFAULT NULL,
+ "rec.var" int(21) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# TINYINT
+#
+CREATE PROCEDURE p1() AS var TINYINT; rec ROW(var TINYINT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(4) DEFAULT NULL,
+ "rec.var" tinyint(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(1); rec ROW(var TINYINT(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(4) DEFAULT NULL,
+ "rec.var" tinyint(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(2); rec ROW(var TINYINT(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(4) DEFAULT NULL,
+ "rec.var" tinyint(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(3); rec ROW(var TINYINT(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(4) DEFAULT NULL,
+ "rec.var" tinyint(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(4); rec ROW(var TINYINT(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(4) DEFAULT NULL,
+ "rec.var" tinyint(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(5); rec ROW(var TINYINT(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(5) DEFAULT NULL,
+ "rec.var" tinyint(5) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(6); rec ROW(var TINYINT(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(6) DEFAULT NULL,
+ "rec.var" tinyint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(7); rec ROW(var TINYINT(7)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(7) DEFAULT NULL,
+ "rec.var" tinyint(7) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(8); rec ROW(var TINYINT(8)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(8) DEFAULT NULL,
+ "rec.var" tinyint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(9); rec ROW(var TINYINT(9)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(9) DEFAULT NULL,
+ "rec.var" tinyint(9) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(10); rec ROW(var TINYINT(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(10) DEFAULT NULL,
+ "rec.var" tinyint(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(11); rec ROW(var TINYINT(11)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(11) DEFAULT NULL,
+ "rec.var" tinyint(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(12); rec ROW(var TINYINT(12)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(12) DEFAULT NULL,
+ "rec.var" tinyint(12) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(13); rec ROW(var TINYINT(13)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(13) DEFAULT NULL,
+ "rec.var" tinyint(13) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(14); rec ROW(var TINYINT(14)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(14) DEFAULT NULL,
+ "rec.var" tinyint(14) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(20); rec ROW(var TINYINT(20)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(20) DEFAULT NULL,
+ "rec.var" tinyint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYINT(21); rec ROW(var TINYINT(21)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinyint(21) DEFAULT NULL,
+ "rec.var" tinyint(21) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# SMALLINT
+#
+CREATE PROCEDURE p1() AS var SMALLINT; rec ROW(var SMALLINT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(1); rec ROW(var SMALLINT(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(2); rec ROW(var SMALLINT(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(3); rec ROW(var SMALLINT(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(4); rec ROW(var SMALLINT(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(5); rec ROW(var SMALLINT(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(6); rec ROW(var SMALLINT(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(6) DEFAULT NULL,
+ "rec.var" smallint(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(7); rec ROW(var SMALLINT(7)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(7) DEFAULT NULL,
+ "rec.var" smallint(7) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(8); rec ROW(var SMALLINT(8)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(8) DEFAULT NULL,
+ "rec.var" smallint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(9); rec ROW(var SMALLINT(9)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(9) DEFAULT NULL,
+ "rec.var" smallint(9) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(10); rec ROW(var SMALLINT(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(10) DEFAULT NULL,
+ "rec.var" smallint(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(11); rec ROW(var SMALLINT(11)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(11) DEFAULT NULL,
+ "rec.var" smallint(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(12); rec ROW(var SMALLINT(12)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(12) DEFAULT NULL,
+ "rec.var" smallint(12) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(13); rec ROW(var SMALLINT(13)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(13) DEFAULT NULL,
+ "rec.var" smallint(13) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(14); rec ROW(var SMALLINT(14)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(14) DEFAULT NULL,
+ "rec.var" smallint(14) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(20); rec ROW(var SMALLINT(20)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(20) DEFAULT NULL,
+ "rec.var" smallint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var SMALLINT(21); rec ROW(var SMALLINT(21)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" smallint(21) DEFAULT NULL,
+ "rec.var" smallint(21) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# MEDIUMINT
+#
+CREATE PROCEDURE p1() AS var MEDIUMINT; rec ROW(var MEDIUMINT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(9) DEFAULT NULL,
+ "rec.var" mediumint(9) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(1); rec ROW(var MEDIUMINT(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(2); rec ROW(var MEDIUMINT(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(3); rec ROW(var MEDIUMINT(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(4); rec ROW(var MEDIUMINT(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(5); rec ROW(var MEDIUMINT(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(6); rec ROW(var MEDIUMINT(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(7); rec ROW(var MEDIUMINT(7)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(8); rec ROW(var MEDIUMINT(8)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(8) DEFAULT NULL,
+ "rec.var" mediumint(8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(9); rec ROW(var MEDIUMINT(9)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(9) DEFAULT NULL,
+ "rec.var" mediumint(9) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(10); rec ROW(var MEDIUMINT(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(10) DEFAULT NULL,
+ "rec.var" mediumint(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(11); rec ROW(var MEDIUMINT(11)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(11) DEFAULT NULL,
+ "rec.var" mediumint(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(12); rec ROW(var MEDIUMINT(12)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(12) DEFAULT NULL,
+ "rec.var" mediumint(12) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(13); rec ROW(var MEDIUMINT(13)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(13) DEFAULT NULL,
+ "rec.var" mediumint(13) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(14); rec ROW(var MEDIUMINT(14)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(14) DEFAULT NULL,
+ "rec.var" mediumint(14) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(20); rec ROW(var MEDIUMINT(20)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(20) DEFAULT NULL,
+ "rec.var" mediumint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMINT(21); rec ROW(var MEDIUMINT(21)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumint(21) DEFAULT NULL,
+ "rec.var" mediumint(21) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# BIGINT
+#
+CREATE PROCEDURE p1() AS var BIGINT; rec ROW(var BIGINT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(1); rec ROW(var BIGINT(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(2); rec ROW(var BIGINT(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(3); rec ROW(var BIGINT(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(4); rec ROW(var BIGINT(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(5); rec ROW(var BIGINT(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(6); rec ROW(var BIGINT(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(7); rec ROW(var BIGINT(7)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(8); rec ROW(var BIGINT(8)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(9); rec ROW(var BIGINT(9)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(10); rec ROW(var BIGINT(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(11); rec ROW(var BIGINT(11)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(12); rec ROW(var BIGINT(12)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(13); rec ROW(var BIGINT(13)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(14); rec ROW(var BIGINT(14)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(20); rec ROW(var BIGINT(20)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(20) DEFAULT NULL,
+ "rec.var" bigint(20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BIGINT(21); rec ROW(var BIGINT(21)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" bigint(21) DEFAULT NULL,
+ "rec.var" bigint(21) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# DOUBLE
+#
+CREATE PROCEDURE p1() AS var DOUBLE; rec ROW(var DOUBLE); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double DEFAULT NULL,
+ "rec.var" double DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,1); rec ROW(var DOUBLE(30,1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,1) DEFAULT NULL,
+ "rec.var" double(30,1) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,2); rec ROW(var DOUBLE(30,2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,2) DEFAULT NULL,
+ "rec.var" double(30,2) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,3); rec ROW(var DOUBLE(30,3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,3) DEFAULT NULL,
+ "rec.var" double(30,3) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,4); rec ROW(var DOUBLE(30,4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,4) DEFAULT NULL,
+ "rec.var" double(30,4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,5); rec ROW(var DOUBLE(30,5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,5) DEFAULT NULL,
+ "rec.var" double(30,5) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,6); rec ROW(var DOUBLE(30,6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,6) DEFAULT NULL,
+ "rec.var" double(30,6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,7); rec ROW(var DOUBLE(30,7)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,7) DEFAULT NULL,
+ "rec.var" double(30,7) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,8); rec ROW(var DOUBLE(30,8)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,8) DEFAULT NULL,
+ "rec.var" double(30,8) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,9); rec ROW(var DOUBLE(30,9)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,9) DEFAULT NULL,
+ "rec.var" double(30,9) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,10); rec ROW(var DOUBLE(30,10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,10) DEFAULT NULL,
+ "rec.var" double(30,10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,11); rec ROW(var DOUBLE(30,11)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,11) DEFAULT NULL,
+ "rec.var" double(30,11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,12); rec ROW(var DOUBLE(30,12)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,12) DEFAULT NULL,
+ "rec.var" double(30,12) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,13); rec ROW(var DOUBLE(30,13)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,13) DEFAULT NULL,
+ "rec.var" double(30,13) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,14); rec ROW(var DOUBLE(30,14)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,14) DEFAULT NULL,
+ "rec.var" double(30,14) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,20); rec ROW(var DOUBLE(30,20)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,20) DEFAULT NULL,
+ "rec.var" double(30,20) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DOUBLE(30,21); rec ROW(var DOUBLE(30,21)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" double(30,21) DEFAULT NULL,
+ "rec.var" double(30,21) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# VARCHAR
+#
+CREATE PROCEDURE p1() AS var CHAR; rec ROW(var CHAR); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" char(1) DEFAULT NULL,
+ "rec.var" char(1) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BINARY; rec ROW(var BINARY); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" binary(1) DEFAULT NULL,
+ "rec.var" binary(1) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var CHAR(1); rec ROW(var CHAR(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" char(1) DEFAULT NULL,
+ "rec.var" char(1) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var CHAR(10); rec ROW(var CHAR(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" char(10) DEFAULT NULL,
+ "rec.var" char(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var NCHAR(10); rec ROW(var NCHAR(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" char(10) CHARACTER SET utf8 DEFAULT NULL,
+ "rec.var" char(10) CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var BINARY(10); rec ROW(var BINARY(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" binary(10) DEFAULT NULL,
+ "rec.var" binary(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var VARBINARY(10); rec ROW(var VARBINARY(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" varbinary(10) DEFAULT NULL,
+ "rec.var" varbinary(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var VARCHAR(10); rec ROW(var VARCHAR(10)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" varchar(10) DEFAULT NULL,
+ "rec.var" varchar(10) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var VARCHAR(10) CHARACTER SET utf8; rec ROW(var VARCHAR(10) CHARACTER SET utf8); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
+ "rec.var" varchar(10) CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin; rec ROW(var VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ "rec.var" varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# TIME
+#
+CREATE PROCEDURE p1() AS var TIME; rec ROW(var TIME); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time DEFAULT NULL,
+ "rec.var" time DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TIME(1); rec ROW(var TIME(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time(1) DEFAULT NULL,
+ "rec.var" time(1) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TIME(2); rec ROW(var TIME(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time(2) DEFAULT NULL,
+ "rec.var" time(2) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TIME(3); rec ROW(var TIME(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time(3) DEFAULT NULL,
+ "rec.var" time(3) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TIME(4); rec ROW(var TIME(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time(4) DEFAULT NULL,
+ "rec.var" time(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TIME(5); rec ROW(var TIME(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time(5) DEFAULT NULL,
+ "rec.var" time(5) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TIME(6); rec ROW(var TIME(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" time(6) DEFAULT NULL,
+ "rec.var" time(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# DATETIME
+#
+CREATE PROCEDURE p1() AS var DATETIME; rec ROW(var DATETIME); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime DEFAULT NULL,
+ "rec.var" datetime DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DATETIME(1); rec ROW(var DATETIME(1)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime(1) DEFAULT NULL,
+ "rec.var" datetime(1) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DATETIME(2); rec ROW(var DATETIME(2)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime(2) DEFAULT NULL,
+ "rec.var" datetime(2) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DATETIME(3); rec ROW(var DATETIME(3)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime(3) DEFAULT NULL,
+ "rec.var" datetime(3) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DATETIME(4); rec ROW(var DATETIME(4)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime(4) DEFAULT NULL,
+ "rec.var" datetime(4) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DATETIME(5); rec ROW(var DATETIME(5)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime(5) DEFAULT NULL,
+ "rec.var" datetime(5) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var DATETIME(6); rec ROW(var DATETIME(6)); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" datetime(6) DEFAULT NULL,
+ "rec.var" datetime(6) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# LOB
+#
+CREATE PROCEDURE p1() AS var TEXT; rec ROW(var TEXT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" text DEFAULT NULL,
+ "rec.var" text DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYTEXT; rec ROW(var TINYTEXT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinytext DEFAULT NULL,
+ "rec.var" tinytext DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMTEXT; rec ROW(var MEDIUMTEXT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumtext DEFAULT NULL,
+ "rec.var" mediumtext DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var LONGTEXT; rec ROW(var LONGTEXT); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" longtext DEFAULT NULL,
+ "rec.var" longtext DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TEXT CHARACTER SET utf8; rec ROW(var TEXT CHARACTER SET utf8); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" text CHARACTER SET utf8 DEFAULT NULL,
+ "rec.var" text CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var TINYTEXT CHARACTER SET utf8; rec ROW(var TINYTEXT CHARACTER SET utf8); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" tinytext CHARACTER SET utf8 DEFAULT NULL,
+ "rec.var" tinytext CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var MEDIUMTEXT CHARACTER SET utf8; rec ROW(var MEDIUMTEXT CHARACTER SET utf8); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" mediumtext CHARACTER SET utf8 DEFAULT NULL,
+ "rec.var" mediumtext CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() AS var LONGTEXT CHARACTER SET utf8; rec ROW(var LONGTEXT CHARACTER SET utf8); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END;
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "var" longtext CHARACTER SET utf8 DEFAULT NULL,
+ "rec.var" longtext CHARACTER SET utf8 DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# End of MDEV-10914 ROW data type for stored routine variables
+#
+#
+# MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
+#
+#
+# Referring to a table in a non-existing database
+#
+CREATE PROCEDURE p1()
+AS
+rec test2.t1%ROWTYPE;
+BEGIN
+NULL;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test2.t1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+ERROR 42S02: Table 'test2.t1' doesn't exist
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Referring to a table in the current database
+#
+CREATE PROCEDURE p1()
+AS
+rec t1%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Referring to a table in an explicitly specified database
+#
+CREATE PROCEDURE p1()
+AS
+rec test.t1%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Referring to a view in the current database
+#
+CREATE PROCEDURE p1()
+AS
+rec v1%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.v1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Referring to a view in an explicitly specified database
+#
+CREATE PROCEDURE p1()
+AS
+rec test.v1%ROWTYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.v1' doesn't exist
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "rec.a" int(11) DEFAULT NULL,
+ "rec.b" varchar(10) DEFAULT NULL,
+ "rec.c" double DEFAULT NULL,
+ "rec.d" decimal(10,0) DEFAULT NULL
+)
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Checking that all table%ROWTYPE fields are NULL by default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+SELECT rec1.a, rec1.b, rec1.c, rec1.d;
+END;
+$$
+CALL p1();
+rec1.a rec1.b rec1.c rec1.d
+NULL NULL NULL NULL
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A table%ROWTYPE variable with a ROW expression as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE DEFAULT ROW(10,'bbb');
+BEGIN
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 bbb
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A table%ROWTYPE variable with an incompatible ROW expression as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE DEFAULT ROW(10,'bbb','ccc');
+BEGIN
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A table%ROWTYPE variable with a ROW variable as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 ROW(a INT, b VARCHAR(10)):= ROW(10,'bbb');
+rec2 t1%ROWTYPE DEFAULT rec1;
+BEGIN
+SELECT rec2.a, rec2.b;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+10 bbb
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# A ROW variable using a table%ROWTYPE variable as a default
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE := ROW(10,'bbb');
+rec2 ROW(a INT, b VARCHAR(10)):= rec1;
+BEGIN
+SELECT rec2.a, rec2.b;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+10 bbb
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning table%ROWTYPE variables with a different column count
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE);
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+rec2 t2%ROWTYPE;
+BEGIN
+rec2:=rec1;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+rec2 t2%ROWTYPE;
+BEGIN
+rec1:=rec2;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 3 column(s)
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning compatible table%ROWTYPE variables (equal number of fields)
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+rec2 t2%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+rec1.b:= 'bbb';
+rec2:=rec1;
+SELECT rec2.x, rec2.y;
+END;
+$$
+CALL p1();
+rec2.x rec2.y
+10 bbb
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning between incompatible table%ROWTYPE and explicit ROW variables
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+rec2 ROW(x INT,y INT,z INT);
+BEGIN
+rec2.x:= 10;
+rec2.y:= 20;
+rec2.z:= 30;
+rec1:= rec2;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning between compatible table%ROWTYPE and explicit ROW variables
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+rec2 ROW(x INT,y INT);
+BEGIN
+rec2.x:= 10;
+rec2.y:= 20;
+rec1:= rec2;
+SELECT rec1.a, rec1.b;
+rec1.a:= 11;
+rec1.b:= 21;
+rec2:= rec1;
+SELECT rec2.x, rec2.y;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 20
+rec2.x rec2.y
+11 21
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Assigning table%ROWTYPE from a ROW expression
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+rec1:= ROW(10,20);
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 20
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a table%ROWTYPE variable with a wrong field count
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+CREATE PROCEDURE p1()
+AS
+rec2 t2%ROWTYPE;
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec2;
+CLOSE cur1;
+END;
+$$
+CALL p1();
+ERROR HY000: Incorrect number of FETCH variables
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a table%ROWTYPE variable
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+INSERT INTO t1 VALUES (20,'bb2',222.222e2, 12.32);
+INSERT INTO t1 VALUES (30,'bb3',333.333e2, 12.33);
+CREATE PROCEDURE p1()
+AS
+rec t1%ROWTYPE;
+CURSOR cur IS SELECT * FROM t1;
+BEGIN
+OPEN cur;
+LOOP
+FETCH cur INTO rec;
+EXIT WHEN cur%NOTFOUND;
+SELECT rec.a, rec.b, rec.c, rec.d;
+INSERT INTO t2 VALUES (rec.a, rec.b, rec.c, rec.d);
+END LOOP;
+CLOSE cur;
+END;
+$$
+CALL p1();
+rec.a rec.b rec.c rec.d
+10 bb1 11111.1 12.31
+rec.a rec.b rec.c rec.d
+20 bb2 22222.2 12.32
+rec.a rec.b rec.c rec.d
+30 bb3 33333.3 12.33
+SELECT * FROM t2;
+a b c d
+10 bb1 11111.1 12.31
+20 bb2 22222.2 12.32
+30 bb3 33333.3 12.33
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a table%ROWTYPE variable with different column names
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bbb');
+CREATE PROCEDURE p1()
+AS
+rec2 t2%ROWTYPE;
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec2;
+SELECT rec2.x, rec2.y;
+CLOSE cur1;
+END;
+$$
+CALL p1();
+rec2.x rec2.y
+10 bbb
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# Fetching a cursor into a table%ROWTYPE variable, with truncation
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t1 VALUES (10,'11x');
+CREATE PROCEDURE p1()
+AS
+rec2 t2%ROWTYPE;
+CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+OPEN cur1;
+FETCH cur1 INTO rec2;
+SELECT rec2.a, rec2.b;
+CLOSE cur1;
+END;
+$$
+CALL p1();
+rec2.a rec2.b
+10 11
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# table%ROWTYPE variables are not allowed in LIMIT
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2);
+CREATE PROCEDURE p1()
+AS
+rec1 t1%ROWTYPE:=(1,2);
+BEGIN
+SELECT * FROM t1 LIMIT rec1.a;
+END;
+$$
+ERROR HY000: A variable of a non-integer based type in LIMIT clause
+DROP TABLE t1;
+#
+# table%ROWTYPE variable fields as OUT parameters
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a OUT INT,b OUT VARCHAR(10))
+AS
+BEGIN
+a:=10;
+b:='bb';
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+CALL p1(rec1.a, rec1.b);
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p2();
+rec1.a rec1.b
+10 bb
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Passing the entire table%ROWTYPE variable
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+SELECT a.a, a.b;
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+rec1 t1%ROWTYPE:= ROW(10,'bb');
+BEGIN
+CALL p1(rec1);
+END;
+$$
+CALL p2();
+a.a a.b
+10 bb
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Passing the entire table%ROWTYPE variable as an OUT parameter
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1(a OUT ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+a:= ROW(10,'bb');
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+rec1 t1%ROWTYPE;
+BEGIN
+CALL p1(rec1);
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p2();
+rec1.a rec1.b
+10 bb
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Assigning a table%ROWTYPE field to an OUT parameter
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1 (res IN OUT INTEGER)
+AS
+rec1 t1%ROWTYPE:=ROW(10,'b0');
+BEGIN
+res:=rec1.a;
+END;
+$$
+CALL p1(@res);
+SELECT @res;
+@res
+10
+SET @res=NULL;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing Item_splocal_row_field_by_name::print
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+rec t1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+EXPLAIN EXTENDED SELECT rec.a, rec.b;
+END;
+$$
+CALL p1();
+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 rec.a@0["a"] AS "rec.a",rec.b@0["b"] AS "rec.b"
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Non-existing field
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+rec t1%ROWTYPE;
+BEGIN
+SELECT rec.c;
+END;
+$$
+CALL p1();
+ERROR HY000: Row variable 'rec' does not have a field 'c'
+ALTER TABLE t1 ADD c INT;
+CALL p1();
+rec.c
+NULL
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that field names are case insensitive
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+rec t1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+SELECT rec.A, rec.B;
+END;
+$$
+CALL p1();
+rec.A rec.B
+10 bb
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that table%ROWTYPE uses temporary tables vs shadowed real tables
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TEMPORARY TABLE t1 (x INT, y VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+rec t1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+SELECT rec.A, rec.B;
+END;
+$$
+CALL p1();
+ERROR HY000: Row variable 'rec' does not have a field 'A'
+DROP TEMPORARY TABLE t1;
+CALL p1();
+rec.A rec.B
+10 bb
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Testing that the structure of table%ROWTYPE variables is determined at the very beginning and is not changed after ALTER
+#
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+BEGIN
+ALTER TABLE t1 ADD c INT;
+DECLARE
+rec t1%ROWTYPE; -- this will not have column "c"
+ BEGIN
+rec.c:=10;
+END;
+END;
+$$
+CALL p1();
+ERROR HY000: Row variable 'rec' does not have a field 'c'
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# MDEV-12291 Allow ROW variables as SELECT INTO targets
+#
+# ROW variable with a wrong column count
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+rec1 ROW(a INT, b VARCHAR(32), c DOUBLE);
+BEGIN
+SELECT * FROM t1 INTO rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: The used SELECT statements have a different number of columns
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# Multiple ROW variables
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+SELECT * FROM t1 INTO rec1, rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# ROW variables working example
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+SELECT * FROM t1 INTO rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 b10
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# table%ROWTYPE variable with a wrong column count
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+rec1 t1%ROWTYPE;
+BEGIN
+SELECT 10,'a','b' FROM t1 INTO rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: The used SELECT statements have a different number of columns
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# Multiple table%ROWTYPE variables
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+rec1 t1%ROWTYPE;
+BEGIN
+SELECT 10,'a' FROM t1 INTO rec1, rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# table%ROWTYPE working example
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+rec1 t1%ROWTYPE;
+BEGIN
+SELECT * FROM t1 INTO rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 b10
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# cursor%ROWTYPE variable with a wrong column count
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+CURSOR cur1 IS SELECT 10, 'b0', 'c0';
+rec1 cur1%ROWTYPE;
+BEGIN
+SELECT * FROM t1 INTO rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: The used SELECT statements have a different number of columns
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# Multiple cursor%ROWTYPE variables
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+CURSOR cur1 IS SELECT * FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+SELECT * FROM t1 INTO rec1, rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+ERROR 21000: Operand should contain 2 column(s)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# cursor%ROWTYPE working example
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+CREATE PROCEDURE p1 AS
+CURSOR cur1 IS SELECT * FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+SELECT * FROM t1 INTO rec1;
+SELECT rec1.a, rec1.b;
+END;
+$$
+CALL p1();
+rec1.a rec1.b
+10 b10
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# MDEV-12347 Valgrind reports invalid read errors in Item_field_row::element_index_by_name
+#
+CREATE TABLE t1 (a INT, b ENUM('b0','b1','b12','b3'));
+CREATE PROCEDURE p1 AS
+BEGIN
+DECLARE
+rec t1%ROWTYPE;
+BEGIN
+rec.b:='b0';
+SELECT rec.b;
+END;
+END;
+$$
+CALL p1();
+rec.b
+b0
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT, b SET('b0','b1','b12','b3'));
+CREATE PROCEDURE p1 AS
+BEGIN
+DECLARE
+rec t1%ROWTYPE;
+BEGIN
+rec.b:='b0';
+SELECT rec.b;
+END;
+END;
+$$
+CALL p1();
+rec.b
+b0
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# MDEV-13273 Confusion between table alias and ROW type variable
+#
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+CREATE PROCEDURE p1
+AS
+a INT;
+b INT;
+BEGIN
+-- a.c1 is a table column
+SELECT a.c1 INTO b
+FROM t1 a
+WHERE a.c2 = 0;
+SELECT b;
+END;
+$$
+CALL p1;
+b
+0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+CREATE PROCEDURE p1
+AS
+a ROW (c1 INT, c2 INT) := ROW(101,102);
+b INT;
+BEGIN
+-- a.c1 is a ROW variable field
+SELECT a.c1 INTO b
+FROM t1 a
+WHERE a.c2 = 102;
+SELECT b;
+END;
+$$
+CALL p1;
+b
+101
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+CREATE PROCEDURE p1
+AS
+a t1%ROWTYPE := ROW (10,20);
+b INT;
+BEGIN
+-- a.c1 is a ROW variable field
+SELECT a.c1 INTO b
+FROM t1 a
+WHERE a.c2 = 20;
+SELECT b;
+END;
+$$
+CALL p1;
+b
+10
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+CREATE PROCEDURE p1
+AS
+CURSOR cur1 IS SELECT * FROM t1;
+a cur1%ROWTYPE := ROW (10,20);
+b INT;
+BEGIN
+-- a.c1 is a ROW variable field
+SELECT a.c1 INTO b
+FROM t1 a
+WHERE a.c2 = 20;
+SELECT b;
+END;
+$$
+CALL p1;
+b
+10
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
+#
+DECLARE
+a ROW(a INT);
+BEGIN
+EXPLAIN SELECT 1 INTO a.a;
+END;
+$$
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
+#
+# MDEV-14139 Anchored data types for variables
+#
+DECLARE
+row1 ROW(int11 INT,text1 TEXT);
+a_row1 row1%TYPE;
+aa_row1 a_row1%TYPE;
+BEGIN
+CREATE TABLE t1 AS SELECT a_row1.int11 AS int11, a_row1.text1 AS text1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT aa_row1.int11 AS int11, aa_row1.text1 AS text1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+END;
+$$
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "int11" int(11) DEFAULT NULL,
+ "text1" text DEFAULT NULL
+)
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "int11" int(11) DEFAULT NULL,
+ "text1" text DEFAULT NULL
+)
diff --git a/mysql-test/suite/compat/oracle/r/sp-security.result b/mysql-test/suite/compat/oracle/r/sp-security.result
new file mode 100644
index 00000000000..b98ecaca972
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-security.result
@@ -0,0 +1,288 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+#
+#
+# Initiation:
+# - creating database db1
+# - creating user user1 with access rights to db1
+#
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT, b VARCHAR(10));
+CREATE USER user1;
+GRANT ALL PRIVILEGES ON test.* TO user1;
+connect conn1,localhost,user1,,test;
+SET sql_mode=ORACLE;
+SELECT database();
+database()
+test
+SELECT user();
+user()
+user1@localhost
+#
+# Making sure that user1 does not have privileges to db1.t1
+#
+SHOW CREATE TABLE db1.t1;
+ERROR 42000: SHOW command denied to user 'user1'@'localhost' for table 't1'
+SHOW FIELDS IN db1.t1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+#
+# Trigger: using %TYPE with a table we don't have access to
+#
+CREATE TABLE test.t1 (a INT, b INT);
+INSERT INTO test.t1 (a,b) VALUES (10,20);
+SELECT * FROM t1;
+a b
+10 20
+CREATE TRIGGER test.tr1 BEFORE INSERT ON test.t1 FOR EACH ROW
+BEGIN
+DECLARE b db1.t1.b%TYPE := 20;
+BEGIN
+:NEW.b := 10;
+END;
+END
+$$
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+SELECT * FROM t1;
+a b
+10 20
+DROP TRIGGER tr1;
+DROP TABLE t1;
+#
+# Stored procedure: Using %TYPE for with a table that we don't have access to
+# DEFINER user1, SQL SECURITY DEFAULT
+#
+CREATE PROCEDURE p1()
+AS
+a db1.t1.a%TYPE := 10;
+BEGIN
+SELECT a;
+END;
+$$
+CALL p1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+a db1.t1%ROWTYPE;
+BEGIN
+SELECT a.a;
+END;
+$$
+CALL p1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+DROP PROCEDURE p1;
+#
+# Stored procedure: Using %TYPE for with a table that we don't have access to
+# DEFINER root, SQL SECURITY INVOKER
+#
+connection default;
+CREATE PROCEDURE p1()
+SQL SECURITY INVOKER
+AS
+a db1.t1.a%TYPE := 10;
+BEGIN
+SELECT a;
+END;
+$$
+connection conn1;
+CALL p1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+DROP PROCEDURE p1;
+connection default;
+CREATE PROCEDURE p1()
+SQL SECURITY INVOKER
+AS
+a db1.t1%ROWTYPE;
+BEGIN
+SELECT a.a;
+END;
+$$
+connection conn1;
+CALL p1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+DROP PROCEDURE p1;
+#
+# Stored procedure: Using %TYPE for with a table that we don't have access to
+# DEFINER root, SQL SECURITY DEFINER
+#
+connection default;
+CREATE PROCEDURE p1()
+SQL SECURITY DEFINER
+AS
+a db1.t1.a%TYPE := 10;
+BEGIN
+SELECT a;
+END;
+$$
+connection conn1;
+CALL p1;
+a
+10
+DROP PROCEDURE p1;
+connection default;
+CREATE PROCEDURE p1()
+SQL SECURITY DEFINER
+AS
+a db1.t1%ROWTYPE;
+BEGIN
+a.a:= 10;
+SELECT a.a;
+END;
+$$
+connection conn1;
+CALL p1;
+a.a
+10
+DROP PROCEDURE p1;
+#
+# Stored function: Using %TYPE for with a table that we don't have access to
+# DEFINER user1, SQL SECURITY DEFAULT
+#
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1() RETURN INT
+AS
+a db1.t1.a%TYPE:=0;
+BEGIN
+RETURN OCTET_LENGTH(a);
+END;
+$$
+SELECT f1();
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Stored function: Using %TYPE for with a table that we don't have access to
+# DEFINER root, SQL SECURITY INVOKER
+#
+connection default;
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1() RETURN INT
+SQL SECURITY INVOKER
+AS
+a db1.t1.a%TYPE:=0;
+BEGIN
+RETURN OCTET_LENGTH(a);
+END;
+$$
+connection conn1;
+SELECT f1();
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Stored function: Using %TYPE for with a table that we don't have access to
+# DEFINER root, SQL SECURITY DEFINER
+#
+connection default;
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1() RETURN INT
+SQL SECURITY DEFINER
+AS
+a db1.t1.a%TYPE:=0;
+BEGIN
+RETURN OCTET_LENGTH(a);
+END;
+$$
+connection conn1;
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+DROP TABLE t1;
+connection default;
+GRANT SELECT (a) ON db1.t1 TO user1;
+connection conn1;
+#
+# Making sure that user1 has access to db1.t1.a, but not to db1.t1.b
+#
+SHOW CREATE TABLE db1.t1;
+ERROR 42000: SHOW command denied to user 'user1'@'localhost' for table 't1'
+SHOW FIELDS IN db1.t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+#
+# Trigger: Per-column privileges
+#
+CREATE TABLE test.t1 (a INT, b INT);
+INSERT INTO test.t1 (a,b) VALUES (10,20);
+SELECT * FROM t1;
+a b
+10 20
+CREATE TRIGGER test.tr1 BEFORE INSERT ON test.t1 FOR EACH ROW
+BEGIN
+DECLARE a db1.t1.a%TYPE := 20;
+BEGIN
+:NEW.b := 10;
+END;
+END
+$$
+INSERT INTO t1 (a) VALUES (10);
+SELECT * FROM t1;
+a b
+10 20
+10 10
+DROP TRIGGER tr1;
+CREATE TRIGGER test.tr1 BEFORE INSERT ON test.t1 FOR EACH ROW
+BEGIN
+DECLARE b db1.t1.b%TYPE := 20;
+BEGIN
+:NEW.b := 10;
+END;
+END
+$$
+INSERT INTO t1 (a) VALUES (10);
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for column 'b' in table 't1'
+SELECT * FROM t1;
+a b
+10 20
+10 10
+DROP TRIGGER tr1;
+DROP TABLE t1;
+#
+# Stored procedure: Per-column privileges
+# DEFINER user1, SQL SECURITY DEFAULT
+#
+CREATE PROCEDURE p1()
+AS
+a db1.t1.a%TYPE := 10;
+BEGIN
+SELECT a;
+END;
+$$
+CALL p1;
+a
+10
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+b db1.t1.b%TYPE := 10;
+BEGIN
+SELECT b;
+END;
+$$
+CALL p1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for column 'b' in table 't1'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+AS
+b db1.t1%ROWTYPE;
+BEGIN
+b.b:=10;
+SELECT b.b;
+END;
+$$
+CALL p1;
+ERROR 42000: SELECT command denied to user 'user1'@'localhost' for column 'b' in table 't1'
+DROP PROCEDURE p1;
+#
+# Clean up
+#
+disconnect conn1;
+connection default;
+DROP USER user1;
+DROP DATABASE db1;
+#
+# End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+#
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result
new file mode 100644
index 00000000000..2d4244110f9
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp.result
@@ -0,0 +1,2562 @@
+SET sql_mode=ORACLE;
+# Testing routines with no parameters
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+RETURN 10;
+END;
+/
+SHOW CREATE FUNCTION f1;
+Function f1
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+Create Function CREATE DEFINER="root"@"localhost" FUNCTION "f1"() RETURN int(11)
+AS
+BEGIN
+RETURN 10;
+END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SELECT f1();
+f1()
+10
+DROP FUNCTION f1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+SET @a=10;
+END;
+/
+SHOW CREATE PROCEDURE p1;
+Procedure p1
+sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
+Create Procedure CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
+AS
+BEGIN
+SET @a=10;
+END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
+SET @a=0;
+CALL p1();
+SELECT @a;
+@a
+10
+DROP PROCEDURE p1;
+# Testing ":=" to set the default value of a variable
+CREATE FUNCTION f1 () RETURN NUMBER(10) AS
+a NUMBER(10) := 10;
+BEGIN
+DECLARE
+b NUMBER(10) DEFAULT 3;
+BEGIN
+RETURN a+b;
+END;
+END;
+/
+SELECT f1();
+f1()
+13
+DROP FUNCTION f1;
+# Testing labels
+CREATE FUNCTION f1 (a INT) RETURN CLOB AS
+BEGIN
+<<label1>>
+BEGIN
+IF a = 1 THEN
+LEAVE label1;
+END IF;
+RETURN 'IS NOT 1';
+END label1;
+RETURN 'IS 1';
+END;
+/
+SELECT f1(1);
+f1(1)
+IS 1
+SELECT f1(2);
+f1(2)
+IS NOT 1
+DROP FUNCTION f1;
+CREATE FUNCTION f1 (a INT) RETURN INT IS
+BEGIN
+<<label1>>
+LOOP
+IF a = 2 THEN
+LEAVE label1;
+END IF;
+SET a= a-1;
+END LOOP;
+RETURN a;
+END;
+/
+SELECT f1(4);
+f1(4)
+2
+DROP FUNCTION f1;
+CREATE FUNCTION f1 (a INT) RETURN INT AS
+BEGIN
+<<label1>>
+WHILE a>0 LOOP
+IF a = 2 THEN
+LEAVE label1;
+END IF;
+SET a= a-1;
+END LOOP label1;
+RETURN a;
+END;
+/
+SELECT f1(4);
+f1(4)
+2
+DROP FUNCTION f1;
+CREATE FUNCTION f1 (a INT) RETURN INT AS
+BEGIN
+<<label1>>
+REPEAT
+IF a = 2 THEN
+LEAVE label1;
+END IF;
+SET a= a-1;
+UNTIL a=0 END REPEAT;
+RETURN a;
+END;
+/
+SELECT f1(4);
+f1(4)
+2
+DROP FUNCTION f1;
+# Testing IN/OUT/INOUT
+CREATE PROCEDURE p1 (p1 IN VARCHAR2(10), p2 OUT VARCHAR2(10)) AS
+BEGIN
+SET p1='p1new';
+SET p2='p2new';
+END;
+/
+SET @p1='p1', @p2='p2';
+CALL p1(@p1, @p2);
+SELECT @p1, @p2;
+@p1 @p2
+p1 p2new
+DROP PROCEDURE p1;
+# Testing Oracle-style assigment
+CREATE PROCEDURE p1 (p1 OUT VARCHAR2(10)) AS
+BEGIN
+p1:= 'p1new';
+END;
+/
+SET @p1='p1';
+CALL p1(@p1);
+SELECT @p1;
+@p1
+p1new
+DROP PROCEDURE p1;
+# Testing that NULL is a valid statement
+CREATE PROCEDURE p1(a INT) AS
+BEGIN
+NULL;
+END;
+/
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(a INT) AS
+a INT:=10;
+BEGIN
+IF a=10 THEN NULL; ELSE NULL; END IF;
+END;
+/
+DROP PROCEDURE p1;
+# Keywords that are OK for table names, but not for SP variables
+CREATE TABLE function (function int);
+INSERT INTO function SET function=10;
+SELECT function.function FROM function;
+function
+10
+DROP TABLE function;
+# Testing that (some) keyword_sp are allowed in Oracle-style assignments
+CREATE PROCEDURE p1 (action OUT INT) AS BEGIN action:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (clob OUT INT) AS BEGIN clob:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (enum OUT INT) AS BEGIN enum:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (via OUT INT) AS BEGIN via:=10; END;/
+DROP PROCEDURE p1/
+# Testing keyword_directly_assignable
+CREATE PROCEDURE p1 (ascii OUT INT) AS BEGIN ascii:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (backup OUT INT) AS BEGIN backup:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (binlog OUT INT) AS BEGIN binlog:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (byte OUT INT) AS BEGIN byte:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (cache OUT INT) AS BEGIN cache:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (checksum OUT INT) AS BEGIN checksum:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (checkpoint OUT INT) AS BEGIN checkpoint:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_add OUT INT) AS BEGIN column_add:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_check OUT INT) AS BEGIN column_check:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_create OUT INT) AS BEGIN column_create:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_delete OUT INT) AS BEGIN column_delete:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_get OUT INT) AS BEGIN column_get:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (deallocate OUT INT) AS BEGIN deallocate:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (examined OUT INT) AS BEGIN examined:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (execute OUT INT) AS BEGIN execute:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (flush OUT INT) AS BEGIN flush:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (format OUT INT) AS BEGIN format:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (get OUT INT) AS BEGIN get:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (help OUT INT) AS BEGIN help:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (host OUT INT) AS BEGIN host:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (install OUT INT) AS BEGIN install:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (option OUT INT) AS BEGIN option:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (options OUT INT) AS BEGIN options:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (owner OUT INT) AS BEGIN owner:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (parser OUT INT) AS BEGIN parser:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (port OUT INT) AS BEGIN port:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (prepare OUT INT) AS BEGIN prepare:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (remove OUT INT) AS BEGIN remove:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (reset OUT INT) AS BEGIN reset:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (restore OUT INT) AS BEGIN restore:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (security OUT INT) AS BEGIN security:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (server OUT INT) AS BEGIN server:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (signed OUT INT) AS BEGIN signed:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (socket OUT INT) AS BEGIN socket:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (slave OUT INT) AS BEGIN slave:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (slaves OUT INT) AS BEGIN slaves:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (soname OUT INT) AS BEGIN soname:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (start OUT INT) AS BEGIN start:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (stop OUT INT) AS BEGIN stop:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (stored OUT INT) AS BEGIN stored:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (unicode OUT INT) AS BEGIN unicode:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (uninstall OUT INT) AS BEGIN uninstall:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (upgrade OUT INT) AS BEGIN upgrade:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (wrapper OUT INT) AS BEGIN wrapper:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (xa OUT INT) AS BEGIN xa:=10; END;/
+DROP PROCEDURE p1/
+# Testing that keyword_directly_not_assignable does not work in :=
+CREATE PROCEDURE p1 (commit OUT INT) AS BEGIN commit:=10; 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 ':=10; END' at line 1
+CREATE PROCEDURE p1 (rollback OUT INT) AS BEGIN rollback:=10; 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 ':=10; END' at line 1
+CREATE PROCEDURE p1 (shutdown OUT INT) AS BEGIN shutdown:=10; 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 ':=10; END' at line 1
+CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN exception:=10; 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 ':=10; END' at line 1
+# Testing that keyword_directly_not_assignable works in SET statements.
+CREATE PROCEDURE p1 (contains OUT INT) AS BEGIN SET contains=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (language OUT INT) AS BEGIN SET language=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (no OUT INT) AS BEGIN SET no=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (charset OUT INT) AS BEGIN SET charset=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (do OUT INT) AS BEGIN SET do=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (repair OUT INT) AS BEGIN SET repair=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (handler OUT INT) AS BEGIN SET handler=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (open OUT INT) AS BEGIN SET open=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (close OUT INT) AS BEGIN SET close=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (savepoint OUT INT) AS BEGIN SET savepoint=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (truncate OUT INT) AS BEGIN SET truncate=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (begin OUT INT) AS BEGIN SET begin=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (end OUT INT) AS BEGIN SET end=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN SET exception=10; END;/
+DROP PROCEDURE p1/
+# Testing that keyword_directly_not_assignable works in table/column names
+CREATE TABLE contains (contains INT);
+DROP TABLE contains;
+CREATE TABLE language (language INT);
+DROP TABLE language;
+CREATE TABLE no (no INT);
+DROP TABLE no;
+CREATE TABLE charset (charset INT);
+DROP TABLE charset;
+CREATE TABLE do (do INT);
+DROP TABLE do;
+CREATE TABLE repair (repair INT);
+DROP TABLE repair;
+CREATE TABLE handler (handler INT);
+DROP TABLE handler;
+CREATE TABLE open (open INT);
+DROP TABLE open;
+CREATE TABLE close (close INT);
+DROP TABLE close;
+CREATE TABLE savepoint (savepoint INT);
+DROP TABLE savepoint;
+CREATE TABLE truncate (truncate INT);
+DROP TABLE truncate;
+CREATE TABLE begin (begin INT);
+DROP TABLE begin;
+CREATE TABLE end (end INT);
+DROP TABLE end;
+CREATE TABLE exception (exception INT);
+DROP TABLE exception;
+# Testing ELSIF
+CREATE FUNCTION f1(a INT) RETURN CLOB
+AS
+BEGIN
+IF a=1 THEN RETURN 'a is 1';
+ELSIF a=2 THEN RETURN 'a is 2';
+ELSE RETURN 'a is unknown';
+END IF;
+END;
+/
+SELECT f1(2) FROM DUAL;
+f1(2)
+a is 2
+DROP FUNCTION f1;
+# Testing top-level declarations
+CREATE PROCEDURE p1 (p1 OUT VARCHAR2(10))
+AS
+p2 VARCHAR(10);
+BEGIN
+p2:='p1new';
+p1:=p2;
+END;
+/
+SET @p1='p1';
+CALL p1(@p1);
+SELECT @p1;
+@p1
+p1new
+DROP PROCEDURE p1;
+CREATE FUNCTION f1 (p1 VARCHAR2(10)) RETURN VARCHAR(20)
+AS
+p2 VARCHAR(10);
+BEGIN
+p2:='new';
+RETURN CONCAT(p1, p2);
+END;
+/
+SET @p1='p1';
+SELECT f1(@p1);
+f1(@p1)
+p1new
+DROP FUNCTION f1;
+# Testing non-top declarations
+CREATE PROCEDURE p1 (p1 OUT VARCHAR2(10))
+AS
+BEGIN
+DECLARE
+p2 VARCHAR(10);
+BEGIN
+p2:='p1new';
+p1:=p2;
+END;
+DECLARE
+t1 VARCHAR(10);
+t2 VARCHAR(10);
+BEGIN
+END;
+END;
+/
+SET @p1='p1';
+CALL p1(@p1);
+SELECT @p1;
+@p1
+p1new
+DROP PROCEDURE p1;
+CREATE FUNCTION f1 (p1 VARCHAR2(10)) RETURN VARCHAR(20)
+AS
+BEGIN
+DECLARE
+p2 VARCHAR(10);
+BEGIN
+p2:='new';
+RETURN CONCAT(p1, p2);
+END;
+DECLARE
+t1 VARCHAR(10);
+t2 VARCHAR(10);
+BEGIN
+END;
+END;
+/
+SET @p1='p1';
+SELECT f1(@p1);
+f1(@p1)
+p1new
+DROP FUNCTION f1;
+# Testing exceptions
+CREATE TABLE t1 (c1 INT);
+CREATE PROCEDURE sp1 (p1 IN VARCHAR2(20), p2 OUT VARCHAR2(30))
+IS
+v1 INT;
+BEGIN
+SELECT c1 INTO v1 FROM t1;
+p2 := p1;
+EXCEPTION
+WHEN NOT FOUND THEN
+BEGIN
+p2 := 'def';
+END;
+END;
+/
+CALL sp1('abc', @a);
+SELECT @a;
+@a
+def
+DROP PROCEDURE sp1;
+DROP TABLE t1;
+CREATE PROCEDURE sp1 (v IN OUT INT, error IN INT)
+IS
+BEGIN
+SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=error, MESSAGE_TEXT='User defined error!';
+v:= 223;
+EXCEPTION
+WHEN 30001 THEN
+BEGIN
+v:= 113;
+END;
+END;
+/
+SET @v=10;
+CALL sp1(@v, 30001);
+CALL sp1(@v, 30002);
+ERROR 45000: User defined error!
+SELECT @v;
+@v
+113
+DROP PROCEDURE sp1;
+CREATE PROCEDURE sp1 (v IN OUT INT, error IN INT)
+IS
+BEGIN
+BEGIN
+BEGIN
+SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=error, MESSAGE_TEXT='User defined error!';
+v:= 223;
+EXCEPTION
+WHEN 30001 THEN
+BEGIN
+v:= 113;
+END;
+END;
+END;
+END;
+/
+SET @v=10;
+CALL sp1(@v, 30001);
+SELECT @v;
+@v
+113
+SET @v=10;
+CALL sp1(@v, 30002);
+ERROR 45000: User defined error!
+SELECT @v;
+@v
+10
+DROP PROCEDURE sp1;
+#
+# Testing EXIT statement
+#
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+EXIT;
+END;
+/
+ERROR 42000: EXIT with no matching label:
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+<<lable1>>
+BEGIN
+<<label2>>
+LOOP
+EXIT label1;
+END LOOP;
+END;
+END;
+/
+ERROR 42000: EXIT with no matching label: label1
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+LOOP
+LOOP
+i:= i + 1;
+IF i >= 5 THEN
+EXIT;
+END IF;
+END LOOP;
+i:= i + 100;
+EXIT;
+END LOOP;
+RETURN i;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+105
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+<<label1>>
+LOOP
+<<label2>>
+LOOP
+i:= i + 1;
+IF i >= 5 THEN
+EXIT label2;
+END IF;
+END LOOP;
+i:= i + 100;
+EXIT;
+END LOOP;
+RETURN i;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+105
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+<<label1>>
+LOOP
+<<label2>>
+LOOP
+i:= i + 1;
+IF i >= 5 THEN
+EXIT label1;
+END IF;
+END LOOP;
+i:= i + 100;
+EXIT;
+END LOOP;
+RETURN i;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+5
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+LOOP
+i:= i + 1;
+EXIT WHEN i >=5;
+END LOOP;
+RETURN i;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+5
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+<<label1>>
+LOOP
+<<label2>>
+LOOP
+i:= i + 1;
+EXIT label2 WHEN i >= 5;
+END LOOP;
+i:= i + 100;
+EXIT;
+END LOOP;
+RETURN i;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+105
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+IS
+i INT := 0;
+BEGIN
+<<label1>>
+LOOP
+<<label2>>
+LOOP
+i:= i + 1;
+EXIT label1 WHEN i >= 5;
+END LOOP;
+i:= i + 100;
+EXIT;
+END LOOP;
+RETURN i;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+5
+DROP FUNCTION f1;
+# Testing CURSOR declaration
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1 RETURN INT
+AS
+v_a INT:=10;
+CURSOR c IS SELECT a FROM t1;
+BEGIN
+OPEN c;
+FETCH c INTO v_a;
+CLOSE c;
+RETURN v_a;
+EXCEPTION
+WHEN OTHERS THEN RETURN -1;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+1
+DROP FUNCTION f1;
+DROP TABLE t1;
+# Testing RETURN in procedures
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+RETURN 10;
+END;
+/
+ERROR 42000: RETURN is only allowed in a FUNCTION
+CREATE FUNCTION f1 (a INT) RETURN INT
+AS
+BEGIN
+RETURN;
+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 ';
+END' at line 4
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+IF a < 10 THEN
+BEGIN
+a:= a - 1;
+RETURN;
+END;
+END IF;
+a:= a + 1;
+EXCEPTION
+WHEN OTHERS THEN RETURN;
+END;
+/
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+11
+SET @v=9;
+CALL p1(@v);
+SELECT @v;
+@v
+8
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+DROP TABLE t1_non_existent;
+EXCEPTION
+WHEN OTHERS THEN
+BEGIN
+a:= 100;
+RETURN;
+END;
+END;
+/
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+@v
+100
+DROP PROCEDURE p1;
+# Testing WHILE loop
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+i INT:= 1;
+j INT:= 3;
+BEGIN
+WHILE i<=j
+LOOP
+a:= a + i;
+i:= i + 1;
+END LOOP;
+END;
+/
+SET @v=0;
+CALL p1(@v);
+SELECT @v;
+@v
+6
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+i INT:= 1;
+j INT:= 3;
+BEGIN
+<<label>>
+WHILE i<=j
+LOOP
+a:= a + i;
+i:= i + 1;
+END LOOP label;
+END;
+/
+SET @v=0;
+CALL p1(@v);
+SELECT @v;
+@v
+6
+DROP PROCEDURE p1;
+# Testing the FOR loop statement
+CREATE TABLE t1 (a INT);
+FOR i IN 1..3
+LOOP
+INSERT INTO t1 VALUES (i);
+END LOOP;
+/
+SELECT * FROM t1;
+a
+1
+2
+3
+DROP TABLE t1;
+CREATE FUNCTION f1 (lower_bound INT, upper_bound INT, lim INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+FOR i IN lower_bound . . upper_bound
+LOOP
+NULL
+END LOOP;
+RETURN total;
+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 '. upper_bound
+LOOP
+NULL
+END LOOP;
+RETURN total;
+END' at line 5
+CREATE FUNCTION f1 (lower_bound INT, upper_bound INT, lim INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+FOR i IN lower_bound .. upper_bound
+LOOP
+total:= total + i;
+IF i = lim THEN
+EXIT;
+END IF;
+-- Bounds are calculated only once.
+-- The below assignments have no effect on the loop condition
+lower_bound:= 900;
+upper_bound:= 1000;
+END LOOP;
+RETURN total;
+END;
+/
+SELECT f1(1, 3, 100) FROM DUAL;
+f1(1, 3, 100)
+6
+SELECT f1(1, 3, 2) FROM DUAL;
+f1(1, 3, 2)
+3
+DROP FUNCTION f1;
+CREATE FUNCTION f1 RETURN INT
+AS
+total INT := 0;
+BEGIN
+FOR i IN 1 .. 5
+LOOP
+total:= total + 1000;
+FOR j IN 1 .. 5
+LOOP
+total:= total + 1;
+IF j = 3 THEN
+EXIT; -- End the internal loop
+END IF;
+END LOOP;
+END LOOP;
+RETURN total;
+END;
+/
+SELECT f1() FROM DUAL;
+f1()
+5015
+DROP FUNCTION f1;
+CREATE FUNCTION f1 (a INT, b INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+FOR i IN REVERSE 1..a
+LOOP
+total:= total + i;
+IF i = b THEN
+EXIT;
+END IF;
+END LOOP;
+RETURN total;
+END
+/
+SELECT f1(3, 100) FROM DUAL;
+f1(3, 100)
+6
+SELECT f1(3, 2) FROM DUAL;
+f1(3, 2)
+5
+DROP FUNCTION f1;
+# Testing labeled FOR LOOP statement
+CREATE FUNCTION f1 (a INT, limita INT, b INT, limitb INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+<<la>>
+FOR ia IN 1 .. a
+LOOP
+total:= total + 1000;
+<<lb>>
+FOR ib IN 1 .. b
+LOOP
+total:= total + 1;
+EXIT lb WHEN ib = limitb;
+EXIT la WHEN ia = limita;
+END LOOP lb;
+END LOOP la;
+RETURN total;
+END;
+/
+SELECT f1(1, 1, 1, 1) FROM DUAL;
+f1(1, 1, 1, 1)
+1001
+SELECT f1(1, 2, 1, 2) FROM DUAL;
+f1(1, 2, 1, 2)
+1001
+SELECT f1(2, 1, 2, 1) FROM DUAL;
+f1(2, 1, 2, 1)
+2002
+SELECT f1(2, 1, 2, 2) FROM DUAL;
+f1(2, 1, 2, 2)
+1001
+SELECT f1(2, 2, 2, 2) FROM DUAL;
+f1(2, 2, 2, 2)
+2003
+SELECT f1(2, 3, 2, 3) FROM DUAL;
+f1(2, 3, 2, 3)
+2004
+DROP FUNCTION f1;
+# Testing labeled ITERATE in a labeled FOR LOOP statement
+CREATE FUNCTION f1 (a INT, b INT, blim INT) RETURN INT
+AS
+total INT := 0;
+BEGIN
+<<la>>
+FOR ia IN 1 .. a
+LOOP
+total:= total + 1000;
+DECLARE
+ib INT:= 1;
+BEGIN
+WHILE ib <= b
+LOOP
+IF ib > blim THEN
+ITERATE la;
+END IF;
+ib:= ib + 1;
+total:= total + 1;
+END LOOP;
+END;
+END LOOP la;
+RETURN total;
+END;
+/
+SELECT f1(3,3,0), f1(3,3,1), f1(3,3,2), f1(3,3,3), f1(3,3,4) FROM DUAL;
+f1(3,3,0) f1(3,3,1) f1(3,3,2) f1(3,3,3) f1(3,3,4)
+3000 3003 3006 3009 3009
+DROP FUNCTION f1;
+# Testing CONTINUE statement
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+FOR i IN 1 .. a
+LOOP
+IF i=5 THEN
+CONTINUE;
+END IF;
+total:= total + 1;
+END LOOP;
+RETURN total;
+END;
+/
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+f1(3) f1(4) f1(5) f1(6)
+3 4 4 5
+DROP FUNCTION f1;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+<<lj>>
+FOR j IN 1 .. 2
+LOOP
+FOR i IN 1 .. a
+LOOP
+IF i=5 THEN
+CONTINUE lj;
+END IF;
+total:= total + 1;
+END LOOP;
+END LOOP;
+RETURN total;
+END;
+/
+SELECT f1(3), f1(4), f1(5) FROM DUAL;
+f1(3) f1(4) f1(5)
+6 8 8
+DROP FUNCTION f1;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+BEGIN
+<<lj>>
+FOR j IN 1 .. 2
+LOOP
+FOR i IN 1 .. a
+LOOP
+CONTINUE lj WHEN i=5;
+total:= total + 1;
+END LOOP;
+END LOOP;
+RETURN total;
+END;
+/
+SELECT f1(3), f1(4), f1(5) FROM DUAL;
+f1(3) f1(4) f1(5)
+6 8 8
+DROP FUNCTION f1;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+total INT:= 0;
+i INT:= 1;
+BEGIN
+WHILE i <= a
+LOOP
+i:= i + 1;
+IF i=6 THEN
+CONTINUE;
+END IF;
+total:= total + 1;
+END LOOP;
+RETURN total;
+END;
+/
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+f1(3) f1(4) f1(5) f1(6)
+3 4 4 5
+DROP FUNCTION f1;
+#
+# Testing behaviour of unknown identifiers in EXIT and CONTINUE statements
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+LOOP
+EXIT WHEN unknown_ident IS NULL;
+END LOOP;
+END$$
+CALL p1;
+ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+<<label>>
+LOOP
+EXIT label WHEN unknown_ident IS NULL;
+END LOOP;
+END$$
+CALL p1;
+ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+LOOP
+CONTINUE WHEN unknown_ident IS NULL;
+END LOOP;
+END$$
+CALL p1;
+ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1
+AS
+BEGIN
+<<label>>
+LOOP
+CONTINUE label WHEN unknown_ident IS NULL;
+END LOOP;
+END$$
+CALL p1;
+ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+DROP PROCEDURE p1;
+#
+# MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
+#
+EXPLAIN EXTENDED SELECT sql%rowcount;
+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 SQL%ROWCOUNT AS "sql%rowcount"
+CREATE TABLE t1 AS SELECT SQL%ROWCOUNT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "SQL%ROWCOUNT" bigint(21) NOT NULL
+)
+DROP TABLE t1;
+#
+# UPDATE
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1
+AS
+BEGIN
+UPDATE t1 SET a=30;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+CREATE PROCEDURE p1
+AS
+BEGIN
+UPDATE t1 SET a=30;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+2
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# DELETE
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1
+AS
+BEGIN
+DELETE FROM t1;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+0
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+CREATE PROCEDURE p1
+AS
+BEGIN
+DELETE FROM t1;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+2
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# SELECT ... INTO var FROM ... - one row found
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+CREATE PROCEDURE p1
+AS
+va INT;
+BEGIN
+SELECT a INTO va FROM t1 LIMIT 1;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# SELECT ... INTO var FROM ... - no rows found
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1
+AS
+va INT;
+BEGIN
+SELECT a INTO va FROM t1;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+0
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1
+AS
+va INT;
+BEGIN
+SELECT a INTO va FROM t1;
+SELECT SQL%ROWCOUNT;
+EXCEPTION
+WHEN NO_DATA_FOUND THEN SELECT SQL%ROWCOUNT||' (EXCEPTION)';
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT||' (EXCEPTION)'
+0 (EXCEPTION)
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# SELECT ... INTO var FROM ... - multiple rows found
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+CREATE PROCEDURE p1
+AS
+va INT:=1;
+BEGIN
+SELECT a INTO va FROM t1;
+SELECT SQL%ROWCOUNT;
+EXCEPTION
+WHEN TOO_MANY_ROWS THEN SELECT SQL%ROWCOUNT||' (EXCEPTION) va='||va;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT||' (EXCEPTION) va='||va
+1 (EXCEPTION) va=10
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# INSERT INTO t2 SELECT ...
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+CREATE PROCEDURE p1
+AS
+BEGIN
+INSERT INTO t2 SELECT * FROM t1;
+SELECT SQL%ROWCOUNT;
+END;
+$$
+CALL p1();
+SQL%ROWCOUNT
+2
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
+#
+# End of MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
+#
+#
+# MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+#
+#
+# Missing table
+#
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE;
+BEGIN
+NULL;
+END;
+$$
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+DROP PROCEDURE p1;
+#
+# Missing column
+#
+CREATE TABLE t1 (b INT);
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE;
+BEGIN
+NULL;
+END;
+$$
+CALL p1();
+ERROR 42S22: Unknown column 'a' in 't1'
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# One %TYPE variable
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE;
+BEGIN
+a:= 123;
+SELECT a;
+END;
+$$
+CALL p1();
+a
+123
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Two %TYPE variables, with a truncation warning on assignment
+#
+CREATE TABLE t1 (a TINYINT, b INT);
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE;
+b t1.b%TYPE;
+BEGIN
+a:= 200;
+b:= 200;
+SELECT a, b;
+END;
+$$
+CALL p1();
+a b
+127 200
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# %TYPE variables for fields with various attributes
+#
+CREATE TABLE t1 (
+id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+a TINYINT NOT NULL,
+b INT NOT NULL,
+ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+UNIQUE(a)
+);
+CREATE PROCEDURE p1
+AS
+id t1.id%TYPE;
+a t1.a%TYPE;
+b t1.b%TYPE;
+ts t1.ts%TYPE;
+BEGIN
+SELECT id, a, b, ts;
+CREATE TABLE t2 AS SELECT id, a, b, ts;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+id a b ts
+NULL NULL NULL NULL
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "id" int(11) DEFAULT NULL,
+ "a" tinyint(4) DEFAULT NULL,
+ "b" int(11) DEFAULT NULL,
+ "ts" timestamp NULL DEFAULT NULL
+)
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# %TYPE + virtual columns
+#
+CREATE TABLE t1 (
+a INT NOT NULL,
+b VARCHAR(32),
+c INT AS (a + 10) VIRTUAL,
+d VARCHAR(5) AS (left(b,5)) PERSISTENT
+);
+CREATE PROCEDURE p1
+AS
+c t1.c%TYPE;
+d t1.d%TYPE;
+BEGIN
+SELECT c, d;
+CREATE TABLE t2 AS SELECT c, d;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+c d
+NULL NULL
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "c" int(11) DEFAULT NULL,
+ "d" varchar(5) DEFAULT NULL
+)
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# %TYPE + the ZEROFILL attribute
+#
+CREATE TABLE t1 (
+dz DECIMAL(10,3) ZEROFILL
+);
+CREATE PROCEDURE p1
+AS
+dzr t1.dz%TYPE := 10;
+dzt DECIMAL(10,3) ZEROFILL := 10;
+BEGIN
+SELECT dzr, dzt;
+CREATE TABLE t2 AS SELECT dzr,dzt;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+dzr dzt
+0000010.000 0000010.000
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "dzr" decimal(10,3) unsigned DEFAULT NULL,
+ "dzt" decimal(10,3) unsigned DEFAULT NULL
+)
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Temporary tables shadow real tables for %TYPE purposes
+#
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('t1');
+CREATE TEMPORARY TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1;
+a
+10
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE:=11;
+BEGIN
+CREATE TABLE t2 AS SELECT a;
+END;
+$$
+#
+# Should use INT(11) as %TYPE, as in the temporary table
+#
+CALL p1();
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL
+)
+SELECT * FROM t2;
+a
+11
+DROP TABLE t2;
+SELECT * FROM t1;
+a
+10
+DROP TEMPORARY TABLE t1;
+SELECT * FROM t1;
+a
+t1
+#
+# Should use VARCHAR(10) as %TYPE, as in the real table
+#
+CALL p1();
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" varchar(10) DEFAULT NULL
+)
+SELECT * FROM t2;
+a
+11
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# t1.a%TYPE searches for "t1" in the current database
+#
+CREATE TABLE t1 (a VARCHAR(10));
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (a INT);
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE:=11;
+BEGIN
+CREATE TABLE test.t2 AS SELECT a;
+END;
+$$
+#
+# This interprets t1.a%TYPE as VARCHAR(10), as in test.t1.a
+#
+USE test;
+CALL test.p1();
+SHOW CREATE TABLE test.t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" varchar(10) DEFAULT NULL
+)
+DROP TABLE test.t2;
+#
+# This interprets t1.a%TYPE as INT, as in test1.t1.a
+#
+USE test1;
+CALL test.p1();
+SHOW CREATE TABLE test.t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL
+)
+DROP TABLE test.t2;
+#
+# Error if there is no an active database
+#
+DROP DATABASE test1;
+CALL test.p1();
+ERROR 3D000: No database selected
+USE test;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# A reference to a table in a non-existing database
+#
+CREATE PROCEDURE p1
+AS
+a test1.t1.a%TYPE;
+BEGIN
+CREATE TABLE t1 AS SELECT a;
+END;
+$$
+CALL p1;
+ERROR 42S02: Table 'test1.t1' doesn't exist
+DROP PROCEDURE p1;
+#
+# A reference to a table in a different database
+#
+CREATE TABLE t1(a INT);
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (a VARCHAR(10));
+CREATE PROCEDURE p1
+AS
+a t1.a%TYPE;
+b test1.t1.a%TYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT a,b;
+END;
+$$
+CALL p1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL,
+ "b" varchar(10) DEFAULT NULL
+)
+DROP PROCEDURE p1;
+DROP TABLE t2;
+DROP DATABASE test1;
+DROP TABLE t1;
+#
+# Using a table before it appears in a %TYPE declaration + multiple %TYPE declarations
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 (a,b) VALUES (10,'b10');
+CREATE PROCEDURE p1
+AS
+BEGIN
+INSERT INTO t1 (a,b) VALUES (11, 'b11');
+SELECT * FROM t1;
+DECLARE
+va t1.a%TYPE:= 30;
+vb t1.b%TYPE:= 'b30';
+BEGIN
+INSERT INTO t1 (a,b) VALUES (12,'b12');
+SELECT * FROM t1;
+INSERT INTO t1 (a,b) VALUES (va, vb);
+SELECT * FROM t1;
+END;
+DECLARE
+va t1.a%TYPE:= 40;
+vb t1.b%TYPE:= 'b40';
+BEGIN
+INSERT INTO t1 (a,b) VALUES (va,vb);
+SELECT * FROM t1;
+END;
+END;
+$$
+CALL p1;
+a b
+10 b10
+11 b11
+a b
+10 b10
+11 b11
+12 b12
+a b
+10 b10
+11 b11
+12 b12
+30 b30
+a b
+10 b10
+11 b11
+12 b12
+30 b30
+40 b40
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# %TYPE variables + TABLE vs VIEW
+#
+CREATE TABLE t1 (
+bit6 BIT(6),
+bit7 BIT(7),
+bit8 BIT(8),
+i1 TINYINT,
+i2 SMALLINT,
+i3 MEDIUMINT,
+i4 INT,
+i8 BIGINT,
+ff FLOAT,
+fd DOUBLE,
+cc CHAR(10),
+cv VARCHAR(10),
+cvu VARCHAR(10) CHARACTER SET utf8,
+t1 TINYTEXT,
+t2 TEXT,
+t3 MEDIUMTEXT,
+t4 LONGTEXT,
+enum1 ENUM('a','b','c'),
+set1 SET('a','b','c'),
+blob1 TINYBLOB,
+blob2 BLOB,
+blob3 MEDIUMBLOB,
+blob4 LONGBLOB,
+yy YEAR,
+dd DATE,
+tm0 TIME,
+tm3 TIME(3),
+tm6 TIME(6),
+dt0 DATETIME,
+dt3 DATETIME(3),
+dt6 DATETIME(6),
+ts0 TIMESTAMP,
+ts3 TIMESTAMP(3),
+ts6 TIMESTAMP(6),
+dc100 DECIMAL(10,0),
+dc103 DECIMAL(10,3),
+dc209 DECIMAL(20,9)
+);
+CREATE PROCEDURE p1(command enum('create','select'))
+AS
+bit6 t1.bit6%TYPE := 0x30;
+bit7 t1.bit7%TYPE := 0x41;
+bit8 t1.bit8%TYPE := 0x7E;
+i1 t1.i1%TYPE := 11;
+i2 t1.i2%TYPE := 12;
+i3 t1.i3%TYPE := 13;
+i4 t1.i4%TYPE := 14;
+i8 t1.i8%TYPE := 18;
+ff t1.ff%TYPE := 21;
+fd t1.fd%TYPE := 22;
+cc t1.cc%TYPE := 'char';
+cv t1.cv%TYPE := 'varchar';
+cvu t1.cvu%TYPE := 'varcharu8';
+t1 t1.t1%TYPE := 'text1';
+t2 t1.t2%TYPE := 'text2';
+t3 t1.t3%TYPE := 'text3';
+t4 t1.t4%TYPE := 'text4';
+enum1 t1.enum1%TYPE := 'b';
+set1 t1.set1%TYPE := 'a,c';
+blob1 t1.blob1%TYPE := 'blob1';
+blob2 t1.blob2%TYPE := 'blob2';
+blob3 t1.blob3%TYPE := 'blob3';
+blob4 t1.blob4%TYPE := 'blob4';
+yy t1.yy%TYPE := 2001;
+dd t1.dd%TYPE := '2001-01-01';
+tm0 t1.tm0%TYPE := '00:00:01';
+tm3 t1.tm3%TYPE := '00:00:03.333';
+tm6 t1.tm6%TYPE := '00:00:06.666666';
+dt0 t1.dt0%TYPE := '2001-01-01 00:00:01';
+dt3 t1.dt3%TYPE := '2001-01-03 00:00:01.333';
+dt6 t1.dt6%TYPE := '2001-01-06 00:00:01.666666';
+ts0 t1.ts0%TYPE := '2002-01-01 00:00:01';
+ts3 t1.ts3%TYPE := '2002-01-03 00:00:01.333';
+ts6 t1.ts6%TYPE := '2002-01-06 00:00:01.666666';
+dc100 t1.dc100%TYPE := 10;
+dc103 t1.dc103%TYPE := 10.123;
+dc209 t1.dc209%TYPE := 10.123456789;
+BEGIN
+CASE
+WHEN command='create' THEN
+CREATE TABLE t2 AS SELECT
+bit6, bit7, bit8,
+i1,i2,i3,i4,i8,
+ff,fd, dc100, dc103, dc209,
+cc,cv,cvu,
+t1,t2,t3,t4,
+enum1, set1,
+blob1, blob2, blob3, blob4,
+dd, yy,
+tm0, tm3, tm6,
+dt0, dt3, dt6,
+ts0, ts3, ts6;
+WHEN command='select' THEN
+SELECT
+bit6, bit7, bit8,
+i1,i2,i3,i4,i8,
+ff,fd, dc100, dc103, dc209,
+cc,cv,cvu,
+t1,t2,t3,t4,
+enum1, set1,
+blob1, blob2, blob3, blob4,
+dd, yy,
+tm0, tm3, tm6,
+dt0, dt3, dt6,
+ts0, ts3, ts6;
+END CASE;
+END;
+$$
+#
+# TABLE
+#
+CALL p1('create');
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "bit6" bit(6) DEFAULT NULL,
+ "bit7" bit(7) DEFAULT NULL,
+ "bit8" bit(8) DEFAULT NULL,
+ "i1" tinyint(4) DEFAULT NULL,
+ "i2" smallint(6) DEFAULT NULL,
+ "i3" mediumint(9) DEFAULT NULL,
+ "i4" int(11) DEFAULT NULL,
+ "i8" bigint(20) DEFAULT NULL,
+ "ff" float DEFAULT NULL,
+ "fd" double DEFAULT NULL,
+ "dc100" decimal(10,0) DEFAULT NULL,
+ "dc103" decimal(10,3) DEFAULT NULL,
+ "dc209" decimal(20,9) DEFAULT NULL,
+ "cc" char(10) DEFAULT NULL,
+ "cv" varchar(10) DEFAULT NULL,
+ "cvu" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
+ "t1" tinytext DEFAULT NULL,
+ "t2" text DEFAULT NULL,
+ "t3" mediumtext DEFAULT NULL,
+ "t4" longtext DEFAULT NULL,
+ "enum1" char(1) DEFAULT NULL,
+ "set1" char(5) DEFAULT NULL,
+ "blob1" tinyblob DEFAULT NULL,
+ "blob2" longblob DEFAULT NULL,
+ "blob3" mediumblob DEFAULT NULL,
+ "blob4" longblob DEFAULT NULL,
+ "dd" datetime DEFAULT NULL,
+ "yy" year(4) DEFAULT NULL,
+ "tm0" time DEFAULT NULL,
+ "tm3" time(3) DEFAULT NULL,
+ "tm6" time(6) DEFAULT NULL,
+ "dt0" datetime DEFAULT NULL,
+ "dt3" datetime(3) DEFAULT NULL,
+ "dt6" datetime(6) DEFAULT NULL,
+ "ts0" timestamp NULL DEFAULT NULL,
+ "ts3" timestamp(3) NULL DEFAULT NULL,
+ "ts6" timestamp(6) NULL DEFAULT NULL
+)
+SELECT * FROM t2;
+bit6 0
+bit7 A
+bit8 ~
+i1 11
+i2 12
+i3 13
+i4 14
+i8 18
+ff 21
+fd 22
+dc100 10
+dc103 10.123
+dc209 10.123456789
+cc char
+cv varchar
+cvu varcharu8
+t1 text1
+t2 text2
+t3 text3
+t4 text4
+enum1 b
+set1 a,c
+blob1 blob1
+blob2 blob2
+blob3 blob3
+blob4 blob4
+dd 2001-01-01 00:00:00
+yy 2001
+tm0 00:00:01
+tm3 00:00:03.333
+tm6 00:00:06.666666
+dt0 2001-01-01 00:00:01
+dt3 2001-01-03 00:00:01.333
+dt6 2001-01-06 00:00:01.666666
+ts0 2002-01-01 00:00:01
+ts3 2002-01-03 00:00:01.333
+ts6 2002-01-06 00:00:01.666666
+DROP TABLE t2;
+CALL p1('select');
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def bit6 bit6 16 6 1 Y 32 0 63
+def bit7 bit7 16 7 1 Y 32 0 63
+def bit8 bit8 16 8 1 Y 32 0 63
+def i1 i1 1 4 2 Y 32768 0 63
+def i2 i2 2 6 2 Y 32768 0 63
+def i3 i3 9 9 2 Y 32768 0 63
+def i4 i4 3 11 2 Y 32768 0 63
+def i8 i8 8 20 2 Y 32768 0 63
+def ff ff 4 12 2 Y 32768 31 63
+def fd fd 5 22 2 Y 32768 31 63
+def dc100 dc100 246 11 2 Y 32768 0 63
+def dc103 dc103 246 12 6 Y 32768 3 63
+def dc209 dc209 246 22 12 Y 32768 9 63
+def cc cc 254 10 4 Y 0 0 8
+def cv cv 253 10 7 Y 0 0 8
+def cvu cvu 253 10 9 Y 0 0 8
+def t1 t1 252 255 5 Y 16 0 8
+def t2 t2 252 65535 5 Y 16 0 8
+def t3 t3 252 16777215 5 Y 16 0 8
+def t4 t4 252 4294967295 5 Y 16 0 8
+def enum1 enum1 254 1 1 Y 256 0 8
+def set1 set1 254 5 3 Y 2048 0 8
+def blob1 blob1 252 255 5 Y 144 0 63
+def blob2 blob2 252 4294967295 5 Y 144 0 63
+def blob3 blob3 252 16777215 5 Y 144 0 63
+def blob4 blob4 252 4294967295 5 Y 144 0 63
+def dd dd 12 19 19 Y 128 0 63
+def yy yy 13 4 4 Y 32864 0 63
+def tm0 tm0 11 10 8 Y 128 0 63
+def tm3 tm3 11 14 12 Y 128 3 63
+def tm6 tm6 11 17 15 Y 128 6 63
+def dt0 dt0 12 19 19 Y 128 0 63
+def dt3 dt3 12 23 23 Y 128 3 63
+def dt6 dt6 12 26 26 Y 128 6 63
+def ts0 ts0 7 19 19 Y 9376 0 63
+def ts3 ts3 7 23 23 Y 160 3 63
+def ts6 ts6 7 26 26 Y 160 6 63
+bit6 0
+bit7 A
+bit8 ~
+i1 11
+i2 12
+i3 13
+i4 14
+i8 18
+ff 21
+fd 22
+dc100 10
+dc103 10.123
+dc209 10.123456789
+cc char
+cv varchar
+cvu varcharu8
+t1 text1
+t2 text2
+t3 text3
+t4 text4
+enum1 b
+set1 a,c
+blob1 blob1
+blob2 blob2
+blob3 blob3
+blob4 blob4
+dd 2001-01-01 00:00:00
+yy 2001
+tm0 00:00:01
+tm3 00:00:03.333
+tm6 00:00:06.666666
+dt0 2001-01-01 00:00:01
+dt3 2001-01-03 00:00:01.333
+dt6 2001-01-06 00:00:01.666666
+ts0 2002-01-01 00:00:01
+ts3 2002-01-03 00:00:01.333
+ts6 2002-01-06 00:00:01.666666
+#
+# VIEW
+#
+ALTER TABLE t1 RENAME t0;
+CREATE VIEW t1 AS SELECT * FROM t0;
+CALL p1('create');
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "bit6" bit(6) DEFAULT NULL,
+ "bit7" bit(7) DEFAULT NULL,
+ "bit8" bit(8) DEFAULT NULL,
+ "i1" tinyint(4) DEFAULT NULL,
+ "i2" smallint(6) DEFAULT NULL,
+ "i3" mediumint(9) DEFAULT NULL,
+ "i4" int(11) DEFAULT NULL,
+ "i8" bigint(20) DEFAULT NULL,
+ "ff" float DEFAULT NULL,
+ "fd" double DEFAULT NULL,
+ "dc100" decimal(10,0) DEFAULT NULL,
+ "dc103" decimal(10,3) DEFAULT NULL,
+ "dc209" decimal(20,9) DEFAULT NULL,
+ "cc" char(10) DEFAULT NULL,
+ "cv" varchar(10) DEFAULT NULL,
+ "cvu" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
+ "t1" tinytext DEFAULT NULL,
+ "t2" text DEFAULT NULL,
+ "t3" mediumtext DEFAULT NULL,
+ "t4" longtext DEFAULT NULL,
+ "enum1" char(1) DEFAULT NULL,
+ "set1" char(5) DEFAULT NULL,
+ "blob1" tinyblob DEFAULT NULL,
+ "blob2" longblob DEFAULT NULL,
+ "blob3" mediumblob DEFAULT NULL,
+ "blob4" longblob DEFAULT NULL,
+ "dd" datetime DEFAULT NULL,
+ "yy" year(4) DEFAULT NULL,
+ "tm0" time DEFAULT NULL,
+ "tm3" time(3) DEFAULT NULL,
+ "tm6" time(6) DEFAULT NULL,
+ "dt0" datetime DEFAULT NULL,
+ "dt3" datetime(3) DEFAULT NULL,
+ "dt6" datetime(6) DEFAULT NULL,
+ "ts0" timestamp NULL DEFAULT NULL,
+ "ts3" timestamp(3) NULL DEFAULT NULL,
+ "ts6" timestamp(6) NULL DEFAULT NULL
+)
+SELECT * FROM t2;
+bit6 0
+bit7 A
+bit8 ~
+i1 11
+i2 12
+i3 13
+i4 14
+i8 18
+ff 21
+fd 22
+dc100 10
+dc103 10.123
+dc209 10.123456789
+cc char
+cv varchar
+cvu varcharu8
+t1 text1
+t2 text2
+t3 text3
+t4 text4
+enum1 b
+set1 a,c
+blob1 blob1
+blob2 blob2
+blob3 blob3
+blob4 blob4
+dd 2001-01-01 00:00:00
+yy 2001
+tm0 00:00:01
+tm3 00:00:03.333
+tm6 00:00:06.666666
+dt0 2001-01-01 00:00:01
+dt3 2001-01-03 00:00:01.333
+dt6 2001-01-06 00:00:01.666666
+ts0 2002-01-01 00:00:01
+ts3 2002-01-03 00:00:01.333
+ts6 2002-01-06 00:00:01.666666
+DROP TABLE t2;
+CALL p1('select');
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def bit6 bit6 16 6 1 Y 32 0 63
+def bit7 bit7 16 7 1 Y 32 0 63
+def bit8 bit8 16 8 1 Y 32 0 63
+def i1 i1 1 4 2 Y 32768 0 63
+def i2 i2 2 6 2 Y 32768 0 63
+def i3 i3 9 9 2 Y 32768 0 63
+def i4 i4 3 11 2 Y 32768 0 63
+def i8 i8 8 20 2 Y 32768 0 63
+def ff ff 4 12 2 Y 32768 31 63
+def fd fd 5 22 2 Y 32768 31 63
+def dc100 dc100 246 11 2 Y 32768 0 63
+def dc103 dc103 246 12 6 Y 32768 3 63
+def dc209 dc209 246 22 12 Y 32768 9 63
+def cc cc 254 10 4 Y 0 0 8
+def cv cv 253 10 7 Y 0 0 8
+def cvu cvu 253 10 9 Y 0 0 8
+def t1 t1 252 255 5 Y 16 0 8
+def t2 t2 252 65535 5 Y 16 0 8
+def t3 t3 252 16777215 5 Y 16 0 8
+def t4 t4 252 4294967295 5 Y 16 0 8
+def enum1 enum1 254 1 1 Y 256 0 8
+def set1 set1 254 5 3 Y 2048 0 8
+def blob1 blob1 252 255 5 Y 144 0 63
+def blob2 blob2 252 4294967295 5 Y 144 0 63
+def blob3 blob3 252 16777215 5 Y 144 0 63
+def blob4 blob4 252 4294967295 5 Y 144 0 63
+def dd dd 12 19 19 Y 128 0 63
+def yy yy 13 4 4 Y 32864 0 63
+def tm0 tm0 11 10 8 Y 128 0 63
+def tm3 tm3 11 14 12 Y 128 3 63
+def tm6 tm6 11 17 15 Y 128 6 63
+def dt0 dt0 12 19 19 Y 128 0 63
+def dt3 dt3 12 23 23 Y 128 3 63
+def dt6 dt6 12 26 26 Y 128 6 63
+def ts0 ts0 7 19 19 Y 160 0 63
+def ts3 ts3 7 23 23 Y 160 3 63
+def ts6 ts6 7 26 26 Y 160 6 63
+bit6 0
+bit7 A
+bit8 ~
+i1 11
+i2 12
+i3 13
+i4 14
+i8 18
+ff 21
+fd 22
+dc100 10
+dc103 10.123
+dc209 10.123456789
+cc char
+cv varchar
+cvu varcharu8
+t1 text1
+t2 text2
+t3 text3
+t4 text4
+enum1 b
+set1 a,c
+blob1 blob1
+blob2 blob2
+blob3 blob3
+blob4 blob4
+dd 2001-01-01 00:00:00
+yy 2001
+tm0 00:00:01
+tm3 00:00:03.333
+tm6 00:00:06.666666
+dt0 2001-01-01 00:00:01
+dt3 2001-01-03 00:00:01.333
+dt6 2001-01-06 00:00:01.666666
+ts0 2002-01-01 00:00:01
+ts3 2002-01-03 00:00:01.333
+ts6 2002-01-06 00:00:01.666666
+DROP VIEW t1;
+DROP TABLE t0;
+DROP PROCEDURE p1;
+#
+# VIEW with subqueries
+#
+CREATE TABLE t1 (a INT,b INT);
+INSERT INTO t1 VALUES (10,1),(20,2),(30,3),(40,4);
+SELECT AVG(a) FROM t1;
+AVG(a)
+25.0000
+CREATE VIEW v1 AS SELECT a,1 as b FROM t1 WHERE a>(SELECT AVG(a) FROM t1) AND b>(SELECT 1);
+SELECT * FROM v1;
+a b
+30 1
+40 1
+CREATE PROCEDURE p1
+AS
+a v1.a%TYPE := 10;
+b v1.b%TYPE := 1;
+BEGIN
+SELECT a,b;
+END;
+$$
+CALL p1;
+a b
+10 1
+DROP PROCEDURE p1;
+CREATE FUNCTION f1 RETURN INT
+AS
+a v1.a%TYPE := 10;
+b v1.b%TYPE := 1;
+BEGIN
+RETURN a+b;
+END;
+$$
+SELECT f1();
+f1()
+11
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# %TYPE variables + INFORMATION_SCHEMA
+#
+CREATE PROCEDURE p1
+AS
+tables_table_name INFORMATION_SCHEMA.TABLES.TABLE_NAME%TYPE;
+tables_table_rows INFORMATION_SCHEMA.TABLES.TABLE_ROWS%TYPE;
+processlist_info INFORMATION_SCHEMA.PROCESSLIST.INFO%TYPE;
+processlist_info_binary INFORMATION_SCHEMA.PROCESSLIST.INFO_BINARY%TYPE;
+BEGIN
+CREATE TABLE t1 AS SELECT
+tables_table_name,
+tables_table_rows,
+processlist_info,
+processlist_info_binary;
+END;
+$$
+CALL p1();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "tables_table_name" varchar(64) CHARACTER SET utf8 DEFAULT NULL,
+ "tables_table_rows" bigint(21) unsigned DEFAULT NULL,
+ "processlist_info" longtext CHARACTER SET utf8 DEFAULT NULL,
+ "processlist_info_binary" blob(65535) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# %TYPE + Table structure change
+# Data type for both a0 and a1 is chosen in the very beginning
+#
+CREATE PROCEDURE p1
+AS
+a0 t1.a%TYPE;
+BEGIN
+ALTER TABLE t1 MODIFY a VARCHAR(10); -- This does not affect a1
+DECLARE
+a1 t1.a%TYPE;
+BEGIN
+CREATE TABLE t2 AS SELECT a0, a1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+END;
+END
+$$
+CREATE TABLE t1 (a INT);
+CALL p1;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a0" int(11) DEFAULT NULL,
+ "a1" int(11) DEFAULT NULL
+)
+DROP TABLE t1;
+DROP PROCEDURE p1;
+#
+# %TYPE in parameters
+#
+CREATE TABLE t1 (a VARCHAR(10));
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (b SMALLINT);
+CREATE PROCEDURE p1(a t1.a%TYPE, b test1.t1.b%TYPE)
+AS
+BEGIN
+CREATE TABLE t2 AS SELECT a, b;
+END;
+$$
+CALL p1('test', 123);
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" varchar(10) DEFAULT NULL,
+ "b" smallint(6) DEFAULT NULL
+)
+SELECT * FROM t2;
+a b
+test 123
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE test1.t1;
+DROP DATABASE test1;
+DROP TABLE t1;
+#
+# %TYPE in a stored function variables and arguments
+#
+CREATE TABLE t1 (a INT);
+SET sql_mode=ORACLE;
+CREATE FUNCTION f1 (prm t1.a%TYPE) RETURN INT
+AS
+a t1.a%TYPE:= prm;
+BEGIN
+RETURN a;
+END;
+$$
+SELECT f1(20);
+f1(20)
+20
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# %TYPE in function RETURN clause is not supported yet
+#
+CREATE FUNCTION f1 RETURN t1.a%TYPE
+AS
+BEGIN
+RETURN 0;
+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 't1.a%TYPE
+AS
+BEGIN
+RETURN 0;
+END' at line 1
+#
+# End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+#
+#
+# MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
+#
+CREATE FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END f1;
+$$
+DROP FUNCTION f1;
+CREATE FUNCTION test.f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END test.f1;
+$$
+DROP FUNCTION f1;
+CREATE FUNCTION test.f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END test2.f1;
+$$
+ERROR HY000: END identifier 'test2.f1' does not match 'test.f1'
+CREATE FUNCTION test.f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END test.f2;
+$$
+ERROR HY000: END identifier 'test.f2' does not match 'test.f1'
+CREATE FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END test.f2;
+$$
+ERROR HY000: END identifier 'test.f2' does not match 'test.f1'
+CREATE FUNCTION f1 RETURN INT AS
+BEGIN
+RETURN 10;
+END test2.f1;
+$$
+ERROR HY000: END identifier 'test2.f1' does not match 'test.f1'
+CREATE PROCEDURE p1 AS
+BEGIN
+NULL;
+END p1;
+$$
+DROP PROCEDURE p1;
+CREATE PROCEDURE test.p1 AS
+BEGIN
+NULL;
+END test.p1;
+$$
+DROP PROCEDURE p1;
+CREATE PROCEDURE test.p1 AS
+BEGIN
+NULL;
+END test2.p1;
+$$
+ERROR HY000: END identifier 'test2.p1' does not match 'test.p1'
+CREATE PROCEDURE test.p1 AS
+BEGIN
+NULL;
+END test.p2;
+$$
+ERROR HY000: END identifier 'test.p2' does not match 'test.p1'
+CREATE PROCEDURE p1 AS
+BEGIN
+NULL;
+END test.p2;
+$$
+ERROR HY000: END identifier 'test.p2' does not match 'test.p1'
+CREATE PROCEDURE p1 AS
+BEGIN
+NULL;
+END test2.p1;
+$$
+ERROR HY000: END identifier 'test2.p1' does not match 'test.p1'
+#
+# MDEV-12107 sql_mode=ORACLE: Inside routines the CALL keywoard is optional
+#
+CREATE OR REPLACE PROCEDURE p1(a INT) AS
+BEGIN
+SELECT 'This is p1' AS "comment";
+END;
+/
+CREATE OR REPLACE PROCEDURE p2 AS
+BEGIN
+SELECT 'This is p2' AS "comment";
+END;
+/
+BEGIN
+p1(10);
+p2;
+test.p1(10);
+test.p2;
+END;
+/
+comment
+This is p1
+comment
+This is p2
+comment
+This is p1
+comment
+This is p2
+CREATE PROCEDURE p3 AS
+BEGIN
+p1(10);
+p2;
+test.p1(10);
+test.p2;
+END
+/
+CALL p3;
+comment
+This is p1
+comment
+This is p2
+comment
+This is p1
+comment
+This is p2
+DROP PROCEDURE p3;
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+#
+# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+#
+SELECT SQL%ROWCOUNT;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def SQL%ROWCOUNT 8 21 1 N 32897 0 63
+SQL%ROWCOUNT
+0
+#
+# MDEV-13686 EXCEPTION reserved keyword in SQL_MODE=oracle but not in Oracle itself
+#
+CREATE TABLE t1 (c1 int);
+CREATE VIEW v1 AS SELECT c1 exception FROM t1;
+SELECT exception FROM v1;
+exception
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# MDEV-14139 Anchored data types for variables
+#
+BEGIN NOT ATOMIC
+DECLARE a a%TYPE;
+END;
+$$
+ERROR 42000: Undeclared variable: a
+DECLARE
+int11 INT;
+dec103 DECIMAL(10,3);
+flt0 FLOAT;
+dbl0 DOUBLE;
+enum0 ENUM('a','b');
+bit3 BIT(3);
+varchar10 VARCHAR(10);
+text1 TEXT;
+tinytext1 TINYTEXT;
+mediumtext1 MEDIUMTEXT;
+longtext1 LONGTEXT;
+time3 TIME(3);
+datetime4 DATETIME(4);
+timestamp5 TIMESTAMP(5);
+date0 DATE;
+a_int11 int11%TYPE;
+a_dec103 dec103%TYPE;
+a_flt0 flt0%TYPE;
+a_dbl0 dbl0%TYPE;
+a_bit3 bit3%TYPE;
+a_enum0 enum0%TYPE;
+a_varchar10 varchar10%TYPE;
+a_text1 text1%TYPE;
+a_tinytext1 tinytext1%TYPE;
+a_mediumtext1 mediumtext1%TYPE;
+a_longtext1 longtext1%TYPE;
+a_time3 time3%TYPE;
+a_datetime4 datetime4%TYPE;
+a_timestamp5 timestamp5%TYPE;
+a_date0 date0%TYPE;
+aa_int11 a_int11%TYPE;
+aa_dec103 a_dec103%TYPE;
+aa_flt0 a_flt0%TYPE;
+aa_dbl0 a_dbl0%TYPE;
+aa_bit3 a_bit3%TYPE;
+aa_enum0 a_enum0%TYPE;
+aa_varchar10 a_varchar10%TYPE;
+aa_text1 a_text1%TYPE;
+aa_tinytext1 a_tinytext1%TYPE;
+aa_mediumtext1 a_mediumtext1%TYPE;
+aa_longtext1 a_longtext1%TYPE;
+aa_time3 a_time3%TYPE;
+aa_datetime4 a_datetime4%TYPE;
+aa_timestamp5 a_timestamp5%TYPE;
+aa_date0 a_date0%TYPE;
+BEGIN
+CREATE TABLE t1 AS
+SELECT a_int11,a_dec103,a_flt0,a_dbl0,a_bit3,
+a_enum0,a_varchar10,
+a_text1,a_tinytext1,a_mediumtext1,a_longtext1,
+a_time3,a_datetime4,a_timestamp5,a_date0;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT aa_int11,aa_dec103,aa_flt0,aa_dbl0,aa_bit3,
+aa_enum0,aa_varchar10,
+aa_text1,aa_tinytext1,aa_mediumtext1,aa_longtext1,
+aa_time3,aa_datetime4,aa_timestamp5,aa_date0;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+END;
+$$
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a_int11" int(11) DEFAULT NULL,
+ "a_dec103" decimal(10,3) DEFAULT NULL,
+ "a_flt0" float DEFAULT NULL,
+ "a_dbl0" double DEFAULT NULL,
+ "a_bit3" bit(3) DEFAULT NULL,
+ "a_enum0" char(1) DEFAULT NULL,
+ "a_varchar10" varchar(10) DEFAULT NULL,
+ "a_text1" text DEFAULT NULL,
+ "a_tinytext1" tinytext DEFAULT NULL,
+ "a_mediumtext1" mediumtext DEFAULT NULL,
+ "a_longtext1" longtext DEFAULT NULL,
+ "a_time3" time(3) DEFAULT NULL,
+ "a_datetime4" datetime(4) DEFAULT NULL,
+ "a_timestamp5" timestamp(5) NULL DEFAULT NULL,
+ "a_date0" datetime DEFAULT NULL
+)
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "aa_int11" int(11) DEFAULT NULL,
+ "aa_dec103" decimal(10,3) DEFAULT NULL,
+ "aa_flt0" float DEFAULT NULL,
+ "aa_dbl0" double DEFAULT NULL,
+ "aa_bit3" bit(3) DEFAULT NULL,
+ "aa_enum0" char(1) DEFAULT NULL,
+ "aa_varchar10" varchar(10) DEFAULT NULL,
+ "aa_text1" text DEFAULT NULL,
+ "aa_tinytext1" tinytext DEFAULT NULL,
+ "aa_mediumtext1" mediumtext DEFAULT NULL,
+ "aa_longtext1" longtext DEFAULT NULL,
+ "aa_time3" time(3) DEFAULT NULL,
+ "aa_datetime4" datetime(4) DEFAULT NULL,
+ "aa_timestamp5" timestamp(5) NULL DEFAULT NULL,
+ "aa_date0" datetime DEFAULT NULL
+)
+#
+# MDEV-11160 "Incorrect column name" when "CREATE TABLE t1 AS SELECT spvar"
+#
+CREATE TABLE t1 (x INT);
+INSERT INTO t1 VALUES (10);
+CREATE VIEW v1 AS SELECT x+1 AS a,x+1 AS b FROM t1;
+CREATE PROCEDURE p1
+AS
+a INT := 1;
+b INT := 2;
+BEGIN
+CREATE TABLE t2 AS SELECT a,b FROM v1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL,
+ "b" int(11) DEFAULT NULL
+)
+a b
+1 2
+DROP PROCEDURE p1;
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# MDEV-14228 MariaDB crashes with function
+#
+CREATE TABLE t1 (c VARCHAR(16), KEY(c));
+INSERT INTO t1 VALUES ('foo');
+CREATE FUNCTION f1() RETURN VARCHAR(16)
+IS
+v VARCHAR2(16);
+BEGIN
+FOR v IN (SELECT DISTINCT c FROM t1)
+LOOP
+IF (v = 'bar') THEN
+SELECT 1 INTO @a;
+END IF;
+END LOOP;
+RETURN 'qux';
+END $$
+SELECT f1();
+ERROR HY000: Illegal parameter data types row and varchar for operation '='
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURN VARCHAR(16)
+IS
+v t1%ROWTYPE;
+BEGIN
+IF v = 'bar' THEN
+NULL;
+END IF;
+RETURN 'qux';
+END $$
+SELECT f1();
+ERROR HY000: Illegal parameter data types row and varchar for operation '='
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURN VARCHAR(16)
+IS
+v ROW(a INT);
+BEGIN
+IF v = 'bar' THEN
+NULL;
+END IF;
+RETURN 'qux';
+END $$
+SELECT f1();
+ERROR HY000: Illegal parameter data types row and varchar for operation '='
+DROP FUNCTION f1;
+DROP TABLE t1;
+DECLARE
+v ROW(a INT);
+BEGIN
+SELECT v IN ('a','b');
+END $$
+ERROR HY000: Illegal parameter data types row and varchar for operation 'in'
+DECLARE
+v ROW(a INT);
+BEGIN
+SELECT 'a' IN (v,'b');
+END $$
+ERROR HY000: Illegal parameter data types varchar and row for operation 'in'
+DECLARE
+v ROW(a INT);
+BEGIN
+SELECT 'a' IN ('b',v);
+END $$
+ERROR HY000: Illegal parameter data types varchar and row for operation 'in'
+#
+# MDEV-17253 Oracle compatibility: The REVERSE key word for FOR loop behaves incorrectly
+#
+DECLARE
+totalprice DECIMAL(12,2):=NULL;
+loop_start INTEGER := 1;
+BEGIN
+FOR idx IN REVERSE loop_start..10 LOOP
+SELECT idx;
+END LOOP;
+END;
+$$
+idx
+10
+idx
+9
+idx
+8
+idx
+7
+idx
+6
+idx
+5
+idx
+4
+idx
+3
+idx
+2
+idx
+1
+CREATE PROCEDURE p1 AS
+loop_start INTEGER := 1;
+BEGIN
+FOR idx IN REVERSE 3..loop_start LOOP
+SELECT idx;
+END LOOP;
+END;
+$$
+CALL p1();
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 AS
+loop_start INTEGER := 1;
+BEGIN
+FOR idx IN REVERSE loop_start..3 LOOP
+SELECT idx;
+END LOOP;
+END;
+$$
+CALL p1();
+idx
+3
+idx
+2
+idx
+1
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/statement-expr.result b/mysql-test/suite/compat/oracle/r/statement-expr.result
new file mode 100644
index 00000000000..ea3bd5232d3
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/statement-expr.result
@@ -0,0 +1,69 @@
+SET sql_mode=ORACLE;
+#
+# Start of 10.3 tests
+#
+CREATE TABLE t1 (id INT, id1 INT);
+INSERT INTO t1 VALUES (1,7);
+INSERT INTO t1 VALUES (1,8);
+SELECT ROW(1,7) IN (SELECT id, id1 FROM t1 WHERE id1= 8);
+ROW(1,7) IN (SELECT id, id1 FROM t1 WHERE id1= 8)
+0
+EXECUTE IMMEDIATE 'SELECT ROW(1, 7) IN (SELECT id, id1 FROM t1 WHERE id1= 8)';
+ROW(1, 7) IN (SELECT id, id1 FROM t1 WHERE id1= 8)
+0
+DROP TABLE t1;
+EXECUTE IMMEDIATE 'SELECT ?' USING (1 IN (SELECT * 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 'SELECT * FROM t1))' at line 1
+EXECUTE IMMEDIATE 'SELECT ?' USING (SELECT * 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 'SELECT * FROM t1)' at line 1
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (10);
+CREATE PROCEDURE p1(a INT) AS BEGIN NULL; END;
+$$
+CALL p1((1) IN (SELECT * FROM t1));
+CALL p1(EXISTS (SELECT * FROM t1));
+DROP PROCEDURE p1;
+DROP TABLE t1;
+SIGNAL SQLSTATE '01000' SET MYSQL_ERRNO=(1 IN (SELECT * 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 '(1 IN (SELECT * FROM t1))' at line 1
+SIGNAL SQLSTATE '01000' SET MYSQL_ERRNO=EXISTS (SELECT * 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 'EXISTS (SELECT * FROM t1)' at line 1
+BEGIN NOT ATOMIC
+DECLARE CONTINUE HANDLER FOR SQLWARNING
+RESIGNAL SET MYSQL_ERRNO=(1 IN (SELECT * FROM t1));
+SIGNAL SQLSTATE '01000';
+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 '(1 IN (SELECT * FROM t1));
+SIGNAL SQLSTATE '01000';
+END' at line 3
+BEGIN NOT ATOMIC
+DECLARE CONTINUE HANDLER FOR SQLWARNING
+RESIGNAL SET MYSQL_ERRNO=EXISTS (SELECT * FROM t1);
+SIGNAL SQLSTATE '01000';
+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 'EXISTS (SELECT * FROM t1);
+SIGNAL SQLSTATE '01000';
+END' at line 3
+PREPARE stmt FROM (1 IN (SELECT * 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 'SELECT * FROM t1))' at line 1
+PREPARE stmt FROM EXISTS (SELECT * 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 '(SELECT * FROM t1)' at line 1
+EXECUTE IMMEDIATE (1 IN (SELECT * 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 'SELECT * FROM t1))' at line 1
+EXECUTE IMMEDIATE EXISTS (SELECT * 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 '(SELECT * FROM t1)' at line 1
+GET DIAGNOSTICS CONDITION (1 IN (SELECT * FROM t1)) @errno=MYSQL_ERRNO;
+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 IN (SELECT * FROM t1)) @errno=MYSQL_ERRNO' at line 1
+GET DIAGNOSTICS CONDITION EXISTS (SELECT * FROM t1) @errno=MYSQL_ERRNO;
+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 'EXISTS (SELECT * FROM t1) @errno=MYSQL_ERRNO' at line 1
+PURGE BINARY LOGS BEFORE (1 IN (SELECT * 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 'SELECT * FROM t1))' at line 1
+PURGE BINARY LOGS BEFORE EXISTS (SELECT * 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 '(SELECT * FROM t1)' at line 1
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+DO 1 IN (SELECT * FROM t1);
+DO EXISTS (SELECT * FROM t1);
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/table_value_constr.result b/mysql-test/suite/compat/oracle/r/table_value_constr.result
new file mode 100644
index 00000000000..d4f8e28fe07
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/table_value_constr.result
@@ -0,0 +1,2506 @@
+SET sql_mode=ORACLE;
+create table t1 (a int, b int);
+insert into t1 values (1,2),(4,6),(9,7),
+(1,1),(2,5),(7,8);
+# just VALUES
+values (1,2);
+1 2
+1 2
+values (1,2), (3,4), (5.6,0);
+1 2
+1.0 2
+3.0 4
+5.6 0
+values ('abc', 'def');
+abc def
+abc def
+# UNION that uses VALUES structure(s)
+select 1,2
+union
+values (1,2);
+1 2
+1 2
+values (1,2)
+union
+select 1,2;
+1 2
+1 2
+select 1,2
+union
+values (1,2),(3,4),(5,6),(7,8);
+1 2
+1 2
+3 4
+5 6
+7 8
+select 3,7
+union
+values (1,2),(3,4),(5,6);
+3 7
+3 7
+1 2
+3 4
+5 6
+select 3,7,4
+union
+values (1,2,5),(4,5,6);
+3 7 4
+3 7 4
+1 2 5
+4 5 6
+select 1,2
+union
+values (1,7),(3,6.5);
+1 2
+1 2.0
+1 7.0
+3 6.5
+select 1,2
+union
+values (1,2.0),(3,6);
+1 2
+1 2.0
+3 6.0
+select 1.8,2
+union
+values (1,2),(3,6);
+1.8 2
+1.8 2
+1.0 2
+3.0 6
+values (1,2.4),(3,6)
+union
+select 2.8,9;
+1 2.4
+1.0 2.4
+3.0 6.0
+2.8 9.0
+values (1,2),(3,4),(5,6),(7,8)
+union
+select 5,6;
+1 2
+1 2
+3 4
+5 6
+7 8
+select 'ab','cdf'
+union
+values ('al','zl'),('we','q');
+ab cdf
+ab cdf
+al zl
+we q
+values ('ab', 'cdf')
+union
+select 'ab','cdf';
+ab cdf
+ab cdf
+values (1,2)
+union
+values (1,2),(5,6);
+1 2
+1 2
+5 6
+values (1,2)
+union
+values (3,4),(5,6);
+1 2
+1 2
+3 4
+5 6
+values (1,2)
+union
+values (1,2)
+union values (4,5);
+1 2
+1 2
+4 5
+# UNION ALL that uses VALUES structure
+values (1,2),(3,4)
+union all
+select 5,6;
+1 2
+1 2
+3 4
+5 6
+values (1,2),(3,4)
+union all
+select 1,2;
+1 2
+1 2
+3 4
+1 2
+select 5,6
+union all
+values (1,2),(3,4);
+5 6
+5 6
+1 2
+3 4
+select 1,2
+union all
+values (1,2),(3,4);
+1 2
+1 2
+1 2
+3 4
+values (1,2)
+union all
+values (1,2),(5,6);
+1 2
+1 2
+1 2
+5 6
+values (1,2)
+union all
+values (3,4),(5,6);
+1 2
+1 2
+3 4
+5 6
+values (1,2)
+union all
+values (1,2)
+union all
+values (4,5);
+1 2
+1 2
+1 2
+4 5
+values (1,2)
+union all
+values (1,2)
+union values (1,2);
+1 2
+1 2
+values (1,2)
+union
+values (1,2)
+union all
+values (1,2);
+1 2
+1 2
+1 2
+# EXCEPT that uses VALUES structure(s)
+select 1,2
+except
+values (3,4),(5,6);
+1 2
+1 2
+select 1,2
+except
+values (1,2),(3,4);
+1 2
+values (1,2),(3,4)
+except
+select 5,6;
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+except
+select 1,2;
+1 2
+3 4
+values (1,2),(3,4)
+except
+values (5,6);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+except
+values (1,2);
+1 2
+3 4
+# INTERSECT that uses VALUES structure(s)
+select 1,2
+intersect
+values (3,4),(5,6);
+1 2
+select 1,2
+intersect
+values (1,2),(3,4);
+1 2
+1 2
+values (1,2),(3,4)
+intersect
+select 5,6;
+1 2
+values (1,2),(3,4)
+intersect
+select 1,2;
+1 2
+1 2
+values (1,2),(3,4)
+intersect
+values (5,6);
+1 2
+values (1,2),(3,4)
+intersect
+values (1,2);
+1 2
+1 2
+# combination of different structures that uses VALUES structures : UNION + EXCEPT
+values (1,2),(3,4)
+except
+select 1,2
+union values (1,2);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+except
+values (1,2)
+union
+values (1,2);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+except
+values (1,2)
+union
+values (3,4);
+1 2
+3 4
+values (1,2),(3,4)
+union
+values (1,2)
+except
+values (1,2);
+1 2
+3 4
+# combination of different structures that uses VALUES structures : UNION ALL + EXCEPT
+values (1,2),(3,4)
+except
+select 1,2
+union all
+values (1,2);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+except
+values (1,2)
+union all
+values (1,2);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+except
+values (1,2)
+union all
+values (3,4);
+1 2
+3 4
+3 4
+values (1,2),(3,4)
+union all
+values (1,2)
+except
+values (1,2);
+1 2
+3 4
+# combination of different structures that uses VALUES structures : UNION + INTERSECT
+values (1,2),(3,4)
+intersect
+select 1,2
+union
+values (1,2);
+1 2
+1 2
+values (1,2),(3,4)
+intersect
+values (1,2)
+union
+values (1,2);
+1 2
+1 2
+values (1,2),(3,4)
+intersect
+values (1,2)
+union
+values (3,4);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+union
+values (1,2)
+intersect
+values (1,2);
+1 2
+1 2
+# combination of different structures that uses VALUES structures : UNION ALL + INTERSECT
+values (1,2),(3,4)
+intersect
+select 1,2
+union all
+values (1,2);
+1 2
+1 2
+1 2
+values (1,2),(3,4)
+intersect
+values (1,2)
+union all
+values (1,2);
+1 2
+1 2
+1 2
+values (1,2),(3,4)
+intersect
+values (1,2)
+union all
+values (3,4);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+union all
+values (1,2)
+intersect
+values (1,2);
+1 2
+1 2
+# combination of different structures that uses VALUES structures : UNION + UNION ALL
+values (1,2),(3,4)
+union all
+select 1,2
+union
+values (1,2);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+union all
+values (1,2)
+union
+values (1,2);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+union all
+values (1,2)
+union
+values (3,4);
+1 2
+1 2
+3 4
+values (1,2),(3,4)
+union
+values (1,2)
+union all
+values (1,2);
+1 2
+1 2
+3 4
+1 2
+values (1,2)
+union
+values (1,2)
+union all
+values (1,2);
+1 2
+1 2
+1 2
+# CTE that uses VALUES structure(s) : non-recursive CTE
+with t2 as
+(
+values (1,2),(3,4)
+)
+select * from t2;
+1 2
+1 2
+3 4
+with t2 as
+(
+select 1,2
+union
+values (1,2)
+)
+select * from t2;
+1 2
+1 2
+with t2 as
+(
+select 1,2
+union
+values (1,2),(3,4)
+)
+select * from t2;
+1 2
+1 2
+3 4
+with t2 as
+(
+values (1,2)
+union
+select 1,2
+)
+select * from t2;
+1 2
+1 2
+with t2 as
+(
+values (1,2),(3,4)
+union
+select 1,2
+)
+select * from t2;
+1 2
+1 2
+3 4
+with t2 as
+(
+values (5,6)
+union
+values (1,2),(3,4)
+)
+select * from t2;
+5 6
+5 6
+1 2
+3 4
+with t2 as
+(
+values (1,2)
+union
+values (1,2),(3,4)
+)
+select * from t2;
+1 2
+1 2
+3 4
+with t2 as
+(
+select 1,2
+union all
+values (1,2),(3,4)
+)
+select * from t2;
+1 2
+1 2
+1 2
+3 4
+with t2 as
+(
+values (1,2),(3,4)
+union all
+select 1,2
+)
+select * from t2;
+1 2
+1 2
+3 4
+1 2
+with t2 as
+(
+values (1,2)
+union all
+values (1,2),(3,4)
+)
+select * from t2;
+1 2
+1 2
+1 2
+3 4
+# recursive CTE that uses VALUES structure(s) : singe VALUES structure as anchor
+with recursive t2(a,b) as
+(
+values(1,1)
+union
+select t1.a, t1.b
+from t1,t2
+where t1.a=t2.a
+)
+select * from t2;
+a b
+1 1
+1 2
+with recursive t2(a,b) as
+(
+values(1,1)
+union
+select t1.a+1, t1.b
+from t1,t2
+where t1.a=t2.a
+)
+select * from t2;
+a b
+1 1
+2 2
+2 1
+3 5
+# recursive CTE that uses VALUES structure(s) : several VALUES structures as anchors
+with recursive t2(a,b) as
+(
+values(1,1)
+union
+values (3,4)
+union
+select t2.a+1, t1.b
+from t1,t2
+where t1.a=t2.a
+)
+select * from t2;
+a b
+1 1
+3 4
+2 2
+2 1
+3 5
+# recursive CTE that uses VALUES structure(s) : that uses UNION ALL
+with recursive t2(a,b,st) as
+(
+values(1,1,1)
+union all
+select t2.a, t1.b, t2.st+1
+from t1,t2
+where t1.a=t2.a and st<3
+)
+select * from t2;
+a b st
+1 1 1
+1 2 2
+1 1 2
+1 2 3
+1 2 3
+1 1 3
+1 1 3
+# recursive CTE that uses VALUES structure(s) : computation of factorial (first 10 elements)
+with recursive fact(n,f) as
+(
+values(1,1)
+union
+select n+1,f*n from fact where n < 10
+)
+select * from fact;
+n f
+1 1
+2 1
+3 2
+4 6
+5 24
+6 120
+7 720
+8 5040
+9 40320
+10 362880
+# Derived table that uses VALUES structure(s) : singe VALUES structure
+select * from (values (1,2),(3,4)) as t2;
+1 2
+1 2
+3 4
+# Derived table that uses VALUES structure(s) : UNION with VALUES structure(s)
+select * from (select 1,2 union values (1,2)) as t2;
+1 2
+1 2
+select * from (select 1,2 union values (1,2),(3,4)) as t2;
+1 2
+1 2
+3 4
+select * from (values (1,2) union select 1,2) as t2;
+1 2
+1 2
+select * from (values (1,2),(3,4) union select 1,2) as t2;
+1 2
+1 2
+3 4
+select * from (values (5,6) union values (1,2),(3,4)) as t2;
+5 6
+5 6
+1 2
+3 4
+select * from (values (1,2) union values (1,2),(3,4)) as t2;
+1 2
+1 2
+3 4
+# Derived table that uses VALUES structure(s) : UNION ALL with VALUES structure(s)
+select * from (select 1,2 union all values (1,2),(3,4)) as t2;
+1 2
+1 2
+1 2
+3 4
+select * from (values (1,2),(3,4) union all select 1,2) as t2;
+1 2
+1 2
+3 4
+1 2
+select * from (values (1,2) union all values (1,2),(3,4)) as t2;
+1 2
+1 2
+1 2
+3 4
+# CREATE VIEW that uses VALUES structure(s) : singe VALUES structure
+create view v1 as values (1,2),(3,4);
+select * from v1;
+1 2
+1 2
+3 4
+drop view v1;
+# CREATE VIEW that uses VALUES structure(s) : UNION with VALUES structure(s)
+create view v1 as
+select 1,2
+union
+values (1,2);
+select * from v1;
+1 2
+1 2
+drop view v1;
+create view v1 as
+select 1,2
+union
+values (1,2),(3,4);
+select * from v1;
+1 2
+1 2
+3 4
+drop view v1;
+create view v1 as
+values (1,2)
+union
+select 1,2;
+select * from v1;
+1 2
+1 2
+drop view v1;
+create view v1 as
+values (1,2),(3,4)
+union
+select 1,2;
+select * from v1;
+1 2
+1 2
+3 4
+drop view v1;
+create view v1 as
+values (5,6)
+union
+values (1,2),(3,4);
+select * from v1;
+5 6
+5 6
+1 2
+3 4
+drop view v1;
+# CREATE VIEW that uses VALUES structure(s) : UNION ALL with VALUES structure(s)
+create view v1 as
+values (1,2)
+union
+values (1,2),(3,4);
+select * from v1;
+1 2
+1 2
+3 4
+drop view v1;
+create view v1 as
+select 1,2
+union all
+values (1,2),(3,4);
+select * from v1;
+1 2
+1 2
+1 2
+3 4
+drop view v1;
+create view v1 as
+values (1,2),(3,4)
+union all
+select 1,2;
+select * from v1;
+1 2
+1 2
+3 4
+1 2
+drop view v1;
+create view v1 as
+values (1,2)
+union all
+values (1,2),(3,4);
+select * from v1;
+1 2
+1 2
+1 2
+3 4
+drop view v1;
+# IN-subquery with VALUES structure(s) : simple case
+select * from t1
+where a in (values (1));
+a b
+1 2
+1 1
+select * from t1
+where a in (select * from (values (1)) as tvc_0);
+a b
+1 2
+1 1
+explain extended select * from t1
+where a in (values (1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1)) "tvc_0") where 1
+explain extended select * from t1
+where a in (select * from (values (1)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1)) "tvc_0") where 1
+# IN-subquery with VALUES structure(s) : UNION with VALUES on the first place
+select * from t1
+where a in (values (1) union select 2);
+a b
+1 2
+1 1
+2 5
+select * from t1
+where a in (select * from (values (1)) as tvc_0 union
+select 2);
+a b
+1 2
+1 1
+2 5
+explain extended select * from t1
+where a in (values (1) union select 2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1" union /* select#3 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2))))
+explain extended select * from t1
+where a in (select * from (values (1)) as tvc_0 union
+select 2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1" union /* select#4 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2))))
+# IN-subquery with VALUES structure(s) : UNION with VALUES on the second place
+select * from t1
+where a in (select 2 union values (1));
+a b
+1 2
+1 1
+2 5
+select * from t1
+where a in (select 2 union
+select * from (values (1)) tvc_0);
+a b
+1 2
+1 1
+2 5
+explain extended select * from t1
+where a in (select 2 union values (1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2) union /* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1")))
+explain extended select * from t1
+where a in (select 2 union
+select * from (values (1)) tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2) union /* select#3 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1")))
+# IN-subquery with VALUES structure(s) : UNION ALL
+select * from t1
+where a in (values (1) union all select b from t1);
+a b
+1 2
+1 1
+2 5
+7 8
+select * from t1
+where a in (select * from (values (1)) as tvc_0 union all
+select b from t1);
+a b
+1 2
+1 1
+2 5
+7 8
+explain extended select * from t1
+where a in (values (1) union all select b from t1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1" union all /* select#3 */ select "test"."t1"."b" from "test"."t1" where <cache>("test"."t1"."a") = "test"."t1"."b")))
+explain extended select * from t1
+where a in (select * from (values (1)) as tvc_0 union all
+select b from t1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1" union all /* select#4 */ select "test"."t1"."b" from "test"."t1" where <cache>("test"."t1"."a") = "test"."t1"."b")))
+# NOT IN subquery with VALUES structure(s) : simple case
+select * from t1
+where a not in (values (1),(2));
+a b
+4 6
+9 7
+7 8
+select * from t1
+where a not in (select * from (values (1),(2)) as tvc_0);
+a b
+4 6
+9 7
+7 8
+explain extended select * from t1
+where a not in (values (1),(2));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a","test"."t1"."a" in ( <materialize> (/* select#3 */ select "tvc_0"."1" from (values (1),(2)) "tvc_0" ), <primary_index_lookup>("test"."t1"."a" in <temporary table> on distinct_key where "test"."t1"."a" = "<subquery3>"."1"))))
+explain extended select * from t1
+where a not in (select * from (values (1),(2)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a","test"."t1"."a" in ( <materialize> (/* select#2 */ select "tvc_0"."1" from (values (1),(2)) "tvc_0" ), <primary_index_lookup>("test"."t1"."a" in <temporary table> on distinct_key where "test"."t1"."a" = "<subquery2>"."1"))))
+# NOT IN subquery with VALUES structure(s) : UNION with VALUES on the first place
+select * from t1
+where a not in (values (1) union select 2);
+a b
+4 6
+9 7
+7 8
+select * from t1
+where a not in (select * from (values (1)) as tvc_0 union
+select 2);
+a b
+4 6
+9 7
+7 8
+explain extended select * from t1
+where a not in (values (1) union select 2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+4 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") = "tvc_0"."1") union /* select#3 */ select 2 having trigcond(<cache>("test"."t1"."a") = <ref_null_helper>(2)))))
+explain extended select * from t1
+where a not in (select * from (values (1)) as tvc_0 union
+select 2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") = "tvc_0"."1") union /* select#4 */ select 2 having trigcond(<cache>("test"."t1"."a") = <ref_null_helper>(2)))))
+# NOT IN subquery with VALUES structure(s) : UNION with VALUES on the second place
+select * from t1
+where a not in (select 2 union values (1));
+a b
+4 6
+9 7
+7 8
+select * from t1
+where a not in (select 2 union
+select * from (values (1)) as tvc_0);
+a b
+4 6
+9 7
+7 8
+explain extended select * from t1
+where a not in (select 2 union values (1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION <derived3> ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 2 having trigcond(<cache>("test"."t1"."a") = <ref_null_helper>(2)) union /* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") = "tvc_0"."1"))))
+explain extended select * from t1
+where a not in (select 2 union
+select * from (values (1)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION <derived4> ALL NULL NULL NULL NULL 2 100.00 Using where
+4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 2 having trigcond(<cache>("test"."t1"."a") = <ref_null_helper>(2)) union /* select#3 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") = "tvc_0"."1"))))
+# ANY-subquery with VALUES structure(s) : simple case
+select * from t1
+where a = any (values (1),(2));
+a b
+1 2
+1 1
+2 5
+select * from t1
+where a = any (select * from (values (1),(2)) as tvc_0);
+a b
+1 2
+1 1
+2 5
+explain extended select * from t1
+where a = any (values (1),(2));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1),(2)) "tvc_0") where 1
+explain extended select * from t1
+where a = any (select * from (values (1),(2)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1),(2)) "tvc_0") where 1
+# ANY-subquery with VALUES structure(s) : UNION with VALUES on the first place
+select * from t1
+where a = any (values (1) union select 2);
+a b
+1 2
+1 1
+2 5
+select * from t1
+where a = any (select * from (values (1)) as tvc_0 union
+select 2);
+a b
+1 2
+1 1
+2 5
+explain extended select * from t1
+where a = any (values (1) union select 2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1" union /* select#3 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2))))
+explain extended select * from t1
+where a = any (select * from (values (1)) as tvc_0 union
+select 2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1" union /* select#4 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2))))
+# ANY-subquery with VALUES structure(s) : UNION with VALUES on the second place
+select * from t1
+where a = any (select 2 union values (1));
+a b
+1 2
+1 1
+2 5
+select * from t1
+where a = any (select 2 union
+select * from (values (1)) as tvc_0);
+a b
+1 2
+1 1
+2 5
+explain extended select * from t1
+where a = any (select 2 union values (1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2) union /* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1")))
+explain extended select * from t1
+where a = any (select 2 union
+select * from (values (1)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 2 having <cache>("test"."t1"."a") = <ref_null_helper>(2) union /* select#3 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1")))
+# ALL-subquery with VALUES structure(s) : simple case
+select * from t1
+where a = all (values (1));
+a b
+1 2
+1 1
+select * from t1
+where a = all (select * from (values (1)) as tvc_0);
+a b
+1 2
+1 1
+explain extended select * from t1
+where a = all (values (1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+3 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <not>(<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#3 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") <> "tvc_0"."1")))))
+explain extended select * from t1
+where a = all (select * from (values (1)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <not>(<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") <> "tvc_0"."1")))))
+# ALL-subquery with VALUES structure(s) : UNION with VALUES on the first place
+select * from t1
+where a = all (values (1) union select 1);
+a b
+1 2
+1 1
+select * from t1
+where a = all (select * from (values (1)) as tvc_0 union
+select 1);
+a b
+1 2
+1 1
+explain extended select * from t1
+where a = all (values (1) union select 1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+4 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <not>(<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") <> "tvc_0"."1") union /* select#3 */ select 1 having trigcond(<cache>("test"."t1"."a") <> <ref_null_helper>(1))))))
+explain extended select * from t1
+where a = all (select * from (values (1)) as tvc_0 union
+select 1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <not>(<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select "tvc_0"."1" from (values (1)) "tvc_0" where trigcond(<cache>("test"."t1"."a") <> "tvc_0"."1") union /* select#4 */ select 1 having trigcond(<cache>("test"."t1"."a") <> <ref_null_helper>(1))))))
+# ALL-subquery with VALUES structure(s) : UNION with VALUES on the second place
+select * from t1
+where a = any (select 1 union values (1));
+a b
+1 2
+1 1
+select * from t1
+where a = any (select 1 union
+select * from (values (1)) as tvc_0);
+a b
+1 2
+1 1
+explain extended select * from t1
+where a = any (select 1 union values (1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 1 having <cache>("test"."t1"."a") = <ref_null_helper>(1) union /* select#4 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1")))
+explain extended select * from t1
+where a = any (select 1 union
+select * from (values (1)) as tvc_0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where <expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(/* select#2 */ select 1 having <cache>("test"."t1"."a") = <ref_null_helper>(1) union /* select#3 */ select "tvc_0"."1" from (values (1)) "tvc_0" where <cache>("test"."t1"."a") = "tvc_0"."1")))
+# prepare statement that uses VALUES structure(s): single VALUES structure
+prepare stmt1 from '
+values (1,2);
+';
+execute stmt1;
+1 2
+1 2
+execute stmt1;
+1 2
+1 2
+deallocate prepare stmt1;
+# prepare statement that uses VALUES structure(s): UNION with VALUES structure(s)
+prepare stmt1 from '
+ select 1,2
+ union
+ values (1,2),(3,4);
+';
+execute stmt1;
+1 2
+1 2
+3 4
+execute stmt1;
+1 2
+1 2
+3 4
+deallocate prepare stmt1;
+prepare stmt1 from '
+ values (1,2),(3,4)
+ union
+ select 1,2;
+';
+execute stmt1;
+1 2
+1 2
+3 4
+execute stmt1;
+1 2
+1 2
+3 4
+deallocate prepare stmt1;
+prepare stmt1 from '
+ select 1,2
+ union
+ values (3,4)
+ union
+ values (1,2);
+';
+execute stmt1;
+1 2
+1 2
+3 4
+execute stmt1;
+1 2
+1 2
+3 4
+deallocate prepare stmt1;
+prepare stmt1 from '
+ values (5,6)
+ union
+ values (1,2),(3,4);
+';
+execute stmt1;
+5 6
+5 6
+1 2
+3 4
+execute stmt1;
+5 6
+5 6
+1 2
+3 4
+deallocate prepare stmt1;
+# prepare statement that uses VALUES structure(s): UNION ALL with VALUES structure(s)
+prepare stmt1 from '
+ select 1,2
+ union
+ values (1,2),(3,4);
+';
+execute stmt1;
+1 2
+1 2
+3 4
+execute stmt1;
+1 2
+1 2
+3 4
+deallocate prepare stmt1;
+prepare stmt1 from '
+ values (1,2),(3,4)
+ union all
+ select 1,2;
+';
+execute stmt1;
+1 2
+1 2
+3 4
+1 2
+execute stmt1;
+1 2
+1 2
+3 4
+1 2
+deallocate prepare stmt1;
+prepare stmt1 from '
+ select 1,2
+ union all
+ values (3,4)
+ union all
+ values (1,2);
+';
+execute stmt1;
+1 2
+1 2
+3 4
+1 2
+execute stmt1;
+1 2
+1 2
+3 4
+1 2
+deallocate prepare stmt1;
+prepare stmt1 from '
+ values (1,2)
+ union all
+ values (1,2),(3,4);
+';
+execute stmt1;
+1 2
+1 2
+1 2
+3 4
+execute stmt1;
+1 2
+1 2
+1 2
+3 4
+deallocate prepare stmt1;
+# explain query that uses VALUES structure(s): single VALUES structure
+explain
+values (1,2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
+explain format=json
+values (1,2);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<unit1>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# explain query that uses VALUES structure(s): UNION with VALUES structure(s)
+explain
+select 1,2
+union
+values (1,2),(3,4);
+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
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+explain
+values (1,2),(3,4)
+union
+select 1,2;
+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
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+explain
+values (5,6)
+union
+values (1,2),(3,4);
+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
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+explain format=json
+select 1,2
+union
+values (1,2),(3,4);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain format=json
+values (1,2),(3,4)
+union
+select 1,2;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain format=json
+values (5,6)
+union
+values (1,2),(3,4);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+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
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2,3> ALL NULL NULL NULL NULL NULL
+explain format=json
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2,3>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# explain query that uses VALUES structure(s): UNION ALL with VALUES structure(s)
+explain
+select 1,2
+union
+values (1,2),(3,4);
+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
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+explain
+values (1,2),(3,4)
+union all
+select 1,2;
+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
+explain
+values (1,2)
+union all
+values (1,2),(3,4);
+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
+explain format=json
+values (1,2),(3,4)
+union all
+select 1,2;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain format=json
+select 1,2
+union
+values (1,2),(3,4);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain format=json
+values (1,2)
+union all
+values (1,2),(3,4);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+explain
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+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
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+explain format=json
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2,3>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# analyze query that uses VALUES structure(s): single VALUES structure
+analyze
+values (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 No tables used
+analyze format=json
+values (1,2);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<unit1>",
+ "access_type": "ALL",
+ "r_loops": 0,
+ "r_rows": null,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# analyze query that uses VALUES structure(s): UNION with VALUES structure(s)
+analyze
+select 1,2
+union
+values (1,2),(3,4);
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 2.00 NULL NULL
+analyze
+values (1,2),(3,4)
+union
+select 1,2;
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 2.00 NULL NULL
+analyze
+values (5,6)
+union
+values (1,2),(3,4);
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 3.00 NULL NULL
+analyze format=json
+select 1,2
+union
+values (1,2),(3,4);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "r_rows": 2,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+analyze format=json
+values (1,2),(3,4)
+union
+select 1,2;
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "r_rows": 2,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+analyze format=json
+values (5,6)
+union
+values (1,2),(3,4);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "r_rows": 3,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+analyze
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2,3> ALL NULL NULL NULL NULL NULL 2.00 NULL NULL
+analyze format=json
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2,3>",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "r_rows": 2,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# analyze query that uses VALUES structure(s): UNION ALL with VALUES structure(s)
+analyze
+select 1,2
+union
+values (1,2),(3,4);
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 2.00 NULL NULL
+analyze
+values (1,2),(3,4)
+union all
+select 1,2;
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+analyze
+values (1,2)
+union all
+values (1,2),(3,4);
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+analyze format=json
+values (1,2),(3,4)
+union all
+select 1,2;
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 0,
+ "r_rows": null,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+analyze format=json
+select 1,2
+union
+values (1,2),(3,4);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "r_rows": 2,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+analyze format=json
+values (1,2)
+union all
+values (1,2),(3,4);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2>",
+ "access_type": "ALL",
+ "r_loops": 0,
+ "r_rows": null,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+analyze
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+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 tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+analyze format=json
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+ANALYZE
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<union1,2,3>",
+ "access_type": "ALL",
+ "r_loops": 0,
+ "r_rows": null,
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# different number of values in TVC
+values (1,2),(3,4,5);
+ERROR HY000: The used table value constructor has a different number of values
+# illegal parameter data types in TVC
+values (1,point(1,1)),(1,1);
+ERROR HY000: Illegal parameter data types geometry and int for operation 'TABLE VALUE CONSTRUCTOR'
+values (1,point(1,1)+1);
+ERROR HY000: Illegal parameter data types geometry and int for operation '+'
+# field reference in TVC
+select * from (values (1), (b), (2)) as new_tvc;
+ERROR HY000: Field reference 'b' can't be used in table value constructor
+select * from (values (1), (t1.b), (2)) as new_tvc;
+ERROR HY000: Field reference 't1.b' can't be used in table value constructor
+drop table t1;
+#
+# MDEV-15940: cursor over TVC
+#
+DECLARE
+v INT;
+CURSOR cur IS VALUES(7);
+BEGIN
+OPEN cur;
+FETCH cur INTO v;
+SELECT v;
+END;
+|
+v
+7
+DECLARE
+v INT DEFAULT 0;
+BEGIN
+FOR a IN (VALUES (7)) LOOP
+SET v = v + 1;
+END LOOP;
+SELECT v;
+END;
+|
+v
+1
+#
+# MDEV-16038: empty row in TVC
+#
+with t as (values (),()) select 1 from t;
+ERROR HY000: Row with no elements is not allowed in table value constructor in this context
+#
+# MDEV-17017: TVC in derived table
+#
+create table t1 (a int);
+insert into t1 values (9), (3), (2);
+select * from (values (7), (5), (8), (1), (3), (8), (1)) t;
+7
+7
+5
+8
+1
+3
+8
+1
+explain select * from (values (7), (5), (8), (1), (3), (8), (1)) t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
+select * from (values (1,11), (7,77), (3,31), (4,42)) t;
+1 11
+1 11
+7 77
+3 31
+4 42
+explain select * from (values (1,11), (7,77), (3,31), (4,42)) t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
+select * from (values (7), (5), (8), (1) union values (3), (8), (1)) t;
+7
+7
+5
+8
+1
+3
+explain select * from (values (7), (5), (8), (1) union values (3), (8), (1)) t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
+2 DERIVED 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
+select * from (values (7), (5), (8), (1) union select * from t1) t;
+7
+7
+5
+8
+1
+9
+3
+2
+explain select * from (values (7), (5), (8), (1) union select * from t1) t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION t1 ALL NULL NULL NULL NULL 3
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+drop table t1;
+#
+# MDEV-16930: expression in the first row of TVC specifying derived table
+#
+SELECT 1 + 1, 2, 'abc';
+1 + 1 2 abc
+2 2 abc
+SELECT * FROM (SELECT 1 + 1, 2, 'abc') t;
+1 + 1 2 abc
+2 2 abc
+WITH cte AS (SELECT 1 + 1, 2, 'abc') SELECT * FROM cte;
+1 + 1 2 abc
+2 2 abc
+SELECT 1 + 1, 2, 'abc' UNION SELECT 3+4, 3, 'abc';
+1 + 1 2 abc
+2 2 abc
+7 3 abc
+CREATE VIEW v1 AS SELECT 1 + 1, 2, 'abc';
+SELECT * FROM v1;
+1 + 1 2 abc
+2 2 abc
+DROP VIEW v1;
+VALUES(1 + 1,2,'abc');
+1 + 1 2 abc
+2 2 abc
+SELECT * FROM (VALUES(1 + 1,2,'abc')) t;
+1 + 1 2 abc
+2 2 abc
+#
+# MDEV-17894: tvc with ORDER BY ... LIMIT
+#
+values (5), (7), (1), (3), (4) limit 2;
+5
+5
+7
+explain extended values (5), (7), (1), (3), (4) limit 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 No tables used
+Warnings:
+Note 1003 values (5),(7),(1),(3),(4) limit 2
+values (5), (7), (1), (3), (4) limit 2 offset 1;
+5
+7
+1
+explain extended values (5), (7), (1), (3), (4) limit 2 offset 1;
+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 values (5),(7),(1),(3),(4) limit 1,2
+values (5), (7), (1), (3), (4) order by 1 limit 2;
+5
+1
+3
+explain extended values (5), (7), (1), (3), (4) order by 1 limit 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 No tables used
+NULL UNIT RESULT <unit1> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 values (5),(7),(1),(3),(4) order by 1 limit 2
+values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1;
+5
+3
+4
+explain extended values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1;
+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
+NULL UNIT RESULT <unit1> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 values (5),(7),(1),(3),(4) order by 1 limit 1,2
+values (5), (7), (1), (3), (4) order by 1;
+5
+1
+3
+4
+5
+7
+explain extended values (5), (7), (1), (3), (4) order by 1;
+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
+NULL UNIT RESULT <unit1> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 values (5),(7),(1),(3),(4) order by 1
+values (5,90), (7,20), (1,70), (3,50), (4,10) order by 2;
+5 90
+4 10
+7 20
+3 50
+1 70
+5 90
+explain extended values (5,90), (7,20), (1,70), (3,50), (4,10) order by 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 No tables used
+NULL UNIT RESULT <unit1> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 values (5,90),(7,20),(1,70),(3,50),(4,10) order by 2
+select 2 union (values (5), (7), (1), (3), (4) limit 2);
+2
+2
+5
+7
+explain extended select 2 union (values (5), (7), (1), (3), (4) limit 2);
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select 2 AS "2" union (values (5),(7),(1),(3),(4) limit 2)
+select 2 union (values (5), (7), (1), (3), (4) limit 2 offset 1);
+2
+2
+7
+1
+explain extended select 2 union (values (5), (7), (1), (3), (4) limit 2 offset 1);
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select 2 AS "2" union (values (5),(7),(1),(3),(4) limit 1,2)
+select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2);
+2
+2
+1
+3
+explain extended select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2);
+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
+3 UNION <derived2> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select 2 AS "2" union (/* select#3 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 2)
+select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1);
+2
+2
+3
+4
+explain extended select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1);
+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
+3 UNION <derived2> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select 2 AS "2" union (/* select#3 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 1,2)
+(values (5), (7), (1), (3), (4) limit 2) union select 2;
+5
+5
+7
+2
+explain extended (values (5), (7), (1), (3), (4) limit 2) union select 2;
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (values (5),(7),(1),(3),(4) limit 2) union /* select#2 */ select 2 AS "2"
+(values (5), (7), (1), (3), (4) limit 2 offset 1) union select 2;
+5
+7
+1
+2
+explain extended (values (5), (7), (1), (3), (4) limit 2 offset 1) union select 2;
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (values (5),(7),(1),(3),(4) limit 1,2) union /* select#2 */ select 2 AS "2"
+(values (5), (7), (1), (3), (4) order by 1 limit 2) union select 2;
+5
+1
+3
+2
+explain extended (values (5), (7), (1), (3), (4) order by 1 limit 2) union select 2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SUBQUERY <derived3> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+3 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (/* select#1 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 2) union /* select#2 */ select 2 AS "2"
+(values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1) union select 2;
+5
+3
+4
+2
+explain extended (values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1) union select 2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SUBQUERY <derived3> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+3 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (/* select#1 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 1,2) union /* select#2 */ select 2 AS "2"
+select 3 union all (values (5), (7), (1), (3), (4) limit 2 offset 3);
+3
+3
+3
+4
+explain extended select 3 union all (values (5), (7), (1), (3), (4) limit 2 offset 3);
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select 3 AS "3" union all (values (5),(7),(1),(3),(4) limit 3,2)
+(values (5), (7), (1), (3), (4) limit 2 offset 3) union all select 3;
+5
+3
+4
+3
+explain extended (values (5), (7), (1), (3), (4) limit 2 offset 3) union all select 3;
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 (values (5),(7),(1),(3),(4) limit 3,2) union all /* select#2 */ select 3 AS "3"
+select 3 union all (values (5), (7), (1), (3), (4) order by 1 limit 2);
+3
+3
+1
+3
+explain extended select 3 union all (values (5), (7), (1), (3), (4) order by 1 limit 2);
+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
+3 UNION <derived2> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select 3 AS "3" union all (/* select#3 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 2)
+(values (5), (7), (1), (3), (4) order by 1 limit 2) union all select 3;
+5
+1
+3
+3
+explain extended (values (5), (7), (1), (3), (4) order by 1 limit 2) union all select 3;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SUBQUERY <derived3> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+3 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (/* select#1 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 2) union all /* select#2 */ select 3 AS "3"
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+union
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+5
+7
+1
+3
+explain extended ( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+union
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+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
+3 UNION <derived2> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (values (5),(7),(1),(3),(4) limit 1,2) union (/* select#3 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 2)
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+union all
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+5
+7
+1
+1
+3
+explain extended ( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+union all
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+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
+3 UNION <derived2> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 (values (5),(7),(1),(3),(4) limit 1,2) union all (/* select#3 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 2)
+(values (5), (7), (1), (3), (4) limit 2 offset 3) union all select 3 order by 1;
+5
+3
+3
+4
+explain extended (values (5), (7), (1), (3), (4) limit 2 offset 3) union all select 3 order by 1;
+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 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 (values (5),(7),(1),(3),(4) limit 3,2) union all /* select#2 */ select 3 AS "3" order by 1
+(values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3 order by 1;
+5
+3
+3
+4
+5
+explain extended (values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3 order by 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SUBQUERY <derived3> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+3 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 (/* select#1 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 1,3) union all /* select#2 */ select 3 AS "3" order by 1
+(values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3
+order by 1 limit 2 offset 1;
+5
+3
+4
+explain extended (values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3
+order by 1 limit 2 offset 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SUBQUERY <derived3> ALL NULL NULL NULL NULL 5 100.00 Using filesort
+3 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
+Warnings:
+Note 1003 (/* select#1 */ select "tvc_0"."5" AS "5" from (values (5),(7),(1),(3),(4)) "tvc_0" order by 1 limit 1,3) union all /* select#2 */ select 3 AS "3" order by 1 limit 1,2
+values (5,90), (7,20), (1,70), (3,50), (4,10) order by 3;
+ERROR 42S22: Unknown column '3' in 'order clause'
+create view v1 as values (5), (7), (1), (3), (4) order by 1 limit 2;
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS values (5),(7),(1),(3),(4) order by 1 limit 2 latin1 latin1_swedish_ci
+select * from v1;
+5
+1
+3
+drop view v1;
+create view v1 as
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+union
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS (values (5),(7),(1),(3),(4) limit 1,2) union (values (5),(7),(1),(3),(4) order by 1 limit 2) latin1 latin1_swedish_ci
+select * from v1;
+5
+7
+1
+3
+drop view v1;
+create view v1 as values (5,90), (7,20), (1,70), (3,50), (4,10) order by 3;
+ERROR 42S22: Unknown column '3' in 'order clause'
+create view v1 as
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+union
+( values (5), (7), (1), (3), (4) order by 2 limit 2 );
+ERROR 42S22: Unknown column '2' in 'order clause'
diff --git a/mysql-test/suite/compat/oracle/r/trigger.result b/mysql-test/suite/compat/oracle/r/trigger.result
new file mode 100644
index 00000000000..7c24c78bba6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/trigger.result
@@ -0,0 +1,100 @@
+set sql_mode=ORACLE;
+:NEW.a := 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':NEW.a := 1' at line 1
+:OLD.a := 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':OLD.a := 1' at line 1
+:OLa.a := 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':OLa.a := 1' at line 1
+SELECT :NEW.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 'a' at line 1
+SELECT :OLD.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 'a' at line 1
+SELECT :OLa.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 'a' at line 1
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW NEW.a:= 10;
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+a
+10
+DROP TRIGGER tr1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW :NEW.a:= 10;
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+a
+10
+DROP TRIGGER tr1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+IF :NEW.a IS NULL
+THEN
+:NEW.a:= 10;
+END IF;
+END;
+/
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+a
+10
+DROP TRIGGER tr1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+IF :OLD.a IS NULL
+THEN
+:NEW.a:= 10;
+END IF;
+END;
+/
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET a=NULL;
+SELECT * FROM t1;
+a
+10
+DROP TRIGGER tr1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, c INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW
+DECLARE
+cnt INT := 0;
+BEGIN
+IF :NEW.a IS NULL THEN cnt:=cnt+1; END IF;
+IF :NEW.b IS NULL THEN cnt:=cnt+1; END IF;
+IF :NEW.c IS NULL THEN :NEW.c:=cnt; END IF;
+END;
+/
+INSERT INTO t1 VALUES ();
+INSERT INTO t1 VALUES (1, NULL, NULL);
+INSERT INTO t1 VALUES (NULL, 1, NULL);
+INSERT INTO t1 VALUES (1, 1, NULL);
+SELECT * FROM t1;
+a b c
+NULL NULL 2
+1 NULL 1
+NULL 1 1
+1 1 0
+DROP TABLE t1;
+#
+# MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+#
+CREATE TABLE t1 (a INT, b INT, total INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW
+DECLARE
+va t1.a%TYPE:= :NEW.a;
+vb t1.b%TYPE:= :NEW.b;
+BEGIN
+:NEW.total:= va + vb;
+END;
+$$
+INSERT INTO t1 (a,b) VALUES (10, 20);
+SELECT * FROM t1;
+a b total
+10 20 30
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/truncate.result b/mysql-test/suite/compat/oracle/r/truncate.result
new file mode 100644
index 00000000000..f04ce09a4f8
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/truncate.result
@@ -0,0 +1,10 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-10588 sql_mode=ORACLE: TRUNCATE TABLE t1 [ {DROP|REUSE} STORAGE ]
+#
+CREATE TABLE t1 (a INT);
+TRUNCATE TABLE t1 REUSE STORAGE;
+TRUNCATE TABLE t1 DROP STORAGE;
+DROP TABLE t1;
+CREATE TABLE reuse (reuse INT);
+DROP TABLE reuse;
diff --git a/mysql-test/suite/compat/oracle/r/type_blob.result b/mysql-test/suite/compat/oracle/r/type_blob.result
new file mode 100644
index 00000000000..27740947a10
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_blob.result
@@ -0,0 +1,26 @@
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (a BLOB);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longblob DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# MDEV-20263 sql_mode=ORACLE: BLOB(65535) should not translate to LONGBLOB
+#
+CREATE TABLE t1 (
+c1 BLOB(100),
+c2 BLOB(65535),
+c3 BLOB(16777215),
+c4 BLOB(16777216)
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "c1" tinyblob DEFAULT NULL,
+ "c2" blob(65535) DEFAULT NULL,
+ "c3" mediumblob DEFAULT NULL,
+ "c4" longblob DEFAULT NULL
+)
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/type_clob.result b/mysql-test/suite/compat/oracle/r/type_clob.result
new file mode 100644
index 00000000000..f96572ea277
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_clob.result
@@ -0,0 +1,15 @@
+SET sql_mode=ORACLE;
+CREATE TABLE clob (clob INT);
+SHOW CREATE TABLE clob;
+Table Create Table
+clob CREATE TABLE "clob" (
+ "clob" int(11) DEFAULT NULL
+)
+DROP TABLE clob;
+CREATE TABLE t1 (a CLOB);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" longtext DEFAULT NULL
+)
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/type_date.result b/mysql-test/suite/compat/oracle/r/type_date.result
new file mode 100644
index 00000000000..40d2a834056
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_date.result
@@ -0,0 +1,158 @@
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (a DATE);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" datetime DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a unknown.DATE);
+ERROR HY000: Unknown data type: 'unknown.date'
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+def_date DATE,
+mdb_date mariadb_schema.DATE,
+ora_date oracle_schema.DATE,
+max_date maxdb_schema.DATE
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `def_date` date DEFAULT NULL,
+ `mdb_date` date DEFAULT NULL,
+ `ora_date` datetime DEFAULT NULL,
+ `max_date` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET sql_mode=ORACLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "def_date" mariadb_schema.date DEFAULT NULL,
+ "mdb_date" mariadb_schema.date DEFAULT NULL,
+ "ora_date" datetime DEFAULT NULL,
+ "max_date" mariadb_schema.date DEFAULT NULL
+)
+DROP TABLE t1;
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (
+def_date DATE,
+mdb_date mariadb_schema.DATE,
+ora_date oracle_schema.DATE,
+max_date maxdb_schema.DATE
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "def_date" datetime DEFAULT NULL,
+ "mdb_date" mariadb_schema.date DEFAULT NULL,
+ "ora_date" datetime DEFAULT NULL,
+ "max_date" mariadb_schema.date DEFAULT NULL
+)
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `def_date` datetime DEFAULT NULL,
+ `mdb_date` date DEFAULT NULL,
+ `ora_date` datetime DEFAULT NULL,
+ `max_date` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# ALTER..MODIFY and ALTER..CHANGE understand qualifiers
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01');
+SET sql_mode=ORACLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+SELECT * FROM t1;
+a
+2001-01-01
+ALTER TABLE t1 MODIFY a DATE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" datetime DEFAULT NULL
+)
+SELECT * FROM t1;
+a
+2001-01-01 00:00:00
+ALTER TABLE t1 MODIFY a mariadb_schema.DATE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mariadb_schema.date DEFAULT NULL
+)
+SELECT * FROM t1;
+a
+2001-01-01
+ALTER TABLE t1 MODIFY a oracle_schema.DATE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" datetime DEFAULT NULL
+)
+SELECT * FROM t1;
+a
+2001-01-01 00:00:00
+ALTER TABLE t1 CHANGE a b mariadb_schema.DATE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "b" mariadb_schema.date DEFAULT NULL
+)
+SELECT * FROM t1;
+b
+2001-01-01
+ALTER TABLE t1 CHANGE b a oracle_schema.DATE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" datetime DEFAULT NULL
+)
+SELECT * FROM t1;
+a
+2001-01-01 00:00:00
+DROP TABLE t1;
+#
+# Qualified syntax is not supported yet in SP
+# See MDEV-23353 Qualified data types in SP
+#
+SET sql_mode=ORACLE;
+CREATE FUNCTION f1() RETURN mariadb_schema.DATE AS
+BEGIN
+RETURN CURRENT_DATE;
+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 'mariadb_schema.DATE AS
+BEGIN
+RETURN CURRENT_DATE;
+END' at line 1
+CREATE PROCEDURE p1(a mariadb_schema.DATE) AS
+BEGIN
+NULL;
+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 ') AS
+BEGIN
+NULL;
+END' at line 1
+CREATE PROCEDURE p1() AS
+a mariadb_schema.DATE;
+BEGIN
+NULL;
+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 ';
+BEGIN
+NULL;
+END' at line 2
diff --git a/mysql-test/suite/compat/oracle/r/type_number.result b/mysql-test/suite/compat/oracle/r/type_number.result
new file mode 100644
index 00000000000..c0848fdccf9
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_number.result
@@ -0,0 +1,15 @@
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (a NUMBER);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" double DEFAULT NULL
+)
+DROP TABLE t1;
+CREATE TABLE t1 (a NUMBER(10,2));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" decimal(10,2) DEFAULT NULL
+)
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/type_raw.result b/mysql-test/suite/compat/oracle/r/type_raw.result
new file mode 100644
index 00000000000..1698c96d5b4
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_raw.result
@@ -0,0 +1,15 @@
+SET sql_mode=ORACLE;
+CREATE TABLE raw (raw INT);
+SHOW CREATE TABLE raw;
+Table Create Table
+raw CREATE TABLE "raw" (
+ "raw" int(11) DEFAULT NULL
+)
+DROP TABLE raw;
+CREATE TABLE t1 (a RAW(10));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varbinary(10) DEFAULT NULL
+)
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/type_varchar.result b/mysql-test/suite/compat/oracle/r/type_varchar.result
new file mode 100644
index 00000000000..906e16867cd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_varchar.result
@@ -0,0 +1,9 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-11275 sql_mode=ORACLE: CAST(..AS VARCHAR(N))
+#
+SELECT CAST(123 AS VARCHAR(10)) FROM DUAL;
+CAST(123 AS VARCHAR(10))
+123
+SELECT CAST(123 AS VARCHAR) FROM DUAL;
+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 DUAL' at line 1
diff --git a/mysql-test/suite/compat/oracle/r/type_varchar2.result b/mysql-test/suite/compat/oracle/r/type_varchar2.result
new file mode 100644
index 00000000000..5030cfbaa0a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/type_varchar2.result
@@ -0,0 +1,23 @@
+SET sql_mode=ORACLE;
+CREATE TABLE varchar2 (varchar2 INT);
+SHOW CREATE TABLE varchar2;
+Table Create Table
+varchar2 CREATE TABLE "varchar2" (
+ "varchar2" int(11) DEFAULT NULL
+)
+DROP TABLE varchar2;
+CREATE TABLE t1 (a VARCHAR2(10));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" varchar(10) DEFAULT NULL
+)
+DROP TABLE t1;
+#
+# MDEV-11275 sql_mode=ORACLE: CAST(..AS VARCHAR(N))
+#
+SELECT CAST(123 AS VARCHAR2(10)) FROM DUAL;
+CAST(123 AS VARCHAR2(10))
+123
+SELECT CAST(123 AS VARCHAR2) FROM DUAL;
+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 DUAL' at line 1
diff --git a/mysql-test/suite/compat/oracle/r/variables.result b/mysql-test/suite/compat/oracle/r/variables.result
new file mode 100644
index 00000000000..a7067d7b3fd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/variables.result
@@ -0,0 +1,39 @@
+SET sql_mode=oracle;
+#
+# MDEV-10411 Providing compatibility for basic PL/SQL constructs
+# Part 6: Assignment operator
+#
+max_sort_length:=1030;
+SELECT @@max_sort_length;
+@@max_sort_length
+1030
+max_sort_length:=DEFAULT;
+#
+# Testing that SP variables shadow global variables in assignments
+#
+CREATE PROCEDURE p1
+AS
+BEGIN
+max_sort_length:=1030;
+DECLARE
+max_sort_length INT DEFAULT 1031;
+BEGIN
+SELECT @@max_sort_length, max_sort_length;
+max_sort_length:=1032;
+SELECT @@max_sort_length, max_sort_length;
+END;
+SELECT @@max_sort_length;
+max_sort_length:= DEFAULT;
+END;
+$$
+CALL p1();
+@@max_sort_length max_sort_length
+1030 1031
+@@max_sort_length max_sort_length
+1030 1032
+@@max_sort_length
+1030
+DROP PROCEDURE p1;
+#
+# End of MDEV-10411 Providing compatibility for basic PL/SQL constructs (part 6)
+#
diff --git a/mysql-test/suite/compat/oracle/r/vcol.result b/mysql-test/suite/compat/oracle/r/vcol.result
new file mode 100644
index 00000000000..89118bad2fd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/vcol.result
@@ -0,0 +1,23 @@
+#
+# MDEV-13500 sql_mode=ORACLE: can't create a virtual column with function MOD
+#
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (c1 INTEGER, c2 INTEGER AS (c1 MOD 10) VIRTUAL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "c1" int(11) DEFAULT NULL,
+ "c2" int(11) GENERATED ALWAYS AS ("c1" MOD 10) VIRTUAL
+)
+INSERT INTO t1 (c1) VALUES (999);
+SELECT * FROM t1;
+c1 c2
+999 9
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT a MOD 10 FROM t1;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select "t1"."a" MOD 10 AS "a MOD 10" from "t1" latin1 latin1_swedish_ci
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/versioning.result b/mysql-test/suite/compat/oracle/r/versioning.result
new file mode 100644
index 00000000000..ebedcf0f462
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/versioning.result
@@ -0,0 +1,16 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-15975 PL/SQL parser does not understand historical queries
+#
+CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES (10);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (20);
+SELECT * FROM t1 FOR SYSTEM_TIME ALL;
+a
+10
+20
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (NOW()+INTERVAL 10 YEAR);
+a
+20
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/win.result b/mysql-test/suite/compat/oracle/r/win.result
new file mode 100644
index 00000000000..b11eba0d1da
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/win.result
@@ -0,0 +1,17 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-13384: "window" seems like a reserved column name but it's not listed as one
+#
+# Currently we allow window as an identifier, except for table aliases.
+#
+CREATE TABLE door (id INT, window VARCHAR(10));
+SELECT id
+FROM door as window;
+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 'window' at line 2
+SELECT id, window
+FROM door;
+id window
+SELECT id, window
+FROM door as window;
+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 'window' at line 2
+DROP TABLE door;
diff --git a/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt
new file mode 100644
index 00000000000..8f0cc182f51
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt
@@ -0,0 +1 @@
+--flashback
diff --git a/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test
new file mode 100644
index 00000000000..bda32af5d4e
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test
@@ -0,0 +1,117 @@
+# ==== Purpose ====
+#
+# Test verifies that point in time recovery of binary log works when
+# sql_mode='ORACLE'.
+#
+# BEGIN statement is printed in three places
+# 1) "Gtid_log_event::print"
+# 2) "Xid_log_event::print" if flashback is enabled
+# 3) "Query_log_event::print" if flashback is enabled and engine is
+# non-transacional.
+#
+# Test verifies all these cases.
+#
+# ==== References ====
+#
+# MDEV-23108: Point in time recovery of binary log fails when sql_mode=ORACLE
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+SET @@SQL_MODE = 'ORACLE';
+
+--echo ##########################################################################
+--echo # Test verifies Gtid_log_event/Xid_log_event specific print #
+--echo ##########################################################################
+CREATE TABLE tm (f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+
+DELIMITER /;
+CREATE OR REPLACE PROCEDURE simpleproc (param1 OUT INT) AS
+ BEGIN
+ SELECT COUNT(*) INTO param1 FROM t;
+ END;
+/
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+ RETURN 10;
+END;
+/
+DELIMITER ;/
+
+FLUSH LOGS;
+--echo ##########################################################################
+--echo # Delete data from master so that it can be restored from binlog #
+--echo ##########################################################################
+DROP FUNCTION f1;
+DROP PROCEDURE simpleproc;
+DROP TABLE tm;
+DROP TABLE t;
+
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/test.sql
+
+--echo ##########################################################################
+--echo # Post recovery using mysqlbinlog #
+--echo ##########################################################################
+SHOW TABLES;
+SELECT * FROM tm;
+SELECT * FROM t;
+--horizontal_results
+SELECT f1();
+CALL simpleproc(@a);
+SELECT @a;
+
+--echo "***** Clean Up *****"
+DROP TABLE t,tm;
+DROP PROCEDURE simpleproc;
+DROP FUNCTION f1;
+--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
+RESET MASTER;
+
+--echo ##########################################################################
+--echo # Test verifies Gtid_log_event/Xid_log_event/Qery_log_event #
+--echo # specific print along with flashback option #
+--echo ##########################################################################
+CREATE TABLE tm(f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+INSERT INTO tm VALUES (20);
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+INSERT INTO t VALUES (20);
+--echo ##########################################################################
+--echo # Initial data #
+--echo ##########################################################################
+SELECT * FROM tm;
+SELECT * FROM t;
+FLUSH LOGS;
+DELETE FROM tm WHERE f=20;
+DELETE FROM t WHERE f=20;
+FLUSH LOGS;
+
+--echo ##########################################################################
+--echo # Data after deletion #
+--echo ##########################################################################
+SELECT * FROM tm;
+SELECT * FROM t;
+--exec $MYSQL_BINLOG --flashback $MYSQLD_DATADIR/master-bin.000002 > $MYSQLTEST_VARDIR/tmp/test.sql
+
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/test.sql
+--let SEARCH_PATTERN=START TRANSACTION
+--source include/search_pattern_in_file.inc
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/test.sql
+
+--echo ##########################################################################
+--echo # Data after recovery using flashback #
+--echo ##########################################################################
+SELECT * FROM tm;
+SELECT * FROM t;
+
+--echo "***** Clean Up *****"
+DROP TABLE t,tm;
+--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
diff --git a/mysql-test/suite/compat/oracle/t/binlog_stm_ps.test b/mysql-test/suite/compat/oracle/t/binlog_stm_ps.test
new file mode 100644
index 00000000000..f305f611bd2
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_stm_ps.test
@@ -0,0 +1,57 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10801 sql_mode: dynamic SQL placeholders
+--echo #
+
+CREATE TABLE t1 (a INT, b INT);
+SET @a=10, @b=20;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?,?)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:a,:b)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:aaa,:bbb)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"a",:"b")';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"aaa",:"bbb")';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:1,:2)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:222,:111)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:0,:65535)';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (:65535,:0)';
+EXECUTE stmt USING @a, @b;
+SELECT * FROM t1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-16095 Oracle-style placeholder inside GROUP BY..WITH ROLLUP breaks replication
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+CREATE TABLE t2 (d DATE, c BIGINT);
+DELIMITER $$;
+BEGIN
+ EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param' USING 1;
+ EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param WITH ROLLUP' USING 1;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1,t2;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/compat/oracle/t/binlog_stm_sp.test b/mysql-test/suite/compat/oracle/t/binlog_stm_sp.test
new file mode 100644
index 00000000000..e6f33cb1118
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_stm_sp.test
@@ -0,0 +1,219 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+CREATE TABLE t1 (a INT, b INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ rec.a:=100;
+ rec.b:=200;
+ INSERT INTO t1 VALUES (rec.a,rec.b);
+ INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+ INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+ rec.a:=NULL;
+ INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+ INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+ INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+ INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+ rec.b:=NULL;
+ INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+ INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--echo #
+--echo # Testing ROW fields in LIMIT
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(10);
+CREATE TABLE t2 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a INT:= 1;
+ rec ROW(a INT);
+BEGIN
+ rec.a:= 1;
+ INSERT INTO t2 SELECT 1 FROM t1 LIMIT a;
+ INSERT INTO t2 SELECT 2 FROM t1 LIMIT rec.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1,t2;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--echo #
+--echo # End of MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+
+--echo #
+--echo # MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
+--echo #
+
+CREATE TABLE t1 (a INT, b INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec t1%ROWTYPE;
+BEGIN
+ rec.a:=100;
+ rec.b:=200;
+ SELECT rec=ROW(100,200) AS true1, ROW(100,200)=rec AS true2;
+ INSERT INTO t1 VALUES (rec.a,rec.b);
+ INSERT INTO t1 VALUES (10, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (10, ROW(100,200)=rec);
+ INSERT INTO t1 SELECT 10, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 10, 21 FROM DUAL WHERE ROW(100,200)=rec;
+ rec.a:=NULL;
+ INSERT INTO t1 VALUES (11, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (11, rec=ROW(100,201));
+ INSERT INTO t1 VALUES (11, ROW(100,200)=rec);
+ INSERT INTO t1 VALUES (11, ROW(100,201)=rec);
+ INSERT INTO t1 SELECT 11, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 11, 21 FROM DUAL WHERE ROW(100,200)=rec;
+ rec.b:=NULL;
+ INSERT INTO t1 VALUES (12, rec=ROW(100,200));
+ INSERT INTO t1 VALUES (12, ROW(100,200)=rec);
+ INSERT INTO t1 SELECT 12, 20 FROM DUAL WHERE rec=ROW(100,200);
+ INSERT INTO t1 SELECT 12, 21 FROM DUAL WHERE ROW(100,200)=rec;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--echo #
+--echo # MDEV-12291 Allow ROW variables as SELECT INTO targets
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+ SELECT * INTO rec1 FROM t1;
+ INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+FLUSH LOGS;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ SELECT * INTO rec1 FROM t1;
+ INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+FLUSH LOGS;
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10, 'b10');
+CREATE TABLE t2 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ rec1 cur1%ROWTYPE;
+BEGIN
+ SELECT * INTO rec1 FROM t1;
+ INSERT INTO t2 VALUES (rec1.a, rec1.b);
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+
+--echo #
+--echo # MDEV-16020 SP variables inside GROUP BY..WITH ROLLUP break replication
+--echo #
+
+FLUSH LOGS;
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+CREATE TABLE t2 (d DATE, c BIGINT);
+DELIMITER $$;
+DECLARE
+ var INT;
+BEGIN
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var;
+ INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, var WITH ROLLUP;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1,t2;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/compat/oracle/t/binlog_stm_sp_package.test b/mysql-test/suite/compat/oracle/t/binlog_stm_sp_package.test
new file mode 100644
index 00000000000..577ff58d5ae
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_stm_sp_package.test
@@ -0,0 +1,158 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+SET sql_mode=ORACLE;
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE IF NOT EXISTS p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN 10;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+DROP PACKAGE BODY p1;
+DROP PACKAGE p1;
+DROP PACKAGE IF EXISTS p1;
+
+--echo #
+--echo # Creating a package with a COMMENT clause
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 COMMENT 'package-p1-comment' AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 COMMENT 'package-body-p1-comment' AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE p1;
+
+--echo #
+--echo # Creating a package with a different DEFINER
+--echo #
+
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # Creating a package with a different DEFINER, with SQL SECURITY INVOKER
+--echo #
+
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # Creating a new package in a remote database
+--echo #
+
+CREATE DATABASE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2.test2 COMMENT 'package-test2-comment' AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2.test2 COMMENT 'package-body-test2-comment' AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+ PROCEDURE p1 AS BEGIN SELECT f1(); END;
+END;
+$$
+DELIMITER ;$$
+
+DROP PACKAGE BODY test2.test2;
+DROP PACKAGE test2.test2;
+DROP DATABASE test2;
+
+
+--echo #
+--echo # MDEV-13139 Package-wide variables in CREATE PACKAGE
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT:=0;
+ PROCEDURE p1 AS
+ BEGIN
+ INSERT INTO t1 VALUES (a);
+ a:=a+1;
+ END;
+BEGIN
+ a:=10;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT * FROM t1;
+--source sp-cache-invalidate.inc
+CALL p1.p1();
+CALL p1.p1();
+SELECT * FROM t1;
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/compat/oracle/t/column_compression.test b/mysql-test/suite/compat/oracle/t/column_compression.test
new file mode 100644
index 00000000000..6fcdd119890
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/column_compression.test
@@ -0,0 +1,84 @@
+--source include/have_innodb.inc
+--source include/have_csv.inc
+
+SET sql_mode=ORACLE;
+
+SET column_compression_zlib_wrap=true;
+CREATE TABLE t1 (a BLOB COMPRESSED);
+INSERT INTO t1 VALUES (REPEAT('a',10000));
+SELECT DATA_LENGTH<100 AS c FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-17363 - Compressed columns cannot be restored from dump
+--echo #
+
+--error ER_WRONG_FIELD_SPEC
+CREATE TABLE t1(a INT NOT NULL COMPRESSED);
+SHOW WARNINGS;
+
+CREATE TABLE t1(
+ a JSON COMPRESSED,
+ b VARCHAR(1000) COMPRESSED BINARY,
+ c NVARCHAR(1000) COMPRESSED BINARY,
+ d TINYTEXT COMPRESSED BINARY
+);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # VARCHAR and TEXT variants
+--echo #
+
+--let type=VARCHAR(10)
+--source include/column_compression_syntax_varchar.inc
+
+--let type=VARCHAR2(10)
+--source include/column_compression_syntax_varchar.inc
+
+--let type=TINYTEXT
+--source include/column_compression_syntax_varchar.inc
+
+--let type=TEXT
+--source include/column_compression_syntax_varchar.inc
+
+--let type=MEDIUMTEXT
+--source include/column_compression_syntax_varchar.inc
+
+--let type=LONGTEXT
+--source include/column_compression_syntax_varchar.inc
+
+
+--echo #
+--echo # VARBINARY and BLOB variables
+--echo #
+
+--let type=VARCHAR(10)
+--source include/column_compression_syntax_varbinary.inc
+
+--let type=TINYBLOB
+--source include/column_compression_syntax_varbinary.inc
+
+--let type=BLOB
+--source include/column_compression_syntax_varbinary.inc
+
+--let type=MEDIUMBLOB
+--source include/column_compression_syntax_varbinary.inc
+
+--let type=LONGBLOB
+--source include/column_compression_syntax_varbinary.inc
+
+
+--echo #
+--echo # NVARCHAR
+--echo #
+
+CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+--error ER_PARSE_ERROR
+CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED);
+--error ER_PARSE_ERROR
+CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED);
diff --git a/mysql-test/suite/compat/oracle/t/empty_string_literal.test b/mysql-test/suite/compat/oracle/t/empty_string_literal.test
new file mode 100644
index 00000000000..3c612f72c20
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/empty_string_literal.test
@@ -0,0 +1,8 @@
+USE test;
+--echo #
+--echo # MDEV-14013 : sql_mode=EMPTY_STRING_IS_NULL
+--echo #
+
+set @mode='ORACLE,EMPTY_STRING_IS_NULL';
+
+--source include/empty_string_literal.inc
diff --git a/mysql-test/suite/compat/oracle/t/events.test b/mysql-test/suite/compat/oracle/t/events.test
new file mode 100644
index 00000000000..e898528636a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/events.test
@@ -0,0 +1,29 @@
+-- source include/not_embedded.inc
+
+set sql_mode='ORACLE';
+
+--echo #
+--echo # MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to execute
+--echo #
+
+SET GLOBAL event_scheduler=off;
+
+SET sql_mode='ORACLE';
+CREATE TABLE t1 (a TIMESTAMP);
+CREATE EVENT e1
+ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MICROSECOND
+ DO INSERT INTO t1 VALUES(NOW());
+SET GLOBAL event_scheduler=on;
+
+let $wait_timeout = 10;
+let $wait_condition =
+ SELECT COUNT(*) = 0
+ FROM INFORMATION_SCHEMA.EVENTS
+ WHERE event_schema = 'test' AND event_name = 'e1';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
+
+
+SET GLOBAL event_scheduler=off;
diff --git a/mysql-test/suite/compat/oracle/t/exception.test b/mysql-test/suite/compat/oracle/t/exception.test
new file mode 100644
index 00000000000..6448a6ef627
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/exception.test
@@ -0,0 +1,457 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # sql_mode=ORACLE: Predefined exceptions: TOO_MANY_ROWS, NO_DATA_FOUND, DUP_VAL_ON_INDEX
+--echo #
+
+--echo #
+--echo # Testing NO_DATA_FOUND and TOO_MANY_ROWS
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1 LIMIT lim;
+EXCEPTION
+ WHEN TOO_MANY_ROWS THEN res:='--- too_many_rows cought ---';
+ WHEN NO_DATA_FOUND THEN res:='--- no_data_found cought ---';
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL p1(0, @res);
+SELECT @res;
+CALL p1(2, @res);
+SELECT @res;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Testing DUP_VAL_ON_INDEX
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+DELIMITER $$;
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+BEGIN
+ INSERT INTO t1 VALUES (10);
+ INSERT INTO t1 VALUES (10);
+EXCEPTION
+ WHEN DUP_VAL_ON_INDEX THEN res:='--- dup_val_on_index cought ---';
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL p1(@res);
+SELECT @res;
+SELECT * FROM t1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptions
+--echo #
+
+--echo #
+--echo # RAISE outside of an SP context
+--echo #
+
+--error ER_SP_COND_MISMATCH
+RAISE NO_DATA_FOUND;
+--error ER_SP_COND_MISMATCH
+RAISE INVALID_CURSOR;
+--error ER_SP_COND_MISMATCH
+RAISE DUP_VAL_ON_INDEX;
+--error ER_SP_COND_MISMATCH
+RAISE TOO_MANY_ROWS;
+
+--error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER
+RAISE;
+
+
+--echo #
+--echo # RAISE for an undefinite exception
+--echo #
+
+DELIMITER $$;
+--error ER_SP_COND_MISMATCH
+CREATE PROCEDURE p1
+AS
+BEGIN
+ RAISE xxx;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # RAISE for predefined exceptions
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ RAISE no_data_found;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ RAISE invalid_cursor;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_CURSOR_NOT_OPEN
+CALL p1();
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ RAISE dup_val_on_index;
+END;
+$$
+DELIMITER ;$$
+--error ER_DUP_ENTRY
+CALL p1();
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ raise too_many_rows;
+END;
+$$
+DELIMITER ;$$
+--error ER_TOO_MANY_ROWS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # RAISE with no exception name (resignal)
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+BEGIN
+ RAISE;
+END;
+$$
+DELIMITER ;$$
+--error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER
+CALL p1();
+DROP PROCEDURE p1;
+
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1(lim INT)
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1 LIMIT lim;
+EXCEPTION
+ WHEN TOO_MANY_ROWS THEN RAISE;
+ WHEN NO_DATA_FOUND THEN RAISE;
+END;
+$$
+DELIMITER ;$$
+CALL p1(0);
+--error ER_TOO_MANY_ROWS
+CALL p1(2);
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1(lim INT)
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1 LIMIT lim;
+EXCEPTION
+ WHEN OTHERS THEN RAISE;
+END;
+$$
+DELIMITER ;$$
+CALL p1(0);
+--error ER_TOO_MANY_ROWS
+CALL p1(2);
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a INT;
+ CURSOR c IS SELECT a FROM t1;
+BEGIN
+ FETCH c INTO a;
+EXCEPTION
+ WHEN INVALID_CURSOR THEN RAISE;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_CURSOR_NOT_OPEN
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a INT;
+ CURSOR c IS SELECT a FROM t1;
+BEGIN
+ FETCH c INTO a;
+EXCEPTION
+ WHEN OTHERS THEN RAISE;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_CURSOR_NOT_OPEN
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Testing that warning-alike errors are caught by OTHERS
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+ a INT:=10;
+BEGIN
+ SELECT a INTO a FROM t1;
+ RETURN 'OK';
+EXCEPTION
+ WHEN OTHERS THEN RETURN 'Exception';
+END;
+$$
+DELIMITER ;$$
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptions
+--echo #
+
+
+--echo #
+--echo # MDEV-10587 sql_mode=ORACLE: User defined exceptions
+--echo #
+
+--echo #
+--echo # Checking that duplicate WHEN clause is not allowed
+--echo #
+
+DELIMITER $$;
+--error ER_SP_DUP_HANDLER
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+ e EXCEPTION;
+BEGIN
+ RETURN 'Got no exceptions';
+EXCEPTION
+ WHEN e THEN RETURN 'Got exception e';
+ WHEN e THEN RETURN 'Got exception e';
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Checking that raised user exceptions are further caught by name
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+ e EXCEPTION;
+ f EXCEPTION;
+BEGIN
+ IF c = 'e' THEN RAISE e; END IF;
+ IF c = 'f' THEN RAISE f; END IF;
+ RETURN 'Got no exceptions';
+EXCEPTION
+ WHEN e THEN RETURN 'Got exception e';
+END;
+$$
+DELIMITER ;$$
+SELECT f1('');
+SELECT f1('e');
+--error ER_SIGNAL_EXCEPTION
+SELECT f1('f');
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Checking that raised user exceptions are further caught by OTHERS
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+ e EXCEPTION;
+ f EXCEPTION;
+BEGIN
+ IF c = 'e' THEN RAISE e; END IF;
+ IF c = 'f' THEN RAISE f; END IF;
+ RETURN 'Got no exceptions';
+EXCEPTION
+ WHEN OTHERS THEN RETURN 'Got some exception';
+END;
+$$
+DELIMITER ;$$
+SELECT f1('');
+SELECT f1('e');
+SELECT f1('f');
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Checking that 'WHEN e .. WHEN f' does not produce ER_SP_DUP_HANDLER
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+ e EXCEPTION;
+ f EXCEPTION;
+ a VARCHAR(64):='';
+BEGIN
+ BEGIN
+ IF c = 'e' THEN RAISE e; END IF;
+ IF c = 'f' THEN RAISE f; END IF;
+ EXCEPTION
+ WHEN e THEN BEGIN a:='Got EXCEPTION1/e; '; RAISE e; END;
+ WHEN f THEN BEGIN a:='Got EXCEPTION1/f; '; RAISE f; END;
+ END;
+ RETURN 'Got no exceptions';
+EXCEPTION
+ WHEN OTHERS THEN RETURN a || 'Got EXCEPTION2/OTHERS;';
+END;
+$$
+DELIMITER ;$$
+SELECT f1('');
+SELECT f1('e');
+SELECT f1('f');
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Checking that resignaled user exceptions are further caught by name
+--echo #
+DELIMITER $$;
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+ e EXCEPTION;
+ f EXCEPTION;
+ a VARCHAR(64):='';
+BEGIN
+ BEGIN
+ IF c = 'e' THEN RAISE e; END IF;
+ IF c = 'f' THEN RAISE f; END IF;
+ EXCEPTION
+ WHEN e THEN BEGIN a:='Got EXCEPTION1/e; '; RAISE; END;
+ WHEN f THEN BEGIN a:='Got EXCEPTION1/f; '; RAISE; END;
+ END;
+ RETURN 'Got no exceptions';
+EXCEPTION
+ WHEN e THEN RETURN a || 'Got EXCEPTION2/e;';
+END;
+$$
+DELIMITER ;$$
+SELECT f1('');
+SELECT f1('e');
+--error ER_SIGNAL_EXCEPTION
+SELECT f1('f');
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Checking that resignaled user exceptions are further caught by OTHERS
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1(c VARCHAR) RETURN VARCHAR
+AS
+ e EXCEPTION;
+ f EXCEPTION;
+ a VARCHAR(64):='';
+BEGIN
+ BEGIN
+ IF c = 'e' THEN RAISE e; END IF;
+ IF c = 'f' THEN RAISE f; END IF;
+ EXCEPTION
+ WHEN e THEN BEGIN a:='Got EXCEPTION1/e; '; RAISE; END;
+ WHEN f THEN BEGIN a:='Got EXCEPTION1/f; '; RAISE; END;
+ END;
+ RETURN 'Got no exceptions';
+EXCEPTION
+ WHEN OTHERS THEN RETURN a || 'Got EXCEPTION2/OTHERS;';
+END;
+$$
+DELIMITER ;$$
+SELECT f1('');
+SELECT f1('e');
+SELECT f1('f');
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # End of MDEV-10587 sql_mode=ORACLE: User defined exceptions
+--echo #
+
+--echo #
+--echo # MDEV-12088 sql_mode=ORACLE: Do not require BEGIN..END in multi-statement exception handlers in THEN clause
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (10),(20),(30);
+DELIMITER $$;
+CREATE PROCEDURE p1(a INT) AS
+BEGIN
+ INSERT INTO t1 (a) VALUES (a);
+EXCEPTION
+ WHEN DUP_VAL_ON_INDEX THEN
+ a:= a+1;
+ INSERT INTO t1 VALUES (a);
+ WHEN OTHERS THEN
+ NULL;
+ NULL;
+END;
+$$
+DELIMITER ;$$
+CALL p1(30);
+SELECT * FROM t1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/func_case.test b/mysql-test/suite/compat/oracle/t/func_case.test
new file mode 100644
index 00000000000..d5e0d650975
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_case.test
@@ -0,0 +1,9 @@
+#
+# Testing CASE and its abbreviations
+#
+
+SET sql_mode=ORACLE;
+
+SELECT NVL(NULL, 'a'), NVL('a', 'b');
+
+SELECT NVL2(NULL, 'a', 'b'), NVL2('a', 'b', 'c');
diff --git a/mysql-test/suite/compat/oracle/t/func_concat.test b/mysql-test/suite/compat/oracle/t/func_concat.test
new file mode 100644
index 00000000000..5a613242e87
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_concat.test
@@ -0,0 +1,184 @@
+#
+# Testing CONCAT with null values
+#
+
+SET sql_mode=ORACLE;
+
+EXPLAIN EXTENDED SELECT 'a'||'b'||'c';
+EXPLAIN EXTENDED SELECT CONCAT('a'||'b'||'c');
+
+SELECT '' || '';
+SELECT '' || 'b';
+SELECT '' || NULL;
+SELECT 'a' || '';
+SELECT 'a' || 'b';
+SELECT 'a' || NULL;
+SELECT NULL || '';
+SELECT NULL || 'b';
+SELECT NULL || NULL;
+
+SELECT '' || '' || '';
+SELECT '' || '' || 'c';
+SELECT '' || '' || NULL;
+SELECT '' || 'b' || '';
+SELECT '' || 'b' || 'c';
+SELECT '' || 'b' || NULL;
+SELECT '' || NULL || '';
+SELECT '' || NULL || 'c';
+SELECT '' || NULL || NULL;
+
+SELECT 'a' || '' || '';
+SELECT 'a' || '' || 'c';
+SELECT 'a' || '' || NULL;
+SELECT 'a' || 'b' || '';
+SELECT 'a' || 'b' || 'c';
+SELECT 'a' || 'b' || NULL;
+SELECT 'a' || NULL || '';
+SELECT 'a' || NULL || 'c';
+SELECT 'a' || NULL || NULL;
+
+SELECT NULL || '' || '';
+SELECT NULL || '' || 'c';
+SELECT NULL || '' || NULL;
+SELECT NULL || 'b' || '';
+SELECT NULL || 'b' || 'c';
+SELECT NULL || 'b' || NULL;
+SELECT NULL || NULL || '';
+SELECT NULL || NULL || 'c';
+SELECT NULL || NULL || NULL;
+
+CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(10));
+
+INSERT INTO t1 VALUES ('', '', '');
+INSERT INTO t1 VALUES ('', '', 'c');
+INSERT INTO t1 VALUES ('', '', NULL);
+INSERT INTO t1 VALUES ('', 'b', '');
+INSERT INTO t1 VALUES ('', 'b', 'c');
+INSERT INTO t1 VALUES ('', 'b', NULL);
+INSERT INTO t1 VALUES ('', NULL, '');
+INSERT INTO t1 VALUES ('', NULL, 'c');
+INSERT INTO t1 VALUES ('', NULL, NULL);
+
+INSERT INTO t1 VALUES ('a', '', '');
+INSERT INTO t1 VALUES ('a', '', 'c');
+INSERT INTO t1 VALUES ('a', '', NULL);
+INSERT INTO t1 VALUES ('a', 'b', '');
+INSERT INTO t1 VALUES ('a', 'b', 'c');
+INSERT INTO t1 VALUES ('a', 'b', NULL);
+INSERT INTO t1 VALUES ('a', NULL, '');
+INSERT INTO t1 VALUES ('a', NULL, 'c');
+INSERT INTO t1 VALUES ('a', NULL, NULL);
+
+INSERT INTO t1 VALUES (NULL, '', '');
+INSERT INTO t1 VALUES (NULL, '', 'c');
+INSERT INTO t1 VALUES (NULL, '', NULL);
+INSERT INTO t1 VALUES (NULL, 'b', '');
+INSERT INTO t1 VALUES (NULL, 'b', 'c');
+INSERT INTO t1 VALUES (NULL, 'b', NULL);
+INSERT INTO t1 VALUES (NULL, NULL, '');
+INSERT INTO t1 VALUES (NULL, NULL, 'c');
+INSERT INTO t1 VALUES (NULL, NULL, NULL);
+
+SELECT LENGTH(a||b||c), a||b||c FROM t1 ORDER BY a,b,c;
+SELECT LENGTH(CONCAT(a||b||c)), CONCAT(a||b||c) FROM t1 ORDER BY a,b,c;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-12478 CONCAT function inside view casts values incorrectly with Oracle sql_mode
+--echo #
+
+SET sql_mode=ORACLE;
+CREATE VIEW v1 AS SELECT 'foo'||NULL||'bar' AS test;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+SET sql_mode=DEFAULT;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+
+SET sql_mode=DEFAULT;
+CREATE VIEW v1 AS SELECT CONCAT('foo',NULL,'bar') AS test;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+SET sql_mode=ORACLE;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+
+SET sql_mode=DEFAULT;
+CREATE VIEW v1 AS SELECT '0'||'1' AS test;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+SET sql_mode=ORACLE;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+
+
+--echo #
+--echo # MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE
+--echo #
+
+# Concatenation operator || has the same precedence with +
+# (stronger than << and weaker than * ^)
+
+SELECT -1<<1||1 AS a FROM DUAL;
+SELECT -1||0<<1 AS a FROM DUAL;
+
+EXPLAIN EXTENDED SELECT -1<<1||1 AS a FROM DUAL;
+EXPLAIN EXTENDED SELECT -1||0<<1 AS a FROM DUAL;
+
+SELECT -1+1||1 AS a FROM DUAL;
+SELECT -1||0+1 AS a FROM DUAL;
+
+EXPLAIN EXTENDED SELECT -1+1||1 AS a FROM DUAL;
+EXPLAIN EXTENDED SELECT -1||0+1 AS a FROM DUAL;
+
+SELECT 1*1||-1 AS a FROM DUAL;
+SELECT 1||1*-1 AS a FROM DUAL;
+
+EXPLAIN EXTENDED SELECT 1*1||-1 AS a FROM DUAL;
+EXPLAIN EXTENDED SELECT 1||1*-1 AS a FROM DUAL;
+
+SELECT -1^1||1 AS a FROM DUAL;
+SELECT -1||0^1 AS a FROM DUAL;
+
+EXPLAIN EXTENDED SELECT -1^1||1 AS a FROM DUAL;
+EXPLAIN EXTENDED SELECT -1||0^1 AS a FROM DUAL;
+
+
+--echo #
+--echo # MDEV-17359 Concatenation operator || in like expression failed in sql_mode=ORACLE
+--echo #
+
+SELECT 'abc' LIKE 'a'||'%';
+EXPLAIN EXTENDED SELECT 'abc' LIKE 'a'||'%';
+
+SELECT 'x' FROM DUAL WHERE 11 LIKE 1||1;
+SELECT 'x' FROM DUAL WHERE 1||1 LIKE 11;
+SELECT 'x' FROM DUAL WHERE 1||1 LIKE 1||1;
+
+CREATE TABLE t1 (c1 VARCHAR(10),c2 VARCHAR(10), ord INTEGER);
+INSERT INTO t1 VALUES ('a', 'ab' ,1);
+INSERT INTO t1 VALUES ('ab', 'ab', 2);
+INSERT INTO t1 VALUES ('abc', 'ab', 3);
+
+SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord;
+EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord;
+
+SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord;
+EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord;
+
+SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%';
+EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%';
+
+SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1;
+EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1;
+
+CREATE VIEW v1 AS SELECT c1, c2, c1 LIKE c2||'_' FROM t1 ORDER BY ord;
+SELECT * FROM v1;
+EXPLAIN EXTENDED SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/func_decode.test b/mysql-test/suite/compat/oracle/t/func_decode.test
new file mode 100644
index 00000000000..1d49cdd2102
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_decode.test
@@ -0,0 +1,98 @@
+SET sql_mode=ORACLE;
+
+--error ER_PARSE_ERROR
+SELECT DECODE(10);
+--error ER_PARSE_ERROR
+SELECT DECODE(10,10);
+
+SELECT DECODE(10,10,'x10');
+SELECT DECODE(11,10,'x10');
+
+SELECT DECODE(10,10,'x10','def');
+SELECT DECODE(11,10,'x10','def');
+
+SELECT DECODE(10,10,'x10',11,'x11','def');
+SELECT DECODE(11,10,'x10',11,'x11','def');
+SELECT DECODE(12,10,'x10',11,'x11','def');
+
+EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11','def');
+
+CREATE TABLE decode (decode int);
+DROP TABLE decode;
+
+
+--echo #
+--echo # MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent
+--echo #
+
+--error ER_PARSE_ERROR
+SELECT DECODE(10);
+--error ER_PARSE_ERROR
+SELECT DECODE(10,10);
+
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT DECODE_ORACLE(10);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT DECODE_ORACLE(10,10);
+
+
+EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11');
+EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11','def');
+EXPLAIN EXTENDED SELECT DECODE_ORACLE(12,10,'x10',11,'x11');
+EXPLAIN EXTENDED SELECT DECODE_ORACLE(12,10,'x10',11,'x11','def');
+
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS
+ SELECT
+ DECODE(a,1,'x1',NULL,'xNULL') AS d1,
+ DECODE(a,1,'x1',NULL,'xNULL','xELSE') AS d2,
+ DECODE_ORACLE(a,1,'x1',NULL,'xNULL') AS d3,
+ DECODE_ORACLE(a,1,'x1',NULL,'xNULL','xELSE') AS d4
+ FROM t1;
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+SELECT DECODE(TIME'10:20:31','10:20:31','then1','10:20:32','then2','def');
+SELECT DECODE(TIME'10:20:32','10:20:31','then1','10:20:32','then2','def');
+SELECT DECODE(TIME'10:20:33','10:20:31','then1',NULL,'then2NULL','10:20:33','then3','def');
+SELECT DECODE(NULL,TIME'10:20:31','then1',NULL,'then2NULL','10:20:33','then3','def');
+
+SELECT DECODE(TIMESTAMP'2001-01-01 10:20:31','2001-01-01 10:20:31','then1','2001-01-01 10:20:32','then2','def');
+SELECT DECODE(TIMESTAMP'2001-01-01 10:20:32','2001-01-01 10:20:31','then1','2001-01-01 10:20:32','then2','def');
+SELECT DECODE(TIMESTAMP'2001-01-01 10:20:33','2001-01-01 10:20:31','then1',NULL,'then2NULL','2001-01-01 10:20:33','then3','def');
+SELECT DECODE(NULL,TIMESTAMP'2001-01-01 10:20:31','then1',NULL,'then2NULL','2001-01-01 10:20:33','then3','def');
+
+SELECT DECODE('w1','w1','then1','w2','then2','def');
+SELECT DECODE('w2','w1','then1','w2','then2','def');
+SELECT DECODE('w3','w1','then1',NULL,'then2NULL','w3','then3','def');
+SELECT DECODE(NULL,'w1','then1',NULL,'then2NULL','w3','then3','def');
+
+SELECT DECODE(1,1,'then1',2,'then2','def');
+SELECT DECODE(2,1,'then1',2,'then2','def');
+SELECT DECODE(3,1,'then1',NULL,'then2NULL',3,'then3','def');
+SELECT DECODE(NULL,1,'then1',NULL,'then2NULL',3,'then3','def');
+SELECT DECODE(CAST(NULL AS SIGNED),1,'then1',NULL,'then2NULL',3,'then3','def');
+
+SELECT DECODE(1.0,1.0,'then1',2.0,'then2','def');
+SELECT DECODE(2.0,1.0,'then1',2.0,'then2','def');
+SELECT DECODE(3.0,1.0,'then1',NULL,'then2NULL',3.0,'then3','def');
+SELECT DECODE(NULL,1.0,'then1',NULL,'then2NULL',3.0,'then3','def');
+SELECT DECODE(CAST(NULL AS DECIMAL),1.0,'then1',NULL,'then2NULL',3.0,'then3','def');
+
+SELECT DECODE(1e0,1e0,'then1',2e0,'then2','def');
+SELECT DECODE(2e0,1e0,'then1',2e0,'then2','def');
+SELECT DECODE(3e0,1e0,'then1',NULL,'then2NULL',3e0,'then3','def');
+SELECT DECODE(NULL,1e0,'then1',NULL,'then2NULL',3e0,'then3','def');
+SELECT DECODE(CAST(NULL AS DOUBLE),1e0,'then1',NULL,'then2NULL',3e0,'then3','def');
+
+SELECT DECODE(NULL,NULL,1,2) FROM DUAL;
+SELECT DECODE(NULL,10,10,NULL,1,2) FROM DUAL;
+
+SELECT DECODE_ORACLE(NULL,NULL,1,2) FROM DUAL;
+SELECT DECODE_ORACLE(NULL,10,10,NULL,1,2) FROM DUAL;
+
+CREATE OR REPLACE TABLE t1 (a VARCHAR(10) DEFAULT NULL);
+INSERT INTO t1 VALUES (NULL),(1);
+SELECT a, DECODE(a,NULL,1,2) FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/func_length.test b/mysql-test/suite/compat/oracle/t/func_length.test
new file mode 100644
index 00000000000..7b76d33a02f
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_length.test
@@ -0,0 +1,18 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
+--echo #
+#
+# Testing LENGTH / LENGTHB
+#
+# LENGTH : return the length of char
+# LENGTHB : return the length of byte
+
+
+SELECT LENGTH(null), LENGTH('a'), LENGTH(123);
+SELECT LENGTHB(null), LENGTHB('a'), LENGTHB(123);
+
+SELECT LENGTH(_utf8 0xC39F), LENGTH(CHAR(14844588 USING utf8));
+SELECT LENGTHB(_utf8 0xC39F), LENGTHB(CHAR(14844588 USING utf8));
+EXPLAIN EXTENDED SELECT LENGTH('a'), LENGTHB('a');
diff --git a/mysql-test/suite/compat/oracle/t/func_misc.test b/mysql-test/suite/compat/oracle/t/func_misc.test
new file mode 100644
index 00000000000..c5b42134f89
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_misc.test
@@ -0,0 +1,346 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10578 sql_mode=ORACLE: SP control functions SQLCODE, SQLERRM
+--echo #
+
+--echo #
+--echo # Using SQLCODE and SQLERRM outside of an SP
+--echo #
+
+--error ER_BAD_FIELD_ERROR
+SELECT SQLCODE;
+
+--error ER_BAD_FIELD_ERROR
+SELECT SQLERRM;
+
+CREATE TABLE t1 (SQLCODE INT, SQLERRM VARCHAR(10));
+INSERT INTO t1 VALUES (10, 'test');
+SELECT SQLCODE, SQLERRM FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # Normal SQLCODE and SQLERRM usage
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(stmt VARCHAR)
+AS
+BEGIN
+ EXECUTE IMMEDIATE stmt;
+ SELECT 'Error1: ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+ WHEN OTHERS THEN
+ SELECT 'Error2: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1('SELECT 1');
+CALL p1('xxx');
+CALL p1('SELECT 1');
+DROP PROCEDURE p1;
+
+--echo #
+--echo # SQLCODE and SQLERRM hidden by local variables
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ sqlcode INT:= 10;
+ sqlerrm VARCHAR(64) := 'test';
+BEGIN
+ SELECT 'Error: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ sqlcode INT;
+ sqlerrm VARCHAR(64);
+BEGIN
+ SQLCODE:= 10;
+ sqlerrm:= 'test';
+ SELECT 'Error: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # SQLCODE and SQLERRM hidden by parameters
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(sqlcode INT, sqlerrm VARCHAR)
+AS
+BEGIN
+ SELECT 'Error: ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1(10, 'test');
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # SQLCODE and SQLERRM in CREATE..SELECT
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ CREATE TABLE t1 AS SELECT SQLCODE, SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # SQLCODE and SQLERRM in EXPLAIN EXTENDED SELECT
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ EXPLAIN EXTENDED SELECT SQLCode, SQLErrm;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+
+
+--echo #
+--echo # Warning-alike errors in stored functions
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1;
+ RETURN 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+ WHEN NO_DATA_FOUND THEN
+ RETURN 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1;
+ RETURN 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Warning-alike errors in stored procedures
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1;
+ res:= 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+ WHEN NO_DATA_FOUND THEN
+ res:= 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1(@a);
+SELECT @a;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ SELECT a INTO a FROM t1;
+ res:= 'No exception ' || SQLCODE || ' ' || SQLERRM;
+EXCEPTION
+ WHEN OTHERS THEN
+ res:= 'Exception ' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+CALL p1(@a);
+SELECT @a;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SQLCODE and SQLERRM are cleared on RETURN
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+ a INT:=10;
+BEGIN
+ SELECT a INTO a FROM t1;
+ RETURN 'Value=' || a;
+EXCEPTION
+ WHEN NO_DATA_FOUND THEN RETURN 'Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+ a VARCHAR(128);
+BEGIN
+ RETURN f1() || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+SELECT f1() FROM DUAL;
+SELECT f2() FROM DUAL;
+DROP TABLE t1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN VARCHAR
+AS
+ a INT:=10;
+BEGIN
+ SELECT a INTO a FROM t1;
+ RETURN 'Value=' || a;
+EXCEPTION
+ WHEN OTHERS THEN RETURN 'Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+ a VARCHAR(128);
+BEGIN
+ RETURN f1() || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+SELECT f1() FROM DUAL;
+SELECT f2() FROM DUAL;
+DROP TABLE t1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # SQLCODE and SQLERRM are cleared on a return from a PROCEDURE
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+ a INT:=10;
+BEGIN
+ SELECT a INTO a FROM t1;
+ res:='Value=' || a;
+EXCEPTION
+ WHEN NO_DATA_FOUND THEN res:='Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+ res VARCHAR(128);
+BEGIN
+ CALL p1(res);
+ RETURN res || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+SELECT f2() FROM DUAL;
+DROP FUNCTION f2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1(res OUT VARCHAR)
+AS
+ a INT:=10;
+BEGIN
+ SELECT a INTO a FROM t1;
+ res:='Value=' || a;
+EXCEPTION
+ WHEN OTHERS THEN res:='Exception|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+CREATE FUNCTION f2 RETURN VARCHAR
+AS
+ res VARCHAR(128);
+BEGIN
+ CALL p1(res);
+ RETURN res || '|' || SQLCODE || ' ' || SQLERRM;
+END;
+$$
+DELIMITER ;$$
+SELECT f2() FROM DUAL;
+DROP FUNCTION f2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of MDEV-10578 sql_mode=ORACLE: SP control functions SQLCODE, SQLERRM
+--echo #
+
+--echo #
+--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+--echo #
+
+--enable_metadata
+--disable_ps_protocol
+DELIMITER $$;
+BEGIN
+ SELECT SQLCODE;
+END
+$$
+DELIMITER ;$$
+--enable_ps_protocol
+--disable_metadata
diff --git a/mysql-test/suite/compat/oracle/t/func_pad.test b/mysql-test/suite/compat/oracle/t/func_pad.test
new file mode 100644
index 00000000000..bc33a9fa4f8
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_pad.test
@@ -0,0 +1,31 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-15739 - sql_mode=ORACLE: Make LPAD and RPAD return NULL instead of empty string
+--echo #
+
+SELECT RPAD('a',0), RPAD('abc',1), RPAD('abc',2) ;
+SELECT RPAD('a',0,'.'), RPAD('abc',1,'.'), RPAD('abc',2,'.') ;
+SELECT LPAD('a',0), LPAD('abc',1), LPAD('abc',2) ;
+SELECT LPAD('a',0,'.'), LPAD('abc',1,'.'), LPAD('abc',2,'.') ;
+
+CREATE TABLE t1 (c1 VARCHAR(10),c2 INTEGER, c3 VARCHAR(10), ord INTEGER);
+INSERT INTO t1 VALUES ('a',1,null,1);
+INSERT INTO t1 VALUES ('a',null,'.',2);
+INSERT INTO t1 VALUES (null,1,'.',3);
+INSERT INTO t1 VALUES ('a',-1,'.',4);
+INSERT INTO t1 VALUES ('a',0,'.',5);
+INSERT INTO t1 VALUES ('a',1,'.',6);
+INSERT INTO t1 VALUES ('a',2,'.',7);
+
+SELECT LPAD(c1,c2,c3), LPAD(c1,c2) FROM t1 ORDER BY ord;
+SELECT RPAD(c1,c2,c3), RPAD(c1,c2) FROM t1 ORDER BY ord;
+
+EXPLAIN EXTENDED SELECT RPAD('a',0,'.'), LPAD('a',0,'.'), LPAD(c1,c2,c3), LPAD(c1,c2), RPAD(c1,c2,c3), RPAD(c1,c2) FROM t1 ORDER BY ord;
+
+CREATE VIEW v1 AS SELECT RPAD('a',0,'.') AS "C1", LPAD('a',0,'.') AS "C2", LPAD(c1,c2,c3) AS "C3", LPAD(c1,c2) AS "C4", RPAD(c1,c2,c3) AS "C5", RPAD(c1,c2) AS "C6" FROM t1 ORDER BY ord;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+SELECT c1||'-'||c2||'-'||c3||'-'||c4||'-'||c5||'-'||c6 FROM v1;
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/func_replace.test b/mysql-test/suite/compat/oracle/t/func_replace.test
new file mode 100644
index 00000000000..0028f7d27cf
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_replace.test
@@ -0,0 +1,22 @@
+#
+# Testing replace with null args
+#
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-13003 - Oracle compatibility : Replace function
+--echo #
+
+SELECT REPLACE(null,'a','b') ;
+SELECT REPLACE('ab',null,'b') ;
+SELECT REPLACE('ab','a',null) ;
+SELECT REPLACE('ab',null,null) ;
+SELECT REPLACE('aaa','a',null) ;
+
+EXPLAIN EXTENDED SELECT REPLACE('ab','a',null) ;
+
+CREATE VIEW v1 AS SELECT REPLACE('ab','a',null) ;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
diff --git a/mysql-test/suite/compat/oracle/t/func_substr.test b/mysql-test/suite/compat/oracle/t/func_substr.test
new file mode 100644
index 00000000000..b661dfd3779
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_substr.test
@@ -0,0 +1,47 @@
+--echo #
+--echo # MDEV-14012 - sql_mode=Oracle: substr(): treat position 0 as position 1
+--echo # MDEV-10574 - sql_mode=Oracle: return null instead of empty string
+--echo #
+
+SET sql_mode=ORACLE;
+SELECT SUBSTR('abc',2,1),SUBSTR('abc',1,1), SUBSTR('abc',0,1) FROM dual;
+SELECT SUBSTR('abc',2),SUBSTR('abc',1), SUBSTR('abc',0) FROM dual;
+SELECT SUBSTR(null,2,1),SUBSTR(null,1), SUBSTR(null,0) FROM dual;
+SELECT SUBSTR('abc',-2),SUBSTR('abc',-1), SUBSTR('abc',-0) FROM dual;
+SELECT SUBSTR('abc',-2,1),SUBSTR('abc',-1,1), SUBSTR('abc',-0,1) FROM dual;
+SELECT SUBSTR('abc',null) FROM dual;
+SELECT SUBSTR('abc',2,null),SUBSTR('abc',1,null), SUBSTR('abc',0,null) FROM dual;
+SELECT SUBSTR('abc',2,0),SUBSTR('abc',1,0), SUBSTR('abc',0,0) FROM dual;
+SELECT SUBSTR('abc',2,-1),SUBSTR('abc',1,-1), SUBSTR('abc',0,-1) FROM dual;
+SELECT SUBSTR(SPACE(0),1) FROM DUAL;
+
+CREATE TABLE t1 (c1 VARCHAR(10),start INTEGER, length INTEGER);
+INSERT INTO t1 VALUES ('abc', 1, 1);
+INSERT INTO t1 VALUES ('abc', 0, 1);
+INSERT INTO t1 VALUES (null, 1, 1);
+INSERT INTO t1 VALUES (null, 0, 1);
+INSERT INTO t1 VALUES ('abc', 1, 0);
+INSERT INTO t1 VALUES ('abc', 0, 0);
+INSERT INTO t1 VALUES (null, 1, 0);
+INSERT INTO t1 VALUES (null, 0, 0);
+INSERT INTO t1 VALUES ('abc', 1, -1);
+INSERT INTO t1 VALUES ('abc', 0, -1);
+INSERT INTO t1 VALUES (null, 1, -1);
+INSERT INTO t1 VALUES (null, 0, -1);
+INSERT INTO t1 VALUES (SPACE(0), 0, 1);
+
+SELECT SUBSTR(c1,start,length) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL);
+CREATE TABLE t2 AS SELECT SUBSTR(C1,1,1) AS C1 from t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+
+EXPLAIN EXTENDED SELECT SUBSTR('abc',2,1) ;
+
+CREATE VIEW v1 AS SELECT SUBSTR('abc',2,1) ;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
diff --git a/mysql-test/suite/compat/oracle/t/func_time.test b/mysql-test/suite/compat/oracle/t/func_time.test
new file mode 100644
index 00000000000..c1174f7f395
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_time.test
@@ -0,0 +1,25 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-16152 Expressions with INTERVAL return bad results in some cases
+--echo #
+
+SELECT TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1,
+ -INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2;
+
+SELECT TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1,
+ INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2,
+ +INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3;
+
+EXPLAIN EXTENDED SELECT
+ TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1,
+ -INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2;
+
+EXPLAIN EXTENDED SELECT
+ TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1,
+ INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2,
+ +INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3;
diff --git a/mysql-test/suite/compat/oracle/t/func_trim.test b/mysql-test/suite/compat/oracle/t/func_trim.test
new file mode 100644
index 00000000000..153238fb092
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_trim.test
@@ -0,0 +1,77 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-15664 sql_mode=ORACLE: Make TRIM return NULL instead of empty string
+--echo #
+
+SELECT TRIM('abc'), TRIM('abc ')||'.', '.'||TRIM(' abc ')||'.', TRIM(' '), TRIM(NULL), TRIM(SPACE(0)),TRIM(SPACE(10)) FROM dual;
+
+SELECT TRIM(TRAILING 'abc' FROM 'abc');
+SELECT TRIM(TRAILING 'abc' FROM 'abc ');
+SELECT TRIM(TRAILING 'abc' FROM ' abc');
+
+SELECT TRIM(LEADING 'abc' FROM 'abc');
+SELECT TRIM(LEADING 'abc' FROM 'abc ');
+SELECT TRIM(LEADING 'abc' FROM ' abc');
+
+SELECT TRIM(BOTH 'abc' FROM 'abc');
+SELECT TRIM(BOTH 'abc' FROM 'abc ');
+SELECT TRIM(BOTH 'abc' FROM ' abc');
+
+SELECT RTRIM('abc'), RTRIM('abc ')||'.', RTRIM(' abc ')||'.', RTRIM(' '), RTRIM(NULL), RTRIM(SPACE(0)),RTRIM(SPACE(10)) FROM dual;
+SELECT LTRIM('abc'), LTRIM('abc '), LTRIM(' abc '), LTRIM(' '), LTRIM(NULL), LTRIM(SPACE(0)),LTRIM(SPACE(10)) FROM dual;
+
+CREATE TABLE t1 (c1 VARCHAR(10),ord INTEGER);
+INSERT INTO t1 VALUES ('abc',1);
+INSERT INTO t1 VALUES (SPACE(0),2);
+INSERT INTO t1 VALUES ('',3);
+INSERT INTO t1 VALUES (' ',4);
+INSERT INTO t1 VALUES (' ',5);
+INSERT INTO t1 VALUES (' a ',6);
+INSERT INTO t1 VALUES ('aa',7);
+INSERT INTO t1 VALUES ('aabb',8);
+INSERT INTO t1 VALUES ('bbaa',9);
+INSERT INTO t1 VALUES ('aabbaa',10);
+
+SELECT ord,'['||c1||']','.'||COALESCE(TRIM(LEADING 'a' FROM c1),'NULL')||'.' FROM t1 ORDER BY ord;
+SELECT ord,'['||c1||']','.'||COALESCE(TRIM(TRAILING 'a' FROM c1),'NULL')||'.' FROM t1 ORDER BY ord;
+SELECT ord,'['||c1||']','.'||COALESCE(TRIM(BOTH 'a' FROM c1),'NULL')||'.' FROM t1 ORDER BY ord;
+SELECT ord,'['||c1||']',COALESCE(LTRIM(c1),'NULL') FROM t1 ORDER BY ord;
+SELECT ord,'['||c1||']',COALESCE(RTRIM(c1),'NULL')||'.' FROM t1 ORDER BY ord;
+
+EXPLAIN EXTENDED SELECT TRIM('abc'),
+ TRIM(BOTH 'a' FROM 'abc'),
+ TRIM(LEADING 'a' FROM 'abc'),
+ TRIM(TRAILING 'a' FROM 'abc') ;
+
+EXPLAIN EXTENDED SELECT RTRIM('abc'),
+ LTRIM('abc');
+
+
+CREATE VIEW v1 AS SELECT ord,TRIM('abc'),RTRIM('abc'),LTRIM('abc'),
+ '['||c1||']',
+ TRIM(LEADING 'a' FROM c1),
+ TRIM(TRAILING 'a' FROM c1),
+ TRIM(BOTH 'a' FROM c1),
+ LTRIM(c1),
+ RTRIM(c1)
+ FROM t1 ORDER BY ord ;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL);
+CREATE TABLE t2 AS SELECT TRIM(LEADING 'a' FROM c1) AS C1,
+ TRIM(TRAILING 'a' FROM c1) AS C2,
+ TRIM(BOTH 'a' FROM c1) AS C3,
+ LTRIM(c1) AS C4,
+ RTRIM(c1) AS C5
+ FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE trim_oracle (trim_oracle int);
+DROP TABLE trim_oracle;
diff --git a/mysql-test/suite/compat/oracle/t/gis.test b/mysql-test/suite/compat/oracle/t/gis.test
new file mode 100644
index 00000000000..a684563390b
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/gis.test
@@ -0,0 +1,4 @@
+-- source include/have_geometry.inc
+
+SELECT WITHIN(POINT(1,1), POINT(1,1));
+SELECT WITHIN(POINT(1,1), POINT(0,0));
diff --git a/mysql-test/suite/compat/oracle/t/information_schema_parameters.test b/mysql-test/suite/compat/oracle/t/information_schema_parameters.test
new file mode 100644
index 00000000000..c13a59103dd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/information_schema_parameters.test
@@ -0,0 +1,127 @@
+
+--echo #
+--echo # MDEV-15416 Crash when reading I_S.PARAMETERS
+--echo #
+
+--echo # Create in sql_mode=ORACLE, display in sql_mode=ORACLE and sql_mode=DEFAULT
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PROCEDURE p1(a0 t1.a%TYPE,
+ a1 test.t1.a%TYPE,
+ b0 t1%ROWTYPE,
+ b1 test.t1%ROWTYPE,
+ d ROW(a INT,b DOUBLE))
+AS
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
+--vertical_results
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+--horizontal_results
+DROP PROCEDURE p1;
+
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE FUNCTION f1(a0 t1.a%TYPE,
+ a1 test.t1.a%TYPE,
+ b0 t1%ROWTYPE,
+ b1 test.t1%ROWTYPE,
+ d ROW(a INT,b DOUBLE))
+ RETURN INT
+AS
+BEGIN
+ RETURN 0;
+END;
+$$
+DELIMITER ;$$
+--vertical_results
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+--horizontal_results
+DROP FUNCTION f1;
+
+
+--echo # Create in sql_mode=DEFAULT, display in sql_mode=DEFAULT and sql_mode=ORACLE
+
+SET sql_mode=DEFAULT;
+DELIMITER $$;
+CREATE PROCEDURE p1(a0 TYPE OF t1.a,
+ a1 TYPE OF test.t1.a,
+ b0 ROW TYPE OF t1,
+ b1 ROW TYPE OF test.t1,
+ d ROW(a INT,b DOUBLE))
+BEGIN
+END;
+$$
+DELIMITER ;$$
+--vertical_results
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='p1';
+--horizontal_results
+DROP PROCEDURE p1;
+
+
+SET sql_mode=DEFAULT;
+DELIMITER $$;
+CREATE FUNCTION f1(a0 TYPE OF t1.a,
+ a1 TYPE OF test.t1.a,
+ b0 ROW TYPE OF t1,
+ b1 ROW TYPE OF test.t1,
+ d ROW(a INT,b DOUBLE))
+ RETURNS INT
+BEGIN
+ RETURN 0;
+END;
+$$
+DELIMITER ;$$
+--vertical_results
+SET sql_mode=DEFAULT;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+SET sql_mode=ORACLE;
+SELECT *, '--------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='f1';
+--horizontal_results
+DROP FUNCTION f1;
+
+--echo #
+--echo # MDEV 18092 Query with the table I_S.PARAMETERS stop working
+--echo # after a package is created
+--echo #
+
+SET sql_mode=ORACLE;
+
+CREATE DATABASE db1_mdev18092;
+USE db1_mdev18092;
+
+DELIMITER $$;
+
+CREATE PROCEDURE p1(a INT)
+AS BEGIN
+ NULL;
+END;
+$$
+
+CREATE OR REPLACE PACKAGE employee_tools AS
+ FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);
+ PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));
+ PROCEDURE raiseSalaryStd(eid INT);
+ PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));
+END;
+$$
+DELIMITER ;$$
+
+--vertical_results
+SELECT *, '---------------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_SCHEMA='db1_mdev18092';
+--horizontal_results
+
+DROP DATABASE db1_mdev18092;
diff --git a/mysql-test/suite/compat/oracle/t/keywords.test b/mysql-test/suite/compat/oracle/t/keywords.test
new file mode 100644
index 00000000000..0768633bf8b
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/keywords.test
@@ -0,0 +1,29 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-17363 Compressed columns cannot be restored from dump
+--echo # In sql_mode=ORACLE, COMPRESSED is still valid both as an SP label
+--echo # and an SP variable name.
+--echo #
+
+DELIMITER $$;
+BEGIN
+ IF TRUE THEN
+ GOTO compressed;
+ END IF;
+ SELECT 'This should not be reached' AS warn;
+<<compressed>>
+ BEGIN
+ SELECT 1 AS a;
+ END;
+END
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+DECLARE compressed INT DEFAULT 1;
+BEGIN
+ SELECT compressed;
+END
+$$
+DELIMITER ;$$
diff --git a/mysql-test/suite/compat/oracle/t/misc.test b/mysql-test/suite/compat/oracle/t/misc.test
new file mode 100644
index 00000000000..d939b20f8a0
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/misc.test
@@ -0,0 +1,10 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-12086 sql_mode=ORACLE: allow SELECT UNIQUE as a synonym for SELECT DISTINCT
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20),(20),(30),(30),(30);
+SELECT UNIQUE a FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/mysqldump_restore.test b/mysql-test/suite/compat/oracle/t/mysqldump_restore.test
new file mode 100644
index 00000000000..dd54c2b5636
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/mysqldump_restore.test
@@ -0,0 +1,30 @@
+# See comments in mysql-test/main/mysqldump_restore.test
+--source include/not_embedded.inc
+
+SET sql_mode=ORACLE;
+
+let $mysqldumpfile = $MYSQLTEST_VARDIR/tmp/mysqldumpfile.sql;
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-17363 Compressed columns cannot be restored from dump
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL);
+INSERT INTO `t1` VALUES (REPEAT('a', 256));
+--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile
+let $table_name = test.t1;
+--source include/mysqldump.inc
+
+CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL);
+INSERT INTO `t1` VALUES (REPEAT('a', 256));
+--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile
+let $table_name = test.t1;
+--source include/mysqldump.inc
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysql-test/suite/compat/oracle/t/parser.test b/mysql-test/suite/compat/oracle/t/parser.test
new file mode 100644
index 00000000000..4d558c5d153
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/parser.test
@@ -0,0 +1,461 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
+--echo #
+
+CREATE TABLE t1 (a INT);
+--error ER_UNKNOWN_STRUCTURED_VARIABLE
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-15615 Unexpected syntax error instead of "Unknown system variable" inside an SP
+--echo #
+
+DELIMITER $$;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+DECLARE
+ a INT;
+BEGIN
+ SET GLOBAL a=10;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # MDEV-16202 Latest changes made erroneously some keywords reserved in sql_mode=ORACLE
+--echo #
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1(name VARCHAR(64), pattern TEXT) AS
+ query TEXT DEFAULT REPLACE(pattern, 'name', name);
+BEGIN
+ SELECT query AS '';
+ EXECUTE IMMEDIATE query;
+EXCEPTION
+ WHEN OTHERS THEN
+ BEGIN
+ SHOW ERRORS;
+ END;
+END;
+$$
+
+CREATE PROCEDURE p2(name VARCHAR(64)) AS
+BEGIN
+ CALL p1(name, 'DECLARE name INT; BEGIN name:=10; SELECT name; END');
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (name INT)', 'name', name);
+ CALL p1(name, 'SELECT name FROM t1');
+ CALL p1(name, 'SELECT name ''alias'' FROM t1');
+ CALL p1(name, 'SELECT name()');
+ CALL p1(name, 'SELECT name.name()');
+ CALL p1(name, 'SELECT name DATE FROM t1');
+ CALL p1(name, 'SELECT name HISTORY FROM t1');
+ CALL p1(name, 'SELECT name NEXT FROM t1');
+ CALL p1(name, 'SELECT name PERIOD FROM t1');
+ CALL p1(name, 'SELECT name PREVIOUS FROM t1');
+ CALL p1(name, 'SELECT name SYSTEM FROM t1');
+ CALL p1(name, 'SELECT name SYSTEM_TIME FROM t1');
+ CALL p1(name, 'SELECT name TIME FROM t1');
+ CALL p1(name, 'SELECT name TIMESTAMP FROM t1');
+ CALL p1(name, 'SELECT name TRANSACTION FROM t1');
+ CALL p1(name, 'SELECT name VALUE FROM t1');
+ CALL p1(name, 'SELECT name VERSIONING FROM t1');
+ CALL p1(name, 'SELECT name WITHOUT FROM t1');
+ DROP TABLE t1;
+END;
+$$
+DELIMITER ;$$
+
+--disable_column_names
+CALL p2('date');
+CALL p2('history');
+CALL p2('next');
+CALL p2('period');
+CALL p2('previous');
+CALL p2('system');
+CALL p2('system_time');
+CALL p2('time');
+CALL p2('timestamp');
+CALL p2('transaction');
+CALL p2('value');
+CALL p2('versioning');
+CALL p2('without');
+--enable_column_names
+
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-16244 sql_mode=ORACLE: Some keywords do not work in variable declarations
+--echo #
+
+SET sql_mode=ORACLE;
+DELIMITER /;
+
+DECLARE
+ do INT;
+BEGIN
+ SELECT do INTO do FROM DUAL;
+END;
+/
+
+DECLARE
+ handler INT;
+BEGIN
+ SELECT handler INTO handler FROM DUAL;
+END;
+/
+
+DECLARE
+ repair INT;
+BEGIN
+ SELECT repair INTO repair FROM DUAL;
+END;
+/
+
+DECLARE
+ shutdown INT;
+BEGIN
+ SELECT shutdown INTO shutdown FROM DUAL;
+END;
+/
+
+DECLARE
+ truncate INT;
+BEGIN
+ SELECT truncate INTO truncate FROM DUAL;
+END;
+/
+
+DECLARE
+ close INT;
+BEGIN
+ SELECT close INTO close FROM DUAL;
+END;
+/
+
+DECLARE
+ commit INT;
+BEGIN
+ SELECT commit INTO commit FROM DUAL;
+END;
+/
+
+DECLARE
+ open INT;
+BEGIN
+ SELECT open INTO open FROM DUAL;
+END;
+/
+
+DECLARE
+ rollback INT;
+BEGIN
+ SELECT rollback INTO rollback FROM DUAL;
+END;
+/
+
+DECLARE
+ savepoint INT;
+BEGIN
+ SELECT savepoint INTO savepoint FROM DUAL;
+END;
+/
+
+DECLARE
+ contains INT;
+BEGIN
+ SELECT contains INTO contains FROM DUAL;
+END;
+/
+
+DECLARE
+ language INT;
+BEGIN
+ SELECT language INTO language FROM DUAL;
+END;
+/
+
+DECLARE
+ no INT;
+BEGIN
+ SELECT no INTO no FROM DUAL;
+END;
+/
+
+DECLARE
+ charset INT;
+BEGIN
+ SELECT charset INTO charset FROM DUAL;
+END;
+/
+DECLARE
+ follows INT;
+BEGIN
+ SELECT follows INTO follows FROM DUAL;
+END;
+/
+
+DECLARE
+ precedes INT;
+BEGIN
+ SELECT precedes INTO precedes FROM DUAL;
+END;
+/
+
+DELIMITER ;/
+
+
+--echo #
+--echo # MDEV-16464 Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc"
+--echo #
+
+SET sql_mode=ORACLE;
+SELECT name, comment FROM mysql.proc WHERE db='test';
+
+CREATE TABLE comment (comment INT);
+SELECT comment FROM comment;
+SELECT comment comment FROM comment comment;
+SELECT comment AS comment FROM comment AS comment;
+DROP TABLE comment;
+
+DELIMITER /;
+DECLARE
+ comment INT;
+BEGIN
+ SELECT comment INTO comment FROM DUAL;
+END;
+/
+DELIMITER ;/
+
+DELIMITER /;
+CREATE PROCEDURE comment COMMENT 'test' AS
+BEGIN
+ SELECT 1;
+END;
+/
+BEGIN
+ comment;
+END;
+/
+DELIMITER ;/
+CALL comment();
+CALL comment;
+DROP PROCEDURE comment;
+
+DELIMITER /;
+CREATE FUNCTION comment RETURN INT COMMENT 'test' AS
+BEGIN
+ RETURN 1;
+END;
+/
+DELIMITER ;/
+enable_prepare_warnings;
+SELECT test.comment() FROM DUAL;
+disable_prepare_warnings;
+DROP FUNCTION comment;
+
+
+--echo #
+--echo # MDEV-17660 sql_mode=ORACLE: Some keywords do not work as label names: history, system, versioning, without
+--echo #
+
+DELIMITER /;
+BEGIN
+<<date_format>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN
+<<decode>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN
+<<history>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN
+<<system>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN
+<<versioning>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN
+<<without>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+--echo #
+--echo # MDEV-17666 sql_mode=ORACLE: Keyword ELSEIF should not be reserved
+--echo #
+
+DELIMITER /;
+DECLARE
+ ELSEIF INT;
+BEGIN
+ ELSEIF:=1;
+END;
+/
+DELIMITER ;/
+
+DELIMITER /;
+BEGIN
+<<ELSEIF>>
+ NULL;
+END;
+/
+DELIMITER ;/
+
+
+--echo #
+--echo # MDEV-17693 Shift/reduce conflicts for NAMES,ROLE,PASSWORD in the option_value_no_option_type grammar
+--echo #
+
+CREATE TABLE names (names INT);
+SELECT names FROM names AS names;
+DROP TABLE names;
+
+CREATE TABLE password (password INT);
+SELECT password FROM password AS password;
+DROP TABLE password;
+
+CREATE TABLE role (role INT);
+SELECT role FROM role AS role;
+DROP TABLE role;
+
+DELIMITER $$;
+DECLARE
+ names VARCHAR(32) DEFAULT '[names]';
+ password VARCHAR(32) DEFAULT '[password]';
+ role VARCHAR(32) DEFAULT '[role]';
+BEGIN
+<<names>>
+ SELECT names;
+<<password>>
+ SELECT password;
+<<role>>
+ SELECT role;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_SP_BAD_VAR_SHADOW
+DECLARE
+ names VARCHAR(32);
+BEGIN
+ SET names='[names]';
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_SP_BAD_VAR_SHADOW
+DECLARE
+ password VARCHAR(32);
+BEGIN
+ SET password='[password]';
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+DECLARE
+ role VARCHAR(32);
+BEGIN
+ SET role='[role]';
+END;
+$$
+DELIMITER ;$$
+
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SELECT @@GLOBAL.names;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SELECT @@GLOBAL.password;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SELECT @@GLOBAL.role;
+
+
+--echo #
+--echo # MDEV-22822 sql_mode="oracle" cannot declare without variable errors
+--echo #
+--echo # It's OK to have no declarations between DECLARE and BEGIN.
+--echo #
+
+DELIMITER //;
+BEGIN
+ DECLARE
+ BEGIN
+ NULL;
+ END;
+EXCEPTION
+WHEN OTHERS THEN
+ NULL;
+END;
+//
+DELIMITER ;//
+
+
+DELIMITER //;
+DECLARE
+BEGIN
+ NULL;
+EXCEPTION
+WHEN OTHERS THEN
+ NULL;
+END;
+//
+DELIMITER ;//
+
+
+DELIMITER //;
+BEGIN
+<<lab>>
+ DECLARE
+ BEGIN
+ NULL;
+ END;
+EXCEPTION
+WHEN OTHERS THEN
+ NULL;
+END;
+//
+DELIMITER ;//
+
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysql-test/suite/compat/oracle/t/ps.test b/mysql-test/suite/compat/oracle/t/ps.test
new file mode 100644
index 00000000000..357b50e0eab
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/ps.test
@@ -0,0 +1,290 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10801 sql_mode: dynamic SQL placeholders
+--echo #
+
+SET @a=10, @b=20;
+PREPARE stmt FROM 'SELECT ?,?';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :a,:b';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :aaa,:bbb';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :"a",:"b"';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :"aaa",:"bbb"';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :1,:2';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :222,:111';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :0,:65535';
+EXECUTE stmt USING @a, @b;
+PREPARE stmt FROM 'SELECT :65535,:0';
+EXECUTE stmt USING @a, @b;
+
+--echo #
+--echo # MDEV-10709 Expressions as parameters to Dynamic SQL
+--echo #
+
+--echo #
+--echo # Testing disallowed expressions in USING
+--echo #
+
+PREPARE stmt FROM 'SELECT :1 FROM DUAL';
+--error ER_PARSE_ERROR
+EXECUTE stmt USING (SELECT 1);
+DEALLOCATE PREPARE stmt;
+
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+BEGIN
+ RETURN 'test';
+END;
+$$
+DELIMITER ;$$
+PREPARE stmt FROM 'SELECT ? FROM DUAL';
+--error ER_SUBQUERIES_NOT_SUPPORTED
+EXECUTE stmt USING f1();
+DEALLOCATE PREPARE stmt;
+DROP FUNCTION f1;
+
+--echo #
+--echo # Using a user variable as a EXECUTE..USING out parameter
+--echo #
+
+DELIMITER /;
+CREATE PROCEDURE p1(a OUT INT)
+AS
+BEGIN
+ a:= 10;
+END;
+/
+DELIMITER ;/
+SET @a=1;
+CALL p1(@a);
+SELECT @a;
+SET @a=2;
+PREPARE stmt FROM 'CALL p1(?)';
+EXECUTE stmt USING @a;
+SELECT @a;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Using an SP variable as a EXECUTE..USING out parameter
+--echo #
+
+DELIMITER /;
+CREATE PROCEDURE p1 (a OUT INT)
+AS
+BEGIN
+ a:=10;
+END;
+/
+CREATE PROCEDURE p2 (a OUT INT)
+AS
+BEGIN
+ PREPARE stmt FROM 'CALL p1(?)';
+ EXECUTE stmt USING a;
+END;
+/
+DELIMITER ;/
+SET @a= 1;
+CALL p2(@a);
+SELECT @a;
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Using a trigger field as a EXECUTE..USING out parameter
+--echo #
+DELIMITER /;
+CREATE PROCEDURE p1 (a OUT INT)
+AS
+BEGIN
+ a:= 10;
+END;
+/
+DELIMITER ;/
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1(:NEW.a);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Testing re-prepare on a table metadata update between PREPARE and EXECUTE
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER /;
+CREATE PROCEDURE p1(a IN INT)
+AS
+BEGIN
+ INSERT INTO t1 VALUES (a);
+END;
+/
+DELIMITER ;/
+PREPARE stmt FROM 'CALL p1(?)';
+EXECUTE stmt USING 10;
+SELECT * FROM t1;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW NEW.a:=NEW.a+1;
+EXECUTE stmt USING 20;
+SELECT * FROM t1;
+DEALLOCATE PREPARE stmt;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-10709 Expressions as parameters to Dynamic SQL
+--echo #
+
+--echo #
+--echo # MDEV-10585 EXECUTE IMMEDIATE statement
+--echo #
+
+--echo #
+--echo # Testing disallowed expressions in USING
+--echo #
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE 'SELECT :1 FROM DUAL' USING (SELECT 1);
+
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+BEGIN
+ RETURN 'test';
+END;
+$$
+DELIMITER ;$$
+--error ER_SUBQUERIES_NOT_SUPPORTED
+EXECUTE IMMEDIATE 'SELECT ? FROM DUAL' USING f1();
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Testing simple expressions
+--echo #
+
+EXECUTE IMMEDIATE 'SELECT :1 FROM DUAL' USING 10;
+
+
+--echo #
+--echo # MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
+--echo #
+
+--echo #
+--echo # Testing erroneous and diallowed prepare source
+--echo #
+
+--error ER_CANT_AGGREGATE_2COLLATIONS
+EXECUTE IMMEDIATE _latin1'SELECT 1 AS c FROM ' || _latin2 'DUAL';
+--error ER_CANT_AGGREGATE_2COLLATIONS
+PREPARE stmt FROM _latin1'SELECT 1 AS c FROM ' || _latin2 'DUAL';
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE (SELECT 'SELECT 1');
+--error ER_PARSE_ERROR
+PREPARE stmt FROM (SELECT 'SELECT 1');
+
+--error ER_BAD_FIELD_ERROR
+EXECUTE IMMEDIATE a;
+--error ER_BAD_FIELD_ERROR
+PREPARE stmt FROM a;
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE NULL;
+--error ER_PARSE_ERROR
+PREPARE stmt FROM NULL;
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE COALESCE(NULL);
+--error ER_PARSE_ERROR
+PREPARE stmt FROM COALESCE(NULL);
+
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN VARCHAR
+AS
+BEGIN
+ RETURN 't1';
+END;
+$$
+DELIMITER ;$$
+--error ER_SUBQUERIES_NOT_SUPPORTED
+EXECUTE IMMEDIATE f1();
+--error ER_SUBQUERIES_NOT_SUPPORTED
+PREPARE stmt FROM f1();
+DROP FUNCTION f1;
+
+--echo #
+--echo # Testing user variables in prepare source
+--echo #
+
+SET @table_name='DUAL';
+EXECUTE IMMEDIATE 'SELECT 1 AS a FROM ' || @table_name;
+PREPARE stmt FROM 'SELECT 1 AS a FROM ' || @table_name;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+--echo #
+--echo # Testing SP parameters and variables in prepare source
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(table_name VARCHAR)
+AS
+BEGIN
+ EXECUTE IMMEDIATE 'SELECT 1 AS c FROM '|| table_name;
+END;
+$$
+DELIMITER ;$$
+CALL p1('DUAL');
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ table_name VARCHAR(64):='DUAL';
+BEGIN
+ EXECUTE IMMEDIATE 'SELECT 1 AS c FROM ' || table_name;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # End of MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
+--echo #
+
+
+--echo #
+--echo # MDEV-12846 sql_mode=ORACLE: using Oracle-style placeholders in direct query execution makes the server crash
+--echo #
+
+# When running with --ps, the below queries return
+# CR_PARAMS_NOT_BOUND instead of ER_PARSE_ERROR
+
+--disable_ps_protocol
+--error ER_PARSE_ERROR
+SELECT ? FROM DUAL;
+--error ER_PARSE_ERROR
+SELECT :a FROM DUAL;
+--error ER_PARSE_ERROR
+SELECT :1 FROM DUAL;
+
+--error ER_PARSE_ERROR
+SELECT 1+? FROM DUAL;
+--error ER_PARSE_ERROR
+SELECT 1+:a FROM DUAL;
+--error ER_PARSE_ERROR
+SELECT 1+:1 FROM DUAL;
+--enable_ps_protocol
diff --git a/mysql-test/suite/compat/oracle/t/rpl_mariadb_date.test b/mysql-test/suite/compat/oracle/t/rpl_mariadb_date.test
new file mode 100644
index 00000000000..b2aff23333b
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/rpl_mariadb_date.test
@@ -0,0 +1,38 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+SET SQL_MODE=DEFAULT;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('2001-01-01');
+
+SET SQL_MODE= ORACLE;
+CREATE TABLE t2 SELECT * FROM t1;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+SET SQL_MODE= DEFAULT;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+SET SQL_MODE= ORACLE;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--sync_slave_with_master
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+SET SQL_MODE= DEFAULT;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+SET SQL_MODE= ORACLE;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+# Cleanup
+--connection master
+DROP TABLE t1, t2;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/compat/oracle/t/rpl_sp_package.test b/mysql-test/suite/compat/oracle/t/rpl_sp_package.test
new file mode 100644
index 00000000000..40bb0b0d9cd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/rpl_sp_package.test
@@ -0,0 +1,134 @@
+--source include/master-slave.inc
+
+connection master;
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PACKAGE pack AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE BODY pack AS
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN 10;
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT f1();
+ END;
+END pack;
+$$
+DELIMITER ;$$
+
+sync_slave_with_master;
+connection slave;
+--vertical_results
+--replace_column 13 # 14 #
+SELECT * FROM mysql.proc WHERE db='test' AND name='pack';
+--replace_column 13 # 14 #
+SELECT * FROM mysql.proc WHERE db='test' AND name LIKE 'pack.%';
+--horizontal_results
+
+SET @@sql_mode=ORACLE;
+SELECT pack.f1();
+CALL pack.p1();
+SET @@sql_mode=DEFAULT;
+
+connection master;
+DROP PACKAGE pack;
+
+sync_slave_with_master;
+connection slave;
+SELECT COUNT(*) FROM mysql.proc WHERE db='test' AND name='pack';
+
+--echo #
+--echo # Creating a package with a COMMENT
+--echo #
+
+connection master;
+
+DELIMITER $$;
+CREATE PACKAGE p1 COMMENT 'package-p1-comment' AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 COMMENT 'package-body-p1-comment' AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT definer, name, security_type, type, `comment` FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+sync_slave_with_master;
+SELECT definer, name, security_type, type, `comment` FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+
+connection master;
+DROP PACKAGE p1;
+sync_slave_with_master;
+
+
+--echo #
+--echo # Creating a package with a different DEFINER
+--echo #
+
+connection master;
+
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+sync_slave_with_master;
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+
+connection master;
+DROP PACKAGE p1;
+sync_slave_with_master;
+
+--echo #
+--echo # Creating a package with a different DEFINER + SQL SECURITY INVOKER
+--echo #
+
+connection master;
+
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+sync_slave_with_master;
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+
+connection master;
+DROP PACKAGE p1;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/compat/oracle/t/rpl_sp_package_variables.test b/mysql-test/suite/compat/oracle/t/rpl_sp_package_variables.test
new file mode 100644
index 00000000000..fca611243ad
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/rpl_sp_package_variables.test
@@ -0,0 +1,36 @@
+--source include/master-slave.inc
+
+connection master;
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-13139 Package-wide variables in CREATE PACKAGE
+--echo #
+connection master;
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ va INT:=10;
+ PROCEDURE p1 AS
+ BEGIN
+ INSERT INTO t1 VALUES (va);
+ END;
+BEGIN
+ CREATE OR REPLACE TABLE t1 (a INT);
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT * FROM t1;
+sync_slave_with_master;
+SELECT * FROM t1;
+connection master;
+DROP PACKAGE p1;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/compat/oracle/t/sequence.test b/mysql-test/suite/compat/oracle/t/sequence.test
new file mode 100644
index 00000000000..719c4bcd45b
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sequence.test
@@ -0,0 +1,43 @@
+--source include/have_binlog_format_row.inc
+
+SET sql_mode=ORACLE;
+
+CREATE SEQUENCE s1;
+SHOW CREATE SEQUENCE s1;
+SELECT s1.currval;
+SELECT s1.nextval;
+SELECT s1.nextval;
+SELECT s1.nextval;
+EXPLAIN EXTENDED SELECT s1.nextval;
+SELECT nextval(s1);
+EXPLAIN EXTENDED SELECT s1.currval;
+SELECT lastval(s1);
+DROP SEQUENCE s1;
+
+
+CREATE SEQUENCE s1;
+CREATE VIEW v1 AS SELECT s1.nextval AS a;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+SELECT * FROM v1;
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
+DROP SEQUENCE s1;
+
+
+CREATE SEQUENCE s1;
+CREATE VIEW v1 AS SELECT s1.currval AS a;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1';
+SELECT * FROM v1;
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
+DROP SEQUENCE s1;
+
+--echo #
+--echo # MDEV-12533 sql_mode=ORACLE: Add support for database qualified sequence names in NEXTVAL and CURRVAL
+--echo #
+CREATE SEQUENCE s1;
+SELECT test.s1.nextval;
+SELECT test.s1.currval;
+SELECT .s1.nextval;
+SELECT .s1.currval;
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-anchor-row-type-table.test b/mysql-test/suite/compat/oracle/t/sp-anchor-row-type-table.test
new file mode 100644
index 00000000000..6e13a6164a9
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-anchor-row-type-table.test
@@ -0,0 +1,124 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-13581 ROW TYPE OF t1 and t1%ROWTYPE for routine parameters
+--echo #
+
+CREATE TABLE t1 (a INT, b TEXT, c ENUM('a','b','c'));
+DELIMITER $$;
+CREATE PROCEDURE p1 (a t1%ROWTYPE) AS
+BEGIN
+ CREATE TABLE t2 AS SELECT a.a AS a, a.b AS b, a.c AS c;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+CREATE PROCEDURE p2 AS
+ a t1%ROWTYPE;
+BEGIN
+ CALL p1(a);
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT, b TEXT);
+DELIMITER $$;
+CREATE PROCEDURE p1 (a OUT t1%ROWTYPE) AS
+BEGIN
+ SET a.a=10;
+ SET a.b='text';
+END;
+$$
+CREATE PROCEDURE p2 AS
+ a t1%ROWTYPE;
+BEGIN
+ CALL p1(a);
+ SELECT a.a, a.b;
+END;
+$$
+CREATE FUNCTION f1(a t1%ROWTYPE) RETURN TEXT AS
+BEGIN
+ RETURN CONCAT(a.a, ' ', a.b);
+END;
+$$
+CREATE FUNCTION f2 RETURN TEXT AS
+ a t1%ROWTYPE;
+BEGIN
+ CALL p1(a);
+ RETURN f1(a);
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+SELECT f2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT, b TEXT);
+DELIMITER $$;
+CREATE PROCEDURE p1 (a OUT db1.t1%ROWTYPE) AS
+BEGIN
+ SET a.a=10;
+ SET a.b='text';
+END;
+$$
+CREATE PROCEDURE p2 AS
+ a db1.t1%ROWTYPE;
+BEGIN
+ CALL p1(a);
+ SELECT a.a, a.b;
+END;
+$$
+CREATE FUNCTION f1(a db1.t1%ROWTYPE) RETURN TEXT AS
+BEGIN
+ RETURN CONCAT(a.a, ' ', a.b);
+END;
+$$
+CREATE FUNCTION f2() RETURN TEXT AS
+ a db1.t1%ROWTYPE;
+BEGIN
+ CALL p1(a);
+ RETURN f1(a);
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+SELECT f2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP DATABASE db1;
+
+
+--echo #
+--echo # MDEV-14139 Anchored data types for variables
+--echo #
+
+CREATE TABLE t1 (int11 INT, text0 TEXT);
+DELIMITER $$;
+DECLARE
+ row1 t1%ROWTYPE;
+ a_row1 row1%TYPE;
+ aa_row1 a_row1%TYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT a_row1.int11 AS int11, a_row1.text0 AS text0;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ CREATE TABLE t2 AS SELECT aa_row1.int11 AS int11, aa_row1.text0 AS text0;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-anonymous.test b/mysql-test/suite/compat/oracle/t/sp-anonymous.test
new file mode 100644
index 00000000000..ac61e8ace2e
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-anonymous.test
@@ -0,0 +1,244 @@
+--source include/have_innodb.inc
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10655 Anonymous blocks
+--echo #
+
+--echo # Testing BEGIN NOT ATOMIC with no declarations
+DELIMITER /;
+BEGIN NOT ATOMIC
+ SELECT 1 AS a;
+END
+/
+DELIMITER ;/
+
+--echo # Testing BEGIN NOT ATOMIC with declarations
+--echo # DECLARE starts a new block and thus must be followed by BEGIN .. END
+DELIMITER /;
+BEGIN NOT ATOMIC
+ DECLARE
+ i INT DEFAULT 5;
+ x INT DEFAULT 10;
+ BEGIN
+ <<label>>
+ WHILE i > 3 LOOP
+ i:= i - 1;
+ SELECT i;
+ END LOOP label;
+ END;
+END
+/
+DELIMITER ;/
+
+
+--echo # Anonymous blocks with no declarations and no exceptions
+
+DELIMITER $$;
+BEGIN
+ SELECT 1 AS a;
+END
+$$
+DELIMITER ;$$
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+BEGIN
+ INSERT INTO t1 VALUES(20);
+ INSERT INTO t1 VALUES(30);
+ ROLLBACK;
+END;
+$$
+DELIMITER ;$$
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+BEGIN
+ INSERT INTO t1 VALUES(20);
+ INSERT INTO t1 VALUES(30);
+END;
+$$
+DELIMITER ;$$
+ROLLBACK;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+BEGIN
+ INSERT INTO t1 VALUES(20);
+ INSERT INTO t1 VALUES(30);
+ COMMIT;
+END;
+$$
+DELIMITER ;$$
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+BEGIN
+ INSERT INTO t1 VALUES(20);
+ INSERT INTO t1 VALUES(30);
+END;
+$$
+DELIMITER ;$$
+COMMIT;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+--error ER_DUP_ENTRY
+BEGIN
+ INSERT INTO t1 VALUES(20);
+ INSERT INTO t1 VALUES(20);
+END;
+$$
+DELIMITER ;$$
+COMMIT;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+--echo # Anonymous blocks with no declarations, with exceptions
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+BEGIN
+ INSERT INTO t1 VALUES(20);
+ INSERT INTO t1 VALUES(20);
+EXCEPTION
+ WHEN DUP_VAL_ON_INDEX THEN NULL;
+END;
+$$
+DELIMITER ;$$
+COMMIT;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+--echo # Anonymous blocks with declarations, with no exceptions
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+DECLARE
+ a20 INT:=20;
+ a30 INT:=30;
+BEGIN
+ INSERT INTO t1 VALUES(a20);
+ INSERT INTO t1 VALUES(a30);
+ ROLLBACK;
+END;
+$$
+DELIMITER ;$$
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+DECLARE
+ a20 INT:=20;
+ a30 INT:=30;
+BEGIN
+ INSERT INTO t1 VALUES(a20);
+ INSERT INTO t1 VALUES(a30);
+END;
+$$
+DELIMITER ;$$
+ROLLBACK;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+DECLARE
+ a20 INT:=20;
+ a30 INT:=30;
+BEGIN
+ INSERT INTO t1 VALUES(a20);
+ INSERT INTO t1 VALUES(a30);
+ COMMIT;
+END;
+$$
+DELIMITER ;$$
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+DECLARE
+ a20 INT:=20;
+ a30 INT:=30;
+BEGIN
+ INSERT INTO t1 VALUES(a20);
+ INSERT INTO t1 VALUES(a30);
+END;
+$$
+DELIMITER ;$$
+COMMIT;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
+
+
+--echo # Anonymous blocks with declarations, with exceptions
+
+SET AUTOCOMMIT=OFF;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+DECLARE
+ a20 INT:=20;
+BEGIN
+ INSERT INTO t1 VALUES(a20);
+ INSERT INTO t1 VALUES(a20);
+EXCEPTION
+ WHEN DUP_VAL_ON_INDEX THEN NULL;
+END;
+$$
+DELIMITER ;$$
+COMMIT;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET AUTOCOMMIT=DEFAULT;
diff --git a/mysql-test/suite/compat/oracle/t/sp-cache-invalidate.inc b/mysql-test/suite/compat/oracle/t/sp-cache-invalidate.inc
new file mode 100644
index 00000000000..945af6e7129
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-cache-invalidate.inc
@@ -0,0 +1,11 @@
+--echo # sp-cache-invalidate
+--disable_query_log
+DELIMITER $$;
+CREATE FUNCTION dummy RETURN INT AS
+BEGIN
+ RETURN 1;
+END;
+$$
+DELIMITER ;$$
+DROP FUNCTION dummy;
+--enable_query_log
diff --git a/mysql-test/suite/compat/oracle/t/sp-code.test b/mysql-test/suite/compat/oracle/t/sp-code.test
new file mode 100644
index 00000000000..ea66ed80d2a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-code.test
@@ -0,0 +1,1057 @@
+-- source include/have_debug.inc
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # Testing exceptions in the top-level blocks
+--echo #
+
+--echo # No HANDLER declarations, no exceptions
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+ RETURN 10;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1();
+DROP FUNCTION f1;
+
+--echo # No HANDLER declarations, no code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 ()
+IS
+BEGIN
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo # No HANDLER declarations, no code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+EXCEPTION
+ WHEN 1002 THEN v:=225;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # No HANDLER declarations, some code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=224;
+EXCEPTION
+ WHEN 1002 THEN v:=225;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # Some HANDLER declarations, no code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=123;
+ END;
+BEGIN
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # Some HANDLER declarations, no code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=123;
+ END;
+BEGIN
+EXCEPTION
+ WHEN 1002 THEN v:=225;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # Some HANDLER declarations, some code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=123;
+ END;
+BEGIN
+ v:=223;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # Some HANDLER declarations, some code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT VARCHAR2(20))
+IS
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=123;
+ END;
+ CONTINUE HANDLER FOR 1001
+ BEGIN
+ SET v=223;
+ END;
+BEGIN
+ v:= 1;
+EXCEPTION
+ WHEN 1002 THEN SET v=225;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Testing EXCEPTIONS in internal blocks
+--echo #
+
+--echo # No HANDLER declarations, no code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ BEGIN
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # No HANDLER declarations, no code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ BEGIN
+ EXCEPTION
+ WHEN 20002 THEN v:=335;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # No HANDLER declarations, some code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ BEGIN
+ v:=223;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # No HANDLER declarations, some code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ BEGIN
+ v:=223;
+ EXCEPTION
+ WHEN 20002 THEN v:=335;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # Some HANDLER declarations, no code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ DECLARE
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=323;
+ END;
+ BEGIN
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # Some HANDLER declarations, no code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ DECLARE
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=323;
+ END;
+ BEGIN
+ EXCEPTION
+ WHEN 20002 THEN v:=335;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # Some HANDLER declarations, some code, no exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ DECLARE
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=323;
+ END;
+ BEGIN
+ v:= 324;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo # Some HANDLER declarations, some code, some exceptions
+DELIMITER /;
+CREATE PROCEDURE p1 (v IN OUT INT)
+IS
+BEGIN
+ v:=123;
+ DECLARE
+ EXIT HANDLER FOR 1000
+ BEGIN
+ v:=323;
+ END;
+ BEGIN
+ v:= 324;
+ EXCEPTION WHEN 2002 THEN v:= 325;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Testing EXIT statement
+--echo #
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ LOOP
+ i:= i + 1;
+ IF i >= 5 THEN
+ EXIT;
+ END IF;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ LOOP
+ i:= i + 1;
+ EXIT WHEN i >=5;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ LOOP
+ BEGIN
+ i:= i + 1;
+ IF i >= 5 THEN
+ EXIT;
+ END IF;
+ EXCEPTION
+ WHEN OTHERS THEN i:= 1000;
+ END;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE PROCEDURE p1(a IN OUT INT)
+IS
+ i INT := 0;
+BEGIN
+ LOOP
+ LOOP
+ BEGIN
+ i:= i + 1;
+ IF i >=5 THEN
+ EXIT;
+ END IF;
+ EXCEPTION
+ WHEN OTHERS THEN a:=1000;
+ END;
+ END LOOP;
+ i:= i + 100;
+ EXIT;
+ END LOOP;
+ a:= i;
+EXCEPTION
+ WHEN OTHERS THEN a:=11;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+set @v= 10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # Testing RETURN in procedures
+DELIMITER /;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+ IF a < 10 THEN
+ BEGIN
+ a:= a + 1;
+ RETURN;
+ END;
+ END IF;
+ a:= 200;
+EXCEPTION
+ WHEN OTHERS THEN
+ BEGIN
+ a:= 100;
+ RETURN;
+ END;
+END;
+/
+DELIMITER ;/
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+--echo # Testing FOR loop statement
+DELIMITER /;
+CREATE FUNCTION f1 (a INT, b INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ FOR i IN 1 .. a
+ LOOP
+ total:= total + i;
+ IF i = b THEN
+ EXIT;
+ END IF;
+ END LOOP;
+ RETURN total;
+END
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(3, 100) FROM DUAL;
+SELECT f1(3, 2) FROM DUAL;
+DROP FUNCTION f1;
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT, b INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ FOR i IN REVERSE 1..a
+ LOOP
+ total:= total + i;
+ IF i = b THEN
+ EXIT;
+ END IF;
+ END LOOP;
+ RETURN total;
+END
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(3, 100) FROM DUAL;
+SELECT f1(3, 2) FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing labeled FOR LOOP statement
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT, limita INT, b INT, limitb INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ <<la>>
+ FOR ia IN 1 .. a
+ LOOP
+ total:= total + 1000;
+ <<lb>>
+ FOR ib IN 1 .. b
+ LOOP
+ total:= total + 1;
+ EXIT lb WHEN ib = limitb;
+ EXIT la WHEN ia = limita;
+ END LOOP lb;
+ END LOOP la;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(2, 1, 2, 2) FROM DUAL;
+SELECT f1(2, 2, 2, 2) FROM DUAL;
+SELECT f1(2, 3, 2, 3) FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing labeled ITERATE in a labeled FOR LOOP
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ <<li>>
+ FOR i IN 1 .. a
+ LOOP
+ total:= total + 1000;
+ IF i = 5 THEN
+ ITERATE li;
+ END IF;
+ total:= total + 1;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ <<li>>
+ FOR i IN 1 .. a
+ LOOP
+ FOR j IN 1 .. 2
+ LOOP
+ total:= total + 1000;
+ IF i = 5 THEN
+ ITERATE li;
+ END IF;
+ total:= total + 1;
+ END LOOP;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ <<lj>>
+ FOR j IN 1 .. 2
+ LOOP
+ <<li>>
+ FOR i IN 1 .. a
+ LOOP
+ total:= total + 1000;
+ IF i = 5 THEN
+ ITERATE li;
+ END IF;
+ total:= total + 1;
+ END LOOP;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing CONTINUE statement
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ FOR i IN 1 .. a
+ LOOP
+ CONTINUE WHEN i=5;
+ total:= total + 1;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SHOW FUNCTION CODE f1;
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+DROP FUNCTION f1;
+
+--echo #
+--echo # Start of MDEV-10597 Cursors with parameters
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(arg_value_a VARCHAR, arg_value_b VARCHAR,
+ arg_pattern_a VARCHAR, arg_pattern_b VARCHAR)
+AS
+ v_a VARCHAR(10);
+ v_b VARCHAR(20);
+ CURSOR c (p_value_a VARCHAR,
+ p_value_b VARCHAR,
+ p_pattern_a VARCHAR,
+ p_pattern_b VARCHAR,
+ p_limit_a INT,
+ p_limit_b INT,
+ p_unused TEXT) IS
+ (SELECT p_value_a, p_value_b FROM DUAL
+ WHERE p_value_a LIKE p_pattern_a LIMIT p_limit_a)
+ UNION
+ (SELECT p_value_b, p_value_a FROM DUAL
+ WHERE p_value_b LIKE p_pattern_b LIMIT p_limit_b);
+BEGIN
+ OPEN c(arg_value_a, (SELECT arg_value_b),
+ arg_pattern_a, arg_pattern_b, 100, 101, 'x');
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT v_a, v_b;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1('aaa','bbb','aaa','bbb');
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # End of MDEV-10597 Cursors with parameters
+--echo #
+
+
+--echo #
+--echo # MDEV-10914 ROW data type for stored routine variables
+--echo #
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT
+AS
+ a ROW(a INT, b INT);
+BEGIN
+ a.b:= 200;
+ RETURN a.b;
+END;
+$$
+DELIMITER ;$$
+SHOW FUNCTION CODE f1;
+SELECT f1();
+DROP FUNCTION f1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10));
+BEGIN
+ rec:= ROW(10,20.123456,30.123,'test');
+ SELECT rec.a, rec.b, rec.c, rec.d;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10)) :=
+ ROW(10,20.123456,30.123,'test');
+BEGIN
+ SELECT rec.a, rec.b, rec.c, rec.d;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10));
+ rec2 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10));
+BEGIN
+ rec1:= ROW(10,20.123456,30.123,'test');
+ rec2:= rec1;
+ SELECT rec2.a, rec2.b, rec2.c, rec2.d;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10)) :=
+ ROW(10,20.123456,30.123,'test');
+ rec2 ROW(a INT,b DOUBLE,c DECIMAL(10,3),d VARCHAR(10)) := rec1;
+BEGIN
+ SELECT rec2.a, rec2.b, rec2.c, rec2.d;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # End of MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+--echo #
+--echo # MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ rec1.a:= 10;
+ rec1.b:= 'bbb';
+ rec1.c:= 10e2;
+ rec1.d:= 10.12;
+ rec1.c:= rec1.d;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1,rec2 cur1%ROWTYPE;
+ rec3 cur2%ROWTYPE;
+ BEGIN
+ rec1.a:= 10;
+ rec1.b:= 'bbb';
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur0 IS SELECT 10 AS a, 'b0' AS b;
+ CURSOR cur1 IS SELECT 10 AS a, 'b0' AS b;
+ CURSOR cur2 IS SELECT 10 AS a, 'b0' AS b;
+BEGIN
+ FOR rec1 IN cur1
+ LOOP
+ SELECT rec1.a, rec1.b;
+ rec1.a:= 11;
+ rec1.b:= 'b1';
+ SELECT rec1.a, rec1.b;
+ END LOOP;
+ FOR rec0 IN cur0
+ LOOP
+ rec0.a:= 10;
+ rec0.b:='b0';
+ END LOOP;
+ FOR rec2 IN cur2
+ LOOP
+ rec2.a:= 10;
+ rec2.b:='b0';
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur0 IS SELECT 10 AS a, 'b0' AS b;
+BEGIN
+ FOR rec0 IN cur0
+ LOOP
+ DECLARE
+ CURSOR cur1 IS SELECT 11 AS a, 'b1' AS b;
+ BEGIN
+ rec0.a:= 11;
+ rec0.b:= 'b0';
+ FOR rec1 IN cur1
+ LOOP
+ rec1.a:= 11;
+ rec1.b:= 'b1';
+ DECLARE
+ CURSOR cur2 IS SELECT 12 AS a, 'b2' AS b;
+ BEGIN
+ FOR rec2 IN cur2
+ LOOP
+ rec2.a:=12;
+ rec2.b:='b2';
+ END LOOP;
+ END;
+ END LOOP;
+ END;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ FOR rec1 IN (SELECT 11 AS a, 'b1' AS b)
+ LOOP
+ SELECT rec1.a, rec1.b;
+ rec1.a:= 11;
+ rec1.b:= 'b1';
+ SELECT rec1.a, rec1.b;
+ END LOOP;
+ FOR rec0 IN (SELECT 10 AS a, 'b0' AS b)
+ LOOP
+ rec0.a:= 10;
+ rec0.b:='b0';
+ END LOOP;
+ FOR rec2 IN (SELECT 12 AS a, 'b2' AS b)
+ LOOP
+ rec2.a:= 10;
+ rec2.b:='b0';
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ FOR rec0 IN (SELECT 10 AS a, 'b0' AS b)
+ LOOP
+ rec0.a:= 11;
+ rec0.b:= 'b0';
+ FOR rec1 IN (SELECT 11 AS a, 'b1' AS b)
+ LOOP
+ rec1.a:= 11;
+ rec1.b:= 'b1';
+ FOR rec2 IN (SELECT 12 AS a, 'b2' AS b)
+ LOOP
+ rec2.a:=12;
+ rec2.b:='b2';
+ END LOOP;
+ END LOOP;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-10598 sql_mode=ORACLE: Variable declarations can go after cursor declarations
+--echo #
+
+--echo #
+--echo # Cursor declaration and cursor%ROWTYPE declaration in the same block
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'a');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT a FROM t1;
+ rec1 cur1%ROWTYPE;
+BEGIN
+ rec1.a:= 10;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Recursive cursor and cursor%ROWTYPE declarations in the same block
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT:=10;
+ CURSOR cur1 IS SELECT a;
+ rec1 cur1%ROWTYPE;
+ CURSOR cur2 IS SELECT rec1.a + 1 "a";
+ rec2 cur2%ROWTYPE;
+BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec1;
+ CLOSE cur1;
+ SELECT rec1.a;
+ open cur2;
+ FETCH cur2 INTO rec2;
+ CLOSE cur2;
+ SELECT rec2.a;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12441 Variables declared after cursors with parameters lose values
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 INT:=101;
+BEGIN
+ OPEN cur(10,11);
+ CLOSE cur;
+ SELECT x0, x1;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1();
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur0(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 INT:=101;
+ CURSOR cur1(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x2 INT:=102;
+ CURSOR cur2(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x3 INT:=103;
+BEGIN
+ OPEN cur0(0,1);
+ CLOSE cur0;
+ SELECT x0, x1, x2, x3;
+ OPEN cur1(10,11);
+ CLOSE cur1;
+ SELECT x0, x1, x2, x3;
+ OPEN cur2(20,21);
+ CLOSE cur2;
+ SELECT x0, x1, x2, x3;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1();
+DROP PROCEDURE p1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 t1.a%TYPE:=101;
+BEGIN
+ OPEN cur(10,11);
+ CLOSE cur;
+ SELECT x0, x1;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 ROW(a INT,b INT):=ROW(101,102);
+BEGIN
+ OPEN cur(10,11);
+ CLOSE cur;
+ SELECT x0, x1.a, x1.b;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1();
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test b/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test
new file mode 100644
index 00000000000..21683dd4220
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test
@@ -0,0 +1,295 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10598 sql_mode=ORACLE: Variable declarations can go after cursor declarations
+--echo #
+
+--echo #
+--echo # Variable after cursor declaration
+--echo #
+
+CREATE TABLE t1 (a INT);
+insert into t1 values (1);
+insert into t1 values (2);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT a FROM t1;
+ var1 varchar(10);
+BEGIN
+ OPEN c;
+ fetch c into var1;
+ SELECT c%ROWCOUNT,var1;
+ close c;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+drop table t1;
+
+--echo #
+--echo # Variable after condition declaration
+--echo #
+
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ dup_key CONDITION FOR SQLSTATE '23000';
+ var1 varchar(40);
+ CONTINUE HANDLER FOR dup_key
+ BEGIN
+ var1:='duplicate key in index';
+ END;
+BEGIN
+ var1:='';
+ insert into t1 values (1);
+ select var1;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+drop table t1;
+
+--echo #
+--echo # Condition after cursor declaration
+--echo #
+
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ var1 varchar(40);
+ var2 integer;
+ CURSOR c IS SELECT col1 FROM t1;
+ dup_key CONDITION FOR SQLSTATE '23000';
+ CONTINUE HANDLER FOR dup_key
+ BEGIN
+ var1:='duplicate key in index';
+ END;
+BEGIN
+ var1:='';
+ insert into t1 values (1);
+ SELECT var1;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+drop table t1;
+
+--echo #
+--echo # Cursor after handler declaration
+--echo #
+
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1
+AS
+ var1 varchar(40);
+ var2 integer;
+ dup_key CONDITION FOR SQLSTATE '23000';
+ CONTINUE HANDLER FOR dup_key
+ BEGIN
+ var1:='duplicate key in index';
+ END;
+ CURSOR c IS SELECT col1 FROM t1;
+BEGIN
+ var1:='';
+ insert into t1 values (1);
+ SELECT var1;
+END;
+$$
+DELIMITER ;$$
+drop table t1;
+
+--echo #
+--echo # Condition after handler declaration
+--echo #
+
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1
+AS
+ var1 varchar(40);
+ var2 integer;
+ dup_key CONDITION FOR SQLSTATE '23000';
+ CURSOR c IS SELECT col1 FROM t1;
+ CONTINUE HANDLER FOR dup_key
+ BEGIN
+ var1:='duplicate key in index';
+ END;
+ divide_by_zero CONDITION FOR SQLSTATE '22012';
+BEGIN
+ var1:='';
+ insert into t1 values (1);
+ SELECT var1;
+END;
+$$
+DELIMITER ;$$
+drop table t1;
+
+--echo #
+--echo # Variable after handler declaration
+--echo #
+
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+create unique index t1_col1 on t1 (col1);
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1
+AS
+ var1 varchar(40);
+ var2 integer;
+ dup_key CONDITION FOR SQLSTATE '23000';
+ CURSOR c IS SELECT col1 FROM t1;
+ CONTINUE HANDLER FOR dup_key
+ BEGIN
+ var1:='duplicate key in index';
+ END;
+ divide_by_zero CONDITION FOR SQLSTATE '22012';
+BEGIN
+ var1:='';
+ insert into t1 values (1);
+ SELECT var1;
+END;
+$$
+DELIMITER ;$$
+drop table t1;
+
+--echo #
+--echo # Variable after cursor (inner block)
+--echo #
+
+CREATE TABLE t1 (col1 INT);
+insert into t1 values (1);
+insert into t1 values (2);
+create unique index t1_col1 on t1 (col1);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT col1 FROM t1;
+ var1 varchar(40);
+BEGIN
+ OPEN c;
+ begin
+ declare
+ CURSOR c IS SELECT col1 FROM t1 where col1=2;
+ var2 integer;
+ dup_key CONDITION FOR SQLSTATE '23000';
+ CONTINUE HANDLER FOR dup_key
+ BEGIN
+ var1:='duplicate key in index';
+ END;
+ begin
+ OPEN c;
+ fetch c into var1;
+ SELECT 'inner cursor',var1;
+ insert into t1 values (2);
+ close c;
+ end;
+ end;
+ SELECT var1;
+ fetch c into var1;
+ SELECT c%ROWCOUNT,var1;
+ begin
+ insert into t1 values (2);
+ exception when 1062 then
+ begin
+ SELECT 'dup key caugth';
+ end;
+ end;
+ close c;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+drop table t1;
+
+--echo #
+--echo # Cursor declaration and row type declaration in same block
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+insert into t1 values(1,'a');
+delimiter $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT a FROM t1;
+ rec1 cur1%ROWTYPE;
+BEGIN
+ rec1.a:= 10;
+END;
+$$
+delimiter ;$$
+call p1;
+DROP PROCEDURE p1;
+drop table t1;
+
+
+--echo #
+--echo # Recursive cursor and cursor%ROWTYPE declarations in the same block
+--echo #
+
+delimiter $$;
+CREATE PROCEDURE p1
+AS
+ a INT:=10;
+ b VARCHAR(10):='b0';
+ c DOUBLE:=0.1;
+ CURSOR cur1 IS SELECT a, b, c;
+ rec1 cur1%ROWTYPE;
+ CURSOR cur2 IS SELECT rec1.a + 1 "a", rec1.b||'0' AS b, rec1.c AS c;
+ rec2 cur2%ROWTYPE;
+BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec1;
+ CLOSE cur1;
+ SELECT rec1.a;
+ OPEN cur2;
+ FETCH cur2 INTO rec2;
+ CLOSE cur2;
+ SELECT rec2.a;
+ CREATE TABLE t2 AS SELECT rec2.a AS a, rec2.b AS b, rec2.c AS c;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12916 Wrong column data type for an INT field of a cursor-anchored ROW variable
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT DEFAULT 10;
+ CURSOR cur1 IS SELECT a;
+ rec1 cur1%ROWTYPE;
+BEGIN
+ CREATE TABLE t1 AS SELECT rec1.a;
+ SHOW CREATE TABLE t1;
+ DROP TABLE t1;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test b/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
new file mode 100644
index 00000000000..ba0ca9b6a60
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
@@ -0,0 +1,1597 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations
+--echo #
+
+--echo #
+--echo # A complete working example
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'b10');
+INSERT INTO t1 VALUES (20,'b20');
+INSERT INTO t1 VALUES (30,'b30');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR c IS SELECT a,b FROM t1;
+BEGIN
+ DECLARE
+ rec c%ROWTYPE;
+ BEGIN
+ OPEN c;
+ LOOP
+ FETCH c INTO rec;
+ EXIT WHEN c%NOTFOUND;
+ SELECT 'rec=(' || rec.a ||','|| rec.b||')' AS c FROM dual;
+ INSERT INTO t2 VALUES (rec.a, rec.b);
+ END LOOP;
+ CLOSE c;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+DROP PROCEDURE p1;
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # cursor%ROWTYPE referring to a table in a non-existing database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM tes2.t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+--error ER_NO_SUCH_TABLE
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # cursor%ROWTYPE referring to a table in the current database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+DROP TABLE t1;
+--error ER_NO_SUCH_TABLE
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # cursor%ROWTYPE referring to a table in an explicitly specified database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM test.t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Cursor%ROWTYPE referring to a view in the current database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM v1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # cursor%ROWTYPE referring to a view in an explicitly specified database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM test.v1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Checking that all cursor%ROWTYPE fields are NULL by default
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ BEGIN
+ SELECT rec1.a, rec1.b, rec1.c, rec1.d;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A cursor%ROWTYPE variable with a ROW expression as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE := ROW(10,'bbb');
+ BEGIN
+ SELECT rec1.a, rec1.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A cursor%ROWTYPE variable with an incompatible ROW expression as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE := ROW(10,'bbb','ccc');
+ BEGIN
+ SELECT rec1.a, rec1.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A cursor%ROWTYPE variable with a ROW variable as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 ROW(a INT, b VARCHAR(10)):= ROW(10,'bbb');
+ rec2 cur%ROWTYPE := rec1;
+ BEGIN
+ SELECT rec2.a, rec2.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A ROW variable using a cursor%ROWTYPE variable as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE := ROW(10,'bbb');
+ rec2 ROW(a INT, b VARCHAR(10)):= rec1;
+ BEGIN
+ SELECT rec2.a, rec2.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning cursor%ROWTYPE variables with a different column count
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE);
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ rec2:=rec1;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ rec1:=rec2;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning compatible cursor%ROWTYPE variables (equal number of fields)
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ rec1.a:= 10;
+ rec1.b:= 'bbb';
+ rec2:=rec1;
+ SELECT rec2.x, rec2.y;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning between incompatible cursor%ROWTYPE and explicit ROW variables
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ rec2 ROW(x INT,y INT,z INT);
+ BEGIN
+ rec2.x:= 10;
+ rec2.y:= 20;
+ rec2.z:= 30;
+ rec1:= rec2;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning between compatible cursor%ROWTYPE and explicit ROW variables
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ rec2 ROW(x INT,y INT);
+ BEGIN
+ rec2.x:= 10;
+ rec2.y:= 20;
+ rec1:= rec2;
+ SELECT rec1.a, rec1.b;
+ rec1.a:= 11;
+ rec1.b:= 21;
+ rec2:= rec1;
+ SELECT rec2.x, rec2.y;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning cursor%ROWTYPE from a ROW expression
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ BEGIN
+ rec1:= ROW(10,20);
+ SELECT rec1.a, rec1.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a cursor%ROWTYPE variable with a wrong field count
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+ DECLARE
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec2;
+ CLOSE cur1;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_WRONG_NO_OF_FETCH_ARGS
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a cursor%ROWTYPE variable
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+INSERT INTO t1 VALUES (20,'bb2',222.222e2, 12.32);
+INSERT INTO t1 VALUES (30,'bb3',333.333e2, 12.33);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ OPEN cur;
+ LOOP
+ FETCH cur INTO rec;
+ EXIT WHEN cur%NOTFOUND;
+ SELECT rec.a, rec.b, rec.c, rec.d;
+ INSERT INTO t2 VALUES (rec.a, rec.b, rec.c, rec.d);
+ END LOOP;
+ CLOSE cur;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a cursor%ROWTYPE variable, cur%ROWTYPE declared inside the LOOP
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+INSERT INTO t1 VALUES (20,'bb2',222.222e2, 12.32);
+INSERT INTO t1 VALUES (30,'bb3',333.333e2, 12.33);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ OPEN cur;
+ LOOP
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ FETCH cur INTO rec;
+ EXIT WHEN cur%NOTFOUND;
+ SELECT rec.a, rec.b, rec.c, rec.d;
+ INSERT INTO t2 VALUES (rec.a, rec.b, rec.c, rec.d);
+ END;
+ END LOOP;
+ CLOSE cur;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a cursor%ROWTYPE variable with different column names
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bbb');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+ DECLARE
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec2;
+ SELECT rec2.x, rec2.y;
+ CLOSE cur1;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a cursor%ROWTYPE variable, with truncation
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t1 VALUES (10,'11x');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ CURSOR cur2 IS SELECT * FROM t2;
+BEGIN
+ DECLARE
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec2;
+ SELECT rec2.a, rec2.b;
+ CLOSE cur1;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # cursor%ROWTYPE variables are not allowed in LIMIT
+--echo #
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2);
+DELIMITER $$;
+--error ER_WRONG_SPVAR_TYPE_IN_LIMIT
+CREATE PROCEDURE p1()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE:=(1,2);
+ BEGIN
+ SELECT * FROM t1 LIMIT rec1.a;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
+
+
+--echo #
+--echo # cursor%ROWTYPE variable fields as OUT parameters
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT INT,b OUT VARCHAR(10))
+AS
+BEGIN
+ a:=10;
+ b:='bb';
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ BEGIN
+ CALL p1(rec1.a, rec1.b);
+ SELECT rec1.a, rec1.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Passing the entire cursor%ROWTYPE variable
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1(a ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+ SELECT a.a, a.b;
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur%ROWTYPE:= ROW(10,'bb');
+ BEGIN
+ CALL p1(rec1);
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Passing the entire cursor%ROWTYPE variable as an OUT parameter
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+ a:= ROW(10,'bb');
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur%ROWTYPE;
+ BEGIN
+ CALL p1(rec1);
+ SELECT rec1.a, rec1.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Assigning a cursor%ROWTYPE field to an OUT parameter
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1 (res IN OUT INTEGER)
+AS
+ a INT:=10;
+ CURSOR cur1 IS SELECT a FROM DUAL;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec1;
+ CLOSE cur1;
+ res:=rec1.a;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1(@res);
+SELECT @res;
+SET @res=NULL;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Testing Item_splocal_row_field_by_name::print
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur1%ROWTYPE:=ROW(10,'bb');
+ BEGIN
+ EXPLAIN EXTENDED SELECT rec.a, rec.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Run time error in the cursor statement
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur1 IS SELECT
+ 10 AS a,
+ CONCAT(_latin1'a' COLLATE latin1_bin,
+ _latin1'a' COLLATE latin1_swedish_ci) AS b;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec1;
+ CLOSE cur1;
+ SELECT a,b;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_CANT_AGGREGATE_2COLLATIONS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+
+--echo #
+--echo # Non-existing field
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur1%ROWTYPE;
+ BEGIN
+ SELECT rec.c;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CALL p1();
+ALTER TABLE t1 ADD c INT;
+#
+# The below ALTER is needed as a workaround to call sp_cache_invalidate()
+# Please remove it after fixing MDEV-12166
+#
+ALTER PROCEDURE p1 COMMENT 'test';
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing that field names are case insensitive
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE:=ROW(10,'bb');
+ BEGIN
+ SELECT rec.A, rec.B;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing that cursor%ROWTYPE uses temporary tables vs shadowed real tables
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TEMPORARY TABLE t1 (x INT, y VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE:=ROW(10,'bb');
+ BEGIN
+ SELECT rec.A, rec.B;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CALL p1();
+DROP TEMPORARY TABLE t1;
+#
+# The below ALTER is needed as a workaround to call sp_cache_invalidate()
+# Please remove it after fixing MDEV-12166
+#
+ALTER PROCEDURE p1 COMMENT 'test';
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing that the structure of cursor%ROWTYPE variables is determined at the CURSOR instantiation time
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DROP TABLE t1;
+ CREATE TABLE t1 (a INT, b VARCHAR(32), c INT);
+ DECLARE
+ rec cur%ROWTYPE; -- This has a column "c"
+ BEGIN
+ rec.c:=10;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE; -- This does not have a column "c"
+ BEGIN
+ DROP TABLE t1;
+ CREATE TABLE t1 (a INT, b VARCHAR(32), c INT);
+ rec.c:=10;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Duplicate field nams in a cursor referenced by %ROWTYPE
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur IS SELECT * FROM t1, t2;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ SELECT rec.a;
+ rec.a:=10;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_DUP_FIELDNAME
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Tricky field names a cursor referenced by %ROWTYPE
+--echo #
+
+SET NAMES utf8;
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('a');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur IS SELECT a, CONCAT(a,'a'), CONCAT(a,'ö') FROM t1;
+BEGIN
+ DECLARE
+ rec cur%ROWTYPE;
+ BEGIN
+ OPEN cur;
+ FETCH cur INTO rec;
+ CLOSE cur;
+ SELECT rec.a, rec."CONCAT(a,'a')", rec."CONCAT(a,'ö')";
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+SET NAMES latin1;
+
+
+--echo #
+--echo # Using definitions recursively (cursor%ROWTYPE variables in another cursor SELECT)
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b1'),(20,'b2'),(30,'b3');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur1 IS SELECT a,b FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE:=ROW(0,'b0');
+ CURSOR cur2 IS SELECT rec1.a AS a, rec1.b AS b FROM t1;
+ BEGIN
+ DECLARE
+ rec2 cur2%ROWTYPE;
+ BEGIN
+ OPEN cur2;
+ LOOP
+ FETCH cur2 INTO rec2;
+ EXIT WHEN cur2%NOTFOUND;
+ SELECT rec2.a, rec2.b;
+ END LOOP;
+ CLOSE cur2;
+ END;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing queries with auto-generated Items.
+--echo # An instance of Item_func_conv_charset is created during the below SELECT query.
+--echo # We check here that during an implicit cursor OPEN
+--echo # done in sp_instr_cursor_copy_struct::exec_core()
+--echo # all temporary Items are created on a proper memory root and are safely destroyed.
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8);
+INSERT INTO t1 VALUES (0xFF, 'a');
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur1 IS SELECT CONCAT(a,b) AS c FROM t1;
+BEGIN
+ DECLARE
+ rec1 cur1%ROWTYPE;
+ BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec1;
+ CLOSE cur1;
+ SELECT HEX(rec1.c);
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP
+--echo #
+
+--echo # IN followed by a non-identifier
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 AS
+ CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+ FOR rec IN 10
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # IN followed by a quoted identifier: table.column
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 AS
+ CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+ FOR rec IN c1.c2
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # IN followed by a quoted identifier: .table.column
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 AS
+ CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+ FOR rec IN .c1.c2
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # IN followed by a quoted identifier: schema.table.column
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 AS
+ CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+ FOR rec IN c1.c2.c3
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # IN followed by an unknown cursor name
+
+DELIMITER $$;
+--error ER_SP_CURSOR_MISMATCH
+CREATE PROCEDURE p1 AS
+ CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+ FOR rec IN c2
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # Make sure "rec" shadows other declarations outside the loop
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10, 'b0');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec INT:=10;
+ CURSOR c1 IS SELECT a,b FROM t1;
+BEGIN
+ FOR rec IN c1
+ LOOP
+ SELECT rec.a;
+ END LOOP;
+ SELECT rec;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo # Make sure "rec" is not visible after END LOOP
+
+DELIMITER $$;
+--error ER_UNKNOWN_STRUCTURED_VARIABLE
+CREATE PROCEDURE p1 AS
+ CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
+BEGIN
+ FOR rec IN c1
+ LOOP
+ NULL;
+ END LOOP;
+ rec.a:= 10;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # Make sure that duplicate column names are not allowed
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur IS SELECT 'a' AS a, 'A' as a;
+BEGIN
+ FOR rec IN cur
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+--error ER_DUP_FIELDNAME
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo # A complete working example
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b0');
+INSERT INTO t1 VALUES (11,'b1');
+INSERT INTO t1 VALUES (12,'b2');
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur IS SELECT a, b FROM t1;
+BEGIN
+ FOR rec IN cur
+ LOOP
+ SELECT rec.a, rec.b;
+ INSERT INTO t2 VALUES (rec.a, rec.b);
+ rec.a:= rec.a + 1000;
+ rec.b:= 'b' || rec.b;
+ INSERT INTO t3 VALUES (rec.a, rec.b);
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+SELECT * FROM t3;
+DROP PROCEDURE p1;
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-12314 Implicit cursor FOR LOOP for cursors with parameters
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b0');
+INSERT INTO t1 VALUES (11,'b1');
+INSERT INTO t1 VALUES (12,'b2');
+DELIMITER $$;
+CREATE PROCEDURE p1(pa INT, pb VARCHAR(32)) AS
+ CURSOR cur(va INT, vb VARCHAR(32)) IS
+ SELECT a, b FROM t1 WHERE a=va AND b=vb;
+BEGIN
+ FOR rec IN cur(pa,pb)
+ LOOP
+ SELECT rec.a, rec.b;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1(10,'B0');
+CALL p1(11,'B1');
+CALL p1(12,'B2');
+CALL p1(12,'non-existing');
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop
+--echo #
+
+--echo # Parse error in the cursor SELECT statement
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT a, b FROM)
+ LOOP
+ SELECT rec.a, rec.b;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # Make sure "rec" is not visible after END LOOP
+
+DELIMITER $$;
+--error ER_UNKNOWN_STRUCTURED_VARIABLE
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT 'test' AS a)
+ LOOP
+ NULL;
+ END LOOP;
+ rec.a:= 10;
+END;
+$$
+DELIMITER ;$$
+
+--echo # Make sure "rec" is not visible inside the SELECT statement
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT rec)
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+--error ER_BAD_FIELD_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT rec.a)
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+--error ER_UNKNOWN_TABLE
+CALL p1;
+DROP PROCEDURE p1;
+
+--echo # Totally confusing name mixture
+
+CREATE TABLE rec (rec INT);
+INSERT INTO rec VALUES (10);
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT rec FROM rec)
+ LOOP
+ SELECT rec.rec;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE rec;
+
+
+--echo # Make sure that duplicate column names are not allowed
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT 'a' AS a, 'A' as a)
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+--error ER_DUP_FIELDNAME
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo # A complete working example
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b0');
+INSERT INTO t1 VALUES (11,'b1');
+INSERT INTO t1 VALUES (12,'b2');
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec IN (SELECT a, b FROM t1)
+ LOOP
+ SELECT rec.a, rec.b;
+ INSERT INTO t2 VALUES (rec.a, rec.b);
+ rec.a:= rec.a + 1000;
+ rec.b:= 'b'|| rec.b;
+ INSERT INTO t3 VALUES (rec.a, rec.b);
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+SELECT * FROM t3;
+DROP PROCEDURE p1;
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo # A combination of explicit and implicit cursors
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'b1');
+INSERT INTO t1 VALUES (11,'b2');
+INSERT INTO t1 VALUES (12,'b3');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ FOR rec1 IN (SELECT a, b FROM t1)
+ LOOP
+ DECLARE
+ CURSOR cur2 IS SELECT a+1000 AS a, 'bb'||b AS b FROM t1 WHERE a=rec1.a AND b=rec1.b;
+ BEGIN
+ SELECT rec1.a, rec1.b;
+ FOR rec2 IN cur2
+ LOOP
+ SELECT rec2.a, rec2.b;
+ END LOOP;
+ END;
+ END LOOP;
+ FOR rec1 IN (SELECT a,b FROM t1)
+ LOOP
+ FOR rec2 IN (SELECT a+2000 AS a,'bbb'||b AS b FROM t1 WHERE a=rec1.a AND b=rec1.b)
+ LOOP
+ SELECT rec2.a, rec2.b;
+ END LOOP;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-15941 Explicit cursor FOR loop does not close the cursor
+--echo #
+
+DELIMITER $$;
+--error ER_SP_CURSOR_NOT_OPEN
+DECLARE
+ CURSOR cur IS SELECT 1 AS a FROM DUAL;
+ v INT;
+BEGIN
+ FOR rec IN cur
+ LOOP
+ NULL;
+ END LOOP;
+ FETCH cur INTO v;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_SP_CURSOR_NOT_OPEN
+DECLARE
+ CURSOR cur IS SELECT 1 AS a FROM DUAL;
+ v INT;
+BEGIN
+<<label>>
+ FOR rec IN cur
+ LOOP
+ NULL;
+ END LOOP label;
+ FETCH cur INTO v;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_SP_CURSOR_ALREADY_OPEN
+DECLARE
+ CURSOR cur IS SELECT 1 AS a FROM DUAL;
+BEGIN
+ OPEN cur;
+ FOR rec IN cur
+ LOOP
+ NULL;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+DECLARE
+ CURSOR cur IS SELECT 1 AS a FROM DUAL;
+BEGIN
+ FOR rec IN cur
+ LOOP
+ SELECT rec.a;
+ END LOOP;
+ SELECT cur%ISOPEN;
+ FOR rec IN cur
+ LOOP
+ SELECT rec.a;
+ END LOOP;
+ SELECT cur%ISOPEN;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+DECLARE
+ CURSOR cur IS SELECT 1 AS a FROM DUAL;
+BEGIN
+<<label1>>
+ FOR rec IN cur
+ LOOP
+ SELECT rec.a;
+ END LOOP label1;
+ SELECT cur%ISOPEN;
+<<label2>>
+ FOR rec IN cur
+ LOOP
+ SELECT rec.a;
+ END LOOP;
+ SELECT cur%ISOPEN;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # MDEV-14139 Anchored data types for variables
+--echo #
+
+DELIMITER $$;
+DECLARE
+ CURSOR c1 IS SELECT 10 AS a, 'bbb' AS b, TIME'10:20:30' AS c;
+ row1 c1%ROWTYPE;
+ a_row1 row1%TYPE;
+ aa_row1 a_row1%TYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT a_row1.a AS a, a_row1.b AS b, a_row1.c AS c;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ CREATE TABLE t2 AS SELECT aa_row1.a AS a, aa_row1.b AS b, aa_row1.c AS c;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # MDEV-14388 Server crashes in handle_select / val_uint in ORACLE mode
+--echo #
+
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (0),(1),(2),(3);
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT is
+BEGIN
+ FOR v1 in (SELECT id FROM t1)
+ LOOP
+ NULL;
+ END LOOP;
+ RETURN 1;
+END;
+$$
+DELIMITER ;$$
+SELECT f1();
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT IS
+ CURSOR cur IS SELECT id FROM t1;
+ rec cur%ROWTYPE;
+BEGIN
+ RETURN 1;
+END;
+$$
+DELIMITER ;$$
+SELECT f1();
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes (SERVER CRASH)
+--echo #
+
+CREATE TABLE t1 (id2 int, id int, en1 enum('aaa','a','b','c'));
+INSERT INTO t1 VALUES(1,1,'aaa'),(2,2,'a'),(3,3,'b'),(4,4,'c');
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+BEGIN
+ FOR rec IN (SELECT en1 FROM t1)
+ LOOP
+ SELECT rec.en1;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-cursor.test b/mysql-test/suite/compat/oracle/t/sp-cursor.test
new file mode 100644
index 00000000000..03b8b016ee0
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor.test
@@ -0,0 +1,989 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10582 sql_mode=ORACLE: explicit cursor attributes %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND
+--echo #
+
+
+--echo #
+--echo # Cursor attributes outside of an SP context
+--echo #
+
+--error ER_SP_CURSOR_MISMATCH
+SELECT c%ISOPEN;
+--error ER_SP_CURSOR_MISMATCH
+SELECT c%FOUND;
+--error ER_SP_CURSOR_MISMATCH
+SELECT c%NOTFOUND;
+--error ER_SP_CURSOR_MISMATCH
+SELECT c%ROWCOUNT;
+
+
+--echo #
+--echo # Undefinite cursor attributes
+--echo #
+
+DELIMITER $$;
+--error ER_SP_CURSOR_MISMATCH
+CREATE PROCEDURE p1
+AS
+BEGIN
+ SELECT c%ISOPEN;
+END;
+$$
+--error ER_SP_CURSOR_MISMATCH
+CREATE PROCEDURE p1
+AS
+BEGIN
+ SELECT c%ROWCOUNT;
+END;
+$$
+--error ER_SP_CURSOR_MISMATCH
+CREATE PROCEDURE p1
+AS
+BEGIN
+ SELECT c%FOUND;
+END;
+$$
+--error ER_SP_CURSOR_MISMATCH
+CREATE PROCEDURE p1
+AS
+BEGIN
+ SELECT c%NOTFOUND;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Not opened cursor attributes %FOUND, %NOTFOUND, %ROWCOUNT
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ SELECT c%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_CURSOR_NOT_OPEN
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ SELECT c%FOUND;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_CURSOR_NOT_OPEN
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ SELECT c%NOTFOUND;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_CURSOR_NOT_OPEN
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Not opened cursor attributes %FOUND, %NOTFOUND, %ROWCOUNT with INVALID_CURSOR exception
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ SELECT c%ROWCOUNT;
+EXCEPTION
+ WHEN INVALID_CURSOR THEN SELECT 'INVALID_CURSOR caught' AS msg;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ SELECT c%FOUND;
+EXCEPTION
+ WHEN INVALID_CURSOR THEN SELECT 'INVALID_CURSOR caught' AS msg;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ SELECT c%NOTFOUND;
+EXCEPTION
+ WHEN INVALID_CURSOR THEN SELECT 'INVALID_CURSOR caught' AS msg;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # print()
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+ EXPLAIN EXTENDED SELECT c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Declared data type of the attributes
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+ OPEN c;
+ CREATE TABLE t2 AS SELECT c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Core functionality
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t1 VALUES (30);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT:=0;
+ CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+ SELECT a, c%ISOPEN;
+ OPEN c;
+ /*
+ After OPEN and before FETCH:
+ - %ROWCOUNT returns 0
+ - %FOUND and %NOTFOUND return NULL
+ */
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ FETCH c INTO a;
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ FETCH c INTO a;
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ FETCH c INTO a;
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ FETCH c INTO a;
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ CLOSE c;
+ SELECT a, c%ISOPEN;
+ /*
+ After reopen and before FETCH:
+ - %ROWCOUNT returns 0
+ - %FOUND and %NOTFOUND return NULL
+ */
+ OPEN c;
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ FETCH c INTO a;
+ SELECT a, c%ISOPEN, c%ROWCOUNT, c%FOUND, c%NOTFOUND;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %NOTFOUND as a loop exit condition
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t1 VALUES (30);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT:=0;
+ CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+ OPEN c;
+ LOOP
+ FETCH c INTO a;
+ EXIT WHEN c%NOTFOUND;
+ SELECT a;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %FOUND as a loop exit condition
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+INSERT INTO t1 VALUES (30);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT:=0;
+ CURSOR c IS SELECT * FROM t1 ORDER BY a;
+BEGIN
+ OPEN c;
+ LOOP
+ FETCH c INTO a;
+ EXIT WHEN NOT c%FOUND;
+ SELECT a;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-10582 sql_mode=ORACLE: explicit cursor attributes %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND
+--echo #
+
+--echo #
+--echo # MDEV-10597 Cursors with parameters
+--echo #
+
+--echo #
+--echo # OPEN with a wrong number of parameters
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+--error ER_WRONG_PARAMCOUNT_TO_CURSOR
+CREATE PROCEDURE p1(a_a INT,a_b VARCHAR)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR c (p_a INT, p_b VARCHAR) IS SELECT * FROM t1 WHERE a=p_a;
+BEGIN
+ OPEN c(a_a);
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ DBMS_OUTPUT.PUT_LINE('Fetched a record a='||TO_CHAR(v_a)||' b='||v_b);
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
+
+
+--echo #
+--echo # Cursor parameters are not visible outside of the cursor
+--echo #
+
+DELIMITER $$;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+CREATE PROCEDURE p1(a_a INT)
+AS
+ v_a INT;
+ CURSOR c (p_a INT) IS SELECT a FROM t1 WHERE a=p_a;
+BEGIN
+ OPEN c(a_a);
+ p_a:=10;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+CREATE PROCEDURE p1(a_a INT)
+AS
+ v_a INT;
+ CURSOR c (p_a INT) IS SELECT a FROM t1 WHERE a=p_a;
+BEGIN
+ p_a:=10;
+ OPEN c(a_a);
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Cursor parameter shadowing a local variable
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+DELIMITER $$;
+CREATE PROCEDURE p1(a INT)
+AS
+ v_a INT:=NULL;
+ p_a INT:=NULL;
+ CURSOR c (p_a VARCHAR2) IS SELECT a FROM t1 WHERE p_a IS NOT NULL;
+BEGIN
+ OPEN c(a);
+ FETCH c INTO v_a;
+ IF c%NOTFOUND THEN
+ BEGIN
+ SELECT 'No records found' AS msg;
+ RETURN;
+ END;
+ END IF;
+ CLOSE c;
+ SELECT 'Fetched a record a='||v_a AS msg;
+ INSERT INTO t1 VALUES (v_a);
+END;
+$$
+DELIMITER ;$$
+CALL p1(1);
+SELECT * FROM t1;
+CALL p1(NULL);
+SELECT * FROM t1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Parameters in SELECT list
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a INT, a_b VARCHAR)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR c (p_a INT, p_b VARCHAR) IS SELECT p_a,p_b FROM DUAL;
+BEGIN
+ FOR i IN 0..1
+ LOOP
+ OPEN c(a_a + i,a_b);
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT 'Fetched a record a=' || v_a || ' b=' || v_b AS msg;
+ END LOOP;
+ CLOSE c;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1(1,'b1');
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Parameters in SELECT list + UNION
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a INT, a_b VARCHAR)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR c (p_a INT, p_b VARCHAR) IS
+ SELECT p_a,p_b FROM DUAL
+ UNION ALL
+ SELECT p_a+1,p_b||'b' FROM DUAL;
+BEGIN
+ OPEN c(a_a,a_b);
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT 'Fetched a record a=' || v_a || ' b=' || v_b AS msg;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1(1,'b1');
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Parameters in SELECT list + type conversion + warnings
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a VARCHAR)
+AS
+ v_a INT;
+ CURSOR c (p_a INT) IS SELECT p_a FROM DUAL;
+BEGIN
+ OPEN c(a_a);
+ LOOP
+ FETCH c INTO v_a;
+ EXIT WHEN c%NOTFOUND;
+ SELECT 'Fetched a record a=' || v_a AS msg;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1('1b');
+CALL p1('b1');
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # One parameter in SELECT list + subselect
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a VARCHAR)
+AS
+ v_a VARCHAR(10);
+ CURSOR c (p_a VARCHAR) IS
+ SELECT p_a FROM DUAL UNION SELECT REVERSE(p_a) FROM DUAL;
+BEGIN
+ OPEN c((SELECT a_a));
+ LOOP
+ FETCH c INTO v_a;
+ EXIT WHEN c%NOTFOUND;
+ SELECT v_a;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1('ab');
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Two parameters in SELECT list + subselect
+--echo #
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ v_a VARCHAR(10);
+ v_b VARCHAR(20);
+ CURSOR c (p_a VARCHAR, p_b VARCHAR) IS
+ SELECT p_a, p_b FROM DUAL
+ UNION
+ SELECT p_b, p_a FROM DUAL;
+BEGIN
+ OPEN c((SELECT 'aaa'),(SELECT 'bbb'));
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT v_a, v_b;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Two parameters in SELECT list + two parameters in WHERE + subselects
+--echo #
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a VARCHAR, a_b VARCHAR)
+AS
+ v_a VARCHAR(10);
+ v_b VARCHAR(20);
+ CURSOR c (value_a VARCHAR, value_b VARCHAR,
+ pattern_a VARCHAR, pattern_b VARCHAR) IS
+ SELECT value_a, value_b FROM DUAL WHERE value_a LIKE pattern_a
+ UNION
+ SELECT value_b, value_a FROM DUAL WHERE value_b LIKE pattern_b;
+BEGIN
+ OPEN c((SELECT 'aaa'),(SELECT 'bbb'),(SELECT a_a),(SELECT a_b));
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT v_a, v_b;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1('%','%');
+CALL p1('aaa','xxx');
+CALL p1('xxx','bbb');
+CALL p1('xxx','xxx');
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Parameters in SELECT list + stored function
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1 (a VARCHAR) RETURN VARCHAR
+AS
+BEGIN
+ RETURN a || 'y';
+END;
+$$
+CREATE PROCEDURE p1(a_a VARCHAR)
+AS
+ v_a VARCHAR(10);
+ v_b VARCHAR(10);
+ CURSOR c (p_sel_a VARCHAR, p_cmp_a VARCHAR) IS
+ SELECT p_sel_a, p_cmp_a FROM DUAL;
+BEGIN
+ OPEN c(f1(a_a), f1(a_a));
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT v_a;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1('x');
+# A complex expression
+CALL p1(f1(COALESCE(NULL, f1('x'))));
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # One parameter in WHERE clause
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'11');
+INSERT INTO t1 VALUES (1,'12');
+INSERT INTO t1 VALUES (2,'21');
+INSERT INTO t1 VALUES (2,'22');
+INSERT INTO t1 VALUES (3,'31');
+INSERT INTO t1 VALUES (3,'32');
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a INT)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR c (p_a INT) IS SELECT a,b FROM t1 WHERE a=p_a;
+BEGIN
+ OPEN c(a_a);
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ INSERT INTO t2 VALUES (v_a,v_b);
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1(1);
+SELECT * FROM t2;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Two parameters in WHERE clause
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'11');
+INSERT INTO t1 VALUES (1,'12');
+INSERT INTO t1 VALUES (2,'21');
+INSERT INTO t1 VALUES (2,'22');
+INSERT INTO t1 VALUES (3,'31');
+INSERT INTO t1 VALUES (3,'32');
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a INT, a_b VARCHAR)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR c (p_a INT, p_b VARCHAR) IS SELECT a,b FROM t1 WHERE a=p_a AND b=p_b;
+BEGIN
+ OPEN c(a_a, a_b);
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ INSERT INTO t2 VALUES (v_a,v_b);
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1(1,'11');
+SELECT * FROM t2;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Parameters in WHERE and HAVING clauses
+--echo #
+CREATE TABLE t1 (name VARCHAR(10), value INT);
+INSERT INTO t1 VALUES ('but',1);
+INSERT INTO t1 VALUES ('but',1);
+INSERT INTO t1 VALUES ('but',1);
+INSERT INTO t1 VALUES ('bin',1);
+INSERT INTO t1 VALUES ('bin',1);
+INSERT INTO t1 VALUES ('bot',1);
+DELIMITER $$;
+CREATE PROCEDURE p1 (arg_name_limit VARCHAR, arg_total_limit INT)
+AS
+ v_name VARCHAR(10);
+ v_total INT;
+-- +0 is needed to work around the bug MDEV-11081
+ CURSOR c(p_v INT) IS
+ SELECT name, SUM(value + p_v) + 0 AS total FROM t1
+ WHERE name LIKE arg_name_limit
+ GROUP BY name HAVING total>=arg_total_limit;
+BEGIN
+ FOR i IN 0..1
+ LOOP
+ OPEN c(i);
+ LOOP
+ FETCH c INTO v_name, v_total;
+ EXIT WHEN c%NOTFOUND;
+ SELECT v_name, v_total;
+ END LOOP;
+ CLOSE c;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1('%', 2);
+CALL p1('b_t', 0);
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # One parameter in LIMIT clause
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'b1');
+INSERT INTO t1 VALUES (2,'b2');
+INSERT INTO t1 VALUES (3,'b3');
+INSERT INTO t1 VALUES (4,'b4');
+INSERT INTO t1 VALUES (5,'b5');
+INSERT INTO t1 VALUES (6,'b6');
+DELIMITER $$;
+CREATE PROCEDURE p1(a_a INT)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR c (p_a INT) IS SELECT a,b FROM t1 ORDER BY a LIMIT p_a;
+BEGIN
+ CREATE TABLE t2 (a INT, b VARCHAR(10));
+ OPEN c(a_a);
+ LOOP
+ FETCH c INTO v_a, v_b;
+ EXIT WHEN c%NOTFOUND;
+ INSERT INTO t2 VALUES (v_a,v_b);
+ END LOOP;
+ CLOSE c;
+ SELECT * FROM t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1(1);
+CALL p1(3);
+CALL p1(6);
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # End of MDEV-10597 Cursors with parameters
+--echo #
+
+--echo #
+--echo # MDEV-12209 sql_mode=ORACLE: Syntax error in a OPEN cursor with parameters makes the server crash
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'A');
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1(a INT,b VARCHAR)
+AS
+ CURSOR c (p_a INT, p_b VARCHAR) IS SELECT * FROM t1 WHERE a=p_a;
+BEGIN
+ OPEN c(a+, b);
+ LOOP
+ FETCH c INTO a, b;
+ EXIT WHEN c%NOTFOUND;
+ SELECT a, b;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10),c DATETIME(3));
+INSERT INTO t1 VALUES (1,'b1','2001-01-01 10:20:30.123');
+INSERT INTO t1 VALUES (2,'b2','2001-01-02 10:20:30.123');
+CREATE TABLE t2 LIKE t1;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ v_a t1.a%TYPE;
+ v_b t1.b%TYPE;
+ v_c t1.c%TYPE;
+ CURSOR c IS SELECT a,b,c FROM t1;
+BEGIN
+ OPEN c;
+ LOOP
+ FETCH c INTO v_a, v_b, v_c;
+ EXIT WHEN c%NOTFOUND;
+ INSERT INTO t2 (a,b,c) VALUES (v_a, v_b, v_c);
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-12007 Allow ROW variables as a cursor FETCH target
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+INSERT INTO t1 VALUES (20,'b20');
+INSERT INTO t1 VALUES (30,'b30');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec ROW(a INT, b VARCHAR(32));
+ CURSOR c IS SELECT a,b FROM t1;
+BEGIN
+ OPEN c;
+ LOOP
+ FETCH c INTO rec;
+ EXIT WHEN c%NOTFOUND;
+ SELECT ('rec=(' || rec.a ||','|| rec.b||')') AS c;
+ END LOOP;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-12441 Variables declared after cursors with parameters lose values
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 INT:=101;
+BEGIN
+ OPEN cur(10,11);
+ CLOSE cur;
+ SELECT x0, x1;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 t1.a%TYPE:=101;
+BEGIN
+ OPEN cur(10,11);
+ CLOSE cur;
+ SELECT x0, x1;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT cp1+cp2;
+ x1 ROW(a INT,b INT):=ROW(101,102);
+BEGIN
+ OPEN cur(10,11);
+ CLOSE cur;
+ SELECT x0, x1.a, x1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'Tbl-t1.b0');
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT a,b FROM t1;
+ x1 t1%ROWTYPE:=ROW(101,'Var-x1.b0');
+BEGIN
+ SELECT x0, x1.a, x1.b;
+ OPEN cur(10,11);
+ FETCH cur INTO x1;
+ CLOSE cur;
+ SELECT x0, x1.a, x1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'Tbl-t1.b0');
+DELIMITER $$;
+CREATE PROCEDURE p1() AS
+ x0 INT:=100;
+ CURSOR cur(cp1 INT, cp2 INT) IS SELECT a,b FROM t1;
+ x1 cur%ROWTYPE:=ROW(101,'Var-x1.b0');
+BEGIN
+ SELECT x0, x1.a, x1.b;
+ OPEN cur(10,11);
+ FETCH cur INTO x1;
+ CLOSE cur;
+ SELECT x0, x1.a, x1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+--echo #
+
+--enable_metadata
+--disable_ps_protocol
+DELIMITER $$;
+DECLARE
+ CURSOR c IS SELECT 1 AS c FROM DUAL;
+BEGIN
+ OPEN c;
+ SELECT
+ c%ISOPEN,
+ c%NOTFOUND,
+ c%FOUND,
+ c%ROWCOUNT;
+ CLOSE c;
+END;
+$$
+DELIMITER ;$$
+--enable_ps_protocol
+--disable_metadata
+
+
+--echo #
+--echo # MDEV-17387 MariaDB Server giving wrong error while executing select query from procedure
+--echo #
+
+CREATE TABLE t1
+(
+ JOBN varchar(18) NOT NULL,
+ pk int(11) NOT NULL,
+ PRIMARY KEY (pk),
+ KEY (JOBN)
+);
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ lS NUMBER(10) :=0;
+ CURSOR cBPD IS SELECT * FROM t1 WHERE JOBN='x';
+BEGIN
+ FOR lbpd IN cBPD LOOP
+ lS:=lS+1;
+ END LOOP;
+EXCEPTION
+ WHEN OTHERS THEN
+ BEGIN
+ SELECT SQLERRM;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-expr.test b/mysql-test/suite/compat/oracle/t/sp-expr.test
new file mode 100644
index 00000000000..06a5c59b80c
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-expr.test
@@ -0,0 +1,165 @@
+# Testing expressions of different kinds in various parts of SP syntax
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+#
+# Subselects in SP control structures
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+DELIMITER $$;
+
+BEGIN
+ CASE ((1) IN (SELECT a FROM t1)) WHEN 1 THEN SELECT 1;
+ ELSE SELECT NULL;
+ END CASE;
+END;
+$$
+BEGIN
+ CASE (EXISTS (SELECT a FROM t1)) WHEN 1 THEN SELECT 1;
+ ELSE SELECT NULL;
+ END CASE;
+END;
+$$
+
+BEGIN
+ IF ((1) IN (SELECT a FROM t1)) THEN SELECT 1;
+ ELSE SELECT NULL;
+ END IF;
+END;
+$$
+BEGIN
+ IF (EXISTS (SELECT a FROM t1)) THEN SELECT 1;
+ ELSE SELECT NULL;
+ END IF;
+END;
+$$
+
+BEGIN
+ WHILE ((1234) IN (SELECT * FROM t1)) LOOP
+ SELECT 1;
+ END LOOP;
+END;
+$$
+BEGIN
+ WHILE (EXISTS (SELECT * FROM t1 WHERE a=1234)) LOOP
+ SELECT 1;
+ END LOOP;
+END;
+$$
+
+BEGIN
+ REPEAT
+ SELECT 1;
+ UNTIL (1 IN (SELECT * FROM t1))
+ END REPEAT;
+END;
+$$
+BEGIN
+ REPEAT
+ SELECT 1;
+ UNTIL EXISTS (SELECT * FROM t1 WHERE a=1)
+ END REPEAT;
+END;
+$$
+
+BEGIN
+ FOR i IN 0..(1 IN (SELECT * FROM t1))
+ LOOP
+ SELECT i;
+ END LOOP;
+END;
+$$
+BEGIN
+ FOR i IN 0..EXISTS (SELECT * FROM t1 WHERE a=1)
+ LOOP
+ SELECT i;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
+
+
+#
+# Subselects as SP variable default values
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+DECLARE
+ a INT DEFAULT ((10) IN (SELECT * FROM t1));
+BEGIN
+ SELECT a;
+END;
+$$
+DECLARE
+ a INT DEFAULT EXISTS (SELECT * FROM t1);
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
+
+
+#
+# Subselects SP function return values
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT AS
+BEGIN
+ RETURN ((1) IN (SELECT * FROM t1));
+END;
+$$
+CREATE FUNCTION f2() RETURN INT AS
+BEGIN
+ RETURN EXISTS (SELECT * FROM t1 WHERE a=1);
+END;
+$$
+DELIMITER ;$$
+SELECT f1();
+SELECT f2();
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+
+
+#
+# Subselects in CURSOR parameters
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+DELIMITER $$;
+DECLARE
+ va INT;
+ CURSOR cur(amin INT) IS SELECT a FROM t1 WHERE a>amin ORDER BY a;
+BEGIN
+ OPEN cur(1 IN (SELECT * FROM t1));
+ FETCH cur INTO va;
+ SELECT va;
+ CLOSE cur;
+END;
+$$
+DECLARE
+ va INT;
+ CURSOR cur(amin INT) IS SELECT a FROM t1 WHERE a>amin ORDER BY a;
+BEGIN
+ OPEN cur(EXISTS (SELECT * FROM t1));
+ FETCH cur INTO va;
+ SELECT va;
+ CLOSE cur;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-goto-debug.test b/mysql-test/suite/compat/oracle/t/sp-goto-debug.test
new file mode 100644
index 00000000000..0ded370b17a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-goto-debug.test
@@ -0,0 +1,178 @@
+-- source include/have_debug.inc
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-20667 Server crash on pop_cursor
+--echo #
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ GOTO iac_err;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+ BEGIN
+ SELECT 'cur2';
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+ BEGIN
+ SELECT 'cur3';
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+ BEGIN
+ SELECT 'cur4';
+ GOTO ret;
+ END;
+ END IF;
+ GOTO ret;
+ END;
+ END IF;
+ GOTO ret;
+ END;
+ END IF;
+<<ret>>
+ RETURN;
+END;
+//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1(lab VARCHAR(32)) IS
+BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+ BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+ BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+ BEGIN
+ IF lab = 'cur4' THEN
+ SELECT 'goto from cur4' AS comment;
+ GOTO ret;
+ END IF;
+ END;
+ END IF;
+ IF lab = 'cur3' THEN
+ SELECT 'goto from cur3' AS comment;
+ GOTO ret;
+ END IF;
+ END;
+ END IF;
+ IF lab = 'cur2' THEN
+ SELECT 'goto from cur2' AS comment;
+ GOTO ret;
+ END IF;
+ END;
+ END IF;
+<<ret>>
+ RETURN;
+END;
+//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+CALL p1('');
+CALL p1('cur2');
+CALL p1('cur3');
+CALL p1('cur4');
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<<iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-goto.test b/mysql-test/suite/compat/oracle/t/sp-goto.test
new file mode 100644
index 00000000000..9c15d10b3de
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-goto.test
@@ -0,0 +1,968 @@
+set sql_mode=oracle;
+--echo #
+--echo # MDEV-10697 sql_mode=ORACLE: GOTO statement
+--echo #
+
+--echo # matrice of tests in procedure
+--echo # |--------------------------------------------------------
+--echo # | | Same | Outside | to sub | No |
+--echo # | | block | one block | block | matching |
+--echo # | | | | | label |
+--echo # |--------------------------------------------------------
+--echo # | Forward jump | F1 | F3 | F5 | F7 |
+--echo # |--------------------------------------------------------
+--echo # | Backward jump | F2 | F4 | F6 | F8 |
+--echo # |--------------------------------------------------------
+--echo # Jump from handler to outside handling code block : F9
+--echo # Jump from handler to handling code block : F10 (forbidden)
+--echo # Jump inside handler : F21
+--echo # Jump between handler : F22 (forbidden)
+--echo # Jump from cascaded block with handler : F11
+--echo # Duplicate label in same block : F12 (forbidden)
+--echo # Duplicate label in different block : F13
+--echo # Jump outside unlabeled block : F14
+--echo # Jump inside/outside labeled block : F15
+--echo # Jump from if / else : F16
+--echo # Jump with cursors : F17
+--echo # Jump outside case : F18
+--echo # Jump inside/outside case block : F19
+--echo # Jump outside labeled loop : F20
+--echo # Jump (continue) labeled loop : F23
+--echo # Two consecutive label : P24
+--echo # Two consecutive label (backward and forward jump) : P25
+--echo # Two consecutive label, continue to wrong label : P26
+--echo # Consecutive goto label and block label : P27
+
+--echo # Test in function
+--echo # backward jump : func1
+--echo # forward jump : func2
+
+--echo # Test in trigger
+--echo # forward jump : trg1
+
+--echo #
+--echo # Forward jump in same block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f1(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ p2:='a';
+ goto lab1;
+<<lab1>>
+ goto lab2;
+ p2:='b';
+<<lab2>>
+ return ;
+END;
+$$
+
+DELIMITER ;$$
+call f1(@wp1);
+select 'f1',@wp1;
+DROP PROCEDURE f1;
+
+--echo #
+--echo # Backward jump in same block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f2(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ p2:='a';
+<<lab1>>
+ if (p2='b') then
+ return ;
+ end if;
+ p2:='b';
+ goto lab1;
+END;
+$$
+DELIMITER ;$$
+call f2(@wp1);
+select 'f2',@wp1;
+DROP PROCEDURE f2;
+
+--echo #
+--echo # Forward jump outside one block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f3(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ p2:='a';
+ if (p2='a') then
+ goto lab1;
+ end if;
+ p2:='c';
+<<lab1>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+call f3(@wp1);
+select 'f3',@wp1;
+DROP PROCEDURE f3;
+
+--echo #
+--echo # Backward jump outside one block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f4(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ p2:='a';
+<<lab1>>
+ if (p2='a') then
+ p2:=p2||'b';
+ goto lab1;
+ end if;
+ if (p2='ab') then
+ p2:=p2||'c';
+ end if;
+ return ;
+END;
+$$
+DELIMITER ;$$
+call f4(@wp1);
+select 'f4',@wp1;
+DROP PROCEDURE f4;
+
+DELIMITER $$;
+--echo #
+--echo # Forward jump inside sub block
+--error ER_SP_LILABEL_MISMATCH
+CREATE or replace procedure f5(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ p2:='a';
+goto lab5 ;
+ if (p2='a') then
+<<lab5>>
+ p2:=p2||'b';
+ end if;
+ return ;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--echo #
+--echo # Backward jump inside sub block
+--error ER_SP_LILABEL_MISMATCH
+CREATE or replace procedure f6(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ p2:='a';
+ if (p2='a') then
+<<lab6>>
+ p2:=p2||'b';
+ return ;
+ end if;
+goto lab6 ;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--echo #
+--echo # Backward jump - missing label
+--error ER_SP_LILABEL_MISMATCH
+CREATE or replace procedure f7(p2 IN OUT VARCHAR)
+AS
+BEGIN
+<<lab>>
+ goto lab7 ;
+ return ;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--echo #
+--echo # Forward jump - missing label
+--error ER_SP_LILABEL_MISMATCH
+CREATE or replace procedure f8(p2 IN OUT VARCHAR)
+AS
+BEGIN
+ goto lab8 ;
+<<lab>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # Jump from handler to procedure code
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f9(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+<<lab9>>
+ if lim=-1 then
+ res:=res||' -- goto end limit -1 --';
+ goto lab9_end;
+ end if;
+
+ begin
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ begin
+ res:=res||'--- too_many_rows cought ---';
+ lim:=0;
+ goto lab9;
+ end;
+ WHEN NO_DATA_FOUND THEN
+ begin
+ res:=res||'--- no_data_found cought ---';
+ lim:=-1;
+ goto lab9;
+ end;
+ end;
+ res:=res||'error';
+<<lab9_end>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f9(2, @res);
+SELECT 'f9',@res;
+CALL f9(0, @res);
+SELECT 'f9',@res;
+DROP PROCEDURE f9;
+
+DELIMITER $$;
+--echo #
+--echo # Jump from handler to handling bloc
+--error ER_SP_LILABEL_MISMATCH
+CREATE or replace procedure f10(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ begin
+<<lab10>>
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ begin
+ res:='--- too_many_rows cought ---';
+ goto lab10;
+ end;
+ WHEN NO_DATA_FOUND THEN res:='--- no_data_found cought ---';
+ end;
+ return ;
+END;
+$$
+
+--echo #
+--echo # Jump from cascaded block with handler
+--echo #
+CREATE or replace procedure f11(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+<<lab11a>>
+ begin
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ begin
+ res:=res||'--- too_many_rows cought 1 ---';
+ goto lab11b;
+ end;
+ WHEN NO_DATA_FOUND THEN
+ begin
+ res:=res||'--- no_data_found cought 1 ---';
+ lim:=2;
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ begin
+ res:=res||'--- too_many_rows cought 2 ---';
+ goto lab11a;
+ end;
+ WHEN NO_DATA_FOUND THEN res:='--- no_data_found cought 2 ---';
+ end;
+ end;
+ set res:=res||' error ';
+<<lab11b>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f11(0, @res);
+SELECT 'f11',@res;
+DROP PROCEDURE f11;
+
+DELIMITER $$;
+--echo #
+--echo # Jump inside handler
+--echo #
+CREATE or replace procedure f21(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ begin
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ begin
+ <<retry>>
+ lim:=lim-1;
+ loop
+ begin
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ begin
+ lim:=lim-1;
+ goto retry;
+ end;
+ end;
+ exit ;
+ end loop;
+ end;
+ end;
+ res:=lim;
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f21(10, @res);
+SELECT 'f21',@res;
+drop procedure f21;
+
+DELIMITER $$;
+--echo #
+--echo # Jump beetween handler
+--error ER_SP_LILABEL_MISMATCH
+CREATE or replace procedure f22(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ res:='ok';
+ begin
+ SELECT a INTO a FROM information_schema.tables LIMIT lim;
+ EXCEPTION
+ WHEN TOO_MANY_ROWS THEN
+ goto nodata ;
+ WHEN NO_DATA_FOUND THEN
+ begin
+<<nodata>>
+ res:='error';
+ end;
+ end;
+ return ;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--echo #
+--echo # Duplicate label in same bloc
+--error 1309
+CREATE or replace procedure f12(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+<<lab12>>
+ res:='error';
+<<lab12>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # Duplicate label in different block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f13(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ a:=0;
+<<lab13>>
+ a:=a+1;
+ begin
+ <<lab13>>
+ a:=a+1;
+ if (a<10) then
+ goto lab13;
+ end if;
+ end;
+ res:=a;
+ if (a=10) then
+ goto lab13;
+ end if;
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f13(0, @res);
+SELECT 'f13',@res;
+DROP PROCEDURE f13;
+
+
+--echo #
+--echo # Jump outside unlabeled block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f14(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ a:=0;
+ loop
+ a:=a+1;
+ if (a<10) then
+ continue;
+ end if;
+ if (a>=lim) then
+ goto lab14;
+ end if;
+ if (a>=20) then
+ exit;
+ end if;
+ end loop;
+<<lab14>>
+ res:=a;
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f14(15, @res);
+SELECT 'f14',@res;
+CALL f14(8, @res);
+SELECT 'f14',@res;
+CALL f14(25, @res);
+SELECT 'f14',@res;
+DROP PROCEDURE f14;
+
+--echo #
+--echo # Jump inside/outside labeled block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f15(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ a:=0;
+ <<looplabel>> loop
+ <<beginlooplabel>>
+ a:=a+1;
+ if (a<10) then
+ continue looplabel;
+ end if;
+ if (a>=lim) then
+ goto lab15;
+ end if;
+ if (a>=20) then
+ exit looplabel;
+ end if;
+ goto beginlooplabel;
+ end loop;
+<<lab15>>
+ res:=a;
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f15(15, @res);
+SELECT 'f15',@res;
+CALL f15(8, @res);
+SELECT 'f15',@res;
+CALL f15(25, @res);
+SELECT 'f15',@res;
+DROP PROCEDURE f15;
+
+--echo #
+--echo # Jump from if / else
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f16(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ if (lim<10) then
+ goto lab16_1;
+ else
+ goto lab16_2;
+ end if;
+<<lab16_1>>
+ res:='if lab16_1';
+ goto lab16_3;
+<<lab16_2>>
+ res:='else lab16_2';
+ goto lab16_3;
+ res:='error lab16_3';
+<<lab16_3>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f16(15, @res);
+SELECT 'f16',@res;
+CALL f16(8, @res);
+SELECT 'f16',@res;
+DROP PROCEDURE f16;
+
+--echo #
+--echo # Jump with cursors
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f17(lim INT, res OUT VARCHAR)
+AS
+ v_a INT;
+ v_b VARCHAR(10);
+ CURSOR cur1 IS SELECT 1 FROM dual where 1=2;
+BEGIN
+ OPEN cur1;
+ LOOP
+ FETCH cur1 INTO v_a;
+ EXIT WHEN cur1%NOTFOUND;
+ END LOOP;
+ CLOSE cur1;
+ <<lab17>>
+ lim:=lim-1;
+ begin
+ declare
+ CURSOR cur1 IS SELECT 1 FROM dual;
+ CURSOR cur2 IS SELECT 1 FROM dual where 1=2;
+ begin
+ LOOP
+ OPEN cur1;
+ FETCH cur1 INTO v_a;
+ EXIT WHEN cur1%NOTFOUND;
+ res:=res||'-'||lim ;
+ close cur1;
+ if (lim>0) then
+ goto lab17;
+ else
+ goto lab17_end;
+ end if;
+ END LOOP;
+ end;
+ <<lab17_end>>
+ null;
+ end;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f17(5, @res);
+SELECT 'f17',@res;
+DROP PROCEDURE f17;
+
+--echo #
+--echo # Jump outside case
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f18(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ case lim
+ when 1 then
+ res:='case branch 18_1';
+ goto lab18_1;
+ res:='error';
+ when 2 then
+ res:='case branch 18_2';
+ goto lab18_2;
+ res:='error';
+ else
+ res:='default branch 18';
+ end case;
+<<lab18_1>>
+ null;
+<<lab18_2>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f18(0, @res);
+SELECT 'f18',@res;
+CALL f18(1, @res);
+SELECT 'f18',@res;
+CALL f18(2, @res);
+SELECT 'f18',@res;
+DROP PROCEDURE f18;
+
+--echo #
+--echo # Jump inside/outside case block
+--echo #
+DELIMITER $$;
+CREATE or replace procedure f19(lim INT, res OUT VARCHAR)
+AS
+ a INT;
+BEGIN
+ a:=1;
+ case lim
+ when 1 then
+<<lab19_0>>
+ a:=a+1;
+ if (a<10) then
+ goto lab19_0;
+ else
+ goto lab19_1;
+ end if;
+ res:='case branch 19_1';
+ else
+ res:='default branch 18';
+ end case;
+ goto lab19_end;
+<<lab19_1>>
+ res:=a;
+<<lab19_end>>
+ return ;
+END;
+$$
+DELIMITER ;$$
+SET @res='';
+CALL f19(1, @res);
+SELECT 'f19',@res;
+DROP PROCEDURE f19;
+
+DELIMITER $$;
+--echo #
+--echo # Jump outside labeled loop
+--echo #
+CREATE OR REPLACE PROCEDURE f20(res OUT VARCHAR)
+AS
+ a INT := 1;
+BEGIN
+ <<lab>>
+ FOR i IN a..10 LOOP
+ IF i = 5 THEN
+ a:= a+1;
+ goto lab;
+ END IF;
+ END LOOP;
+ res:=a;
+END;
+$$
+DELIMITER ;$$
+CALL f20(@res);
+SELECT 'f20',@res;
+DROP PROCEDURE f20;
+
+DELIMITER $$;
+--echo #
+--echo # Jump (continue) labeled loop
+--echo #
+CREATE OR REPLACE PROCEDURE f23(res OUT VARCHAR)
+AS
+ a INT := 1;
+BEGIN
+ <<lab>>
+ FOR i IN a..10 LOOP
+ IF i = 5 THEN
+ a:= a+1;
+ continue lab;
+ END IF;
+ END LOOP;
+ res:=a;
+END;
+$$
+DELIMITER ;$$
+CALL f23(@res);
+SELECT 'f23',@res;
+DROP PROCEDURE f23;
+
+DELIMITER $$;
+--echo #
+--echo # Two consecutive label (backward jump)
+--echo #
+CREATE OR REPLACE PROCEDURE p24(action IN INT, res OUT varchar) AS
+ a integer;
+BEGIN
+ <<lab1>>
+ <<lab2>>
+ if (action = 1) then
+ res:=res||' '||action;
+ action:=2;
+ goto lab1;
+ end if;
+ if (action = 2) then
+ res:=res||' '||action;
+ action:=3;
+ goto lab2;
+ end if;
+END;
+$$
+DELIMITER ;$$
+call p24(1,@res);
+select 'p24',@res;
+DROP PROCEDURE p24;
+
+DELIMITER $$;
+--echo #
+--echo # Two consecutive label (backward and forward jump)
+--echo #
+CREATE OR REPLACE PROCEDURE p25(action IN INT, res OUT varchar) AS
+ a integer;
+BEGIN
+ if (action = 1) then
+ res:=res||' '||action;
+ action:=2;
+ goto lab2;
+ end if;
+ goto lab_end;
+ <<lab1>>
+ <<lab2>>
+ res:=res||' '||action;
+ if (action = 2) then
+ res:=res||' '||action;
+ action:=3;
+ goto lab1;
+ end if;
+<<lab_end>>
+ null;
+END;
+$$
+DELIMITER ;$$
+call p25(1,@res);
+select 'p25',@res;
+DROP PROCEDURE p25;
+
+
+DELIMITER $$;
+--echo #
+--echo # Two consecutive label, continue to wrong label
+--error ER_SP_LILABEL_MISMATCH
+CREATE OR REPLACE PROCEDURE p26(action IN INT, res OUT varchar) AS
+BEGIN
+ <<lab1>>
+ <<lab2>>
+ FOR i IN 1..10 LOOP
+ continue lab1;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--echo #
+--echo # Consecutive goto label and block label
+--echo #
+CREATE OR REPLACE PROCEDURE p27(action IN INT, res OUT varchar) AS
+BEGIN
+ res:='';
+ <<lab1>>
+ <<lab2>>
+ FOR i IN 1..10 LOOP
+ if (action = 1) then
+ res:=res||' '||action||'-'||i;
+ action:=2;
+ continue lab2;
+ end if;
+ if (action = 2) then
+ res:=res||' '||action||'-'||i;
+ action:='3';
+ goto lab2;
+ end if;
+ if (action = 3) then
+ res:=res||' '||action||'-'||i;
+ action:='4';
+ goto lab1;
+ end if;
+ if (action = 4) then
+ res:=res||' '||action||'-'||i;
+ exit lab2;
+ end if;
+ END LOOP;
+END;
+$$
+
+DELIMITER ;$$
+call p27(1,@res);
+select 'p27',@res;
+DROP PROCEDURE p27;
+
+--echo # ----------------------
+--echo # -- TEST IN FUNCTION --
+--echo # ----------------------
+
+--echo #
+--echo # FUNCTION : Backward jump
+--echo #
+DELIMITER $$;
+CREATE or replace function func1()
+return varchar
+AS
+ p2 varchar(10);
+BEGIN
+ p2:='a';
+<<lab1>>
+ if (p2='a') then
+ p2:=p2||'b';
+ goto lab1;
+ end if;
+ if (p2='ab') then
+ p2:=p2||'c';
+ end if;
+ return p2;
+END;
+$$
+DELIMITER ;$$
+select 'func1',func1();
+DROP function func1;
+
+--echo #
+--echo # FUNCTION : forward jump
+--echo #
+DELIMITER $$;
+CREATE or replace function func2()
+return varchar
+AS
+ p2 varchar(10);
+BEGIN
+ p2:='a';
+ if (p2='a') then
+ goto lab1;
+ end if;
+ p2:='b';
+<<lab1>>
+ return p2;
+END;
+$$
+DELIMITER ;$$
+select 'func2',func2();
+DROP function func2;
+
+--echo # ---------------------
+--echo # -- TEST IN TRIGGER --
+--echo # ---------------------
+
+--echo #
+--echo # TRIGGER : forward jump
+--echo #
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ IF :NEW.a IS NULL
+ THEN
+ :NEW.a:= 15;
+ goto end_trg;
+ END IF;
+ :NEW.a:= 10;
+<<end_trg>>
+ null;
+END;
+$$
+DELIMITER ;$$
+insert into t1 values (1);
+insert into t1 values (null);
+SELECT * FROM t1;
+DROP TRIGGER trg1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-20667 Server crash on pop_cursor
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(6));
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ GOTO iac_err;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<<iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-code.test b/mysql-test/suite/compat/oracle/t/sp-package-code.test
new file mode 100644
index 00000000000..9cca53964ec
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-code.test
@@ -0,0 +1,182 @@
+-- source include/have_debug.inc
+
+SET sql_mode=ORACLE;
+
+
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p2show;
+ PROCEDURE p2public;
+ FUNCTION f2public RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ a INT:=10;
+ PROCEDURE p1 AS
+ b INT:=20;
+ BEGIN
+ b:=a;
+ b:=a+1;
+ a:=b;
+ a:=b+1;
+ a:=a+1;
+ SET @a:=@a+2;
+ SELECT f1() FROM DUAL;
+ END;
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN a;
+ END;
+ PROCEDURE p2private AS
+ BEGIN
+ SELECT 'This is p2private';
+ END;
+ PROCEDURE p2public AS
+ BEGIN
+ SELECT 'This is p2public';
+ END;
+ FUNCTION f2private RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f2private';
+ END;
+ FUNCTION f2public RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f2public';
+ END;
+ PROCEDURE p2show AS
+ BEGIN
+ SHOW FUNCTION CODE f2public;
+ SHOW FUNCTION CODE f2private;
+ SHOW PROCEDURE CODE p2public;
+ SHOW PROCEDURE CODE p2private;
+ SHOW PROCEDURE CODE p2show;
+ END;
+BEGIN
+ a:=a+1;
+ DECLARE
+ b INT;
+ BEGIN
+ b:=a;
+ b:=a+1;
+ a:=b;
+ a:=b+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW FUNCTION CODE pkg1.f1;
+SHOW PACKAGE BODY CODE pkg1;
+CALL pkg1.p2show;
+
+DROP PACKAGE pkg1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ a t1.a%TYPE:=10;
+ PROCEDURE p1 AS
+ b t1.a%TYPE:=20;
+ BEGIN
+ b:=a;
+ b:=a+1;
+ b:=b+1;
+ a:=b;
+ a:=b+1;
+ a:=a+1;
+ END;
+BEGIN
+ a:=a+1;
+ DECLARE
+ b t1.a%TYPE;
+ BEGIN
+ b:=a;
+ b:=a+1;
+ a:=b;
+ a:=b+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+
+
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ a ROW(a INT,b TEXT):=ROW(10,'x10');
+ PROCEDURE p1 AS
+ b ROW(a INT,b TEXT):=ROW(20,'x20');
+ BEGIN
+ b:=a;
+ a:=b;
+ b.a:=a.a+1;
+ a.a:=b.a+1;
+ a.a:=a.a+1;
+ END;
+BEGIN
+ a.a:=a.a+1;
+ DECLARE
+ b ROW(a INT,b TEXT):=ROW(30,'x30');
+ BEGIN
+ b:=a;
+ b.a:=a.a+1;
+ a:=b;
+ a.a:=b.a+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+
+
+CREATE TABLE t1 (a INT, b TEXT);
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ a t1%ROWTYPE:=ROW(10,'x10');
+ PROCEDURE p1 AS
+ b t1%ROWTYPE:=ROW(20,'x20');
+ BEGIN
+ b:=a;
+ a:=b;
+ b.a:=a.a+1;
+ a.a:=b.a+1;
+ a.a:=a.a+1;
+ END;
+BEGIN
+ a.a:=a.a+1;
+ DECLARE
+ b t1%ROWTYPE:=ROW(30,'x30');
+ BEGIN
+ b:=a;
+ b.a:=a.a+1;
+ a:=b;
+ a.a:=b.a+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-db.test b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-db.test
new file mode 100644
index 00000000000..0528e6cbfcd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-db.test
@@ -0,0 +1,6 @@
+--echo #
+--echo # MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+--echo #
+
+SET @object_type='db';
+--source sp-package-concurrent-dml.inc
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-package.test b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-package.test
new file mode 100644
index 00000000000..0f1a0ef3975
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-package.test
@@ -0,0 +1,10 @@
+--echo #
+--echo # MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+--echo #
+
+SET @object_type='package_replace_pkg1';
+--source sp-package-concurrent-dml.inc
+
+SET @object_type='package_body_replace_pkg1';
+--source sp-package-concurrent-dml.inc
+
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-trigger.test b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-trigger.test
new file mode 100644
index 00000000000..09ba1d70142
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-trigger.test
@@ -0,0 +1,6 @@
+--echo #
+--echo # MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+--echo #
+
+SET @object_type='trigger';
+--source sp-package-concurrent-dml.inc
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-view.test b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-view.test
new file mode 100644
index 00000000000..d2c2041a353
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml-view.test
@@ -0,0 +1,6 @@
+--echo #
+--echo # MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+--echo #
+
+SET @object_type='view';
+--source sp-package-concurrent-dml.inc
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml.inc b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml.inc
new file mode 100644
index 00000000000..8ee96d1ee6a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-concurrent-dml.inc
@@ -0,0 +1,107 @@
+--echo #
+--echo # Start of sp-package-concurrent-dml.inc
+--echo #
+
+--source include/count_sessions.inc
+
+let $object_type= `SELECT @object_type`;
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p2 AS
+ BEGIN
+ SELECT 'This is p2' AS msg;
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 'This is p1' AS msg;
+ DO GET_LOCK('mdev15070',120);
+ CALL p2();
+ DO RELEASE_LOCK('mdev15070');
+ END;
+END;
+$$
+DELIMITER ;$$
+
+connect (con2,localhost,root);
+connection con2;
+DO GET_LOCK('mdev15070', 120);
+
+connection default;
+send CALL pkg1.p1;
+
+connection con2;
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE state = "User lock" AND info LIKE "%GET_LOCK%mdev15070%";
+--source include/wait_condition.inc
+
+
+if ($object_type==view)
+{
+ CREATE VIEW v1 AS SELECT 1 AS c;
+ DROP VIEW v1;
+}
+
+
+if ($object_type==package_replace_pkg1)
+{
+ SET sql_mode=ORACLE;
+ DELIMITER $$;
+ CREATE OR REPLACE PACKAGE pkg1 AS
+ PROCEDURE p1;
+ END;
+ $$
+ DELIMITER ;$$
+ DROP PACKAGE pkg1;
+}
+
+
+if ($object_type==package_body_replace_pkg1)
+{
+ SET sql_mode=ORACLE;
+ DELIMITER $$;
+ CREATE OR REPLACE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 'This is p1 version 2' AS msg;
+ END;
+ END;
+ $$
+ DELIMITER ;$$
+ DROP PACKAGE pkg1;
+}
+
+
+if ($object_type==trigger)
+{
+ CREATE TABLE t1 (a INT);
+ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1;
+ DROP TRIGGER tr1;
+ DROP TABLE t1;
+}
+
+
+if ($object_type=='db')
+{
+ CREATE DATABASE test1;
+ CREATE FUNCTION test1.f1() RETURNS INT RETURN 10;
+ DROP DATABASE test1;
+}
+
+
+DO RELEASE_LOCK('mdev15070');
+
+disconnect con2;
+
+connection default;
+reap;
+
+DROP PACKAGE IF EXISTS pkg1;
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-innodb.test b/mysql-test/suite/compat/oracle/t/sp-package-innodb.test
new file mode 100644
index 00000000000..f4cd05b7112
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-innodb.test
@@ -0,0 +1,62 @@
+-- source include/have_innodb.inc
+
+SET default_storage_engine=InnoDB;
+
+SET sql_mode=ORACLE;
+
+CREATE TABLE t1 (a INT, routine TEXT);
+SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (10,'none');
+
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ a INT;
+ PROCEDURE p1 AS
+ BEGIN
+ a:=a+1;
+ INSERT INTO t1 VALUES (a,'p1');
+ END;
+BEGIN
+ SELECT MAX(t1.a) FROM t1 INTO a;
+ a:=a+1;
+ INSERT INTO t1 VALUES (a,'pkg1 initialization');
+END;
+$$
+DELIMITER ;$$
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+DELETE FROM t1;
+
+--source sp-cache-invalidate.inc
+START TRANSACTION;
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+DELETE FROM t1;
+
+--source sp-cache-invalidate.inc
+INSERT INTO t1 VALUES (20,'none');
+START TRANSACTION;
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+DELETE FROM t1;
+
+--source sp-cache-invalidate.inc
+INSERT INTO t1 VALUES (20,'none');
+START TRANSACTION;
+CALL pkg1.p1;
+SELECT * FROM t1 ORDER BY a;
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+DELETE FROM t1;
+
+DROP PACKAGE pkg1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-mdl.test b/mysql-test/suite/compat/oracle/t/sp-package-mdl.test
new file mode 100644
index 00000000000..de4f7aaabad
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-mdl.test
@@ -0,0 +1,110 @@
+--source include/have_metadata_lock_info.inc
+
+#
+# This test demonstrates that:
+# - A call to a package routine acquires a shared MDL lock on the entire package
+# - "DROP PACKAGE" waits until the currently running package routines end
+#
+
+SET sql_mode=ORACLE;
+DO GET_LOCK('lock',300);
+
+
+#
+# conn1 will execute package pkg1 routines and
+# and therefore acquire a shared MDL on "package body pkg1"
+#
+
+connect (conn1,localhost,root,,);
+SET sql_mode=ORACLE;
+let $conn1_id= `SELECT CONNECTION_ID()`;
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ DO GET_LOCK('lock',300);
+ END;
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ CALL p1;
+ RETURN 1;
+ END;
+END;
+$$
+DELIMITER ;$$
+send SELECT pkg1.f1();
+
+#
+# wait for conn1 to actually start execution of pkg1.p1
+#
+
+connection default;
+let $wait_timeout= 60;
+let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE ID=$conn1_id AND INFO LIKE '%GET_LOCK%' AND STATE='User lock';
+--source include/wait_condition.inc
+
+
+#
+# conn2 will do "DROP PACKAGE pkg1".
+# It will acquire an exclusive MDL on "package body pkg1", and therefore
+# it should wait until conn1 ends the package routine execution
+#
+
+connect (conn2,localhost,root,,);
+let $conn2_id= `SELECT CONNECTION_ID()`;
+SET sql_mode=ORACLE;
+send DROP PACKAGE pkg1;
+
+#
+# wait for conn2 to actually enter the "DROP" statement and get locked by conn1
+#
+connection default;
+let $wait_timeout= 60;
+let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE ID=$conn2_id
+ AND INFO LIKE '%DROP PACKAGE%'
+ AND STATE='Waiting for stored package body metadata lock';
+--source include/wait_condition.inc
+
+#
+# Now we have three threads involved.
+# The following I_S query will check that the threads are in these states:
+#
+# default (0) - is holding a user lock 'lock'
+# conn1 (1) - is executing the package procedure test.pkg1.p1,
+# is holding a shared MDL on 'package body pkg1',
+# is waiting for the user lock 'lock' to be released
+# conn2 (2) - is waiting for 'conn1' to end execution of test.pkg1.* routines,
+# to acquire an exclusive MDL on 'package body pkg1',
+# to DROP the package pkg1
+#
+--vertical_results
+SELECT ID-CONNECTION_ID() AS CONN,INFO,STATE,LOCK_MODE,LOCK_TYPE,TABLE_NAME
+ FROM INFORMATION_SCHEMA.PROCESSLIST
+ LEFT JOIN INFORMATION_SCHEMA.METADATA_LOCK_INFO
+ ON (ID=THREAD_ID)
+ ORDER BY ID,TABLE_NAME,LOCK_MODE,LOCK_TYPE;
+--horizontal_results
+
+#
+# Now let conn1 finish the package routine execution
+#
+DO RELEASE_LOCK('lock');
+connection conn1;
+reap;
+disconnect conn1;
+
+#
+# Now conn2 should actually DROP the package
+#
+connection conn2;
+reap;
+disconnect conn2;
+
+connection default;
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-mysqldump.test b/mysql-test/suite/compat/oracle/t/sp-package-mysqldump.test
new file mode 100644
index 00000000000..c4e4b2a1598
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-mysqldump.test
@@ -0,0 +1,94 @@
+--source include/have_utf8mb4.inc
+--source include/not_embedded.inc
+
+SET sql_mode=ORACLE;
+
+#
+# Create a standalone procedure test.p1 and a package pkg1.
+# The standalone routine test.p1 and the package routines call each other.
+#
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ SELECT pkg1.f1(); -- a standalone routine calls a package routine
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ CALL test.p1; -- a package routine calls a standalone routine
+ END;
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN 10;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+CALL p1;
+CALL pkg1.p1;
+SELECT pkg1.f1();
+
+
+#
+# Create specifications for one more package, without a BODY
+#
+DELIMITER $$;
+CREATE PACKAGE pkg2 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+
+--exec $MYSQL_DUMP --skip-comments --routines --default-character-set=utf8mb4 test
+--exec $MYSQL_DUMP --skip-comments --routines --xml test
+
+let $dump = $MYSQLTEST_VARDIR/tmp/sp-package-mysqldump.sql;
+
+--exec $MYSQL_DUMP --compact --routines test > $dump
+
+DROP PACKAGE pkg1;
+DROP PACKAGE pkg2;
+DROP PROCEDURE p1;
+
+--exec $MYSQL test < $dump
+
+--vertical_results
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+SHOW PACKAGE STATUS;
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+SHOW PACKAGE BODY STATUS;
+--horizontal_results
+
+SHOW CREATE PACKAGE pkg1;
+SHOW CREATE PACKAGE pkg2;
+SHOW CREATE PACKAGE BODY pkg1;
+
+CALL p1;
+CALL pkg1.p1;
+SELECT pkg1.f1();
+
+DROP PACKAGE pkg1;
+DROP PACKAGE pkg2;
+DROP PROCEDURE p1;
+
+--echo # removing the dump file
+--error 0,1
+--remove_file $dump
diff --git a/mysql-test/suite/compat/oracle/t/sp-package-security.test b/mysql-test/suite/compat/oracle/t/sp-package-security.test
new file mode 100644
index 00000000000..583f70afe14
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package-security.test
@@ -0,0 +1,332 @@
+--source include/not_embedded.inc
+--source include/default_charset.inc
+
+SET sql_mode=ORACLE;
+
+CREATE DATABASE db1;
+CREATE USER u1@localhost IDENTIFIED BY '';
+GRANT SELECT ON db1.* TO u1@localhost;
+
+connect (conn1,localhost,u1,,db1);
+SELECT CURRENT_USER;
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # User u1 cannot drop PROCEDURE, PACKAGE, PACKAGE BODY by default
+--echo #
+
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PROCEDURE p1;
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PACKAGE pkg1;
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PACKAGE BODY pkg1;
+
+--echo #
+--echo # User u1 cannot create PROCEDURE, PACKAGE, PACKAGE BODY by default
+--echo #
+
+DELIMITER $$;
+--error ER_DBACCESS_DENIED_ERROR
+CREATE PROCEDURE p1 AS
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_DBACCESS_DENIED_ERROR
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+DELIMITER ;$$
+
+# TODO: this should probably return ER_DBACCESS_DENIED_ERROR
+DELIMITER $$;
+--error ER_SP_DOES_NOT_EXIST
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Now create a PACKAGE by root
+--echo #
+
+connection default;
+USE db1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1root AS
+BEGIN
+ SELECT 1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+DELIMITER ;$$
+SHOW CREATE PACKAGE pkg1;
+
+--echo #
+--echo # u1 cannot SHOW yet:
+--echo # - the standalone procedure earlier created by root
+--echo # - the package specifications earlier create by root
+--echo #
+
+connection conn1;
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE p1root;
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PACKAGE pkg1;
+
+
+--echo #
+--echo # User u1 still cannot create a PACKAGE BODY
+--echo #
+
+connection conn1;
+DELIMITER $$;
+--error ER_DBACCESS_DENIED_ERROR
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is f1'; END;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Now grant EXECUTE:
+--echo # - on the standalone procedure earlier created by root
+--echo # - on the package specification earlier created by root
+--echo #
+connection default;
+GRANT EXECUTE ON PROCEDURE db1.p1root TO u1@localhost;
+GRANT EXECUTE ON PACKAGE db1.pkg1 TO u1@localhost;
+
+--echo #
+--echo # Now u1 can do SHOW for:
+--echo # - the standalone procedure earlier created by root
+--echo # - the package specification earlier created by root
+--echo #
+
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+SET sql_mode=ORACLE;
+SHOW CREATE PROCEDURE db1.p1root;
+SHOW CREATE PACKAGE db1.pkg1;
+
+
+--echo #
+--echo # Now revoke EXECUTE and grant CREATE ROUTINE instead
+--echo #
+
+connection default;
+REVOKE EXECUTE ON PROCEDURE db1.p1root FROM u1@localhost;
+REVOKE EXECUTE ON PACKAGE db1.pkg1 FROM u1@localhost;
+GRANT CREATE ROUTINE ON db1.* TO u1@localhost;
+
+--echo #
+--echo # Reconnect u1 to make new grants have effect
+--echo #
+
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # Now u1 can SHOW:
+--echo # - standalone routines earlier created by root
+--echo # - package specifications earlier created by root
+--echo #
+SHOW CREATE PROCEDURE p1root;
+SHOW CREATE PACKAGE pkg1;
+
+--echo #
+--echo # Now u1 can CREATE, DROP and EXECUTE its own standalone procedures
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
+SHOW GRANTS;
+CALL p1;
+DROP PROCEDURE p1;
+SHOW GRANTS;
+
+--echo #
+--echo # Now u1 can also CREATE, DROP its own package specifications
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE pkg2 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+DELIMITER ;$$
+SHOW CREATE PACKAGE pkg2;
+SHOW GRANTS;
+DROP PACKAGE pkg2;
+SHOW GRANTS;
+
+
+--echo #
+--echo # Now u1 can also CREATE, DROP package bodies and EXECUTE package body routines
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
+END;
+$$
+DELIMITER ;$$
+SHOW CREATE PACKAGE pkg1;
+SHOW CREATE PACKAGE BODY pkg1;
+SHOW GRANTS;
+CALL pkg1.p1;
+SELECT pkg1.f1();
+DROP PACKAGE BODY pkg1;
+SHOW GRANTS;
+
+--echo #
+--echo # Now create a PACKAGE BODY by root.
+--echo # u1 does not have EXECUTE access by default.
+--echo #
+
+connection default;
+DELIMITER $$;
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
+END;
+$$
+DELIMITER ;$$
+
+connection conn1;
+SHOW CREATE PACKAGE pkg1;
+SHOW CREATE PACKAGE BODY pkg1;
+--error ER_PROCACCESS_DENIED_ERROR
+CALL pkg1.p1;
+--error ER_PROCACCESS_DENIED_ERROR
+SELECT pkg1.f1();
+
+--echo #
+--echo # Now grant EXECUTE to u1 on the PACKAGE BODY created by root
+--echo #
+
+connection default;
+GRANT EXECUTE ON PACKAGE BODY db1.pkg1 TO u1@localhost;
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+SELECT CURRENT_USER;
+SET sql_mode=ORACLE;
+SHOW GRANTS;
+CALL pkg1.p1;
+SELECT pkg1.f1();
+
+connection default;
+DROP PACKAGE BODY pkg1;
+
+
+--echo #
+--echo # u1 still cannot DROP the package specification earlier created by root.
+--echo #
+
+connection conn1;
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PACKAGE pkg1;
+
+--echo #
+--echo # Grant ALTER ROUTINE to u1
+--echo #
+
+connection default;
+GRANT ALTER ROUTINE ON db1.* TO u1@localhost;
+
+--echo #
+--echo # Now u1 can DROP:
+--echo # - the standalone procedure earlier created by root
+--echo # - the package specification earlier created by root
+--echo #
+
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+SET sql_mode=ORACLE;
+DROP PACKAGE pkg1;
+DROP PROCEDURE p1root;
+
+disconnect conn1;
+connection default;
+
+DROP USER u1@localhost;
+DROP DATABASE db1;
+USE test;
+
+
+--echo #
+--echo # Creator=root, definer=xxx
+--echo #
+
+CREATE USER xxx@localhost;
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+ END;
+BEGIN
+ SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+DELIMITER ;$$
+--error ER_PROCACCESS_DENIED_ERROR
+CALL p1.p1;
+GRANT EXECUTE ON PACKAGE BODY test.p1 TO xxx@localhost;
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+
+
+--echo #
+--echo # Creator=root, definer=xxx, SQL SECURITY INVOKER
+--echo #
+
+CREATE USER xxx@localhost;
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+ END;
+BEGIN
+ SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
diff --git a/mysql-test/suite/compat/oracle/t/sp-package.test b/mysql-test/suite/compat/oracle/t/sp-package.test
new file mode 100644
index 00000000000..5eac3987982
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-package.test
@@ -0,0 +1,2684 @@
+--source include/default_charset.inc
+
+SET sql_mode=ORACLE;
+
+
+--echo #
+--echo # Creating a body of a non-existing package
+--echo #
+DELIMITER $$;
+--error ER_SP_DOES_NOT_EXIST
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # Dropping a non-existing package
+--echo #
+--error ER_SP_DOES_NOT_EXIST
+DROP PACKAGE test2;
+DROP PACKAGE IF EXISTS test2;
+--error ER_SP_DOES_NOT_EXIST
+DROP PACKAGE BODY test2;
+
+
+--echo #
+--echo # Bad combinations of OR REPLACE and IF EXISTS
+--echo #
+
+DELIMITER $$;
+--error ER_WRONG_USAGE
+CREATE OR REPLACE PACKAGE IF NOT EXISTS pkg AS
+ PROCEDURE p1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_WRONG_USAGE
+CREATE OR REPLACE PACKAGE BODY IF NOT EXISTS pkg AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # PACKAGE and PS
+--echo #
+
+--error ER_UNSUPPORTED_PS
+PREPARE stmt FROM 'CREATE PACKAGE test2 AS FUNCTION f1 RETURN INT; END test2';
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+--error ER_UNSUPPORTED_PS
+PREPARE stmt FROM 'CREATE PACKAGE BODY test2 AS'
+ ' FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;'
+ 'END test2';
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Package and READ ONLY transactions
+--echo #
+
+SET SESSION TRANSACTION READ ONLY;
+
+DELIMITER $$;
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END
+$$
+DELIMITER ;$$
+
+SET SESSION TRANSACTION READ WRITE;
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION f2 RETURN INT;
+END;
+$$
+SET SESSION TRANSACTION READ ONLY
+$$
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+ FUNCTION f2 RETURN INT AS BEGIN RETURN f1(); END;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT f2();
+ END;
+END;
+$$
+DELIMITER ;$$
+SET SESSION TRANSACTION READ WRITE;
+DROP PACKAGE test2;
+
+SET SESSION TRANSACTION READ ONLY;
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+DROP PACKAGE test2;
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+DROP PACKAGE BODY test2;
+
+SET SESSION TRANSACTION READ WRITE;
+
+
+--echo #
+--echo # Syntax error inside a CREATE PACKAGE, inside a routine definition
+--echo #
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION f2 RETURN INT;
+ FUNCTION f3;
+ FUNCTION f4 RETURN INT;
+END
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Syntax error inside a CREATE PACKAGE, outside of a routine definition
+--echo #
+
+# The definition "FUNCTION f3 RETURN INT AS BEGIN RETURN 10; END;"
+# is valid in CREATE PACKAGE BODY, but not in CREATE PACKAGE.
+# Syntax error happens after parsing "FUNCTION f3 RETURN INT".
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION f2 RETURN INT;
+ FUNCTION f3 RETURN INT AS BEGIN RETURN 10; END;
+ FUNCTION f4 RETURN INT;
+END
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Syntax error inside a CREATE PACKAGE BODY, inside a routine definition
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION f2 RETURN INT;
+END;
+$$
+--error ER_PARSE_ERROR
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+ FUNCTION f2 RETURN INT SA BEGIN RETURN 10; END; -- Notice "SA" vs "AS"
+END
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+--echo #
+--echo # Syntax error inside a CREATE PACKAGE BODY, outside a routine definition
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION f2 RETURN INT;
+END;
+$$
+--error ER_PARSE_ERROR
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+ SOME SYNTAX ERROR;
+ FUNCTION f2 RETURN INT AS BEGIN RETURN 10; END;
+END
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Syntax error inside a CREATE PACKAGE BODY executable section
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+--error ER_PARSE_ERROR
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+BEGIN
+ SOME SYNTAX ERROR;
+END
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # CREATE PROCEDURE inside a package PROCEDURE is not allowed
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_SP_NO_RECURSIVE_CREATE
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS
+ BEGIN
+ CREATE PROCEDURE p1 AS BEGIN NULL; END;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # CREATE PACKAGE inside a package PROCEDURE is not allowed
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_SP_NO_RECURSIVE_CREATE
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS
+ BEGIN
+ CREATE PACKAGE p1 AS PROCEDURE p1; END;
+ END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # CREATE PROCEDURE inside a package executable section is not allowed
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_SP_NO_RECURSIVE_CREATE
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+BEGIN
+ CREATE PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # CREATE FUNCTION inside a package executable section is not allowed
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_SP_NO_RECURSIVE_CREATE
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+BEGIN
+ CREATE FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # CREATE PACKAGE inside a package executable section is not allowed
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_SP_NO_RECURSIVE_CREATE
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+BEGIN
+ CREATE PACKAGE p1 AS PROCEDURE p1; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Broken CREATE PACKAGE at CREATE PACKAGE BODY time
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+UPDATE mysql.proc SET `body`='garbage'
+ WHERE db='test' AND name='test2' AND type='PACKAGE';
+
+DELIMITER $$;
+--error ER_SP_PROC_TABLE_CORRUPT
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT
+ AS BEGIN
+ RETURN f2();
+ END;
+END;
+$$
+DELIMITER ;$$
+
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Broken CREATE PACKAGE at a package function call time
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT
+ AS BEGIN
+ RETURN f2();
+ END;
+END;
+$$
+DELIMITER ;$$
+
+--error ER_SP_DOES_NOT_EXIST
+SELECT test2.f1();
+UPDATE mysql.proc SET `body`='garbage'
+ WHERE db='test' AND name='test2' AND type='PACKAGE';
+--source sp-cache-invalidate.inc
+--error ER_SP_PROC_TABLE_CORRUPT
+SELECT test2.f1();
+--error ER_SP_PROC_TABLE_CORRUPT
+SELECT test2.f1();
+--error ER_SP_PROC_TABLE_CORRUPT
+SELECT test2.f1();
+
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Broken CREATE PACKAGE at a package procedure call time
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1
+ AS BEGIN
+ CALL p2;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+--error ER_SP_DOES_NOT_EXIST
+CALL test2.f1();
+UPDATE mysql.proc SET `body`='garbage'
+ WHERE db='test' AND name='test2' AND type='PACKAGE';
+--source sp-cache-invalidate.inc
+--error ER_SP_PROC_TABLE_CORRUPT
+CALL test2.p1();
+--error ER_SP_PROC_TABLE_CORRUPT
+CALL test2.p1();
+--error ER_SP_PROC_TABLE_CORRUPT
+CALL test2.p1();
+
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Bad routine names
+--echo #
+
+DELIMITER $$;
+--error ER_TOO_LONG_IDENT
+CREATE PACKAGE p1 AS
+ PROCEDURE pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_TOO_LONG_IDENT
+CREATE PACKAGE p1 AS
+ FUNCTION fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1
+ RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_SP_WRONG_NAME
+CREATE PACKAGE p1 AS
+ PROCEDURE "p1 ";
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_SP_WRONG_NAME
+CREATE PACKAGE p1 AS
+ FUNCTION "f1 " RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_SP_WRONG_NAME
+CREATE PACKAGE p1 AS
+ PROCEDURE "p1.p1";
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_SP_WRONG_NAME
+CREATE PACKAGE p1 AS
+ FUNCTION "f1.f1" RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Duplicate PROCEDURE in CREATE PACKAGE
+--echo #
+
+DELIMITER $$;
+--error ER_SP_ALREADY_EXISTS,
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+ PROCEDURE p1;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_SP_ALREADY_EXISTS,
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+ PROCEDURE P1;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Duplicate FUNCTION in CREATE PACKAGE
+--echo #
+
+DELIMITER $$;
+--error ER_SP_ALREADY_EXISTS,
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_SP_ALREADY_EXISTS,
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ FUNCTION F1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Duplicate PROCEDURE in CREATE PACKAGE BODY
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_SP_ALREADY_EXISTS
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+ PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+--error ER_SP_ALREADY_EXISTS
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+ PROCEDURE P1 AS BEGIN NULL; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Duplicate FUNCTION in CREATE PACKAGE BODY
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+--error ER_SP_ALREADY_EXISTS
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+END;
+$$
+--error ER_SP_ALREADY_EXISTS
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 0; END;
+ FUNCTION F1 RETURN INT AS BEGIN RETURN 0; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Routines declared in CREATE PACKAGE missing in CREATE PACKAGE BODY
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p2 AS BEGIN NULL; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f2 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2 AS
+ FUNCTION p1 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1(a INT) AS BEGIN NULL; END; -- Notice different prototype
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+--echo #
+--echo # Forward declarations in CREATE PACKAGE BODY with missing implementations
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS BEGIN NULL; END;
+ PROCEDURE p2;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1 AS BEGIN NULL; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Creating a new package
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 COMMENT 'package-test2-comment' AS
+ FUNCTION f1 RETURN INT DETERMINISTIC;
+ FUNCTION f2(a INT) RETURN INT;
+ FUNCTION concat RETURN INT;
+ PROCEDURE p1;
+ PROCEDURE p2(a INT);
+END
+$$
+DELIMITER ;$$
+
+--vertical_results
+--replace_column 13 # 14 #
+SELECT * FROM mysql.proc WHERE db='test' AND name='test2';
+--replace_column 24 # 25 #
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='test2';
+--horizontal_results
+
+DELIMITER $$;
+CREATE PACKAGE IF NOT EXISTS test2 AS
+ FUNCTION f1 RETURN INT;
+END test2
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2 COMMENT 'package-body-test2-comment' AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+ FUNCTION f2(a INT) RETURN INT AS BEGIN RETURN f1()+a; END;
+ FUNCTION concat RETURN INT AS BEGIN RETURN 1; END;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT f2(0);
+ END;
+ PROCEDURE p2(a INT) AS
+ BEGIN
+ SELECT f2(a);
+ END;
+END;
+$$
+DELIMITER ;$$
+
+# This should do nothing and return a warning
+DELIMITER $$;
+CREATE PACKAGE BODY IF NOT EXISTS test2 AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 20; END;
+ FUNCTION f2(a INT) RETURN INT AS BEGIN RETURN f1()+a; END;
+ FUNCTION concat RETURN INT AS BEGIN RETURN 1; END;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT f2(0);
+ END;
+ PROCEDURE p2(a INT) AS
+ BEGIN
+ SELECT f2(a);
+ END;
+END;
+$$
+DELIMITER ;$$
+
+#
+# The next query issues a warning about "concat" name collision,
+# raised during compilation of the package body.
+# However, "mtr --ps" does not produce the warning.
+# It's not a package specific issue. The same difference exists for
+# standalone functions. So just suppress warning for now.
+#
+--disable_warnings
+SELECT test2.f1();
+--enable_warnings
+SELECT test2.f2(1);
+CALL test2.p1();
+CALL test2.p2(1);
+
+--vertical_results
+--replace_column 13 # 14 #
+SELECT * FROM mysql.proc WHERE db='test' AND name LIKE 'test2.%';
+--replace_column 24 # 25 #
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='test2';
+--replace_column 24 # 25 #
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME LIKE 'test2.%';
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+SHOW PACKAGE STATUS;
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+SHOW PACKAGE BODY STATUS;
+SHOW CREATE PACKAGE test2;
+SHOW CREATE PACKAGE BODY test2;
+--horizontal_results
+
+
+
+DROP PACKAGE BODY test2;
+--error ER_SP_DOES_NOT_EXIST
+SELECT test2.f1();
+--error ER_SP_DOES_NOT_EXIST
+SELECT test2.f2();
+--error ER_SP_DOES_NOT_EXIST
+CALL test2.p1();
+
+DROP PACKAGE BODY IF EXISTS test2;
+
+--error ER_SP_DOES_NOT_EXIST
+DROP PACKAGE BODY test2;
+
+
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Creating a new package in a remote database
+--echo #
+
+CREATE DATABASE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2.test2 COMMENT 'package-test2-comment' AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2.test2 COMMENT 'package-body-test2-comment' AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+ PROCEDURE p1 AS BEGIN SELECT f1(); END;
+END;
+$$
+DELIMITER ;$$
+
+--vertical_results
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+SHOW PACKAGE STATUS;
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+SHOW PACKAGE BODY STATUS;
+--horizontal_results
+
+USE test2;
+SELECT test2.f1();
+CALL test2.p1();
+USE test;
+DROP PACKAGE BODY test2.test2;
+DROP PACKAGE test2.test2;
+DROP DATABASE test2;
+
+
+--echo #
+--echo # Only public routines are available outside
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+ -- Public routines
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN 'This is test2.f1';
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 'This is test2.p1';
+ END;
+ -- Private routines
+ FUNCTION f2 RETURN TEXT AS
+ BEGIN
+ RETURN 'This is test2.f2';
+ END;
+ PROCEDURE p2 AS
+ BEGIN
+ SELECT 'This is test2.p2';
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT test2.f1();
+CALL test2.p1();
+--error ER_SP_DOES_NOT_EXIST
+SELECT test2.f2();
+--error ER_SP_DOES_NOT_EXIST
+CALL test2.p2();
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # PACKAGE BODY with forward declarations
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+ -- Forward declarations
+ FUNCTION f2private RETURN TEXT;
+ PROCEDURE p2private;
+ -- Public routines
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN f2private();
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL p2private;
+ END;
+ -- Definitions for the forward declarations
+ FUNCTION f2private RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f2private';
+ END;
+ PROCEDURE p2private AS
+ BEGIN
+ SELECT 'This is p2private';
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT test2.f1();
+CALL test2.p1();
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Calling private routines with forward declarations,
+--echo # using qualified notation, e.g. "CALL pkg.proc"
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+ -- Forward declarations
+ FUNCTION f2private RETURN TEXT;
+ PROCEDURE p2private;
+ -- Public routines
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN test2.f2private();
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL test2.p2private;
+ END;
+ -- Definitions for the forward declarations
+ FUNCTION f2private RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f2private';
+ END;
+ PROCEDURE p2private AS
+ BEGIN
+ SELECT 'This is p2private' AS msg;
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT test2.f1();
+CALL test2.p1();
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Calling private routines, using qualified notation, e.g. "pkg.proc"
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+ -- Private routines
+ FUNCTION f2private RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f2private';
+ END;
+ PROCEDURE p2private AS
+ BEGIN
+ SELECT 'This is p2private' AS msg;
+ END;
+ -- Public routines
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN test2.f2private();
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL test2.p2private;
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT test2.f1();
+CALL test2.p1();
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Calling private routines from the package initialization section,
+--echo # using qualified notation, e.g. "pkg.proc"
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+ -- Private routines
+ FUNCTION f2private RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f2private';
+ END;
+ PROCEDURE p2private AS
+ BEGIN
+ SELECT 'This is p2private' AS msg;
+ END;
+ -- Public routines
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 'This is p1' AS msg;
+ END;
+BEGIN
+ SELECT test2.f2private();
+ CALL test2.p2private();
+END;
+$$
+DELIMITER ;$$
+CALL test2.p1();
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # Testing OR REPLACE
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg AS
+ FUNCTION f0 RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE pkg AS
+ FUNCTION f1 RETURN INT;
+END;
+$$
+DELIMITER ;$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE BODY pkg AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END;
+END;
+$$
+DELIMITER ;$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+SELECT pkg.f1();
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE BODY pkg AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 20; END;
+END;
+$$
+DELIMITER ;$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+SELECT pkg.f1();
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg AS
+ FUNCTION f1 RETURN BIGINT;
+END;
+$$
+DELIMITER ;$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+--error ER_SP_DOES_NOT_EXIST
+SELECT pkg.f1();
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE BODY pkg AS
+ FUNCTION f1 RETURN INT AS BEGIN RETURN 30; END;
+END;
+$$
+DELIMITER ;$$
+SELECT name, type, `body` FROM mysql.proc WHERE name LIKE 'pkg%' ORDER BY type;
+SELECT pkg.f1();
+
+DROP PACKAGE pkg;
+
+
+--echo #
+--echo # Package routines accessing tables
+--echo #
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ PROCEDURE p1(a INT);
+END;
+$$
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1(a INT) AS
+ BEGIN
+ INSERT INTO t1 VALUES (10);
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL test2.p1(10);
+SELECT * FROM t1;
+DROP PACKAGE test2;
+DROP TABLE t1;
+
+
+--echo #
+--echo # CREATE PACKAGE: Optional package name after the "END" keyword
+--echo #
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END test2.test2
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END test3
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END test2
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
+--echo #
+
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN INT;
+ PROCEDURE p1;
+END test2;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN 10;
+ END f1.f1;
+END test2;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN 10;
+ END f2;
+END test2;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END p1.p1;
+END test2;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PACKAGE BODY test2 AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END p2;
+END test2;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN 10;
+ END f1;
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END p1;
+END test2;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+--echo #
+--echo # Package and package routine name and end name are case insensitive
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2 AS
+ FUNCTION f1 RETURN TEXT;
+ PROCEDURE p1;
+END TEST2;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE BODY test2 AS
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f1';
+ END F1;
+ PROCEDURE P1 AS
+ BEGIN
+ SELECT 'This is p1' AS msg;
+ END p1;
+END TEST2;
+$$
+DELIMITER ;$$
+SELECT TEST2.F1();
+SELECT test2.f1();
+CALL TEST2.p1();
+CALL test2.P1();
+DROP PACKAGE BODY TEST2;
+DROP PACKAGE TEST2;
+
+
+--echo #
+--echo # Testing various qualified/non-qualified db/package SP call chains
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f3() RETURN TEXT AS
+BEGIN
+ SET @track= @track || ' ' || 'test.f3()';
+ RETURN '';
+END;
+$$
+CREATE PROCEDURE p3() AS
+BEGIN
+ SET @track= @track || ' ' || 'test.p3()';
+END;
+$$
+CREATE FUNCTION ff2(task TEXT) RETURN TEXT AS
+ step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+ tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+ rc TEXT;
+BEGIN
+ SET @track= @track || ' ' || 'test.ff2()';
+ CASE step
+ WHEN '' THEN NULL;
+ WHEN 'p3' THEN CALL p3();
+ WHEN 'f3' THEN rc:= f3();
+ WHEN 'pack.p2' THEN CALL pack.p2(tail);
+ WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+ WHEN 'pack.p3' THEN CALL pack.p3();
+ WHEN 'pack.f3' THEN rc:= pack.f3();
+ WHEN 'test.p3' THEN CALL test.p3();
+ WHEN 'test.f3' THEN rc:= test.f3();
+ WHEN 'test.pp2' THEN CALL test.pp2(tail);
+ WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+ END CASE;
+ RETURN '';
+END;
+$$
+CREATE PROCEDURE pp2(task TEXT) AS
+ step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+ tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+ rc TEXT;
+BEGIN
+ SET @track= @track || ' ' || 'test.pp2()';
+ CASE step
+ WHEN '' THEN NULL;
+ WHEN 'p3' THEN CALL p3();
+ WHEN 'f3' THEN rc:= f3();
+ WHEN 'pack.p2' THEN CALL pack.p2(tail);
+ WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+ WHEN 'pack.p3' THEN CALL pack.p3();
+ WHEN 'pack.f3' THEN rc:= pack.f3();
+ WHEN 'test.p3' THEN CALL test.p3();
+ WHEN 'test.f3' THEN rc:= test.f3();
+ WHEN 'test.pp2' THEN CALL test.pp2(tail);
+ WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+ END CASE;
+END;
+$$
+CREATE PACKAGE pack AS
+ PROCEDURE p1(task TEXT);
+ PROCEDURE p2(task TEXT);
+ FUNCTION f1(task TEXT) RETURN TEXT;
+ FUNCTION f2(step2 TEXT) RETURN TEXT;
+ FUNCTION f3 RETURN TEXT;
+ PROCEDURE p3;
+END;
+$$
+CREATE PACKAGE BODY pack AS
+ PROCEDURE p1(task TEXT) AS
+ step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+ tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+ rc TEXT;
+ BEGIN
+ SET @track= 'test.pack.p1()';
+ CASE step
+ WHEN '' THEN NULL;
+ WHEN 'p2' THEN CALL p2(tail);
+ WHEN 'f2' THEN rc:= f2(tail);
+ WHEN 'p3' THEN CALL p3();
+ WHEN 'f3' THEN rc:= f3();
+ WHEN 'px' THEN CALL px();
+ WHEN 'fx' THEN rc:= fx();
+ WHEN 'pp2' THEN CALL pp2(tail);
+ WHEN 'ff2' THEN rc:= ff2(tail);
+ WHEN 'pack.p2' THEN CALL pack.p2(tail);
+ WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+ WHEN 'pack.p3' THEN CALL pack.p3();
+ WHEN 'pack.f3' THEN rc:= pack.f3();
+ WHEN 'pack.px' THEN CALL pack.px();
+ WHEN 'pack.fx' THEN rc:= pack.fx();
+ WHEN 'test.p3' THEN CALL test.p3();
+ WHEN 'test.f3' THEN rc:= test.f3();
+ WHEN 'test.pp2' THEN CALL test.pp2(tail);
+ WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+ END CASE;
+ SELECT @track;
+ END;
+
+ FUNCTION f1(task TEXT) RETURN TEXT AS
+ step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+ tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+ rc TEXT;
+ BEGIN
+ SET @track= 'test.pack.f1()';
+ CASE step
+ WHEN '' THEN NULL;
+ WHEN 'p2' THEN CALL p2(tail);
+ WHEN 'f2' THEN rc:= f2(tail);
+ WHEN 'p3' THEN CALL p3();
+ WHEN 'f3' THEN rc:= f3();
+ WHEN 'px' THEN CALL px();
+ WHEN 'fx' THEN rc:= fx();
+ WHEN 'pp2' THEN CALL pp2(tail);
+ WHEN 'ff2' THEN rc:= ff2(tail);
+ WHEN 'pack.p2' THEN CALL pack.p2(tail);
+ WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+ WHEN 'pack.p3' THEN CALL pack.p3();
+ WHEN 'pack.f3' THEN rc:= pack.f3();
+ WHEN 'pack.px' THEN CALL pack.px();
+ WHEN 'pack.fx' THEN rc:= pack.fx();
+ WHEN 'test.p3' THEN CALL test.p3();
+ WHEN 'test.f3' THEN rc:= test.f3();
+ WHEN 'test.pp2' THEN CALL test.pp2(tail);
+ WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+ END CASE;
+ SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT=@track;
+ RETURN '';
+ END;
+
+ PROCEDURE p2(task TEXT) AS
+ step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+ tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+ rc TEXT;
+ BEGIN
+ SET @track= @track || ' ' || 'test.pack.p2()';
+ CASE step
+ WHEN '' THEN NULL;
+ WHEN 'p2' THEN CALL p2(tail);
+ WHEN 'f2' THEN rc:= f2(tail);
+ WHEN 'p3' THEN CALL p3();
+ WHEN 'f3' THEN rc:= f3();
+ WHEN 'px' THEN CALL px();
+ WHEN 'fx' THEN rc:= fx();
+ WHEN 'pp2' THEN CALL pp2(tail);
+ WHEN 'ff2' THEN rc:= ff2(tail);
+ WHEN 'pack.p2' THEN CALL pack.p2(tail);
+ WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+ WHEN 'pack.p3' THEN CALL pack.p3();
+ WHEN 'pack.f3' THEN rc:= pack.f3();
+ WHEN 'pack.px' THEN CALL pack.px();
+ WHEN 'pack.fx' THEN rc:= pack.fx();
+ WHEN 'test.p3' THEN CALL test.p3();
+ WHEN 'test.f3' THEN rc:= test.f3();
+ WHEN 'test.pp2' THEN CALL test.pp2(tail);
+ WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+ END CASE;
+ END;
+
+ FUNCTION f2(task TEXT) RETURN TEXT AS
+ step TEXT := REGEXP_SUBSTR(task,'^[^ ]*');
+ tail TEXT := REGEXP_REPLACE(task,'^[^ ]*[ ]*(.*)','\\1');
+ rc TEXT;
+ BEGIN
+ SET @track= @track || ' ' || 'test.pack.f2()';
+ CASE step
+ WHEN '' THEN NULL;
+ WHEN 'p2' THEN CALL p2(tail);
+ WHEN 'f2' THEN rc:= f2(tail);
+ WHEN 'p3' THEN CALL p3();
+ WHEN 'f3' THEN rc:= f3();
+ WHEN 'px' THEN CALL px();
+ WHEN 'fx' THEN rc:= fx();
+ WHEN 'pp2' THEN CALL pp2(tail);
+ WHEN 'ff2' THEN rc:= ff2(tail);
+ WHEN 'pack.p2' THEN CALL pack.p2(tail);
+ WHEN 'pack.f2' THEN rc:= pack.f2(tail);
+ WHEN 'pack.p3' THEN CALL pack.p3();
+ WHEN 'pack.f3' THEN rc:= pack.f3();
+ WHEN 'pack.px' THEN CALL pack.px();
+ WHEN 'pack.fx' THEN rc:= pack.fx();
+ WHEN 'test.p3' THEN CALL test.p3();
+ WHEN 'test.f3' THEN rc:= test.f3();
+ WHEN 'test.pp2' THEN CALL test.pp2(tail);
+ WHEN 'test.ff2' THEN rc:= test.ff2(tail);
+ ELSE SET @track= @track || ' ' || step || ' [unknown step]';
+ END CASE;
+ RETURN '';
+ END;
+ PROCEDURE p3 AS
+ BEGIN
+ SET @track= @track || ' ' || 'test.pack.p3()';
+ END;
+ FUNCTION f3 RETURN TEXT AS
+ BEGIN
+ SET @track= @track || ' ' || 'test.pack.f3()';
+ RETURN '';
+ END;
+
+END pack;
+$$
+DELIMITER ;$$
+
+SET max_sp_recursion_depth=10;
+
+--echo # pack.routine -> *
+
+CALL pack.p1('p2');
+CALL pack.p1('f2');
+--error ER_SP_DOES_NOT_EXIST
+CALL pack.p1('px');
+--error ER_SP_DOES_NOT_EXIST
+CALL pack.p1('fx');
+
+CALL pack.p1('pp2');
+CALL pack.p1('ff2');
+
+CALL pack.p1('pack.p2');
+CALL pack.p1('pack.f2');
+--error ER_SP_DOES_NOT_EXIST
+CALL pack.p1('pack.px');
+--error ER_SP_DOES_NOT_EXIST
+CALL pack.p1('pack.fx');
+
+CALL pack.p1('test.pp2');
+CALL pack.p1('test.ff2');
+
+DO pack.f1('p2');
+DO pack.f1('f2');
+--error ER_SP_DOES_NOT_EXIST
+DO pack.p1('px');
+--error ER_SP_DOES_NOT_EXIST
+DO pack.p1('fx');
+
+DO pack.f1('pp2');
+DO pack.f1('ff2');
+
+DO pack.f1('pack.p2');
+DO pack.f1('pack.f2');
+--error ER_SP_DOES_NOT_EXIST
+SELECT pack.f1('pack.px');
+--error ER_SP_DOES_NOT_EXIST
+SELECT pack.f1('pack.fx');
+
+DO pack.f1('test.pp2');
+DO pack.f1('test.ff2');
+
+--echo #
+--echo # Qualified_package_routine -> Non_qualified_package_routine
+--echo #
+
+--echo # pack.routine -> [pack.]routine -> pack.routine
+
+CALL pack.p1('p2 pack.p3');
+CALL pack.p1('p2 pack.f3');
+CALL pack.p1('f2 pack.p3');
+CALL pack.p1('f2 pack.f3');
+
+DO pack.f1('p2 pack.p3');
+DO pack.f1('p2 pack.f3');
+DO pack.f1('f2 pack.p3');
+DO pack.f1('f2 pack.f3');
+
+--echo # pack.routine -> [pack.]routine -> [pack]routine
+
+CALL pack.p1('p2 p3');
+CALL pack.p1('p2 f3');
+CALL pack.p1('f2 p3');
+CALL pack.p1('f2 f3');
+
+DO pack.f1('p2 p3');
+DO pack.f1('p2 f3');
+DO pack.f1('f2 p3');
+DO pack.f1('f2 f3');
+
+--echo # pack.routine -> [pack.]routine -> test.routine
+
+CALL pack.p1('p2 test.p3');
+CALL pack.p1('p2 test.f3');
+CALL pack.p1('f2 test.p3');
+CALL pack.p1('f2 test.f3');
+
+DO pack.f1('p2 test.p3');
+DO pack.f1('p2 test.f3');
+DO pack.f1('f2 test.p3');
+DO pack.f1('f2 test.f3');
+
+--echo # pack.routine -> [pack.]routine -> [test.]routine
+
+CALL pack.p1('p2 pp2');
+CALL pack.p1('p2 ff2');
+CALL pack.p1('f2 pp2');
+CALL pack.p1('f2 ff2');
+
+DO pack.f1('p2 pp2');
+DO pack.f1('p2 ff2');
+DO pack.f1('f2 pp2');
+DO pack.f1('f2 ff2');
+
+
+--echo #
+--echo # Qualified_package_routine -> Non_qualified_database_routine
+--echo #
+
+--echo # pack.routine -> [test.]routine -> pack.routine
+
+CALL pack.p1('pp2 pack.p3');
+CALL pack.p1('pp2 pack.f3');
+CALL pack.p1('ff2 pack.p3');
+CALL pack.p1('ff2 pack.f3');
+
+DO pack.f1('pp2 pack.p3');
+DO pack.f1('pp2 pack.f3');
+DO pack.f1('ff2 pack.p3');
+DO pack.f1('ff2 pack.f3');
+
+--echo # pack.routine -> [test.]routine -> test.routine
+
+CALL pack.p1('pp2 test.p3');
+CALL pack.p1('pp2 test.f3');
+CALL pack.p1('ff2 test.p3');
+CALL pack.p1('ff2 test.f3');
+
+DO pack.f1('pp2 test.p3');
+DO pack.f1('pp2 test.f3');
+DO pack.f1('ff2 test.p3');
+DO pack.f1('ff2 test.f3');
+
+--echo # pack.routine -> [test.]routine -> [test.]routine
+
+CALL pack.p1('pp2 p3');
+CALL pack.p1('pp2 f3');
+CALL pack.p1('ff2 p3');
+CALL pack.p1('ff2 f3');
+
+DO pack.f1('pp2 p3');
+DO pack.f1('pp2 f3');
+DO pack.f1('ff2 p3');
+DO pack.f1('ff2 f3');
+
+
+--echo #
+--echo # Qualified_package_routine -> Qualified_package_routine
+--echo #
+
+--echo # pack.routine -> pack.routine -> pack.routine
+
+CALL pack.p1('pack.p2 pack.p3');
+CALL pack.p1('pack.p2 pack.f3');
+CALL pack.p1('pack.f2 pack.p3');
+CALL pack.p1('pack.f2 pack.f3');
+
+DO pack.f1('pack.p2 pack.p3');
+DO pack.f1('pack.p2 pack.f3');
+DO pack.f1('pack.f2 pack.p3');
+DO pack.f1('pack.f2 pack.f3');
+
+--echo # pack.routine -> pack.routine -> [pack.]routine
+
+CALL pack.p1('pack.p2 p3');
+CALL pack.p1('pack.p2 f3');
+CALL pack.p1('pack.f2 p3');
+CALL pack.p1('pack.f2 f3');
+
+DO pack.f1('pack.p2 p3');
+DO pack.f1('pack.p2 f3');
+DO pack.f1('pack.f2 p3');
+DO pack.f1('pack.f2 f3');
+
+--echo # pack.routine -> pack.routine -> test.routine
+
+CALL pack.p1('pack.p2 test.p3');
+CALL pack.p1('pack.p2 test.f3');
+CALL pack.p1('pack.f2 test.p3');
+CALL pack.p1('pack.f2 test.f3');
+
+DO pack.f1('pack.p2 test.p3');
+DO pack.f1('pack.p2 test.f3');
+DO pack.f1('pack.f2 test.p3');
+DO pack.f1('pack.f2 test.f3');
+
+--echo # pack.routine -> pack.routine -> [test.]routine
+
+CALL pack.p1('pack.p2 pp2');
+CALL pack.p1('pack.p2 ff2');
+CALL pack.p1('pack.f2 pp2');
+CALL pack.p1('pack.f2 ff2');
+
+DO pack.f1('pack.p2 pp2');
+DO pack.f1('pack.p2 ff2');
+DO pack.f1('pack.f2 pp2');
+DO pack.f1('pack.f2 ff2');
+
+
+--echo #
+--echo # Qualified_package_routine -> Qualified_database_routine
+--echo #
+
+--echo pack.routine -> test.routine -> pack.routine
+
+CALL pack.p1('test.pp2 pack.p3');
+CALL pack.p1('test.pp2 pack.f3');
+CALL pack.p1('test.ff2 pack.p3');
+CALL pack.p1('test.ff2 pack.f3');
+
+DO pack.f1('test.pp2 pack.p3');
+DO pack.f1('test.pp2 pack.f3');
+DO pack.f1('test.ff2 pack.p3');
+DO pack.f1('test.ff2 pack.f3');
+
+--echo pack.routine -> test.routine -> test.routine
+
+CALL pack.p1('test.pp2 test.p3');
+CALL pack.p1('test.pp2 test.f3');
+CALL pack.p1('test.ff2 test.p3');
+CALL pack.p1('test.ff2 test.f3');
+
+DO pack.f1('test.pp2 test.p3');
+DO pack.f1('test.pp2 test.f3');
+DO pack.f1('test.ff2 test.p3');
+DO pack.f1('test.ff2 test.f3');
+
+--echo pack.routine -> test.routine -> [test.]routine
+
+CALL pack.p1('test.pp2 p3');
+CALL pack.p1('test.pp2 f3');
+CALL pack.p1('test.ff2 p3');
+CALL pack.p1('test.ff2 f3');
+
+DO pack.f1('test.pp2 p3');
+DO pack.f1('test.pp2 f3');
+DO pack.f1('test.ff2 p3');
+DO pack.f1('test.ff2 f3');
+
+
+--echo # Longer chains
+
+CALL pack.p1('p2 f2 p2 test.pp2 test.ff2 pack.p3');
+CALL pack.p1('p2 test.pp2 pack.p2 pack.f2 test.ff2 pack.p3');
+
+
+DROP PACKAGE pack;
+DROP FUNCTION f3;
+DROP PROCEDURE p3;
+DROP FUNCTION ff2;
+DROP PROCEDURE pp2;
+
+
+--echo #
+--echo # Calling a standalone function from a non-current database,
+--echo # which calls a package routine from the same non-current database.
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ CALL pkg1.p1;
+END;
+$$
+CREATE PACKAGE pkg1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT database();
+ END;
+END;
+$$
+DELIMITER ;$$
+# Current database
+CALL p1;
+CREATE DATABASE test2;
+USE test2;
+# Non-current database
+CALL test.p1;
+DROP DATABASE test2;
+# No current database at all
+CALL test.p1;
+USE test;
+DROP PACKAGE pkg1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Creating a package with a different DEFINER
+--echo #
+
+CREATE USER xxx@localhost;
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+
+--echo #
+--echo # Creating a package with a different DEFINER, with SQL SECURITY INVOKER
+--echo #
+
+CREATE USER xxx@localhost;
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1;
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type;
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+
+--echo #
+--echo # A package with an initialization section
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS BEGIN SET @a=@a+1; SELECT @a; END;
+ FUNCTION f1 RETURN INT AS BEGIN SET @a=@a+1; RETURN @a; END;
+BEGIN
+ SET @a:=10;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # A package with an initialization section calling
+--echo # routines from the same package, and standalone routines.
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE init20 AS
+BEGIN
+ SET @msg= @msg || '[init20]';
+END;
+$$
+CREATE PACKAGE p1 AS
+ PROCEDURE init1;
+ PROCEDURE init2;
+ FUNCTION init3 RETURN INT;
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE init1 AS
+ BEGIN
+ SET @msg= @msg || '[p1.init1]';
+ END;
+ PROCEDURE init2 AS
+ BEGIN
+ SET @msg= @msg || '[p1.init2]';
+ END;
+ FUNCTION init3 RETURN INT AS
+ BEGIN
+ SET @msg= @msg || '[p1.init3]';
+ RETURN 0;
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ SET @msg= @msg || '[p1.p1]';
+ SELECT @msg;
+ END;
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ SET @msg= @msg || '[p1.f1]';
+ RETURN @msg;
+ END;
+BEGIN
+ SET @msg= '';
+ init1();
+ init2();
+ DO init3();
+ init20();
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+DROP PROCEDURE init20;
+
+
+--echo #
+--echo # EXECUTE IMMEDIATE in the package initialization section
+--echo #
+
+SET @a=1000;
+CREATE TABLE t1 AS SELECT 10 AS a;
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS BEGIN SET @a=@a+1; SELECT @a; END;
+ FUNCTION f1 RETURN INT AS BEGIN SET @a=@a+1; RETURN @a; END;
+BEGIN
+ EXECUTE IMMEDIATE 'SELECT MAX(a) FROM t1 INTO @a';
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+SELECT p1.f1();
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # A package with an initialization section, loading table data into a user variable
+--echo #
+
+SET @a=1000;
+CREATE TABLE t1 AS SELECT 10 AS a;
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS BEGIN SET @a=@a+1; SELECT @a; END;
+ FUNCTION f1 RETURN INT AS BEGIN SET @a=@a+1; RETURN @a; END;
+BEGIN
+ SELECT MAX(a) FROM t1 INTO @a;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # A package with an initialization section producing an error
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS BEGIN SELECT 'This is p1' AS msg; END;
+ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is f1'; END;
+BEGIN
+ SELECT 1 FROM t1 INTO @a;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1.p1();
+--error ER_NO_SUCH_TABLE
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+--error ER_NO_SUCH_TABLE
+SELECT p1.f1();
+--error ER_NO_SUCH_TABLE
+CALL p1.p1();
+--error ER_NO_SUCH_TABLE
+SELECT p1.f1();
+CREATE TABLE t1 (a INT) AS SELECT 1;
+CALL p1.p1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+CALL p1.p1();
+DROP TABLE t1;
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # A package with SF-unsafe statements in the initialization section
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS BEGIN SELECT 'This is p1' AS msg; END;
+ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is f1'; END;
+BEGIN
+ CREATE TABLE IF NOT EXISTS t1 (a INT);
+ DROP TABLE IF EXISTS t1;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # MDEV-13139 Package-wide variables in CREATE PACKAGE
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+--error ER_SP_DUP_VAR
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ a INT;
+ PROCEDURE p1 AS
+ BEGIN
+ CREATE VIEW v1 AS SELECT a;
+ END;
+END;
+$$
+--error ER_PARSE_ERROR
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ PROCEDURE p1 AS
+ BEGIN
+ NULL;
+ END;
+ b INT; -- Variables cannot go after routine definitions
+END;
+$$
+--error ER_VIEW_SELECT_VARIABLE
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ PROCEDURE p1 AS
+ BEGIN
+ CREATE VIEW v1 AS SELECT a;
+ END;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT:=NULL;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT a;
+ a:=COALESCE(a,0)+100;
+ SET a=a+1;
+ END;
+ FUNCTION f1 RETURN INT AS
+ BEGIN
+ RETURN a;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+CALL p1.p1;
+CALL p1.p1;
+SELECT p1.f1();
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # One package variable with a default value
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT:=10;
+ PROCEDURE p1 AS BEGIN a:=a+1; SELECT a; END;
+ FUNCTION f1 RETURN INT AS BEGIN a:=a+1; RETURN a; END;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a ROW (a INT, b TEXT):=ROW(10,'bbb');
+ PROCEDURE p1 AS
+ BEGIN
+ a.a:= a.a+1;
+ a.b:= a.b || 'B';
+ SELECT a.a, a.b;
+ END;
+ FUNCTION f1 RETURN INT AS BEGIN a.a:= a.a+1; RETURN a.a; END;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a t1.a%TYPE:=10;
+ PROCEDURE p1 AS BEGIN a:=a+1; SELECT a; END;
+ FUNCTION f1 RETURN INT AS BEGIN a:=a+1; RETURN a; END;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT, b TEXT);
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a t1%ROWTYPE:=ROW(10,'bbb');
+ PROCEDURE p1 AS
+ BEGIN
+ a.a:= a.a+1;
+ a.b:= a.b || 'B';
+ SELECT a.a, a.b;
+ END;
+ FUNCTION f1 RETURN INT AS BEGIN a.a:= a.a+1; RETURN a.a; END;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # One package variable, set in the package initialization section
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ PROCEDURE p1 AS BEGIN a:=a+1; SELECT a; END;
+ FUNCTION f1 RETURN INT AS BEGIN a:=a+1; RETURN a; END;
+BEGIN
+ a:=10;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+CALL p1.p1();
+SELECT p1.f1();
+CALL p1.p1();
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # A package with an initialization section,
+--echo # loading table data into a package variable
+--echo #
+
+CREATE TABLE t1 AS SELECT 10 AS a;
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN INT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ PROCEDURE p1 AS BEGIN SET a=a+1; SELECT a; END;
+ FUNCTION f1 RETURN INT AS BEGIN SET a=a+1; RETURN a; END;
+BEGIN
+ a:=(SELECT MAX(t1.a) FROM t1);
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1();
+CALL p1.p1();
+SELECT p1.f1();
+SELECT p1.f1();
+--source sp-cache-invalidate.inc
+SELECT p1.f1();
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Package variables and XPath
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ i INT:=0;
+ xml TEXT:= '<a><b>b1</b><b>b2</b><b>b3</b></a>';
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ SET i=i+1;
+ RETURN ExtractValue(xml, '/a/b[$i]');
+ END;
+END;
+$$
+DELIMITER ;$$
+SELECT p1.f1();
+SELECT p1.f1();
+SELECT p1.f1();
+DROP PACKAGE p1;
+
+--echo #
+--echo # Package variables as OUT routine parameter
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ b INT;
+ c INT:=10;
+ PROCEDURE p2(a OUT INT) AS
+ BEGIN
+ a:=c;
+ c:=c+1;
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL p2(b);
+ SELECT a,b;
+ END;
+BEGIN
+ CALL p2(a);
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a ROW(a INT, b TEXT);
+ b ROW(a INT, b TEXT);
+ c ROW(a INT, b TEXT):=ROW(1,'b');
+ PROCEDURE p2(x OUT ROW(a INT,b TEXT)) AS
+ BEGIN
+ x:=c;
+ x.a:=c.a+100;
+ x.b:=c.b||'X';
+ c.a:=c.a+1;
+ c.b:=c.b||'B';
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL p2(b);
+ SELECT a.a,a.b,b.a,b.b;
+ END;
+BEGIN
+ CALL p2(a);
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+
+
+CREATE TABLE t1 (a INT,b TEXT);
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a t1%ROWTYPE;
+ b t1%ROWTYPE;
+ c t1%ROWTYPE:=ROW(1,'b');
+ PROCEDURE p2(x OUT t1%ROWTYPE) AS
+ BEGIN
+ x:=c;
+ x.a:=c.a+100;
+ x.b:=c.b||'X';
+ c.a:=c.a+1;
+ c.b:=c.b||'B';
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL p2(b);
+ SELECT a.a,a.b,b.a,b.b;
+ END;
+BEGIN
+ CALL p2(a);
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Package variable fields as OUT routine parameters
+--echo #
+
+CREATE TABLE t1 (a INT,b TEXT);
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a t1%ROWTYPE;
+ x t1%ROWTYPE:=ROW(10,'b');
+ PROCEDURE p2(a OUT INT,b OUT TEXT) AS
+ BEGIN
+ a:=x.a;
+ b:=x.b;
+ x.a:=x.a+1;
+ x.b:=x.b||'B';
+ END;
+ PROCEDURE p1 AS
+ BEGIN
+ CALL p2(a.a, a.b);
+ SELECT a.a,a.b;
+ END;
+BEGIN
+ CALL p2(a.a, a.b);
+ SELECT a.a, a.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Package variables as SELECT INTO targets
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a INT;
+ b INT;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 2 INTO b;
+ SELECT a,b;
+ END;
+BEGIN
+ SELECT 1 INTO a;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+
+
+CREATE TABLE t1 (a INT, b TEXT);
+INSERT INTO t1 VALUES (10,'b');
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a t1%ROWTYPE;
+ b t1%ROWTYPE;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT * FROM t1 INTO a;
+ SELECT a.a,a.b;
+ END;
+BEGIN
+ SELECT * FROM t1 INTO b;
+ SELECT b.a, b.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Package variable fields as SELECT INTO targets
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ a ROW(a INT, b TEXT);
+ b ROW(a INT, b TEXT);
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 20,'x2' INTO b.a,b.b;
+ SELECT a.a,a.b,b.a,b.b;
+ END;
+BEGIN
+ SELECT 10,'x1' INTO a.a,a.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # Recursive package procedure calls
+--echo # Makes sure that the non-top sp_head instances created by
+--echo # sp_clone_and_link_routine() correctly reproduce the package context:
+--echo # package variables, package routines.
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1(c INT);
+END p1;
+$$
+CREATE PACKAGE BODY p1 AS
+ pv1 INT:=10;
+ FUNCTION f1 RETURN INT AS BEGIN RETURN pv1+100; END;
+ PROCEDURE p1(c INT) AS
+ BEGIN
+ SELECT c, pv1, f1();
+ IF c>0 THEN
+ pv1:=pv1+1;
+ CALL p1(c-1);
+ END IF;
+ END;
+END;
+$$
+DELIMITER ;$$
+SET max_sp_recursion_depth=5;
+CALL p1.p1(5);
+SET max_sp_recursion_depth=0;
+CALL p1.p1(0);
+--error ER_SP_RECURSION_LIMIT
+CALL p1.p1(1);
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # Non-reserved keywords as package body variable names
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+END p1;
+$$
+CREATE PACKAGE BODY p1 AS
+ ascii INT:=10;
+ action INT:=20;
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT ascii, action;
+ END;
+BEGIN
+ ascii := ascii + 1;
+ action := action + 1;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+
+
+--echo #
+--echo # Package routines calling routines of another package
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE p1 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE p2 AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY p1 AS
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 'This is p1.p1' AS msg;
+ END;
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN 'This is p1.f1';
+ END;
+END;
+$$
+CREATE PACKAGE BODY p2 AS
+ PROCEDURE p1 AS
+ BEGIN
+ CALL p1.p1;
+ END;
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN p1.f1();
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+CALL p2.p1;
+SELECT p1.f1(), p2.f1();
+DROP PACKAGE p2;
+DROP PACKAGE p1;
+
+--echo #
+--echo # Package names with dot characters
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE "p1.p1" AS
+ PROCEDURE p1;
+ FUNCTION f1 RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY "p1.p1" AS
+ PROCEDURE p1 AS
+ BEGIN
+ SELECT 'This is p1' AS msg;
+ END;
+ FUNCTION f1 RETURN TEXT AS
+ BEGIN
+ RETURN 'This is f1';
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL "p1.p1"."p1";
+SELECT "p1.p1"."f1"();
+DROP PACKAGE "p1.p1";
+
+
+--echo #
+--echo # MDEV-15070 Crash when doing a CREATE VIEW inside a package routine
+--echo #
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg1 AS
+ PROCEDURE p00();
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg1 AS
+ PROCEDURE p01() AS
+ BEGIN
+ SELECT 'This is p01' AS msg;
+ END;
+ PROCEDURE p00() AS
+ BEGIN
+ CREATE OR REPLACE VIEW v1 AS SELECT 1;
+ DROP VIEW v1;
+ CALL p01();
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL pkg1.p00;
+DROP PACKAGE pkg1;
+
+
+CREATE OR REPLACE TABLE t1 (a INT);
+CREATE OR REPLACE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1;
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg1 AS
+ PROCEDURE p00();
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg1 AS
+ PROCEDURE p01() AS
+ BEGIN
+ SELECT 'This is p01' AS msg;
+ END;
+ PROCEDURE p00() AS
+ BEGIN
+ DROP TRIGGER tr1;
+ CALL p01();
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL pkg1.p00;
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-17387 MariaDB Server giving wrong error while executing select query from procedure
+--echo #
+
+CREATE TABLE t1 (
+ CTR varchar(2) NOT NULL,
+ COR varchar(3) NOT NULL,
+ DATE datetime NOT NULL,
+ CHAN varchar(4) NOT NULL,
+ CNO varchar(20) NOT NULL,
+ JOBN varchar(18) NOT NULL,
+ C1 varchar(30) DEFAULT NULL,
+ C2 varchar(30) DEFAULT NULL,
+ TIME datetime DEFAULT NULL,
+ AMT decimal(12,2) DEFAULT NULL,
+ DT datetime NOT NULL,
+ pk int(11) NOT NULL,
+ PRIMARY KEY (pk),
+ KEY Indx1 (JOBN)
+);
+
+DELIMITER $$;
+
+CREATE PACKAGE xyz IS
+ PROCEDURE xyz123(ctr IN VARCHAR2,Jn IN VARCHAR2,R OUT VARCHAR2);
+END;
+$$
+
+CREATE OR REPLACE PACKAGE BODY xyz IS
+ PROCEDURE xyz123(
+ ctr IN VARCHAR2,
+ Jn IN VARCHAR2,
+ R OUT VARCHAR2)
+ AS
+ lS NUMBER(10) :=0;
+ CURSOR cBPD IS
+ SELECT CTR, COR, DATE, CHAN, CNO, C1, C2, TIME, AMT
+ FROM t1 WHERE JOBN=Jn;
+ BEGIN
+ FOR lbpd IN cBPD
+ LOOP
+ lS:=lS+1;
+ END LOOP;
+ EXCEPTION
+ WHEN OTHERS THEN
+ BEGIN
+ SELECT SQLERRM;
+ END;
+ END;
+END $$
+DELIMITER ;$$
+
+CALL xyz.xyz123(17,18,@R);
+DROP PACKAGE xyz;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-param.inc b/mysql-test/suite/compat/oracle/t/sp-param.inc
new file mode 100644
index 00000000000..35bce8accea
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-param.inc
@@ -0,0 +1,9 @@
+--eval CREATE FUNCTION f1(param $type) RETURN $type AS BEGIN RETURN param; END;
+SHOW CREATE FUNCTION f1;
+
+--eval SELECT LENGTH(f1(REPEAT('a',$length)));
+--eval CREATE TABLE t1 AS SELECT f1(REPEAT('a',$length)) AS a;
+
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+DROP FUNCTION f1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-param.test b/mysql-test/suite/compat/oracle/t/sp-param.test
new file mode 100644
index 00000000000..b887858d736
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-param.test
@@ -0,0 +1,363 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10596 Allow VARCHAR and VARCHAR2 without length as a data type of routine parameters and in RETURN clause
+--echo #
+
+--let type = CHAR
+--let length = 2000
+--source sp-param.inc
+
+--let type = NCHAR
+--let length = 2000
+--source sp-param.inc
+
+--let type = BINARY
+--let length = 2000
+--source sp-param.inc
+
+--let type = VARCHAR
+--let length = 4000
+--source sp-param.inc
+
+--let type = VARCHAR2
+--let length = 4000
+--source sp-param.inc
+
+--let type = NVARCHAR
+--let length = 4000
+--source sp-param.inc
+
+--let type = VARBINARY
+--let length = 4000
+--source sp-param.inc
+
+--let type = RAW
+--let length = 4000
+--source sp-param.inc
+
+--echo
+--echo MDEV-13919 sql_mode=ORACLE: Derive length of VARCHAR SP parameters with no length from actual parameters
+--echo
+set sql_mode= 'oracle,strict_trans_tables';
+delimiter /;
+CREATE OR REPLACE PROCEDURE p1(pinout INOUT varchar, pin IN varchar)
+AS
+BEGIN
+ pinout:=pin;
+END;
+/
+call p1(@w,'0123456789')
+/
+declare w varchar(10);
+begin
+ call p1(w,'0123456789');
+end;
+/
+--error ER_DATA_TOO_LONG
+declare w varchar(5);
+begin
+ call p1(w,'0123456789');
+end;
+/
+declare w varchar(20);
+begin
+ w:='aaa';
+ call p1(w,'0123456789');
+end;
+/
+--error ER_DATA_TOO_LONG
+declare w varchar(8);
+begin
+ w:='aaa';
+ call p1(w,'0123456789');
+end;
+/
+declare str varchar(6000);
+ pout varchar(6000);
+begin
+ str:=lpad('x',6000,'y');
+ call p1(pout,str);
+ select length(pout);
+end;
+/
+--error ER_DATA_TOO_LONG
+declare str varchar(6000);
+ pout varchar(4000);
+begin
+ str:=lpad('x',6000,'y');
+ call p1(pout,str);
+ select length(pout);
+end;
+/
+declare str varchar(40000);
+ pout varchar(60000);
+begin
+ str:=lpad('x',40000,'y');
+ call p1(pout,str);
+ select length(pout);
+end;
+/
+--error ER_DATA_TOO_LONG
+declare str text(80000);
+ pout text(80000);
+begin
+ str:=lpad('x',80000,'y');
+ call p1(pout,str);
+ select length(pout);
+end;
+/
+declare str text(80000);
+ pout text(80000);
+begin
+ str:=lpad('x',60000,'y');
+ call p1(pout,str);
+ select length(pout);
+end;
+/
+drop procedure p1
+/
+DELIMITER ;/
+
+
+#
+# Procedure, non-strict mode
+#
+
+SET sql_mode=ORACLE;
+DELIMITER /;
+CREATE PROCEDURE p1(pinout INOUT varchar, pin IN varchar)
+AS
+BEGIN
+ pinout:=pin;
+END;
+/
+CREATE PROCEDURE p2(len INT)
+AS
+ pinout VARCHAR(10);
+ pin VARCHAR(30);
+BEGIN
+ pin:= REPEAT('x', len);
+ p1(pinout, pin);
+ SELECT LENGTH(pinout);
+END;
+/
+DELIMITER ;/
+CALL p2(10);
+CALL p2(11);
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+
+#
+# Function, not-strict mode
+#
+
+SET sql_mode=ORACLE;
+DELIMITER /;
+CREATE FUNCTION f1(pin VARCHAR, padlen INT) RETURN TEXT
+AS
+BEGIN
+ pin:=LPAD(pin, padlen);
+ RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str TEXT :='x';
+BEGIN
+ SELECT LENGTH(f1(str,padlen));
+END;
+/
+DELIMITER ;/
+CALL p2(65535);
+CALL p2(65536);
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+
+
+#
+# Procedure, utf8 formal parameter, latin actual parameter
+#
+
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+DELIMITER /;
+CREATE PROCEDURE p1(pinout INOUT VARCHAR CHARACTER SET utf8,
+ pin IN VARCHAR CHARACTER SET utf8)
+AS
+BEGIN
+ pinout:=pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str VARCHAR(40000) CHARACTER SET latin1;
+ pout VARCHAR(60000) CHARACTER SET latin1;
+BEGIN
+ str:=lpad('x',padlen,'y');
+ p1(pout,str);
+ SELECT length(pout);
+END;
+/
+DELIMITER ;/
+CALL p2(21844);
+--error ER_DATA_TOO_LONG
+CALL p2(21845);
+--error ER_DATA_TOO_LONG
+CALL p2(21846);
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+
+#
+# Procedure, utf8 formal parameter, utf8 actual parameter
+#
+
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+DELIMITER /;
+CREATE PROCEDURE p1(pinout INOUT VARCHAR CHARACTER SET utf8,
+ pin IN VARCHAR CHARACTER SET utf8)
+AS
+BEGIN
+ pinout:=pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str TEXT CHARACTER SET utf8;
+ pout TEXT CHARACTER SET utf8;
+BEGIN
+ str:=lpad('x',padlen,'y');
+ p1(pout,str);
+ SELECT length(pout);
+END;
+/
+DELIMITER ;/
+CALL p2(21844);
+--error ER_DATA_TOO_LONG
+CALL p2(21845);
+--error ER_DATA_TOO_LONG
+CALL p2(21846);
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+
+#
+# Function, latin1 formal parameter, latin1 actual parameter
+#
+
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+DELIMITER /;
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET latin1, padlen INT) RETURN TEXT
+AS
+BEGIN
+ pin:=LPAD(pin, padlen);
+ RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str TEXT CHARACTER SET latin1 :='x';
+BEGIN
+ SELECT LENGTH(f1(str,padlen));
+END;
+/
+DELIMITER ;/
+CALL p2(65532);
+--error ER_DATA_TOO_LONG
+CALL p2(65533);
+--error ER_DATA_TOO_LONG
+CALL p2(65534);
+--error ER_DATA_TOO_LONG
+CALL p2(65535);
+--error ER_DATA_TOO_LONG
+CALL p2(65536);
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+
+
+#
+# Function, utf8 formal parameter, utf8 actual parameter
+#
+
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+DELIMITER /;
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET utf8, padlen INT) RETURN TEXT
+AS
+BEGIN
+ pin:=LPAD(pin, padlen);
+ RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str TEXT CHARACTER SET utf8 := 'x';
+BEGIN
+ SELECT LENGTH(f1(str,padlen));
+END;
+/
+DELIMITER ;/
+CALL p2(21844);
+--error ER_DATA_TOO_LONG
+CALL p2(21845);
+--error ER_DATA_TOO_LONG
+CALL p2(21846);
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+
+
+#
+# Function, utf8 formal parameter, latin1 actual parameter
+#
+
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+DELIMITER /;
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET utf8, padlen INT) RETURN TEXT
+AS
+BEGIN
+ pin:=LPAD(pin, padlen);
+ RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str TEXT CHARACTER SET latin1 := 'x';
+BEGIN
+ SELECT LENGTH(f1(str,padlen));
+END;
+/
+DELIMITER ;/
+CALL p2(21844);
+--error ER_DATA_TOO_LONG
+CALL p2(21845);
+--error ER_DATA_TOO_LONG
+CALL p2(21846);
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+
+
+#
+# Function, latin1 formal parameter, utf8 actual parameter
+#
+
+SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
+DELIMITER /;
+CREATE FUNCTION f1(pin VARCHAR CHARACTER SET latin1, padlen INT) RETURN TEXT
+AS
+BEGIN
+ pin:=LPAD(pin, padlen);
+ RETURN pin;
+END;
+/
+CREATE PROCEDURE p2(padlen INT) AS
+ str TEXT CHARACTER SET utf8 := 'x';
+BEGIN
+ SELECT LENGTH(f1(str,padlen));
+END;
+/
+DELIMITER ;/
+CALL p2(65532);
+--error ER_DATA_TOO_LONG
+CALL p2(65533);
+--error ER_DATA_TOO_LONG
+CALL p2(65534);
+--error ER_DATA_TOO_LONG
+CALL p2(65535);
+--error ER_DATA_TOO_LONG
+CALL p2(65536);
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-row-vs-var.inc b/mysql-test/suite/compat/oracle/t/sp-row-vs-var.inc
new file mode 100644
index 00000000000..14f6f7dfd44
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-row-vs-var.inc
@@ -0,0 +1,6 @@
+--let $query= CREATE PROCEDURE p1() AS var $type; rec ROW(var $type); BEGIN CREATE TABLE t1 AS SELECT var,rec.var FROM DUAL;END
+--eval $query
+CALL p1();
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-row.test b/mysql-test/suite/compat/oracle/t/sp-row.test
new file mode 100644
index 00000000000..469494ad228
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-row.test
@@ -0,0 +1,2411 @@
+SET sql_mode=ORACLE;
+
+
+--echo #
+--echo # MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+
+
+--echo #
+--echo # ROW of ROWs is not supported yet
+--echo #
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1()
+AS
+ a ROW(a ROW(a INT));
+BEGIN
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Returning the entire ROW parameter from a function
+--echo #
+# TODO: this should probably return an error at compile time
+DELIMITER $$;
+CREATE FUNCTION f1(a ROW(a INT, b INT)) RETURN INT
+AS
+BEGIN
+ RETURN a;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+SELECT f1(ROW(10,20));
+DROP FUNCTION f1;
+
+
+
+--echo #
+--echo # ROW as an SP parameter
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1(a ROW(a INT,b INT)) RETURN INT
+AS
+BEGIN
+ RETURN a.b;
+END;
+$$
+CREATE PROCEDURE p1()
+AS
+ a ROW(a INT,b INT):=(11,21);
+BEGIN
+ SELECT f1(a);
+END;
+$$
+DELIMITER ;$$
+SELECT f1(ROW(10,20));
+--error ER_OPERAND_COLUMNS
+SELECT f1(10);
+--error ER_OPERAND_COLUMNS
+SELECT f1(ROW(10,20,30));
+CALL p1();
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a ROW(a INT,b INT))
+AS
+BEGIN
+ SELECT a.a, a.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1(ROW(10,20));
+--error ER_OPERAND_COLUMNS
+CALL p1(10);
+--error ER_OPERAND_COLUMNS
+CALL p1(ROW(10,20,30));
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW as an SP OUT parameter
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT ROW(a INT,b INT))
+AS
+BEGIN
+ a.a:=10;
+ a.b:=20;
+END;
+$$
+CREATE PROCEDURE p2
+AS
+ a ROW(a INT,b INT):=(11,21);
+BEGIN
+ CALL p1(a);
+ SELECT a.a,a.b;
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW as an SP return value is not supported yet
+--echo #
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE FUNCTION p1() RETURN ROW(a INT)
+AS
+BEGIN
+ RETURN NULL;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Diplicate row field
+--echo #
+DELIMITER $$;
+--error ER_DUP_FIELDNAME
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT, a DOUBLE);
+BEGIN
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Bad scalar default value
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT, b DOUBLE):= 1;
+BEGIN
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Bad ROW default value with a wrong number of fields
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT, b DOUBLE):= ROW(1,2,3);
+BEGIN
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Scalar variable vs table alias cause no ambiguity
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a INT;
+BEGIN
+ -- a.x is a table column here (not a row variable field)
+ SELECT a.x FROM a;
+ SELECT a.x FROM t1 a;
+END;
+$$
+DELIMITER ;$$
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Using the entire ROW variable in select list
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT);
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT,b INT);
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Using the entire ROW variable in functions
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT);
+BEGIN
+ SELECT COALESCE(a);
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT,b INT);
+BEGIN
+ SELECT COALESCE(a);
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT);
+BEGIN
+ SELECT a+1;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT,b INT);
+BEGIN
+ SELECT a+1;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Comparing the entire ROW to a scalar value
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT,b INT);
+BEGIN
+ SELECT a=1;
+END;
+$$
+DELIMITER ;$$
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p1();
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT,b INT);
+BEGIN
+ SELECT 1=a;
+END;
+$$
+DELIMITER ;$$
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Passing the entire ROW to a stored function
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+BEGIN
+ RETURN a;
+END;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT,b INT);
+BEGIN
+ SELECT f1(a);
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
+
+DELIMITER $$;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+BEGIN
+ RETURN a;
+END;
+CREATE PROCEDURE p1()
+AS
+ a ROW (a INT);
+BEGIN
+ SELECT f1(a);
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Assigning a scalar value to a ROW variable with 1 column
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE p1
+AS
+ rec ROW(a INT);
+BEGIN
+ rec:=1;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning a scalar value to a ROW variable with 2 columns
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ rec:=1;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning a ROW value to a ROW variable with different number of columns
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ rec:=ROW(1,2,3);
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Returning the entire ROW from a function is not supported yet
+--echo # This syntax would be needed: SELECT f1().x FROM DUAL;
+--echo #
+DELIMITER $$;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ rec ROW(a INT);
+BEGIN
+ RETURN rec;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+SELECT f1(10);
+DROP FUNCTION f1;
+
+
+--echo #
+--echo # Using the entire ROW in SELECT..CREATE
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ CREATE TABLE t1 AS SELECT rec;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Using the entire ROW in LIMIT
+--echo #
+DELIMITER $$;
+--error ER_WRONG_SPVAR_TYPE_IN_LIMIT
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a INT);
+BEGIN
+ rec.a:= '10';
+ SELECT * FROM t1 LIMIT rec;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Setting ROW fields using a SET command
+--echo #
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE p1
+AS
+ rec ROW(a INT,b DOUBLE,c VARCHAR(10));
+ a INT;
+BEGIN
+ SET @a= 10, rec.a=10, rec.b=20, rec.c= 'test', a= 5;
+ SELECT rec.a, rec.b, rec.c, a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning a ROW variable from a ROW value
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ rec:=ROW(1,2);
+ SELECT rec.a, rec.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning a ROW variable from another ROW value
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1 ROW(a INT,b INT);
+ rec2 ROW(a INT,b INT);
+BEGIN
+ rec1:=ROW(1,2);
+ rec2:=rec1;
+ SELECT rec2.a, rec2.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Comparing a ROW variable to a ROW() function
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE p1
+AS
+ rec ROW(a INT,b INT);
+BEGIN
+ rec.a:= 1;
+ rec.b:= 2;
+ SELECT rec=(0,0), rec=ROW(0,0), (0,0)=rec, ROW(0,0)=rec;
+ SELECT rec=(1,2), rec=ROW(1,2), (1,2)=rec, ROW(1,2)=rec;
+ SELECT rec=(NULL,0), rec=ROW(NULL,0);
+ SELECT rec=(NULL,2), rec=ROW(NULL,2);
+ SELECT rec<>(0,0), rec<>ROW(0,0);
+ SELECT rec<>(1,2), rec<>ROW(1,2);
+ SELECT rec<>(NULL,0), rec<>ROW(NULL,0);
+ SELECT rec<>(NULL,2), rec<>ROW(NULL,2);
+ SELECT rec IN ((0,0)), rec IN (ROW(0,0));
+ SELECT rec IN ((1,2)), rec IN (ROW(1,2));
+ SELECT rec IN ((0,NULL),(1,2));
+ SELECT rec NOT IN ((0,NULL),(1,1));
+ SELECT rec NOT IN ((1,NULL),(1,1));
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Comparing a ROW variable to another ROW variable
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE p1
+AS
+ rec1,rec2,rec3 ROW(a INT,b INT);
+BEGIN
+ rec1.a:= 1;
+ rec1.b:= 2;
+ rec2.a:= 11;
+ rec2.b:= 12;
+ rec3.a:= 11;
+ rec3.b:= 12;
+ SELECT rec1=rec2, rec2=rec1, rec2=rec3, rec3=rec2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Referencing a non-existing row variable
+--echo #
+DELIMITER $$;
+--error ER_UNKNOWN_STRUCTURED_VARIABLE
+CREATE PROCEDURE p1()
+AS
+BEGIN
+ SET a.b=1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_UNKNOWN_STRUCTURED_VARIABLE
+CREATE PROCEDURE p1()
+AS
+BEGIN
+ a.b:=1;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Referencing a non-existing row field
+--echo #
+DELIMITER $$;
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CREATE PROCEDURE p1()
+AS
+ a ROW(a INT,b INT);
+BEGIN
+ SELECT a.c FROM t1;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # ROW and scalar variables with the same name shadowing each other
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW(a INT);
+BEGIN
+ a.a:=100;
+ DECLARE
+ a INT:= 200;
+ BEGIN
+ SELECT a;
+ DECLARE
+ a ROW(a INT);
+ BEGIN
+ a.a:=300;
+ SELECT a.a;
+ END;
+ SELECT a;
+ END;
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW with good default values
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a ROW(a INT,b INT):= (10,20);
+ b ROW(a INT,b INT):= (11,21);
+ c ROW(a INT,b INT):= a;
+BEGIN
+ SELECT a.a, a.b, b.a, b.b, c.a, c.b FROM DUAL;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW in WHERE clause
+--echo #
+
+CREATE TABLE t1 (a INT,b INT);
+INSERT INTO t1 VALUES (10,20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a INT,b INT):=ROW(10,20);
+BEGIN
+ SELECT * FROM t1 WHERE rec=ROW(a,b);
+ SELECT * FROM t1 WHERE ROW(a,b)=rec;
+ SELECT * FROM t1 WHERE rec=ROW(10,20);
+ SELECT * FROM t1 WHERE ROW(10,20)=rec;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW fields in WHERE clause
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a INT);
+BEGIN
+ rec.a:= 10;
+ SELECT * FROM t1 WHERE a=rec.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW fields in HAVING clause
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a INT);
+BEGIN
+ rec.a:= 10;
+ SELECT * FROM t1 HAVING a=rec.a;
+ SELECT * FROM t1 HAVING MIN(a)=rec.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW fields in LIMIT clause
+--echo #
+
+CREATE TABLE t1 (a INT);
+--error ER_SP_UNDECLARED_VAR
+SELECT 1 FROM t1 LIMIT t1.a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a INT);
+BEGIN
+ rec.a:= 10;
+ SELECT * FROM t1 LIMIT rec.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+--error ER_WRONG_SPVAR_TYPE_IN_LIMIT
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a VARCHAR(10));
+BEGIN
+ rec.a:= '10';
+ SELECT * FROM t1 LIMIT rec.a;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # ROW fields in select list
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10),(20);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ t1 ROW(a INT);
+BEGIN
+ t1.a:= 10;
+ SELECT t1.a, 'This is the variable t1.a value, rather than the column t1.a' AS comm FROM t1;
+ SELECT t1.a, t2.a, t1.a+t2.a FROM t1 t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW fields as insert values
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec ROW(a INT, b VARCHAR(10));
+BEGIN
+ rec.a:= 10;
+ rec.b:= 'test';
+ INSERT INTO t1 VALUES (rec.a, rec.b);
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # ROW fields as SP out parameters
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT INT, b OUT VARCHAR)
+AS
+BEGIN
+ a:= 10;
+ b:= 'test';
+END;
+$$
+CREATE PROCEDURE p2
+AS
+ rec ROW(a INT, b VARCHAR(10));
+BEGIN
+ CALL p1(rec.a, rec.b);
+ SELECT rec.a, rec.b;
+END;
+$$
+DELIMITER ;$$
+CALL p2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+
+--echo #
+--echo # ROW fields as dynamic SQL out parameters
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT INT, b OUT VARCHAR)
+AS
+BEGIN
+ a:= 20;
+ b:= 'test-dynamic-sql';
+END;
+$$
+CREATE PROCEDURE p2
+AS
+ rec ROW(a INT, b VARCHAR(30));
+BEGIN
+ EXECUTE IMMEDIATE 'CALL p1(?,?)' USING rec.a, rec.b;
+ SELECT rec.a, rec.b;
+END;
+$$
+DELIMITER ;$$
+CALL p2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+
+--echo #
+--echo # ROW fields as SELECT..INTO targets
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT, b VARCHAR(10));
+BEGIN
+ SELECT 10,'test' INTO rec.a,rec.b;
+ SELECT rec.a, rec.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Implicit default NULL handling
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec ROW(a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,0), e TIME, f DATETIME);
+BEGIN
+ SELECT rec.a, rec.b, rec.c, rec.d, rec.e, rec.f FROM DUAL;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # NULL handling
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1 ROW(a INT, b VARCHAR(10)):=(NULL,NULL);
+ rec2 ROW(a INT, b VARCHAR(10)):=rec1;
+BEGIN
+ SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+
+ rec1:= (10,20);
+ rec2:= rec1;
+ SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+
+ rec1:= (NULL,20);
+ rec2:= rec1;
+ SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+
+ rec1:= (10,NULL);
+ rec2:= rec1;
+ SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+
+ rec1:= (NULL,NULL);
+ rec2:= rec1;
+ SELECT rec1.a, rec1.b, rec2.a, rec2.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Testing multiple ROW variable declarations
+--echo # This makes sure that fill_field_definitions() is called only once
+--echo # per a ROW field, so create length is not converted to internal length
+--echo # multiple times.
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec1, rec2, rec3 ROW(a VARCHAR(10) CHARACTER SET utf8);
+BEGIN
+ CREATE TABLE t1 AS SELECT rec1.a, rec2.a, rec3.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # INT
+--echo #
+
+--let type=INT
+--source sp-row-vs-var.inc
+
+--let type=INT(1)
+--source sp-row-vs-var.inc
+
+--let type=INT(2)
+--source sp-row-vs-var.inc
+
+--let type=INT(3)
+--source sp-row-vs-var.inc
+
+--let type=INT(4)
+--source sp-row-vs-var.inc
+
+--let type=INT(5)
+--source sp-row-vs-var.inc
+
+--let type=INT(6)
+--source sp-row-vs-var.inc
+
+--let type=INT(7)
+--source sp-row-vs-var.inc
+
+--let type=INT(8)
+--source sp-row-vs-var.inc
+
+--let type=INT(9)
+--source sp-row-vs-var.inc
+
+--let type=INT(10)
+--source sp-row-vs-var.inc
+
+--let type=INT(11)
+--source sp-row-vs-var.inc
+
+--let type=INT(12)
+--source sp-row-vs-var.inc
+
+--let type=INT(13)
+--source sp-row-vs-var.inc
+
+--let type=INT(14)
+--source sp-row-vs-var.inc
+
+--let type=INT(20)
+--source sp-row-vs-var.inc
+
+--let type=INT(21)
+--source sp-row-vs-var.inc
+
+
+--echo #
+--echo # TINYINT
+--echo #
+
+--let type=TINYINT
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(1)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(2)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(3)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(4)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(5)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(6)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(7)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(8)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(9)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(10)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(11)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(12)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(13)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(14)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(20)
+--source sp-row-vs-var.inc
+
+--let type=TINYINT(21)
+--source sp-row-vs-var.inc
+
+--echo #
+--echo # SMALLINT
+--echo #
+
+--let type=SMALLINT
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(1)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(2)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(3)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(4)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(5)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(6)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(7)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(8)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(9)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(10)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(11)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(12)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(13)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(14)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(20)
+--source sp-row-vs-var.inc
+
+--let type=SMALLINT(21)
+--source sp-row-vs-var.inc
+
+
+--echo #
+--echo # MEDIUMINT
+--echo #
+
+--let type=MEDIUMINT
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(1)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(2)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(3)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(4)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(5)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(6)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(7)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(8)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(9)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(10)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(11)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(12)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(13)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(14)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(20)
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMINT(21)
+--source sp-row-vs-var.inc
+
+
+--echo #
+--echo # BIGINT
+--echo #
+
+--let type=BIGINT
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(1)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(2)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(3)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(4)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(5)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(6)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(7)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(8)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(9)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(10)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(11)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(12)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(13)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(14)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(20)
+--source sp-row-vs-var.inc
+
+--let type=BIGINT(21)
+--source sp-row-vs-var.inc
+
+
+--echo #
+--echo # DOUBLE
+--echo #
+
+--let type=DOUBLE
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,1)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,2)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,3)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,4)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,5)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,6)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,7)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,8)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,9)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,10)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,11)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,12)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,13)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,14)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,20)
+--source sp-row-vs-var.inc
+
+--let type=DOUBLE(30,21)
+--source sp-row-vs-var.inc
+
+--echo #
+--echo # VARCHAR
+--echo #
+
+--let type=CHAR
+--source sp-row-vs-var.inc
+
+--let type=BINARY
+--source sp-row-vs-var.inc
+
+--let type=CHAR(1)
+--source sp-row-vs-var.inc
+
+--let type=CHAR(10)
+--source sp-row-vs-var.inc
+
+--let type=NCHAR(10)
+--source sp-row-vs-var.inc
+
+--let type=BINARY(10)
+--source sp-row-vs-var.inc
+
+--let type=VARBINARY(10)
+--source sp-row-vs-var.inc
+
+--let type=VARCHAR(10)
+--source sp-row-vs-var.inc
+
+--let type=VARCHAR(10) CHARACTER SET utf8
+--source sp-row-vs-var.inc
+
+--let type=VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
+--source sp-row-vs-var.inc
+
+--echo #
+--echo # TIME
+--echo #
+
+--let type=TIME
+--source sp-row-vs-var.inc
+
+--let type=TIME(1)
+--source sp-row-vs-var.inc
+
+--let type=TIME(2)
+--source sp-row-vs-var.inc
+
+--let type=TIME(3)
+--source sp-row-vs-var.inc
+
+--let type=TIME(4)
+--source sp-row-vs-var.inc
+
+--let type=TIME(5)
+--source sp-row-vs-var.inc
+
+--let type=TIME(6)
+--source sp-row-vs-var.inc
+
+--echo #
+--echo # DATETIME
+--echo #
+
+--let type=DATETIME
+--source sp-row-vs-var.inc
+
+--let type=DATETIME(1)
+--source sp-row-vs-var.inc
+
+--let type=DATETIME(2)
+--source sp-row-vs-var.inc
+
+--let type=DATETIME(3)
+--source sp-row-vs-var.inc
+
+--let type=DATETIME(4)
+--source sp-row-vs-var.inc
+
+--let type=DATETIME(5)
+--source sp-row-vs-var.inc
+
+--let type=DATETIME(6)
+--source sp-row-vs-var.inc
+
+
+--echo #
+--echo # LOB
+--echo #
+
+--let type=TEXT
+--source sp-row-vs-var.inc
+
+--let type=TINYTEXT
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMTEXT
+--source sp-row-vs-var.inc
+
+--let type=LONGTEXT
+--source sp-row-vs-var.inc
+
+--let type=TEXT CHARACTER SET utf8
+--source sp-row-vs-var.inc
+
+--let type=TINYTEXT CHARACTER SET utf8
+--source sp-row-vs-var.inc
+
+--let type=MEDIUMTEXT CHARACTER SET utf8
+--source sp-row-vs-var.inc
+
+--let type=LONGTEXT CHARACTER SET utf8
+--source sp-row-vs-var.inc
+
+
+--echo #
+--echo # End of MDEV-10914 ROW data type for stored routine variables
+--echo #
+
+
+--echo #
+--echo # MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
+--echo #
+
+--echo #
+--echo # Referring to a table in a non-existing database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec test2.t1%ROWTYPE;
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+--error ER_NO_SUCH_TABLE
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Referring to a table in the current database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec t1%ROWTYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Referring to a table in an explicitly specified database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec test.t1%ROWTYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Referring to a view in the current database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec v1%ROWTYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Referring to a view in an explicitly specified database
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec test.v1%ROWTYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT rec.a, rec.b, rec.c, rec.d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CALL p1();
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Checking that all table%ROWTYPE fields are NULL by default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ SELECT rec1.a, rec1.b, rec1.c, rec1.d;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A table%ROWTYPE variable with a ROW expression as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE DEFAULT ROW(10,'bbb');
+BEGIN
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A table%ROWTYPE variable with an incompatible ROW expression as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE DEFAULT ROW(10,'bbb','ccc');
+BEGIN
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A table%ROWTYPE variable with a ROW variable as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 ROW(a INT, b VARCHAR(10)):= ROW(10,'bbb');
+ rec2 t1%ROWTYPE DEFAULT rec1;
+BEGIN
+ SELECT rec2.a, rec2.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A ROW variable using a table%ROWTYPE variable as a default
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE := ROW(10,'bbb');
+ rec2 ROW(a INT, b VARCHAR(10)):= rec1;
+BEGIN
+ SELECT rec2.a, rec2.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning table%ROWTYPE variables with a different column count
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE);
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+ rec2 t2%ROWTYPE;
+BEGIN
+ rec2:=rec1;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP PROCEDURE p1;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+ rec2 t2%ROWTYPE;
+BEGIN
+ rec1:=rec2;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning compatible table%ROWTYPE variables (equal number of fields)
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+ rec2 t2%ROWTYPE;
+BEGIN
+ rec1.a:= 10;
+ rec1.b:= 'bbb';
+ rec2:=rec1;
+ SELECT rec2.x, rec2.y;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning between incompatible table%ROWTYPE and explicit ROW variables
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+ rec2 ROW(x INT,y INT,z INT);
+BEGIN
+ rec2.x:= 10;
+ rec2.y:= 20;
+ rec2.z:= 30;
+ rec1:= rec2;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning between compatible table%ROWTYPE and explicit ROW variables
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+ rec2 ROW(x INT,y INT);
+BEGIN
+ rec2.x:= 10;
+ rec2.y:= 20;
+ rec1:= rec2;
+ SELECT rec1.a, rec1.b;
+ rec1.a:= 11;
+ rec1.b:= 21;
+ rec2:= rec1;
+ SELECT rec2.x, rec2.y;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Assigning table%ROWTYPE from a ROW expression
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ rec1:= ROW(10,20);
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a table%ROWTYPE variable with a wrong field count
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec2 t2%ROWTYPE;
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec2;
+ CLOSE cur1;
+END;
+$$
+DELIMITER ;$$
+--error ER_SP_WRONG_NO_OF_FETCH_ARGS
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a table%ROWTYPE variable
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10), c DOUBLE, d DECIMAL(10,2));
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (10,'bb1',111.111e2, 12.31);
+INSERT INTO t1 VALUES (20,'bb2',222.222e2, 12.32);
+INSERT INTO t1 VALUES (30,'bb3',333.333e2, 12.33);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec t1%ROWTYPE;
+ CURSOR cur IS SELECT * FROM t1;
+BEGIN
+ OPEN cur;
+ LOOP
+ FETCH cur INTO rec;
+ EXIT WHEN cur%NOTFOUND;
+ SELECT rec.a, rec.b, rec.c, rec.d;
+ INSERT INTO t2 VALUES (rec.a, rec.b, rec.c, rec.d);
+ END LOOP;
+ CLOSE cur;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # Fetching a cursor into a table%ROWTYPE variable with different column names
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (x INT, y VARCHAR(10));
+INSERT INTO t1 VALUES (10,'bbb');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec2 t2%ROWTYPE;
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec2;
+ SELECT rec2.x, rec2.y;
+ CLOSE cur1;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Fetching a cursor into a table%ROWTYPE variable, with truncation
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t1 VALUES (10,'11x');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ rec2 t2%ROWTYPE;
+ CURSOR cur1 IS SELECT * FROM t1;
+BEGIN
+ OPEN cur1;
+ FETCH cur1 INTO rec2;
+ SELECT rec2.a, rec2.b;
+ CLOSE cur1;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # table%ROWTYPE variables are not allowed in LIMIT
+--echo #
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2);
+DELIMITER $$;
+--error ER_WRONG_SPVAR_TYPE_IN_LIMIT
+CREATE PROCEDURE p1()
+AS
+ rec1 t1%ROWTYPE:=(1,2);
+BEGIN
+ SELECT * FROM t1 LIMIT rec1.a;
+END;
+$$
+DELIMITER ;$$
+DROP TABLE t1;
+
+
+--echo #
+--echo # table%ROWTYPE variable fields as OUT parameters
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT INT,b OUT VARCHAR(10))
+AS
+BEGIN
+ a:=10;
+ b:='bb';
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ CALL p1(rec1.a, rec1.b);
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Passing the entire table%ROWTYPE variable
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1(a ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+ SELECT a.a, a.b;
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+ rec1 t1%ROWTYPE:= ROW(10,'bb');
+BEGIN
+ CALL p1(rec1);
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Passing the entire table%ROWTYPE variable as an OUT parameter
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1(a OUT ROW(a INT, b VARCHAR(10)))
+AS
+BEGIN
+ a:= ROW(10,'bb');
+END;
+$$
+CREATE PROCEDURE p2()
+AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ CALL p1(rec1);
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p2();
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Assigning a table%ROWTYPE field to an OUT parameter
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1 (res IN OUT INTEGER)
+AS
+ rec1 t1%ROWTYPE:=ROW(10,'b0');
+BEGIN
+ res:=rec1.a;
+END;
+$$
+DELIMITER ;$$
+CALL p1(@res);
+SELECT @res;
+SET @res=NULL;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing Item_splocal_row_field_by_name::print
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec t1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+ EXPLAIN EXTENDED SELECT rec.a, rec.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Non-existing field
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec t1%ROWTYPE;
+BEGIN
+ SELECT rec.c;
+END;
+$$
+DELIMITER ;$$
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CALL p1();
+ALTER TABLE t1 ADD c INT;
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing that field names are case insensitive
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec t1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+ SELECT rec.A, rec.B;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing that table%ROWTYPE uses temporary tables vs shadowed real tables
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+CREATE TEMPORARY TABLE t1 (x INT, y VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ rec t1%ROWTYPE:=ROW(10,'bb');
+BEGIN
+ SELECT rec.A, rec.B;
+END;
+$$
+DELIMITER ;$$
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CALL p1();
+DROP TEMPORARY TABLE t1;
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Testing that the structure of table%ROWTYPE variables is determined at the very beginning and is not changed after ALTER
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ ALTER TABLE t1 ADD c INT;
+ DECLARE
+ rec t1%ROWTYPE; -- this will not have column "c"
+ BEGIN
+ rec.c:=10;
+ END;
+END;
+$$
+DELIMITER ;$$
+--error ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12291 Allow ROW variables as SELECT INTO targets
+--echo #
+
+
+--echo # ROW variable with a wrong column count
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec1 ROW(a INT, b VARCHAR(32), c DOUBLE);
+BEGIN
+ SELECT * FROM t1 INTO rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # Multiple ROW variables
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+ SELECT * FROM t1 INTO rec1, rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # ROW variables working example
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec1 ROW(a INT, b VARCHAR(32));
+BEGIN
+ SELECT * FROM t1 INTO rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # table%ROWTYPE variable with a wrong column count
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ SELECT 10,'a','b' FROM t1 INTO rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # Multiple table%ROWTYPE variables
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ SELECT 10,'a' FROM t1 INTO rec1, rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # table%ROWTYPE working example
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ rec1 t1%ROWTYPE;
+BEGIN
+ SELECT * FROM t1 INTO rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # cursor%ROWTYPE variable with a wrong column count
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur1 IS SELECT 10, 'b0', 'c0';
+ rec1 cur1%ROWTYPE;
+BEGIN
+ SELECT * FROM t1 INTO rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # Multiple cursor%ROWTYPE variables
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ rec1 cur1%ROWTYPE;
+BEGIN
+ SELECT * FROM t1 INTO rec1, rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_OPERAND_COLUMNS
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo # cursor%ROWTYPE working example
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+INSERT INTO t1 VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ rec1 cur1%ROWTYPE;
+BEGIN
+ SELECT * FROM t1 INTO rec1;
+ SELECT rec1.a, rec1.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12347 Valgrind reports invalid read errors in Item_field_row::element_index_by_name
+--echo #
+
+# An additional test for MDEV-12347, to make sure that
+# Column_definition::interval creates a permanent copy of TYPELIB on
+# the memory root when processing %ROWTYPE for a table with ENUM/SET column,
+# rather than reuses the TYPELIB from table->field[i], which is freed in the
+# end of sp_rcontext::resolve_table_rowtype_ref().
+
+CREATE TABLE t1 (a INT, b ENUM('b0','b1','b12','b3'));
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ DECLARE
+ rec t1%ROWTYPE;
+ BEGIN
+ rec.b:='b0';
+ SELECT rec.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+CREATE TABLE t1 (a INT, b SET('b0','b1','b12','b3'));
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ DECLARE
+ rec t1%ROWTYPE;
+ BEGIN
+ rec.b:='b0';
+ SELECT rec.b;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-13273 Confusion between table alias and ROW type variable
+--echo #
+
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT;
+ b INT;
+BEGIN
+ -- a.c1 is a table column
+ SELECT a.c1 INTO b
+ FROM t1 a
+ WHERE a.c2 = 0;
+ SELECT b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a ROW (c1 INT, c2 INT) := ROW(101,102);
+ b INT;
+BEGIN
+ -- a.c1 is a ROW variable field
+ SELECT a.c1 INTO b
+ FROM t1 a
+ WHERE a.c2 = 102;
+ SELECT b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1%ROWTYPE := ROW (10,20);
+ b INT;
+BEGIN
+ -- a.c1 is a ROW variable field
+ SELECT a.c1 INTO b
+ FROM t1 a
+ WHERE a.c2 = 20;
+ SELECT b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (0,0);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ CURSOR cur1 IS SELECT * FROM t1;
+ a cur1%ROWTYPE := ROW (10,20);
+ b INT;
+BEGIN
+ -- a.c1 is a ROW variable field
+ SELECT a.c1 INTO b
+ FROM t1 a
+ WHERE a.c2 = 20;
+ SELECT b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
+--echo #
+
+DELIMITER $$;
+DECLARE
+ a ROW(a INT);
+BEGIN
+ EXPLAIN SELECT 1 INTO a.a;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # MDEV-14139 Anchored data types for variables
+--echo #
+
+DELIMITER $$;
+DECLARE
+ row1 ROW(int11 INT,text1 TEXT);
+ a_row1 row1%TYPE;
+ aa_row1 a_row1%TYPE;
+BEGIN
+ CREATE TABLE t1 AS SELECT a_row1.int11 AS int11, a_row1.text1 AS text1;
+ SHOW CREATE TABLE t1;
+ DROP TABLE t1;
+ CREATE TABLE t1 AS SELECT aa_row1.int11 AS int11, aa_row1.text1 AS text1;
+ SHOW CREATE TABLE t1;
+ DROP TABLE t1;
+END;
+$$
+DELIMITER ;$$
diff --git a/mysql-test/suite/compat/oracle/t/sp-security.test b/mysql-test/suite/compat/oracle/t/sp-security.test
new file mode 100644
index 00000000000..1732c0b80db
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-security.test
@@ -0,0 +1,345 @@
+--source include/not_embedded.inc
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+--echo #
+
+
+--echo #
+--echo # Initiation:
+--echo # - creating database db1
+--echo # - creating user user1 with access rights to db1
+--echo #
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT, b VARCHAR(10));
+
+CREATE USER user1;
+
+GRANT ALL PRIVILEGES ON test.* TO user1;
+
+connect (conn1,localhost,user1,,test);
+SET sql_mode=ORACLE;
+
+SELECT database();
+SELECT user();
+
+--echo #
+--echo # Making sure that user1 does not have privileges to db1.t1
+--echo #
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE TABLE db1.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW FIELDS IN db1.t1;
+
+
+--echo #
+--echo # Trigger: using %TYPE with a table we don't have access to
+--echo #
+CREATE TABLE test.t1 (a INT, b INT);
+INSERT INTO test.t1 (a,b) VALUES (10,20);
+SELECT * FROM t1;
+DELIMITER $$;
+CREATE TRIGGER test.tr1 BEFORE INSERT ON test.t1 FOR EACH ROW
+BEGIN
+ DECLARE b db1.t1.b%TYPE := 20;
+ BEGIN
+ :NEW.b := 10;
+ END;
+END
+$$
+DELIMITER ;$$
+--error ER_TABLEACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Stored procedure: Using %TYPE for with a table that we don't have access to
+--echo # DEFINER user1, SQL SECURITY DEFAULT
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a db1.t1.a%TYPE := 10;
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+--error ER_TABLEACCESS_DENIED_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a db1.t1%ROWTYPE;
+BEGIN
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+--error ER_TABLEACCESS_DENIED_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Stored procedure: Using %TYPE for with a table that we don't have access to
+--echo # DEFINER root, SQL SECURITY INVOKER
+--echo #
+
+connection default;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+SQL SECURITY INVOKER
+AS
+ a db1.t1.a%TYPE := 10;
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+connection conn1;
+--error ER_TABLEACCESS_DENIED_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+connection default;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+SQL SECURITY INVOKER
+AS
+ a db1.t1%ROWTYPE;
+BEGIN
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+connection conn1;
+--error ER_TABLEACCESS_DENIED_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Stored procedure: Using %TYPE for with a table that we don't have access to
+--echo # DEFINER root, SQL SECURITY DEFINER
+--echo #
+
+connection default;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+SQL SECURITY DEFINER
+AS
+ a db1.t1.a%TYPE := 10;
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+connection conn1;
+CALL p1;
+DROP PROCEDURE p1;
+
+connection default;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+SQL SECURITY DEFINER
+AS
+ a db1.t1%ROWTYPE;
+BEGIN
+ a.a:= 10;
+ SELECT a.a;
+END;
+$$
+DELIMITER ;$$
+connection conn1;
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Stored function: Using %TYPE for with a table that we don't have access to
+--echo # DEFINER user1, SQL SECURITY DEFAULT
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT
+AS
+ a db1.t1.a%TYPE:=0;
+BEGIN
+ RETURN OCTET_LENGTH(a);
+END;
+$$
+DELIMITER ;$$
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT f1();
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Stored function: Using %TYPE for with a table that we don't have access to
+--echo # DEFINER root, SQL SECURITY INVOKER
+--echo #
+
+connection default;
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT
+SQL SECURITY INVOKER
+AS
+ a db1.t1.a%TYPE:=0;
+BEGIN
+ RETURN OCTET_LENGTH(a);
+END;
+$$
+DELIMITER ;$$
+connection conn1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT f1();
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Stored function: Using %TYPE for with a table that we don't have access to
+--echo # DEFINER root, SQL SECURITY DEFINER
+--echo #
+
+connection default;
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN INT
+SQL SECURITY DEFINER
+AS
+ a db1.t1.a%TYPE:=0;
+BEGIN
+ RETURN OCTET_LENGTH(a);
+END;
+$$
+DELIMITER ;$$
+connection conn1;
+SELECT f1();
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+connection default;
+GRANT SELECT (a) ON db1.t1 TO user1;
+connection conn1;
+
+--echo #
+--echo # Making sure that user1 has access to db1.t1.a, but not to db1.t1.b
+--echo #
+
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE TABLE db1.t1;
+SHOW FIELDS IN db1.t1;
+
+--echo #
+--echo # Trigger: Per-column privileges
+--echo #
+CREATE TABLE test.t1 (a INT, b INT);
+INSERT INTO test.t1 (a,b) VALUES (10,20);
+SELECT * FROM t1;
+# %TYPE reference using a column we have access to
+DELIMITER $$;
+CREATE TRIGGER test.tr1 BEFORE INSERT ON test.t1 FOR EACH ROW
+BEGIN
+ DECLARE a db1.t1.a%TYPE := 20;
+ BEGIN
+ :NEW.b := 10;
+ END;
+END
+$$
+DELIMITER ;$$
+INSERT INTO t1 (a) VALUES (10);
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+# %TYPE reference using a column that we don't have access to
+DELIMITER $$;
+CREATE TRIGGER test.tr1 BEFORE INSERT ON test.t1 FOR EACH ROW
+BEGIN
+ DECLARE b db1.t1.b%TYPE := 20;
+ BEGIN
+ :NEW.b := 10;
+ END;
+END
+$$
+DELIMITER ;$$
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t1 (a) VALUES (10);
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+
+
+--echo #
+--echo # Stored procedure: Per-column privileges
+--echo # DEFINER user1, SQL SECURITY DEFAULT
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ a db1.t1.a%TYPE := 10;
+BEGIN
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ b db1.t1.b%TYPE := 10;
+BEGIN
+ SELECT b;
+END;
+$$
+DELIMITER ;$$
+--error ER_COLUMNACCESS_DENIED_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+ b db1.t1%ROWTYPE;
+BEGIN
+ b.b:=10;
+ SELECT b.b;
+END;
+$$
+DELIMITER ;$$
+--error ER_COLUMNACCESS_DENIED_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Clean up
+--echo #
+disconnect conn1;
+connection default;
+
+DROP USER user1;
+DROP DATABASE db1;
+
+--echo #
+--echo # End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+--echo #
diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test
new file mode 100644
index 00000000000..31657aa4aef
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp.test
@@ -0,0 +1,2399 @@
+--source include/default_charset.inc
+
+SET sql_mode=ORACLE;
+
+--echo # Testing routines with no parameters
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+ RETURN 10;
+END;
+/
+DELIMITER ;/
+--vertical_results
+SHOW CREATE FUNCTION f1;
+--horizontal_results
+SELECT f1();
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ SET @a=10;
+END;
+/
+DELIMITER ;/
+--vertical_results
+SHOW CREATE PROCEDURE p1;
+--horizontal_results
+SET @a=0;
+CALL p1();
+SELECT @a;
+DROP PROCEDURE p1;
+
+--echo # Testing ":=" to set the default value of a variable
+DELIMITER /;
+CREATE FUNCTION f1 () RETURN NUMBER(10) AS
+ a NUMBER(10) := 10;
+BEGIN
+ DECLARE
+ b NUMBER(10) DEFAULT 3;
+ BEGIN
+ RETURN a+b;
+ END;
+END;
+/
+DELIMITER ;/
+SELECT f1();
+DROP FUNCTION f1;
+
+--echo # Testing labels
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT) RETURN CLOB AS
+BEGIN
+ <<label1>>
+ BEGIN
+ IF a = 1 THEN
+ LEAVE label1;
+ END IF;
+ RETURN 'IS NOT 1';
+ END label1;
+ RETURN 'IS 1';
+END;
+/
+DELIMITER ;/
+SELECT f1(1);
+SELECT f1(2);
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT) RETURN INT IS
+BEGIN
+ <<label1>>
+ LOOP
+ IF a = 2 THEN
+ LEAVE label1;
+ END IF;
+ SET a= a-1;
+ END LOOP;
+ RETURN a;
+END;
+/
+DELIMITER ;/
+SELECT f1(4);
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT) RETURN INT AS
+BEGIN
+ <<label1>>
+ WHILE a>0 LOOP
+ IF a = 2 THEN
+ LEAVE label1;
+ END IF;
+ SET a= a-1;
+ END LOOP label1;
+ RETURN a;
+END;
+/
+DELIMITER ;/
+SELECT f1(4);
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT) RETURN INT AS
+BEGIN
+ <<label1>>
+ REPEAT
+ IF a = 2 THEN
+ LEAVE label1;
+ END IF;
+ SET a= a-1;
+ UNTIL a=0 END REPEAT;
+ RETURN a;
+END;
+/
+DELIMITER ;/
+SELECT f1(4);
+DROP FUNCTION f1;
+
+--echo # Testing IN/OUT/INOUT
+
+DELIMITER /;
+CREATE PROCEDURE p1 (p1 IN VARCHAR2(10), p2 OUT VARCHAR2(10)) AS
+BEGIN
+ SET p1='p1new';
+ SET p2='p2new';
+END;
+/
+DELIMITER ;/
+SET @p1='p1', @p2='p2';
+CALL p1(@p1, @p2);
+SELECT @p1, @p2;
+DROP PROCEDURE p1;
+
+--echo # Testing Oracle-style assigment
+DELIMITER /;
+CREATE PROCEDURE p1 (p1 OUT VARCHAR2(10)) AS
+BEGIN
+ p1:= 'p1new';
+END;
+/
+DELIMITER ;/
+SET @p1='p1';
+CALL p1(@p1);
+SELECT @p1;
+DROP PROCEDURE p1;
+
+--echo # Testing that NULL is a valid statement
+DELIMITER /;
+CREATE PROCEDURE p1(a INT) AS
+BEGIN
+ NULL;
+END;
+/
+DELIMITER ;/
+DROP PROCEDURE p1;
+
+DELIMITER /;
+CREATE PROCEDURE p1(a INT) AS
+ a INT:=10;
+BEGIN
+ IF a=10 THEN NULL; ELSE NULL; END IF;
+END;
+/
+DELIMITER ;/
+DROP PROCEDURE p1;
+
+--echo # Keywords that are OK for table names, but not for SP variables
+CREATE TABLE function (function int);
+INSERT INTO function SET function=10;
+SELECT function.function FROM function;
+DROP TABLE function;
+
+--echo # Testing that (some) keyword_sp are allowed in Oracle-style assignments
+DELIMITER /;
+CREATE PROCEDURE p1 (action OUT INT) AS BEGIN action:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (clob OUT INT) AS BEGIN clob:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (enum OUT INT) AS BEGIN enum:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (via OUT INT) AS BEGIN via:=10; END;/
+DROP PROCEDURE p1/
+DELIMITER ;/
+
+--echo # Testing keyword_directly_assignable
+DELIMITER /;
+CREATE PROCEDURE p1 (ascii OUT INT) AS BEGIN ascii:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (backup OUT INT) AS BEGIN backup:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (binlog OUT INT) AS BEGIN binlog:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (byte OUT INT) AS BEGIN byte:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (cache OUT INT) AS BEGIN cache:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (checksum OUT INT) AS BEGIN checksum:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (checkpoint OUT INT) AS BEGIN checkpoint:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_add OUT INT) AS BEGIN column_add:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_check OUT INT) AS BEGIN column_check:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_create OUT INT) AS BEGIN column_create:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_delete OUT INT) AS BEGIN column_delete:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (column_get OUT INT) AS BEGIN column_get:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (deallocate OUT INT) AS BEGIN deallocate:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (examined OUT INT) AS BEGIN examined:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (execute OUT INT) AS BEGIN execute:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (flush OUT INT) AS BEGIN flush:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (format OUT INT) AS BEGIN format:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (get OUT INT) AS BEGIN get:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (help OUT INT) AS BEGIN help:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (host OUT INT) AS BEGIN host:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (install OUT INT) AS BEGIN install:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (option OUT INT) AS BEGIN option:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (options OUT INT) AS BEGIN options:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (owner OUT INT) AS BEGIN owner:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (parser OUT INT) AS BEGIN parser:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (port OUT INT) AS BEGIN port:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (prepare OUT INT) AS BEGIN prepare:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (remove OUT INT) AS BEGIN remove:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (reset OUT INT) AS BEGIN reset:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (restore OUT INT) AS BEGIN restore:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (security OUT INT) AS BEGIN security:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (server OUT INT) AS BEGIN server:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (signed OUT INT) AS BEGIN signed:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (socket OUT INT) AS BEGIN socket:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (slave OUT INT) AS BEGIN slave:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (slaves OUT INT) AS BEGIN slaves:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (soname OUT INT) AS BEGIN soname:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (start OUT INT) AS BEGIN start:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (stop OUT INT) AS BEGIN stop:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (stored OUT INT) AS BEGIN stored:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (unicode OUT INT) AS BEGIN unicode:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (uninstall OUT INT) AS BEGIN uninstall:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (upgrade OUT INT) AS BEGIN upgrade:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (wrapper OUT INT) AS BEGIN wrapper:=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (xa OUT INT) AS BEGIN xa:=10; END;/
+DROP PROCEDURE p1/
+DELIMITER ;/
+
+
+--echo # Testing that keyword_directly_not_assignable does not work in :=
+DELIMITER /;
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 (commit OUT INT) AS BEGIN commit:=10; END;/
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 (rollback OUT INT) AS BEGIN rollback:=10; END;/
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 (shutdown OUT INT) AS BEGIN shutdown:=10; END;/
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN exception:=10; END;/
+DELIMITER ;/
+
+
+--echo # Testing that keyword_directly_not_assignable works in SET statements.
+DELIMITER /;
+CREATE PROCEDURE p1 (contains OUT INT) AS BEGIN SET contains=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (language OUT INT) AS BEGIN SET language=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (no OUT INT) AS BEGIN SET no=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (charset OUT INT) AS BEGIN SET charset=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (do OUT INT) AS BEGIN SET do=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (repair OUT INT) AS BEGIN SET repair=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (handler OUT INT) AS BEGIN SET handler=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (open OUT INT) AS BEGIN SET open=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (close OUT INT) AS BEGIN SET close=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (savepoint OUT INT) AS BEGIN SET savepoint=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (truncate OUT INT) AS BEGIN SET truncate=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (begin OUT INT) AS BEGIN SET begin=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (end OUT INT) AS BEGIN SET end=10; END;/
+DROP PROCEDURE p1/
+CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN SET exception=10; END;/
+DROP PROCEDURE p1/
+DELIMITER ;/
+
+--echo # Testing that keyword_directly_not_assignable works in table/column names
+CREATE TABLE contains (contains INT);
+DROP TABLE contains;
+CREATE TABLE language (language INT);
+DROP TABLE language;
+CREATE TABLE no (no INT);
+DROP TABLE no;
+CREATE TABLE charset (charset INT);
+DROP TABLE charset;
+CREATE TABLE do (do INT);
+DROP TABLE do;
+CREATE TABLE repair (repair INT);
+DROP TABLE repair;
+CREATE TABLE handler (handler INT);
+DROP TABLE handler;
+CREATE TABLE open (open INT);
+DROP TABLE open;
+CREATE TABLE close (close INT);
+DROP TABLE close;
+CREATE TABLE savepoint (savepoint INT);
+DROP TABLE savepoint;
+CREATE TABLE truncate (truncate INT);
+DROP TABLE truncate;
+CREATE TABLE begin (begin INT);
+DROP TABLE begin;
+CREATE TABLE end (end INT);
+DROP TABLE end;
+CREATE TABLE exception (exception INT);
+DROP TABLE exception;
+
+--echo # Testing ELSIF
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN CLOB
+AS
+BEGIN
+ IF a=1 THEN RETURN 'a is 1';
+ ELSIF a=2 THEN RETURN 'a is 2';
+ ELSE RETURN 'a is unknown';
+ END IF;
+END;
+/
+DELIMITER ;/
+SELECT f1(2) FROM DUAL;
+DROP FUNCTION f1;
+
+
+
+--echo # Testing top-level declarations
+DELIMITER /;
+CREATE PROCEDURE p1 (p1 OUT VARCHAR2(10))
+AS
+ p2 VARCHAR(10);
+BEGIN
+ p2:='p1new';
+ p1:=p2;
+END;
+/
+DELIMITER ;/
+SET @p1='p1';
+CALL p1(@p1);
+SELECT @p1;
+DROP PROCEDURE p1;
+
+DELIMITER /;
+CREATE FUNCTION f1 (p1 VARCHAR2(10)) RETURN VARCHAR(20)
+AS
+ p2 VARCHAR(10);
+BEGIN
+ p2:='new';
+ RETURN CONCAT(p1, p2);
+END;
+/
+DELIMITER ;/
+SET @p1='p1';
+SELECT f1(@p1);
+DROP FUNCTION f1;
+
+--echo # Testing non-top declarations
+
+DELIMITER /;
+CREATE PROCEDURE p1 (p1 OUT VARCHAR2(10))
+AS
+BEGIN
+ DECLARE
+ p2 VARCHAR(10);
+ BEGIN
+ p2:='p1new';
+ p1:=p2;
+ END;
+ DECLARE
+ t1 VARCHAR(10);
+ t2 VARCHAR(10);
+ BEGIN
+ END;
+END;
+/
+DELIMITER ;/
+SET @p1='p1';
+CALL p1(@p1);
+SELECT @p1;
+DROP PROCEDURE p1;
+
+DELIMITER /;
+CREATE FUNCTION f1 (p1 VARCHAR2(10)) RETURN VARCHAR(20)
+AS
+BEGIN
+ DECLARE
+ p2 VARCHAR(10);
+ BEGIN
+ p2:='new';
+ RETURN CONCAT(p1, p2);
+ END;
+ DECLARE
+ t1 VARCHAR(10);
+ t2 VARCHAR(10);
+ BEGIN
+ END;
+END;
+/
+DELIMITER ;/
+SET @p1='p1';
+SELECT f1(@p1);
+DROP FUNCTION f1;
+
+
+--echo # Testing exceptions
+
+CREATE TABLE t1 (c1 INT);
+
+DELIMITER /;
+
+CREATE PROCEDURE sp1 (p1 IN VARCHAR2(20), p2 OUT VARCHAR2(30))
+IS
+ v1 INT;
+BEGIN
+ SELECT c1 INTO v1 FROM t1;
+ p2 := p1;
+EXCEPTION
+ WHEN NOT FOUND THEN
+ BEGIN
+ p2 := 'def';
+ END;
+END;
+/
+
+DELIMITER ;/
+
+CALL sp1('abc', @a);
+SELECT @a;
+
+DROP PROCEDURE sp1;
+DROP TABLE t1;
+
+
+DELIMITER /;
+CREATE PROCEDURE sp1 (v IN OUT INT, error IN INT)
+IS
+BEGIN
+ SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=error, MESSAGE_TEXT='User defined error!';
+ v:= 223;
+EXCEPTION
+ WHEN 30001 THEN
+ BEGIN
+ v:= 113;
+ END;
+END;
+/
+DELIMITER ;/
+SET @v=10;
+CALL sp1(@v, 30001);
+--error 30002
+CALL sp1(@v, 30002);
+SELECT @v;
+DROP PROCEDURE sp1;
+
+
+DELIMITER /;
+CREATE PROCEDURE sp1 (v IN OUT INT, error IN INT)
+IS
+BEGIN
+ BEGIN
+ BEGIN
+ SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=error, MESSAGE_TEXT='User defined error!';
+ v:= 223;
+ EXCEPTION
+ WHEN 30001 THEN
+ BEGIN
+ v:= 113;
+ END;
+ END;
+ END;
+END;
+/
+DELIMITER ;/
+SET @v=10;
+CALL sp1(@v, 30001);
+SELECT @v;
+SET @v=10;
+--error 30002
+CALL sp1(@v, 30002);
+SELECT @v;
+DROP PROCEDURE sp1;
+
+
+--echo #
+--echo # Testing EXIT statement
+--echo #
+
+DELIMITER /;
+--error ER_SP_LILABEL_MISMATCH
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ EXIT;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+--error ER_SP_LILABEL_MISMATCH
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ <<lable1>>
+ BEGIN
+ <<label2>>
+ LOOP
+ EXIT label1;
+ END LOOP;
+ END;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ LOOP
+ LOOP
+ i:= i + 1;
+ IF i >= 5 THEN
+ EXIT;
+ END IF;
+ END LOOP;
+ i:= i + 100;
+ EXIT;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ <<label1>>
+ LOOP
+ <<label2>>
+ LOOP
+ i:= i + 1;
+ IF i >= 5 THEN
+ EXIT label2;
+ END IF;
+ END LOOP;
+ i:= i + 100;
+ EXIT;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ <<label1>>
+ LOOP
+ <<label2>>
+ LOOP
+ i:= i + 1;
+ IF i >= 5 THEN
+ EXIT label1;
+ END IF;
+ END LOOP;
+ i:= i + 100;
+ EXIT;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ LOOP
+ i:= i + 1;
+ EXIT WHEN i >=5;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ <<label1>>
+ LOOP
+ <<label2>>
+ LOOP
+ i:= i + 1;
+ EXIT label2 WHEN i >= 5;
+ END LOOP;
+ i:= i + 100;
+ EXIT;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+IS
+ i INT := 0;
+BEGIN
+ <<label1>>
+ LOOP
+ <<label2>>
+ LOOP
+ i:= i + 1;
+ EXIT label1 WHEN i >= 5;
+ END LOOP;
+ i:= i + 100;
+ EXIT;
+ END LOOP;
+ RETURN i;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing CURSOR declaration
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+AS
+ v_a INT:=10;
+ CURSOR c IS SELECT a FROM t1;
+BEGIN
+ OPEN c;
+ FETCH c INTO v_a;
+ CLOSE c;
+ RETURN v_a;
+EXCEPTION
+ WHEN OTHERS THEN RETURN -1;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo # Testing RETURN in procedures
+
+DELIMITER /;
+--error ER_SP_BADRETURN
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+ RETURN 10;
+END;
+/
+DELIMITER ;/
+
+DELIMITER /;
+--error ER_PARSE_ERROR
+CREATE FUNCTION f1 (a INT) RETURN INT
+AS
+BEGIN
+ RETURN;
+END;
+/
+DELIMITER ;/
+
+DELIMITER /;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+ IF a < 10 THEN
+ BEGIN
+ a:= a - 1;
+ RETURN;
+ END;
+ END IF;
+ a:= a + 1;
+EXCEPTION
+ WHEN OTHERS THEN RETURN;
+END;
+/
+DELIMITER ;/
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+SET @v=9;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+DELIMITER /;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+BEGIN
+ DROP TABLE t1_non_existent;
+EXCEPTION
+ WHEN OTHERS THEN
+ BEGIN
+ a:= 100;
+ RETURN;
+ END;
+END;
+/
+DELIMITER ;/
+SET @v=10;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # Testing WHILE loop
+
+DELIMITER /;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+ i INT:= 1;
+ j INT:= 3;
+BEGIN
+ WHILE i<=j
+ LOOP
+ a:= a + i;
+ i:= i + 1;
+ END LOOP;
+END;
+/
+DELIMITER ;/
+SET @v=0;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+DELIMITER /;
+CREATE PROCEDURE p1 (a IN OUT INT)
+AS
+ i INT:= 1;
+ j INT:= 3;
+BEGIN
+ <<label>>
+ WHILE i<=j
+ LOOP
+ a:= a + i;
+ i:= i + 1;
+ END LOOP label;
+END;
+/
+DELIMITER ;/
+SET @v=0;
+CALL p1(@v);
+SELECT @v;
+DROP PROCEDURE p1;
+
+
+--echo # Testing the FOR loop statement
+
+CREATE TABLE t1 (a INT);
+DELIMITER /;
+FOR i IN 1..3
+LOOP
+ INSERT INTO t1 VALUES (i);
+END LOOP;
+/
+DELIMITER ;/
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+DELIMITER /;
+--error ER_PARSE_ERROR
+CREATE FUNCTION f1 (lower_bound INT, upper_bound INT, lim INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ FOR i IN lower_bound . . upper_bound
+ LOOP
+ NULL
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+CREATE FUNCTION f1 (lower_bound INT, upper_bound INT, lim INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ FOR i IN lower_bound .. upper_bound
+ LOOP
+ total:= total + i;
+ IF i = lim THEN
+ EXIT;
+ END IF;
+ -- Bounds are calculated only once.
+ -- The below assignments have no effect on the loop condition
+ lower_bound:= 900;
+ upper_bound:= 1000;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(1, 3, 100) FROM DUAL;
+SELECT f1(1, 3, 2) FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ FOR i IN 1 .. 5
+ LOOP
+ total:= total + 1000;
+ FOR j IN 1 .. 5
+ LOOP
+ total:= total + 1;
+ IF j = 3 THEN
+ EXIT; -- End the internal loop
+ END IF;
+ END LOOP;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1() FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT, b INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ FOR i IN REVERSE 1..a
+ LOOP
+ total:= total + i;
+ IF i = b THEN
+ EXIT;
+ END IF;
+ END LOOP;
+ RETURN total;
+END
+/
+DELIMITER ;/
+SELECT f1(3, 100) FROM DUAL;
+SELECT f1(3, 2) FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing labeled FOR LOOP statement
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT, limita INT, b INT, limitb INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ <<la>>
+ FOR ia IN 1 .. a
+ LOOP
+ total:= total + 1000;
+ <<lb>>
+ FOR ib IN 1 .. b
+ LOOP
+ total:= total + 1;
+ EXIT lb WHEN ib = limitb;
+ EXIT la WHEN ia = limita;
+ END LOOP lb;
+ END LOOP la;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(1, 1, 1, 1) FROM DUAL;
+SELECT f1(1, 2, 1, 2) FROM DUAL;
+SELECT f1(2, 1, 2, 1) FROM DUAL;
+SELECT f1(2, 1, 2, 2) FROM DUAL;
+SELECT f1(2, 2, 2, 2) FROM DUAL;
+SELECT f1(2, 3, 2, 3) FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing labeled ITERATE in a labeled FOR LOOP statement
+
+DELIMITER /;
+CREATE FUNCTION f1 (a INT, b INT, blim INT) RETURN INT
+AS
+ total INT := 0;
+BEGIN
+ <<la>>
+ FOR ia IN 1 .. a
+ LOOP
+ total:= total + 1000;
+ DECLARE
+ ib INT:= 1;
+ BEGIN
+ WHILE ib <= b
+ LOOP
+ IF ib > blim THEN
+ ITERATE la;
+ END IF;
+ ib:= ib + 1;
+ total:= total + 1;
+ END LOOP;
+ END;
+ END LOOP la;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(3,3,0), f1(3,3,1), f1(3,3,2), f1(3,3,3), f1(3,3,4) FROM DUAL;
+DROP FUNCTION f1;
+
+
+--echo # Testing CONTINUE statement
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ FOR i IN 1 .. a
+ LOOP
+ IF i=5 THEN
+ CONTINUE;
+ END IF;
+ total:= total + 1;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ <<lj>>
+ FOR j IN 1 .. 2
+ LOOP
+ FOR i IN 1 .. a
+ LOOP
+ IF i=5 THEN
+ CONTINUE lj;
+ END IF;
+ total:= total + 1;
+ END LOOP;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(3), f1(4), f1(5) FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+BEGIN
+ <<lj>>
+ FOR j IN 1 .. 2
+ LOOP
+ FOR i IN 1 .. a
+ LOOP
+ CONTINUE lj WHEN i=5;
+ total:= total + 1;
+ END LOOP;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(3), f1(4), f1(5) FROM DUAL;
+DROP FUNCTION f1;
+
+
+DELIMITER /;
+CREATE FUNCTION f1(a INT) RETURN INT
+AS
+ total INT:= 0;
+ i INT:= 1;
+BEGIN
+ WHILE i <= a
+ LOOP
+ i:= i + 1;
+ IF i=6 THEN
+ CONTINUE;
+ END IF;
+ total:= total + 1;
+ END LOOP;
+ RETURN total;
+END;
+/
+DELIMITER ;/
+SELECT f1(3), f1(4), f1(5), f1(6) FROM DUAL;
+DROP FUNCTION f1;
+
+--echo #
+--echo # Testing behaviour of unknown identifiers in EXIT and CONTINUE statements
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ LOOP
+ EXIT WHEN unknown_ident IS NULL;
+ END LOOP;
+END$$
+DELIMITER ;$$
+--error ER_BAD_FIELD_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ <<label>>
+ LOOP
+ EXIT label WHEN unknown_ident IS NULL;
+ END LOOP;
+END$$
+DELIMITER ;$$
+--error ER_BAD_FIELD_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ LOOP
+ CONTINUE WHEN unknown_ident IS NULL;
+ END LOOP;
+END$$
+DELIMITER ;$$
+--error ER_BAD_FIELD_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ <<label>>
+ LOOP
+ CONTINUE label WHEN unknown_ident IS NULL;
+ END LOOP;
+END$$
+DELIMITER ;$$
+--error ER_BAD_FIELD_ERROR
+CALL p1;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
+--echo #
+
+EXPLAIN EXTENDED SELECT sql%rowcount;
+CREATE TABLE t1 AS SELECT SQL%ROWCOUNT;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # UPDATE
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ UPDATE t1 SET a=30;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ UPDATE t1 SET a=30;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # DELETE
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ DELETE FROM t1;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ DELETE FROM t1;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SELECT ... INTO var FROM ... - one row found
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ va INT;
+BEGIN
+ SELECT a INTO va FROM t1 LIMIT 1;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SELECT ... INTO var FROM ... - no rows found
+--echo #
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ va INT;
+BEGIN
+ SELECT a INTO va FROM t1;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ va INT;
+BEGIN
+ SELECT a INTO va FROM t1;
+ SELECT SQL%ROWCOUNT;
+EXCEPTION
+ WHEN NO_DATA_FOUND THEN SELECT SQL%ROWCOUNT||' (EXCEPTION)';
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SELECT ... INTO var FROM ... - multiple rows found
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ va INT:=1;
+BEGIN
+ SELECT a INTO va FROM t1;
+ SELECT SQL%ROWCOUNT;
+EXCEPTION
+ WHEN TOO_MANY_ROWS THEN SELECT SQL%ROWCOUNT||' (EXCEPTION) va='||va;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+
+--echo #
+--echo # INSERT INTO t2 SELECT ...
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ INSERT INTO t2 SELECT * FROM t1;
+ SELECT SQL%ROWCOUNT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # End of MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
+--echo #
+
+--echo #
+--echo # MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+--echo #
+
+--echo #
+--echo # Missing table
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE;
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1();
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Missing column
+--echo #
+
+CREATE TABLE t1 (b INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE;
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
+--error ER_BAD_FIELD_ERROR
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # One %TYPE variable
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE;
+BEGIN
+ a:= 123;
+ SELECT a;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # Two %TYPE variables, with a truncation warning on assignment
+--echo #
+
+CREATE TABLE t1 (a TINYINT, b INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE;
+ b t1.b%TYPE;
+BEGIN
+ a:= 200;
+ b:= 200;
+ SELECT a, b;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %TYPE variables for fields with various attributes
+--echo #
+
+CREATE TABLE t1 (
+ id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ a TINYINT NOT NULL,
+ b INT NOT NULL,
+ ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ UNIQUE(a)
+);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ id t1.id%TYPE;
+ a t1.a%TYPE;
+ b t1.b%TYPE;
+ ts t1.ts%TYPE;
+BEGIN
+ SELECT id, a, b, ts;
+ CREATE TABLE t2 AS SELECT id, a, b, ts;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %TYPE + virtual columns
+--echo #
+
+#
+# TODO: Changing 'a + 10' to 'a mod 10' make it fail, because
+# it's Item::print() returns 'a % 10' which makes grammar conflict
+# with cursor attributes
+
+CREATE TABLE t1 (
+ a INT NOT NULL,
+ b VARCHAR(32),
+ c INT AS (a + 10) VIRTUAL,
+ d VARCHAR(5) AS (left(b,5)) PERSISTENT
+);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ c t1.c%TYPE;
+ d t1.d%TYPE;
+BEGIN
+ SELECT c, d;
+ CREATE TABLE t2 AS SELECT c, d;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %TYPE + the ZEROFILL attribute
+--echo #
+
+CREATE TABLE t1 (
+ dz DECIMAL(10,3) ZEROFILL
+);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ dzr t1.dz%TYPE := 10;
+ dzt DECIMAL(10,3) ZEROFILL := 10;
+BEGIN
+ SELECT dzr, dzt;
+ CREATE TABLE t2 AS SELECT dzr,dzt;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Temporary tables shadow real tables for %TYPE purposes
+--echo #
+CREATE TABLE t1 (a VARCHAR(10));
+INSERT INTO t1 VALUES ('t1');
+CREATE TEMPORARY TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE:=11;
+BEGIN
+ CREATE TABLE t2 AS SELECT a;
+END;
+$$
+DELIMITER ;$$
+--echo #
+--echo # Should use INT(11) as %TYPE, as in the temporary table
+--echo #
+CALL p1();
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+SELECT * FROM t1;
+DROP TEMPORARY TABLE t1;
+SELECT * FROM t1;
+--echo #
+--echo # Should use VARCHAR(10) as %TYPE, as in the real table
+--echo #
+CALL p1();
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # t1.a%TYPE searches for "t1" in the current database
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(10));
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE:=11;
+BEGIN
+ CREATE TABLE test.t2 AS SELECT a;
+END;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # This interprets t1.a%TYPE as VARCHAR(10), as in test.t1.a
+--echo #
+
+USE test;
+CALL test.p1();
+SHOW CREATE TABLE test.t2;
+DROP TABLE test.t2;
+
+--echo #
+--echo # This interprets t1.a%TYPE as INT, as in test1.t1.a
+--echo #
+
+USE test1;
+CALL test.p1();
+SHOW CREATE TABLE test.t2;
+DROP TABLE test.t2;
+
+--echo #
+--echo # Error if there is no an active database
+--echo #
+
+DROP DATABASE test1;
+--error ER_NO_DB_ERROR
+CALL test.p1();
+
+USE test;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # A reference to a table in a non-existing database
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a test1.t1.a%TYPE;
+BEGIN
+ CREATE TABLE t1 AS SELECT a;
+END;
+$$
+DELIMITER ;$$
+--error ER_NO_SUCH_TABLE
+CALL p1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # A reference to a table in a different database
+--echo #
+CREATE TABLE t1(a INT);
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (a VARCHAR(10));
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a t1.a%TYPE;
+ b test1.t1.a%TYPE;
+BEGIN
+ CREATE TABLE t2 AS SELECT a,b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+SHOW CREATE TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE t2;
+DROP DATABASE test1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Using a table before it appears in a %TYPE declaration + multiple %TYPE declarations
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 (a,b) VALUES (10,'b10');
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ INSERT INTO t1 (a,b) VALUES (11, 'b11');
+ SELECT * FROM t1;
+ DECLARE
+ va t1.a%TYPE:= 30;
+ vb t1.b%TYPE:= 'b30';
+ BEGIN
+ INSERT INTO t1 (a,b) VALUES (12,'b12');
+ SELECT * FROM t1;
+ INSERT INTO t1 (a,b) VALUES (va, vb);
+ SELECT * FROM t1;
+ END;
+ DECLARE
+ va t1.a%TYPE:= 40;
+ vb t1.b%TYPE:= 'b40';
+ BEGIN
+ INSERT INTO t1 (a,b) VALUES (va,vb);
+ SELECT * FROM t1;
+ END;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # %TYPE variables + TABLE vs VIEW
+--echo #
+
+CREATE TABLE t1 (
+ bit6 BIT(6),
+ bit7 BIT(7),
+ bit8 BIT(8),
+ i1 TINYINT,
+ i2 SMALLINT,
+ i3 MEDIUMINT,
+ i4 INT,
+ i8 BIGINT,
+ ff FLOAT,
+ fd DOUBLE,
+ cc CHAR(10),
+ cv VARCHAR(10),
+ cvu VARCHAR(10) CHARACTER SET utf8,
+ t1 TINYTEXT,
+ t2 TEXT,
+ t3 MEDIUMTEXT,
+ t4 LONGTEXT,
+ enum1 ENUM('a','b','c'),
+ set1 SET('a','b','c'),
+ blob1 TINYBLOB,
+ blob2 BLOB,
+ blob3 MEDIUMBLOB,
+ blob4 LONGBLOB,
+ yy YEAR,
+ dd DATE,
+ tm0 TIME,
+ tm3 TIME(3),
+ tm6 TIME(6),
+ dt0 DATETIME,
+ dt3 DATETIME(3),
+ dt6 DATETIME(6),
+ ts0 TIMESTAMP,
+ ts3 TIMESTAMP(3),
+ ts6 TIMESTAMP(6),
+ dc100 DECIMAL(10,0),
+ dc103 DECIMAL(10,3),
+ dc209 DECIMAL(20,9)
+);
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1(command enum('create','select'))
+AS
+ bit6 t1.bit6%TYPE := 0x30;
+ bit7 t1.bit7%TYPE := 0x41;
+ bit8 t1.bit8%TYPE := 0x7E;
+ i1 t1.i1%TYPE := 11;
+ i2 t1.i2%TYPE := 12;
+ i3 t1.i3%TYPE := 13;
+ i4 t1.i4%TYPE := 14;
+ i8 t1.i8%TYPE := 18;
+ ff t1.ff%TYPE := 21;
+ fd t1.fd%TYPE := 22;
+ cc t1.cc%TYPE := 'char';
+ cv t1.cv%TYPE := 'varchar';
+ cvu t1.cvu%TYPE := 'varcharu8';
+ t1 t1.t1%TYPE := 'text1';
+ t2 t1.t2%TYPE := 'text2';
+ t3 t1.t3%TYPE := 'text3';
+ t4 t1.t4%TYPE := 'text4';
+ enum1 t1.enum1%TYPE := 'b';
+ set1 t1.set1%TYPE := 'a,c';
+ blob1 t1.blob1%TYPE := 'blob1';
+ blob2 t1.blob2%TYPE := 'blob2';
+ blob3 t1.blob3%TYPE := 'blob3';
+ blob4 t1.blob4%TYPE := 'blob4';
+ yy t1.yy%TYPE := 2001;
+ dd t1.dd%TYPE := '2001-01-01';
+ tm0 t1.tm0%TYPE := '00:00:01';
+ tm3 t1.tm3%TYPE := '00:00:03.333';
+ tm6 t1.tm6%TYPE := '00:00:06.666666';
+ dt0 t1.dt0%TYPE := '2001-01-01 00:00:01';
+ dt3 t1.dt3%TYPE := '2001-01-03 00:00:01.333';
+ dt6 t1.dt6%TYPE := '2001-01-06 00:00:01.666666';
+ ts0 t1.ts0%TYPE := '2002-01-01 00:00:01';
+ ts3 t1.ts3%TYPE := '2002-01-03 00:00:01.333';
+ ts6 t1.ts6%TYPE := '2002-01-06 00:00:01.666666';
+ dc100 t1.dc100%TYPE := 10;
+ dc103 t1.dc103%TYPE := 10.123;
+ dc209 t1.dc209%TYPE := 10.123456789;
+BEGIN
+ CASE
+ WHEN command='create' THEN
+ CREATE TABLE t2 AS SELECT
+ bit6, bit7, bit8,
+ i1,i2,i3,i4,i8,
+ ff,fd, dc100, dc103, dc209,
+ cc,cv,cvu,
+ t1,t2,t3,t4,
+ enum1, set1,
+ blob1, blob2, blob3, blob4,
+ dd, yy,
+ tm0, tm3, tm6,
+ dt0, dt3, dt6,
+ ts0, ts3, ts6;
+ WHEN command='select' THEN
+ SELECT
+ bit6, bit7, bit8,
+ i1,i2,i3,i4,i8,
+ ff,fd, dc100, dc103, dc209,
+ cc,cv,cvu,
+ t1,t2,t3,t4,
+ enum1, set1,
+ blob1, blob2, blob3, blob4,
+ dd, yy,
+ tm0, tm3, tm6,
+ dt0, dt3, dt6,
+ ts0, ts3, ts6;
+ END CASE;
+END;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # TABLE
+--echo #
+CALL p1('create');
+SHOW CREATE TABLE t2;
+--vertical_results
+SELECT * FROM t2;
+--horizontal_results
+DROP TABLE t2;
+
+--disable_ps_protocol
+--enable_metadata
+--vertical_results
+CALL p1('select');
+--horizontal_results
+--disable_metadata
+--enable_ps_protocol
+
+--echo #
+--echo # VIEW
+--echo #
+ALTER TABLE t1 RENAME t0;
+CREATE VIEW t1 AS SELECT * FROM t0;
+
+CALL p1('create');
+SHOW CREATE TABLE t2;
+--vertical_results
+SELECT * FROM t2;
+--horizontal_results
+DROP TABLE t2;
+
+--disable_ps_protocol
+--enable_metadata
+--vertical_results
+CALL p1('select');
+--horizontal_results
+--disable_metadata
+--enable_ps_protocol
+
+DROP VIEW t1;
+DROP TABLE t0;
+
+DROP PROCEDURE p1;
+
+--echo #
+--echo # VIEW with subqueries
+--echo #
+CREATE TABLE t1 (a INT,b INT);
+INSERT INTO t1 VALUES (10,1),(20,2),(30,3),(40,4);
+SELECT AVG(a) FROM t1;
+CREATE VIEW v1 AS SELECT a,1 as b FROM t1 WHERE a>(SELECT AVG(a) FROM t1) AND b>(SELECT 1);
+SELECT * FROM v1;
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a v1.a%TYPE := 10;
+ b v1.b%TYPE := 1;
+BEGIN
+ SELECT a,b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN INT
+AS
+ a v1.a%TYPE := 10;
+ b v1.b%TYPE := 1;
+BEGIN
+ RETURN a+b;
+END;
+$$
+DELIMITER ;$$
+SELECT f1();
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %TYPE variables + INFORMATION_SCHEMA
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ tables_table_name INFORMATION_SCHEMA.TABLES.TABLE_NAME%TYPE;
+ tables_table_rows INFORMATION_SCHEMA.TABLES.TABLE_ROWS%TYPE;
+ processlist_info INFORMATION_SCHEMA.PROCESSLIST.INFO%TYPE;
+ processlist_info_binary INFORMATION_SCHEMA.PROCESSLIST.INFO_BINARY%TYPE;
+BEGIN
+ CREATE TABLE t1 AS SELECT
+ tables_table_name,
+ tables_table_rows,
+ processlist_info,
+ processlist_info_binary;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # %TYPE + Table structure change
+--echo # Data type for both a0 and a1 is chosen in the very beginning
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a0 t1.a%TYPE;
+BEGIN
+ ALTER TABLE t1 MODIFY a VARCHAR(10); -- This does not affect a1
+ DECLARE
+ a1 t1.a%TYPE;
+ BEGIN
+ CREATE TABLE t2 AS SELECT a0, a1;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ END;
+END
+$$
+DELIMITER ;$$
+CREATE TABLE t1 (a INT);
+CALL p1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # %TYPE in parameters
+--echo #
+CREATE TABLE t1 (a VARCHAR(10));
+CREATE DATABASE test1;
+CREATE TABLE test1.t1 (b SMALLINT);
+DELIMITER $$;
+CREATE PROCEDURE p1(a t1.a%TYPE, b test1.t1.b%TYPE)
+AS
+BEGIN
+ CREATE TABLE t2 AS SELECT a, b;
+END;
+$$
+DELIMITER ;$$
+CALL p1('test', 123);
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP TABLE test1.t1;
+DROP DATABASE test1;
+DROP TABLE t1;
+
+--echo #
+--echo # %TYPE in a stored function variables and arguments
+--echo #
+
+CREATE TABLE t1 (a INT);
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE FUNCTION f1 (prm t1.a%TYPE) RETURN INT
+AS
+ a t1.a%TYPE:= prm;
+BEGIN
+ RETURN a;
+END;
+$$
+DELIMITER ;$$
+SELECT f1(20);
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # %TYPE in function RETURN clause is not supported yet
+--echo #
+DELIMITER $$;
+--error ER_PARSE_ERROR
+CREATE FUNCTION f1 RETURN t1.a%TYPE
+AS
+BEGIN
+ RETURN 0;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+--echo #
+
+
+--echo #
+--echo # MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
+--echo #
+
+DELIMITER $$;
+CREATE FUNCTION f1 RETURN INT AS
+BEGIN
+ RETURN 10;
+END f1;
+$$
+DELIMITER ;$$
+DROP FUNCTION f1;
+
+DELIMITER $$;
+CREATE FUNCTION test.f1 RETURN INT AS
+BEGIN
+ RETURN 10;
+END test.f1;
+$$
+DELIMITER ;$$
+DROP FUNCTION f1;
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE FUNCTION test.f1 RETURN INT AS
+BEGIN
+ RETURN 10;
+END test2.f1;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE FUNCTION test.f1 RETURN INT AS
+BEGIN
+ RETURN 10;
+END test.f2;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE FUNCTION f1 RETURN INT AS
+BEGIN
+ RETURN 10;
+END test.f2;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE FUNCTION f1 RETURN INT AS
+BEGIN
+ RETURN 10;
+END test2.f1;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+BEGIN
+ NULL;
+END p1;
+$$
+DELIMITER ;$$
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE PROCEDURE test.p1 AS
+BEGIN
+ NULL;
+END test.p1;
+$$
+DELIMITER ;$$
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PROCEDURE test.p1 AS
+BEGIN
+ NULL;
+END test2.p1;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PROCEDURE test.p1 AS
+BEGIN
+ NULL;
+END test.p2;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PROCEDURE p1 AS
+BEGIN
+ NULL;
+END test.p2;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_END_IDENTIFIER_DOES_NOT_MATCH
+CREATE PROCEDURE p1 AS
+BEGIN
+ NULL;
+END test2.p1;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # MDEV-12107 sql_mode=ORACLE: Inside routines the CALL keywoard is optional
+--echo #
+DELIMITER /;
+CREATE OR REPLACE PROCEDURE p1(a INT) AS
+BEGIN
+ SELECT 'This is p1' AS "comment";
+END;
+/
+CREATE OR REPLACE PROCEDURE p2 AS
+BEGIN
+ SELECT 'This is p2' AS "comment";
+END;
+/
+BEGIN
+ p1(10);
+ p2;
+ test.p1(10);
+ test.p2;
+END;
+/
+CREATE PROCEDURE p3 AS
+BEGIN
+ p1(10);
+ p2;
+ test.p1(10);
+ test.p2;
+END
+/
+DELIMITER ;/
+CALL p3;
+DROP PROCEDURE p3;
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+--echo #
+
+--enable_metadata
+--disable_ps_protocol
+SELECT SQL%ROWCOUNT;
+--enable_ps_protocol
+--disable_metadata
+
+--echo #
+--echo # MDEV-13686 EXCEPTION reserved keyword in SQL_MODE=oracle but not in Oracle itself
+--echo #
+CREATE TABLE t1 (c1 int);
+CREATE VIEW v1 AS SELECT c1 exception FROM t1;
+SELECT exception FROM v1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+
+--echo #
+--echo # MDEV-14139 Anchored data types for variables
+--echo #
+
+DELIMITER $$;
+--error ER_SP_UNDECLARED_VAR
+BEGIN NOT ATOMIC
+ DECLARE a a%TYPE;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+DECLARE
+ int11 INT;
+ dec103 DECIMAL(10,3);
+ flt0 FLOAT;
+ dbl0 DOUBLE;
+ enum0 ENUM('a','b');
+ bit3 BIT(3);
+
+ varchar10 VARCHAR(10);
+ text1 TEXT;
+ tinytext1 TINYTEXT;
+ mediumtext1 MEDIUMTEXT;
+ longtext1 LONGTEXT;
+
+ time3 TIME(3);
+ datetime4 DATETIME(4);
+ timestamp5 TIMESTAMP(5);
+ date0 DATE;
+
+ a_int11 int11%TYPE;
+ a_dec103 dec103%TYPE;
+ a_flt0 flt0%TYPE;
+ a_dbl0 dbl0%TYPE;
+ a_bit3 bit3%TYPE;
+ a_enum0 enum0%TYPE;
+ a_varchar10 varchar10%TYPE;
+ a_text1 text1%TYPE;
+ a_tinytext1 tinytext1%TYPE;
+ a_mediumtext1 mediumtext1%TYPE;
+ a_longtext1 longtext1%TYPE;
+ a_time3 time3%TYPE;
+ a_datetime4 datetime4%TYPE;
+ a_timestamp5 timestamp5%TYPE;
+ a_date0 date0%TYPE;
+
+ aa_int11 a_int11%TYPE;
+ aa_dec103 a_dec103%TYPE;
+ aa_flt0 a_flt0%TYPE;
+ aa_dbl0 a_dbl0%TYPE;
+ aa_bit3 a_bit3%TYPE;
+ aa_enum0 a_enum0%TYPE;
+ aa_varchar10 a_varchar10%TYPE;
+ aa_text1 a_text1%TYPE;
+ aa_tinytext1 a_tinytext1%TYPE;
+ aa_mediumtext1 a_mediumtext1%TYPE;
+ aa_longtext1 a_longtext1%TYPE;
+ aa_time3 a_time3%TYPE;
+ aa_datetime4 a_datetime4%TYPE;
+ aa_timestamp5 a_timestamp5%TYPE;
+ aa_date0 a_date0%TYPE;
+BEGIN
+ CREATE TABLE t1 AS
+ SELECT a_int11,a_dec103,a_flt0,a_dbl0,a_bit3,
+ a_enum0,a_varchar10,
+ a_text1,a_tinytext1,a_mediumtext1,a_longtext1,
+ a_time3,a_datetime4,a_timestamp5,a_date0;
+ SHOW CREATE TABLE t1;
+ DROP TABLE t1;
+
+ CREATE TABLE t1 AS
+ SELECT aa_int11,aa_dec103,aa_flt0,aa_dbl0,aa_bit3,
+ aa_enum0,aa_varchar10,
+ aa_text1,aa_tinytext1,aa_mediumtext1,aa_longtext1,
+ aa_time3,aa_datetime4,aa_timestamp5,aa_date0;
+ SHOW CREATE TABLE t1;
+ DROP TABLE t1;
+
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # MDEV-11160 "Incorrect column name" when "CREATE TABLE t1 AS SELECT spvar"
+--echo #
+
+
+CREATE TABLE t1 (x INT);
+INSERT INTO t1 VALUES (10);
+CREATE VIEW v1 AS SELECT x+1 AS a,x+1 AS b FROM t1;
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT := 1;
+ b INT := 2;
+BEGIN
+ CREATE TABLE t2 AS SELECT a,b FROM v1;
+ SHOW CREATE TABLE t2;
+ SELECT * FROM t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-14228 MariaDB crashes with function
+--echo #
+
+CREATE TABLE t1 (c VARCHAR(16), KEY(c));
+INSERT INTO t1 VALUES ('foo');
+
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN VARCHAR(16)
+IS
+ v VARCHAR2(16);
+BEGIN
+ FOR v IN (SELECT DISTINCT c FROM t1)
+ LOOP
+ IF (v = 'bar') THEN
+ SELECT 1 INTO @a;
+ END IF;
+ END LOOP;
+ RETURN 'qux';
+END $$
+DELIMITER ;$$
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT f1();
+DROP FUNCTION f1;
+
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN VARCHAR(16)
+IS
+ v t1%ROWTYPE;
+BEGIN
+ IF v = 'bar' THEN
+ NULL;
+ END IF;
+ RETURN 'qux';
+END $$
+DELIMITER ;$$
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT f1();
+DROP FUNCTION f1;
+
+DELIMITER $$;
+CREATE FUNCTION f1() RETURN VARCHAR(16)
+IS
+ v ROW(a INT);
+BEGIN
+ IF v = 'bar' THEN
+ NULL;
+ END IF;
+ RETURN 'qux';
+END $$
+DELIMITER ;$$
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT f1();
+DROP FUNCTION f1;
+
+DROP TABLE t1;
+
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+DECLARE
+ v ROW(a INT);
+BEGIN
+ SELECT v IN ('a','b');
+END $$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+DECLARE
+ v ROW(a INT);
+BEGIN
+ SELECT 'a' IN (v,'b');
+END $$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+DECLARE
+ v ROW(a INT);
+BEGIN
+ SELECT 'a' IN ('b',v);
+END $$
+DELIMITER ;$$
+
+--echo #
+--echo # MDEV-17253 Oracle compatibility: The REVERSE key word for FOR loop behaves incorrectly
+--echo #
+
+DELIMITER $$;
+DECLARE
+ totalprice DECIMAL(12,2):=NULL;
+ loop_start INTEGER := 1;
+BEGIN
+ FOR idx IN REVERSE loop_start..10 LOOP
+ SELECT idx;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ loop_start INTEGER := 1;
+BEGIN
+ FOR idx IN REVERSE 3..loop_start LOOP
+ SELECT idx;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+
+DELIMITER $$;
+CREATE PROCEDURE p1 AS
+ loop_start INTEGER := 1;
+BEGIN
+ FOR idx IN REVERSE loop_start..3 LOOP
+ SELECT idx;
+ END LOOP;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/statement-expr.test b/mysql-test/suite/compat/oracle/t/statement-expr.test
new file mode 100644
index 00000000000..f4a6a25eff3
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/statement-expr.test
@@ -0,0 +1,86 @@
+# Testing expressions of different kinds in various non-SELECT statements
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+#
+# Subselects in non-SELECT statements
+#
+
+CREATE TABLE t1 (id INT, id1 INT);
+INSERT INTO t1 VALUES (1,7);
+INSERT INTO t1 VALUES (1,8);
+SELECT ROW(1,7) IN (SELECT id, id1 FROM t1 WHERE id1= 8);
+EXECUTE IMMEDIATE 'SELECT ROW(1, 7) IN (SELECT id, id1 FROM t1 WHERE id1= 8)';
+DROP TABLE t1;
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE 'SELECT ?' USING (1 IN (SELECT * FROM t1));
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE 'SELECT ?' USING (SELECT * FROM t1);
+
+
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (10);
+DELIMITER $$;
+CREATE PROCEDURE p1(a INT) AS BEGIN NULL; END;
+$$
+DELIMITER ;$$
+CALL p1((1) IN (SELECT * FROM t1));
+CALL p1(EXISTS (SELECT * FROM t1));
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--error ER_PARSE_ERROR
+SIGNAL SQLSTATE '01000' SET MYSQL_ERRNO=(1 IN (SELECT * FROM t1));
+--error ER_PARSE_ERROR
+SIGNAL SQLSTATE '01000' SET MYSQL_ERRNO=EXISTS (SELECT * FROM t1);
+
+DELIMITER $$;
+--error ER_PARSE_ERROR
+BEGIN NOT ATOMIC
+ DECLARE CONTINUE HANDLER FOR SQLWARNING
+ RESIGNAL SET MYSQL_ERRNO=(1 IN (SELECT * FROM t1));
+ SIGNAL SQLSTATE '01000';
+END;
+$$
+--error ER_PARSE_ERROR
+BEGIN NOT ATOMIC
+ DECLARE CONTINUE HANDLER FOR SQLWARNING
+ RESIGNAL SET MYSQL_ERRNO=EXISTS (SELECT * FROM t1);
+ SIGNAL SQLSTATE '01000';
+END;
+$$
+DELIMITER ;$$
+
+
+--error ER_PARSE_ERROR
+PREPARE stmt FROM (1 IN (SELECT * FROM t1));
+--error ER_PARSE_ERROR
+PREPARE stmt FROM EXISTS (SELECT * FROM t1);
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE (1 IN (SELECT * FROM t1));
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE EXISTS (SELECT * FROM t1);
+
+--error ER_PARSE_ERROR
+GET DIAGNOSTICS CONDITION (1 IN (SELECT * FROM t1)) @errno=MYSQL_ERRNO;
+--error ER_PARSE_ERROR
+GET DIAGNOSTICS CONDITION EXISTS (SELECT * FROM t1) @errno=MYSQL_ERRNO;
+
+--error ER_PARSE_ERROR
+PURGE BINARY LOGS BEFORE (1 IN (SELECT * FROM t1));
+--error ER_PARSE_ERROR
+PURGE BINARY LOGS BEFORE EXISTS (SELECT * FROM t1);
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+DO 1 IN (SELECT * FROM t1);
+DO EXISTS (SELECT * FROM t1);
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/compat/oracle/t/table_value_constr.test b/mysql-test/suite/compat/oracle/t/table_value_constr.test
new file mode 100644
index 00000000000..4e0dcc05514
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/table_value_constr.test
@@ -0,0 +1,1278 @@
+SET sql_mode=ORACLE;
+
+create table t1 (a int, b int);
+
+insert into t1 values (1,2),(4,6),(9,7),
+ (1,1),(2,5),(7,8);
+
+--echo # just VALUES
+
+values (1,2);
+
+values (1,2), (3,4), (5.6,0);
+
+values ('abc', 'def');
+
+--echo # UNION that uses VALUES structure(s)
+
+select 1,2
+union
+values (1,2);
+
+values (1,2)
+union
+select 1,2;
+
+select 1,2
+union
+values (1,2),(3,4),(5,6),(7,8);
+
+select 3,7
+union
+values (1,2),(3,4),(5,6);
+
+select 3,7,4
+union
+values (1,2,5),(4,5,6);
+
+select 1,2
+union
+values (1,7),(3,6.5);
+
+select 1,2
+union
+values (1,2.0),(3,6);
+
+select 1.8,2
+union
+values (1,2),(3,6);
+
+values (1,2.4),(3,6)
+union
+select 2.8,9;
+
+values (1,2),(3,4),(5,6),(7,8)
+union
+select 5,6;
+
+select 'ab','cdf'
+union
+values ('al','zl'),('we','q');
+
+values ('ab', 'cdf')
+union
+select 'ab','cdf';
+
+values (1,2)
+union
+values (1,2),(5,6);
+
+values (1,2)
+union
+values (3,4),(5,6);
+
+values (1,2)
+union
+values (1,2)
+union values (4,5);
+
+--echo # UNION ALL that uses VALUES structure
+
+values (1,2),(3,4)
+union all
+select 5,6;
+
+values (1,2),(3,4)
+union all
+select 1,2;
+
+select 5,6
+union all
+values (1,2),(3,4);
+
+select 1,2
+union all
+values (1,2),(3,4);
+
+values (1,2)
+union all
+values (1,2),(5,6);
+
+values (1,2)
+union all
+values (3,4),(5,6);
+
+values (1,2)
+union all
+values (1,2)
+union all
+values (4,5);
+
+values (1,2)
+union all
+values (1,2)
+union values (1,2);
+
+values (1,2)
+union
+values (1,2)
+union all
+values (1,2);
+
+--echo # EXCEPT that uses VALUES structure(s)
+
+select 1,2
+except
+values (3,4),(5,6);
+
+select 1,2
+except
+values (1,2),(3,4);
+
+values (1,2),(3,4)
+except
+select 5,6;
+
+values (1,2),(3,4)
+except
+select 1,2;
+
+values (1,2),(3,4)
+except
+values (5,6);
+
+values (1,2),(3,4)
+except
+values (1,2);
+
+--echo # INTERSECT that uses VALUES structure(s)
+
+select 1,2
+intersect
+values (3,4),(5,6);
+
+select 1,2
+intersect
+values (1,2),(3,4);
+
+values (1,2),(3,4)
+intersect
+select 5,6;
+
+values (1,2),(3,4)
+intersect
+select 1,2;
+
+values (1,2),(3,4)
+intersect
+values (5,6);
+
+values (1,2),(3,4)
+intersect
+values (1,2);
+
+--echo # combination of different structures that uses VALUES structures : UNION + EXCEPT
+
+values (1,2),(3,4)
+except
+select 1,2
+union values (1,2);
+
+values (1,2),(3,4)
+except
+values (1,2)
+union
+values (1,2);
+
+values (1,2),(3,4)
+except
+values (1,2)
+union
+values (3,4);
+
+values (1,2),(3,4)
+union
+values (1,2)
+except
+values (1,2);
+
+--echo # combination of different structures that uses VALUES structures : UNION ALL + EXCEPT
+
+values (1,2),(3,4)
+except
+select 1,2
+union all
+values (1,2);
+
+values (1,2),(3,4)
+except
+values (1,2)
+union all
+values (1,2);
+
+values (1,2),(3,4)
+except
+values (1,2)
+union all
+values (3,4);
+
+values (1,2),(3,4)
+union all
+values (1,2)
+except
+values (1,2);
+
+--echo # combination of different structures that uses VALUES structures : UNION + INTERSECT
+
+values (1,2),(3,4)
+intersect
+select 1,2
+union
+values (1,2);
+
+values (1,2),(3,4)
+intersect
+values (1,2)
+union
+values (1,2);
+
+values (1,2),(3,4)
+intersect
+values (1,2)
+union
+values (3,4);
+
+values (1,2),(3,4)
+union
+values (1,2)
+intersect
+values (1,2);
+
+--echo # combination of different structures that uses VALUES structures : UNION ALL + INTERSECT
+
+values (1,2),(3,4)
+intersect
+select 1,2
+union all
+values (1,2);
+
+values (1,2),(3,4)
+intersect
+values (1,2)
+union all
+values (1,2);
+
+values (1,2),(3,4)
+intersect
+values (1,2)
+union all
+values (3,4);
+
+values (1,2),(3,4)
+union all
+values (1,2)
+intersect
+values (1,2);
+
+--echo # combination of different structures that uses VALUES structures : UNION + UNION ALL
+
+values (1,2),(3,4)
+union all
+select 1,2
+union
+values (1,2);
+
+values (1,2),(3,4)
+union all
+values (1,2)
+union
+values (1,2);
+
+values (1,2),(3,4)
+union all
+values (1,2)
+union
+values (3,4);
+
+values (1,2),(3,4)
+union
+values (1,2)
+union all
+values (1,2);
+
+values (1,2)
+union
+values (1,2)
+union all
+values (1,2);
+
+--echo # CTE that uses VALUES structure(s) : non-recursive CTE
+
+with t2 as
+(
+ values (1,2),(3,4)
+)
+select * from t2;
+
+with t2 as
+(
+ select 1,2
+ union
+ values (1,2)
+)
+select * from t2;
+
+with t2 as
+(
+ select 1,2
+ union
+ values (1,2),(3,4)
+)
+select * from t2;
+
+with t2 as
+(
+ values (1,2)
+ union
+ select 1,2
+)
+select * from t2;
+
+with t2 as
+(
+ values (1,2),(3,4)
+ union
+ select 1,2
+)
+select * from t2;
+
+with t2 as
+(
+ values (5,6)
+ union
+ values (1,2),(3,4)
+)
+select * from t2;
+
+with t2 as
+(
+ values (1,2)
+ union
+ values (1,2),(3,4)
+)
+select * from t2;
+
+with t2 as
+(
+ select 1,2
+ union all
+ values (1,2),(3,4)
+)
+select * from t2;
+
+with t2 as
+(
+ values (1,2),(3,4)
+ union all
+ select 1,2
+)
+select * from t2;
+
+with t2 as
+(
+ values (1,2)
+ union all
+ values (1,2),(3,4)
+)
+select * from t2;
+
+--echo # recursive CTE that uses VALUES structure(s) : singe VALUES structure as anchor
+
+with recursive t2(a,b) as
+(
+ values(1,1)
+ union
+ select t1.a, t1.b
+ from t1,t2
+ where t1.a=t2.a
+)
+select * from t2;
+
+with recursive t2(a,b) as
+(
+ values(1,1)
+ union
+ select t1.a+1, t1.b
+ from t1,t2
+ where t1.a=t2.a
+)
+select * from t2;
+
+--echo # recursive CTE that uses VALUES structure(s) : several VALUES structures as anchors
+
+with recursive t2(a,b) as
+(
+ values(1,1)
+ union
+ values (3,4)
+ union
+ select t2.a+1, t1.b
+ from t1,t2
+ where t1.a=t2.a
+)
+select * from t2;
+
+--echo # recursive CTE that uses VALUES structure(s) : that uses UNION ALL
+
+with recursive t2(a,b,st) as
+(
+ values(1,1,1)
+ union all
+ select t2.a, t1.b, t2.st+1
+ from t1,t2
+ where t1.a=t2.a and st<3
+)
+select * from t2;
+
+--echo # recursive CTE that uses VALUES structure(s) : computation of factorial (first 10 elements)
+
+with recursive fact(n,f) as
+(
+ values(1,1)
+ union
+ select n+1,f*n from fact where n < 10
+)
+select * from fact;
+
+--echo # Derived table that uses VALUES structure(s) : singe VALUES structure
+
+select * from (values (1,2),(3,4)) as t2;
+
+--echo # Derived table that uses VALUES structure(s) : UNION with VALUES structure(s)
+
+select * from (select 1,2 union values (1,2)) as t2;
+
+select * from (select 1,2 union values (1,2),(3,4)) as t2;
+
+select * from (values (1,2) union select 1,2) as t2;
+
+select * from (values (1,2),(3,4) union select 1,2) as t2;
+
+select * from (values (5,6) union values (1,2),(3,4)) as t2;
+
+select * from (values (1,2) union values (1,2),(3,4)) as t2;
+
+--echo # Derived table that uses VALUES structure(s) : UNION ALL with VALUES structure(s)
+
+select * from (select 1,2 union all values (1,2),(3,4)) as t2;
+
+select * from (values (1,2),(3,4) union all select 1,2) as t2;
+
+select * from (values (1,2) union all values (1,2),(3,4)) as t2;
+
+--echo # CREATE VIEW that uses VALUES structure(s) : singe VALUES structure
+
+let $drop_view= drop view v1;
+let $select_view= select * from v1;
+
+create view v1 as values (1,2),(3,4);
+
+eval $select_view;
+eval $drop_view;
+
+--echo # CREATE VIEW that uses VALUES structure(s) : UNION with VALUES structure(s)
+
+create view v1 as
+ select 1,2
+ union
+ values (1,2);
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ select 1,2
+ union
+ values (1,2),(3,4);
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ values (1,2)
+ union
+ select 1,2;
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ values (1,2),(3,4)
+ union
+ select 1,2;
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ values (5,6)
+ union
+ values (1,2),(3,4);
+
+eval $select_view;
+eval $drop_view;
+
+--echo # CREATE VIEW that uses VALUES structure(s) : UNION ALL with VALUES structure(s)
+
+create view v1 as
+ values (1,2)
+ union
+ values (1,2),(3,4);
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ select 1,2
+ union all
+ values (1,2),(3,4);
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ values (1,2),(3,4)
+ union all
+ select 1,2;
+
+eval $select_view;
+eval $drop_view;
+
+create view v1 as
+ values (1,2)
+ union all
+ values (1,2),(3,4);
+
+eval $select_view;
+eval $drop_view;
+
+--echo # IN-subquery with VALUES structure(s) : simple case
+let $query=
+select * from t1
+where a in (values (1));
+let $subst_query=
+select * from t1
+where a in (select * from (values (1)) as tvc_0);
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # IN-subquery with VALUES structure(s) : UNION with VALUES on the first place
+let $query=
+select * from t1
+where a in (values (1) union select 2);
+let $subst_query=
+select * from t1
+where a in (select * from (values (1)) as tvc_0 union
+ select 2);
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # IN-subquery with VALUES structure(s) : UNION with VALUES on the second place
+let $query=
+select * from t1
+where a in (select 2 union values (1));
+let $subst_query=
+select * from t1
+where a in (select 2 union
+ select * from (values (1)) tvc_0);
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # IN-subquery with VALUES structure(s) : UNION ALL
+let $query=
+select * from t1
+where a in (values (1) union all select b from t1);
+let $subst_query=
+select * from t1
+where a in (select * from (values (1)) as tvc_0 union all
+ select b from t1);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # NOT IN subquery with VALUES structure(s) : simple case
+let $query=
+select * from t1
+where a not in (values (1),(2));
+let $subst_query=
+select * from t1
+where a not in (select * from (values (1),(2)) as tvc_0);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # NOT IN subquery with VALUES structure(s) : UNION with VALUES on the first place
+let $query=
+select * from t1
+where a not in (values (1) union select 2);
+let $subst_query=
+select * from t1
+where a not in (select * from (values (1)) as tvc_0 union
+ select 2);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # NOT IN subquery with VALUES structure(s) : UNION with VALUES on the second place
+let $query=
+select * from t1
+where a not in (select 2 union values (1));
+let $subst_query=
+select * from t1
+where a not in (select 2 union
+ select * from (values (1)) as tvc_0);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # ANY-subquery with VALUES structure(s) : simple case
+let $query=
+select * from t1
+where a = any (values (1),(2));
+let $subst_query=
+select * from t1
+where a = any (select * from (values (1),(2)) as tvc_0);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # ANY-subquery with VALUES structure(s) : UNION with VALUES on the first place
+let $query=
+select * from t1
+where a = any (values (1) union select 2);
+let $subst_query=
+select * from t1
+where a = any (select * from (values (1)) as tvc_0 union
+ select 2);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # ANY-subquery with VALUES structure(s) : UNION with VALUES on the second place
+let $query=
+select * from t1
+where a = any (select 2 union values (1));
+let $subst_query=
+select * from t1
+where a = any (select 2 union
+ select * from (values (1)) as tvc_0);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # ALL-subquery with VALUES structure(s) : simple case
+let $query=
+select * from t1
+where a = all (values (1));
+let $subst_query=
+select * from t1
+where a = all (select * from (values (1)) as tvc_0);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # ALL-subquery with VALUES structure(s) : UNION with VALUES on the first place
+let $query=
+select * from t1
+where a = all (values (1) union select 1);
+let $subst_query=
+select * from t1
+where a = all (select * from (values (1)) as tvc_0 union
+ select 1);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # ALL-subquery with VALUES structure(s) : UNION with VALUES on the second place
+let $query=
+select * from t1
+where a = any (select 1 union values (1));
+let $subst_query=
+select * from t1
+where a = any (select 1 union
+ select * from (values (1)) as tvc_0);
+
+eval $query;
+eval $subst_query;
+eval explain extended $query;
+eval explain extended $subst_query;
+
+--echo # prepare statement that uses VALUES structure(s): single VALUES structure
+
+prepare stmt1 from '
+values (1,2);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+--echo # prepare statement that uses VALUES structure(s): UNION with VALUES structure(s)
+
+prepare stmt1 from '
+ select 1,2
+ union
+ values (1,2),(3,4);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from '
+ values (1,2),(3,4)
+ union
+ select 1,2;
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from '
+ select 1,2
+ union
+ values (3,4)
+ union
+ values (1,2);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from '
+ values (5,6)
+ union
+ values (1,2),(3,4);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+--echo # prepare statement that uses VALUES structure(s): UNION ALL with VALUES structure(s)
+
+prepare stmt1 from '
+ select 1,2
+ union
+ values (1,2),(3,4);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from '
+ values (1,2),(3,4)
+ union all
+ select 1,2;
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from '
+ select 1,2
+ union all
+ values (3,4)
+ union all
+ values (1,2);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from '
+ values (1,2)
+ union all
+ values (1,2),(3,4);
+';
+
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+--echo # explain query that uses VALUES structure(s): single VALUES structure
+
+explain
+values (1,2);
+
+explain format=json
+values (1,2);
+
+--echo # explain query that uses VALUES structure(s): UNION with VALUES structure(s)
+
+explain
+select 1,2
+union
+values (1,2),(3,4);
+
+explain
+values (1,2),(3,4)
+union
+select 1,2;
+
+explain
+values (5,6)
+union
+values (1,2),(3,4);
+
+explain format=json
+select 1,2
+union
+values (1,2),(3,4);
+
+explain format=json
+values (1,2),(3,4)
+union
+select 1,2;
+
+explain format=json
+values (5,6)
+union
+values (1,2),(3,4);
+
+explain
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+
+explain format=json
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+
+--echo # explain query that uses VALUES structure(s): UNION ALL with VALUES structure(s)
+
+explain
+select 1,2
+union
+values (1,2),(3,4);
+
+explain
+values (1,2),(3,4)
+union all
+select 1,2;
+
+explain
+values (1,2)
+union all
+values (1,2),(3,4);
+
+explain format=json
+values (1,2),(3,4)
+union all
+select 1,2;
+
+explain format=json
+select 1,2
+union
+values (1,2),(3,4);
+
+explain format=json
+values (1,2)
+union all
+values (1,2),(3,4);
+
+explain
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+
+explain format=json
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+
+--echo # analyze query that uses VALUES structure(s): single VALUES structure
+
+analyze
+values (1,2);
+
+analyze format=json
+values (1,2);
+
+--echo # analyze query that uses VALUES structure(s): UNION with VALUES structure(s)
+
+analyze
+select 1,2
+union
+values (1,2),(3,4);
+
+analyze
+values (1,2),(3,4)
+union
+select 1,2;
+
+analyze
+values (5,6)
+union
+values (1,2),(3,4);
+
+analyze format=json
+select 1,2
+union
+values (1,2),(3,4);
+
+analyze format=json
+values (1,2),(3,4)
+union
+select 1,2;
+
+analyze format=json
+values (5,6)
+union
+values (1,2),(3,4);
+
+analyze
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+
+analyze format=json
+select 1,2
+union
+values (3,4)
+union
+values (1,2);
+
+--echo # analyze query that uses VALUES structure(s): UNION ALL with VALUES structure(s)
+
+analyze
+select 1,2
+union
+values (1,2),(3,4);
+
+analyze
+values (1,2),(3,4)
+union all
+select 1,2;
+
+analyze
+values (1,2)
+union all
+values (1,2),(3,4);
+
+analyze format=json
+values (1,2),(3,4)
+union all
+select 1,2;
+
+analyze format=json
+select 1,2
+union
+values (1,2),(3,4);
+
+analyze format=json
+values (1,2)
+union all
+values (1,2),(3,4);
+
+analyze
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+
+analyze format=json
+select 1,2
+union all
+values (3,4)
+union all
+values (1,2);
+
+--echo # different number of values in TVC
+--error ER_WRONG_NUMBER_OF_VALUES_IN_TVC
+values (1,2),(3,4,5);
+
+--echo # illegal parameter data types in TVC
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+values (1,point(1,1)),(1,1);
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+values (1,point(1,1)+1);
+
+--echo # field reference in TVC
+--error ER_FIELD_REFERENCE_IN_TVC
+select * from (values (1), (b), (2)) as new_tvc;
+--error ER_FIELD_REFERENCE_IN_TVC
+select * from (values (1), (t1.b), (2)) as new_tvc;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-15940: cursor over TVC
+--echo #
+
+DELIMITER |;
+
+DECLARE
+ v INT;
+ CURSOR cur IS VALUES(7);
+BEGIN
+ OPEN cur;
+ FETCH cur INTO v;
+ SELECT v;
+END;
+|
+
+DECLARE
+ v INT DEFAULT 0;
+BEGIN
+ FOR a IN (VALUES (7)) LOOP
+ SET v = v + 1;
+ END LOOP;
+ SELECT v;
+END;
+|
+
+DELIMITER ;|
+
+--echo #
+--echo # MDEV-16038: empty row in TVC
+--echo #
+
+--error ER_EMPTY_ROW_IN_TVC
+with t as (values (),()) select 1 from t;
+
+--echo #
+--echo # MDEV-17017: TVC in derived table
+--echo #
+
+create table t1 (a int);
+insert into t1 values (9), (3), (2);
+
+let $q1=
+select * from (values (7), (5), (8), (1), (3), (8), (1)) t;
+eval $q1;
+eval explain $q1;
+
+let $q2=
+select * from (values (1,11), (7,77), (3,31), (4,42)) t;
+eval $q2;
+eval explain $q2;
+
+let $q3=
+select * from (values (7), (5), (8), (1) union values (3), (8), (1)) t;
+eval $q3;
+eval explain $q3;
+
+let $q4=
+select * from (values (7), (5), (8), (1) union select * from t1) t;
+eval $q4;
+eval explain $q4;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-16930: expression in the first row of TVC specifying derived table
+--echo #
+
+SELECT 1 + 1, 2, 'abc';
+SELECT * FROM (SELECT 1 + 1, 2, 'abc') t;
+WITH cte AS (SELECT 1 + 1, 2, 'abc') SELECT * FROM cte;
+SELECT 1 + 1, 2, 'abc' UNION SELECT 3+4, 3, 'abc';
+CREATE VIEW v1 AS SELECT 1 + 1, 2, 'abc';
+SELECT * FROM v1;
+DROP VIEW v1;
+
+VALUES(1 + 1,2,'abc');
+SELECT * FROM (VALUES(1 + 1,2,'abc')) t;
+
+--echo #
+--echo # MDEV-17894: tvc with ORDER BY ... LIMIT
+--echo #
+
+let $q=
+values (5), (7), (1), (3), (4) limit 2;
+eval $q;
+eval explain extended $q;
+
+let $q=
+values (5), (7), (1), (3), (4) limit 2 offset 1;
+eval $q;
+eval explain extended $q;
+
+let $q=
+values (5), (7), (1), (3), (4) order by 1 limit 2;
+eval $q;
+eval explain extended $q;
+
+let $q=
+values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1;
+eval $q;
+eval explain extended $q;
+
+let $q=
+values (5), (7), (1), (3), (4) order by 1;
+eval $q;
+eval explain extended $q;
+
+let $q=
+values (5,90), (7,20), (1,70), (3,50), (4,10) order by 2;
+eval $q;
+eval explain extended $q;
+
+let $q=
+select 2 union (values (5), (7), (1), (3), (4) limit 2);
+eval $q;
+eval explain extended $q;
+
+let $q=
+select 2 union (values (5), (7), (1), (3), (4) limit 2 offset 1);
+eval $q;
+eval explain extended $q;
+
+let $q=
+select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2);
+eval $q;
+eval explain extended $q;
+
+let $q=
+select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1);
+eval $q;
+eval explain extended $q;
+
+
+let $q=
+(values (5), (7), (1), (3), (4) limit 2) union select 2;
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) limit 2 offset 1) union select 2;
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) order by 1 limit 2) union select 2;
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1) union select 2;
+eval $q;
+eval explain extended $q;
+
+
+let $q=
+select 3 union all (values (5), (7), (1), (3), (4) limit 2 offset 3);
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) limit 2 offset 3) union all select 3;
+eval $q;
+eval explain extended $q;
+
+let $q=
+select 3 union all (values (5), (7), (1), (3), (4) order by 1 limit 2);
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) order by 1 limit 2) union all select 3;
+eval $q;
+eval explain extended $q;
+
+let $q=
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+ union
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+eval $q;
+eval explain extended $q;
+
+let $q=
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+ union all
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) limit 2 offset 3) union all select 3 order by 1;
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3 order by 1;
+eval $q;
+eval explain extended $q;
+
+let $q=
+(values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3
+ order by 1 limit 2 offset 1;
+eval $q;
+eval explain extended $q;
+
+--error ER_BAD_FIELD_ERROR
+values (5,90), (7,20), (1,70), (3,50), (4,10) order by 3;
+
+create view v1 as values (5), (7), (1), (3), (4) order by 1 limit 2;
+show create view v1;
+select * from v1;
+drop view v1;
+
+create view v1 as
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+ union
+( values (5), (7), (1), (3), (4) order by 1 limit 2 );
+show create view v1;
+select * from v1;
+drop view v1;
+
+--error ER_BAD_FIELD_ERROR
+create view v1 as values (5,90), (7,20), (1,70), (3,50), (4,10) order by 3;
+
+--error ER_BAD_FIELD_ERROR
+create view v1 as
+( values (5), (7), (1), (3), (4) limit 2 offset 1 )
+ union
+( values (5), (7), (1), (3), (4) order by 2 limit 2 );
diff --git a/mysql-test/suite/compat/oracle/t/trigger.test b/mysql-test/suite/compat/oracle/t/trigger.test
new file mode 100644
index 00000000000..45affb2d6e8
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/trigger.test
@@ -0,0 +1,106 @@
+set sql_mode=ORACLE;
+
+--error ER_PARSE_ERROR
+:NEW.a := 1;
+--error ER_PARSE_ERROR
+:OLD.a := 1;
+--error ER_PARSE_ERROR
+:OLa.a := 1;
+
+--error ER_PARSE_ERROR
+SELECT :NEW.a;
+--error ER_PARSE_ERROR
+SELECT :OLD.a;
+--error ER_PARSE_ERROR
+SELECT :OLa.a;
+
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW NEW.a:= 10;
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW :NEW.a:= 10;
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER /;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ IF :NEW.a IS NULL
+ THEN
+ :NEW.a:= 10;
+ END IF;
+END;
+/
+DELIMITER ;/
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT);
+DELIMITER /;
+CREATE TRIGGER tr1 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+ IF :OLD.a IS NULL
+ THEN
+ :NEW.a:= 10;
+ END IF;
+END;
+/
+DELIMITER ;/
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET a=NULL;
+SELECT * FROM t1;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+
+
+CREATE TABLE t1 (a INT, b INT, c INT);
+DELIMITER /;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW
+DECLARE
+ cnt INT := 0;
+BEGIN
+ IF :NEW.a IS NULL THEN cnt:=cnt+1; END IF;
+ IF :NEW.b IS NULL THEN cnt:=cnt+1; END IF;
+ IF :NEW.c IS NULL THEN :NEW.c:=cnt; END IF;
+END;
+/
+DELIMITER ;/
+INSERT INTO t1 VALUES ();
+INSERT INTO t1 VALUES (1, NULL, NULL);
+INSERT INTO t1 VALUES (NULL, 1, NULL);
+INSERT INTO t1 VALUES (1, 1, NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, total INT);
+DELIMITER $$;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW
+DECLARE
+ va t1.a%TYPE:= :NEW.a;
+ vb t1.b%TYPE:= :NEW.b;
+BEGIN
+ :NEW.total:= va + vb;
+END;
+$$
+DELIMITER ;$$
+INSERT INTO t1 (a,b) VALUES (10, 20);
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/truncate.test b/mysql-test/suite/compat/oracle/t/truncate.test
new file mode 100644
index 00000000000..ac540047e49
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/truncate.test
@@ -0,0 +1,16 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-10588 sql_mode=ORACLE: TRUNCATE TABLE t1 [ {DROP|REUSE} STORAGE ]
+--echo #
+
+CREATE TABLE t1 (a INT);
+TRUNCATE TABLE t1 REUSE STORAGE;
+TRUNCATE TABLE t1 DROP STORAGE;
+DROP TABLE t1;
+
+# REUSE is actually a reserved word in Oracle.
+# But we don't reserve it for MDEV-10588
+
+CREATE TABLE reuse (reuse INT);
+DROP TABLE reuse;
diff --git a/mysql-test/suite/compat/oracle/t/type_blob.test b/mysql-test/suite/compat/oracle/t/type_blob.test
new file mode 100644
index 00000000000..989581ee4f6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_blob.test
@@ -0,0 +1,17 @@
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (a BLOB);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-20263 sql_mode=ORACLE: BLOB(65535) should not translate to LONGBLOB
+--echo #
+
+CREATE TABLE t1 (
+ c1 BLOB(100),
+ c2 BLOB(65535),
+ c3 BLOB(16777215),
+ c4 BLOB(16777216)
+);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/type_clob.test b/mysql-test/suite/compat/oracle/t/type_clob.test
new file mode 100644
index 00000000000..275e368b298
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_clob.test
@@ -0,0 +1,10 @@
+SET sql_mode=ORACLE;
+
+# CLOB is not a reserved word even in sql_mode=ORACLE
+CREATE TABLE clob (clob INT);
+SHOW CREATE TABLE clob;
+DROP TABLE clob;
+
+CREATE TABLE t1 (a CLOB);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/type_date.test b/mysql-test/suite/compat/oracle/t/type_date.test
new file mode 100644
index 00000000000..36a5e99795f
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_date.test
@@ -0,0 +1,103 @@
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (a DATE);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+--echo #
+
+SET sql_mode=DEFAULT;
+--error ER_UNKNOWN_ERROR
+CREATE TABLE t1 (a unknown.DATE);
+
+
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+ def_date DATE,
+ mdb_date mariadb_schema.DATE,
+ ora_date oracle_schema.DATE,
+ max_date maxdb_schema.DATE
+);
+SHOW CREATE TABLE t1;
+SET sql_mode=ORACLE;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (
+ def_date DATE,
+ mdb_date mariadb_schema.DATE,
+ ora_date oracle_schema.DATE,
+ max_date maxdb_schema.DATE
+);
+SHOW CREATE TABLE t1;
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # ALTER..MODIFY and ALTER..CHANGE understand qualifiers
+--echo #
+
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES ('2001-01-01');
+SET sql_mode=ORACLE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+ALTER TABLE t1 MODIFY a DATE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+ALTER TABLE t1 MODIFY a mariadb_schema.DATE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+ALTER TABLE t1 MODIFY a oracle_schema.DATE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+ALTER TABLE t1 CHANGE a b mariadb_schema.DATE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+ALTER TABLE t1 CHANGE b a oracle_schema.DATE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Qualified syntax is not supported yet in SP
+--echo # See MDEV-23353 Qualified data types in SP
+--echo #
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+# Change to this when merging to 10.5:
+#--error ER_UNKNOWN_DATA_TYPE
+--error ER_PARSE_ERROR
+CREATE FUNCTION f1() RETURN mariadb_schema.DATE AS
+BEGIN
+ RETURN CURRENT_DATE;
+END;
+$$
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1(a mariadb_schema.DATE) AS
+BEGIN
+ NULL;
+END;
+$$
+--error ER_PARSE_ERROR
+CREATE PROCEDURE p1() AS
+ a mariadb_schema.DATE;
+BEGIN
+ NULL;
+END;
+$$
+DELIMITER ;$$
diff --git a/mysql-test/suite/compat/oracle/t/type_number.test b/mysql-test/suite/compat/oracle/t/type_number.test
new file mode 100644
index 00000000000..d8ea04ab333
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_number.test
@@ -0,0 +1,9 @@
+SET sql_mode=ORACLE;
+
+CREATE TABLE t1 (a NUMBER);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a NUMBER(10,2));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/type_raw.test b/mysql-test/suite/compat/oracle/t/type_raw.test
new file mode 100644
index 00000000000..3b54f5a3735
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_raw.test
@@ -0,0 +1,10 @@
+SET sql_mode=ORACLE;
+
+# RAW is not a reserved word even in sql_mode=ORACLE
+CREATE TABLE raw (raw INT);
+SHOW CREATE TABLE raw;
+DROP TABLE raw;
+
+CREATE TABLE t1 (a RAW(10));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/type_varchar.test b/mysql-test/suite/compat/oracle/t/type_varchar.test
new file mode 100644
index 00000000000..05691bfb8e6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_varchar.test
@@ -0,0 +1,9 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-11275 sql_mode=ORACLE: CAST(..AS VARCHAR(N))
+--echo #
+
+SELECT CAST(123 AS VARCHAR(10)) FROM DUAL;
+--error ER_PARSE_ERROR
+SELECT CAST(123 AS VARCHAR) FROM DUAL;
diff --git a/mysql-test/suite/compat/oracle/t/type_varchar2.test b/mysql-test/suite/compat/oracle/t/type_varchar2.test
new file mode 100644
index 00000000000..bd0243713b6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/type_varchar2.test
@@ -0,0 +1,19 @@
+SET sql_mode=ORACLE;
+
+# VARCHAR2 is not a reserved word even in sql_mode=ORACLE
+CREATE TABLE varchar2 (varchar2 INT);
+SHOW CREATE TABLE varchar2;
+DROP TABLE varchar2;
+
+CREATE TABLE t1 (a VARCHAR2(10));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-11275 sql_mode=ORACLE: CAST(..AS VARCHAR(N))
+--echo #
+
+SELECT CAST(123 AS VARCHAR2(10)) FROM DUAL;
+--error ER_PARSE_ERROR
+SELECT CAST(123 AS VARCHAR2) FROM DUAL;
diff --git a/mysql-test/suite/compat/oracle/t/variables.test b/mysql-test/suite/compat/oracle/t/variables.test
new file mode 100644
index 00000000000..4705cac11c0
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/variables.test
@@ -0,0 +1,38 @@
+SET sql_mode=oracle;
+
+--echo #
+--echo # MDEV-10411 Providing compatibility for basic PL/SQL constructs
+--echo # Part 6: Assignment operator
+--echo #
+
+max_sort_length:=1030;
+SELECT @@max_sort_length;
+max_sort_length:=DEFAULT;
+
+--echo #
+--echo # Testing that SP variables shadow global variables in assignments
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+BEGIN
+ max_sort_length:=1030;
+ DECLARE
+ max_sort_length INT DEFAULT 1031;
+ BEGIN
+ SELECT @@max_sort_length, max_sort_length;
+ max_sort_length:=1032;
+ SELECT @@max_sort_length, max_sort_length;
+ END;
+ SELECT @@max_sort_length;
+ max_sort_length:= DEFAULT;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+
+--echo #
+--echo # End of MDEV-10411 Providing compatibility for basic PL/SQL constructs (part 6)
+--echo #
diff --git a/mysql-test/suite/compat/oracle/t/vcol.test b/mysql-test/suite/compat/oracle/t/vcol.test
new file mode 100644
index 00000000000..1317006fc0f
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/vcol.test
@@ -0,0 +1,16 @@
+--echo #
+--echo # MDEV-13500 sql_mode=ORACLE: can't create a virtual column with function MOD
+--echo #
+
+SET sql_mode=ORACLE;
+CREATE TABLE t1 (c1 INTEGER, c2 INTEGER AS (c1 MOD 10) VIRTUAL);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c1) VALUES (999);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT a MOD 10 FROM t1;
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/versioning.test b/mysql-test/suite/compat/oracle/t/versioning.test
new file mode 100644
index 00000000000..d70058c56e4
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/versioning.test
@@ -0,0 +1,13 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-15975 PL/SQL parser does not understand historical queries
+--echo #
+
+CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES (10);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (20);
+SELECT * FROM t1 FOR SYSTEM_TIME ALL;
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (NOW()+INTERVAL 10 YEAR);
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/win.test b/mysql-test/suite/compat/oracle/t/win.test
new file mode 100644
index 00000000000..c6f0b6474cf
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/win.test
@@ -0,0 +1,22 @@
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-13384: "window" seems like a reserved column name but it's not listed as one
+--echo #
+--echo # Currently we allow window as an identifier, except for table aliases.
+--echo #
+
+CREATE TABLE door (id INT, window VARCHAR(10));
+
+--error ER_PARSE_ERROR
+SELECT id
+FROM door as window;
+
+SELECT id, window
+FROM door;
+
+--error ER_PARSE_ERROR
+SELECT id, window
+FROM door as window;
+
+DROP TABLE door;
diff --git a/mysql-test/suite/csv/read_only.result b/mysql-test/suite/csv/read_only.result
index d6936681f65..1a98572d6b7 100644
--- a/mysql-test/suite/csv/read_only.result
+++ b/mysql-test/suite/csv/read_only.result
@@ -23,6 +23,8 @@ TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
TABLE_COMMENT File './test/t1.CSM' not found (Errcode: 13 "Permission denied")
+MAX_INDEX_LENGTH NULL
+TEMPORARY NULL
Warnings:
Level Warning
Code 29
diff --git a/mysql-test/suite/csv/read_only.test b/mysql-test/suite/csv/read_only.test
index 2af209182d0..a3c851a6a70 100644
--- a/mysql-test/suite/csv/read_only.test
+++ b/mysql-test/suite/csv/read_only.test
@@ -1,3 +1,4 @@
+--source include/not_as_root.inc
#
# MDEV-11883 MariaDB crashes with out-of-memory when query information_schema
#
diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep.result b/mysql-test/suite/encryption/r/encrypt_and_grep.result
index 7068d1d3502..e5ba46d10d2 100644
--- a/mysql-test/suite/encryption/r/encrypt_and_grep.result
+++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result
@@ -1,5 +1,4 @@
SET GLOBAL innodb_file_per_table = ON;
-SET GLOBAL innodb_file_format = `Barracuda`;
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
create table t2 (a varchar(255)) engine=innodb;
show warnings;
@@ -17,6 +16,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
# t1 yes on expecting NOT FOUND
@@ -35,6 +35,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t2
test/t3
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
@@ -59,6 +60,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
# t1 yes on expecting NOT FOUND
diff --git a/mysql-test/suite/encryption/r/innochecksum.result b/mysql-test/suite/encryption/r/innochecksum.result
index 2c1279cd232..2a37ae1aa00 100644
--- a/mysql-test/suite/encryption/r/innochecksum.result
+++ b/mysql-test/suite/encryption/r/innochecksum.result
@@ -1,4 +1,3 @@
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
# Create and populate a tables
@@ -8,12 +7,6 @@ CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR
CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
-# Write file to make mysql-test-run.pl expect the "crash", but don't
-# start it until it's told to
-# We give 30 seconds to do a clean shutdown because we do not want
-# to redo apply the pages of t1.ibd at the time of recovery.
-# We want SQL to initiate the first access to t1.ibd.
-# Wait until disconnected.
# Run innochecksum on t1
# Run innochecksum on t2
# Run innochecksum on t3
@@ -40,6 +33,4 @@ CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
# Run innochecksum on t3
# Run innochecksum on t6
# Restore the original tables
-# Write file to make mysql-test-run.pl start up the server again
-# Cleanup
DROP TABLE t1, t2, t3, t4, t5, t6;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index 7d6d2000cb7..68267f2498d 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -1,5 +1,6 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
index e181a4ee5e1..9cf98b6b1fd 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -1,8 +1,11 @@
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
+call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
@@ -34,8 +37,15 @@ backup: t1
UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
+ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 DISCARD TABLESPACE;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t1`
+Warning 1812 Tablespace is missing for table 'test/t1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
index a535e591773..d3bbe2eccf3 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
index e6ec74e22d4..9d6da0a0291 100644
--- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
diff --git a/mysql-test/suite/encryption/r/innodb-first-page-read.result b/mysql-test/suite/encryption/r/innodb-first-page-read.result
index 6df80e8223d..29253885e83 100644
--- a/mysql-test/suite/encryption/r/innodb-first-page-read.result
+++ b/mysql-test/suite/encryption/r/innodb-first-page-read.result
@@ -1,5 +1,3 @@
-SET GLOBAL innodb_file_format = `Barracuda`;
-SET GLOBAL innodb_file_per_table = ON;
FLUSH STATUS;
create database innodb_test;
use innodb_test;
diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
index a662f5e6343..f5a91fb352e 100644
--- a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
@@ -2,6 +2,8 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
NAME
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
NAME
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
create database enctests;
use enctests;
create table t1(a int not null primary key, b char(200)) engine=innodb;
diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result
index 302bd28ee02..3a501335e2d 100644
--- a/mysql-test/suite/encryption/r/innodb-missing-key.result
+++ b/mysql-test/suite/encryption/r/innodb-missing-key.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
diff --git a/mysql-test/suite/encryption/r/innodb-redo-badkey.result b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
index e551282667a..2248c692076 100644
--- a/mysql-test/suite/encryption/r/innodb-redo-badkey.result
+++ b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
@@ -9,7 +9,6 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
# Restart mysqld --file-key-management-filename=keys2.txt
# Wait max 10 min for key encryption threads to encrypt all spaces
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed;
diff --git a/mysql-test/suite/encryption/r/innodb-remove-encryption.result b/mysql-test/suite/encryption/r/innodb-remove-encryption.result
index 7146ea9de4a..3b0ce29218b 100644
--- a/mysql-test/suite/encryption/r/innodb-remove-encryption.result
+++ b/mysql-test/suite/encryption/r/innodb-remove-encryption.result
@@ -14,6 +14,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
# Success!
SELECT * from t1;
a b
@@ -24,6 +25,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
NAME
# Success!
@@ -34,6 +36,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
NAME
SELECT * from t1;
diff --git a/mysql-test/suite/encryption/r/innodb-spatial-index.result b/mysql-test/suite/encryption/r/innodb-spatial-index.result
index d8b686d1b68..7637d61b400 100644
--- a/mysql-test/suite/encryption/r/innodb-spatial-index.result
+++ b/mysql-test/suite/encryption/r/innodb-spatial-index.result
@@ -39,6 +39,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age.result b/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age.result
index 137ce01e14c..3dfa449daf8 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age.result
@@ -14,6 +14,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
test/t3
@@ -28,6 +29,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
test/t3
@@ -39,6 +41,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
test/t4
@@ -58,6 +61,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
test/t3
@@ -69,6 +73,7 @@ NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/t1
test/t2
test/t3
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result
index e4ece7bc4ed..59b28969559 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result
@@ -49,6 +49,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
+# same, but with current-version header
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
+FOUND 2 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log)
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@@ -104,15 +111,21 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
-FOUND 1 /Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1/ in mysqld.1.err
+FOUND 2 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
# Empty 10.3 redo log
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
-FOUND 1 /InnoDB: Downgrading redo log:/ in mysqld.1.err
+FOUND 1 /InnoDB: .* started; log sequence number 121397[09]/ in mysqld.1.err
+# Empty 10.2 redo log
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+COUNT(*)
+1
+FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
diff --git a/mysql-test/suite/encryption/r/innodb_encryption.result b/mysql-test/suite/encryption/r/innodb_encryption.result
index 75614c6b88c..9fa422bfd91 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption.result
@@ -10,10 +10,10 @@ innodb_encryption_threads 4
SET GLOBAL innodb_encrypt_tables = ON;
# Wait max 10 min for key encryption threads to encrypt all spaces
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
innodb_system
# Success!
@@ -21,11 +21,11 @@ innodb_system
SET GLOBAL innodb_encrypt_tables = off;
# Wait max 10 min for key encryption threads to encrypt all spaces
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
innodb_system
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
# Success!
# Shutdown innodb_encryption_threads
@@ -35,21 +35,21 @@ SET GLOBAL innodb_encryption_threads=0;
SET GLOBAL innodb_encrypt_tables = on;
# Wait 15s to check that nothing gets encrypted
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
innodb_system
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
# Success!
# Startup innodb_encryption_threads
SET GLOBAL innodb_encryption_threads=@start_global_value;
# Wait max 10 min for key encryption threads to encrypt all spaces
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
innodb_system
# Success!
@@ -63,9 +63,9 @@ innodb_encryption_rotate_key_age 15
innodb_encryption_rotation_iops 100
innodb_encryption_threads 0
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
innodb_system
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
NAME
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
index 264187cf892..6b38be38b6d 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
@@ -72,8 +72,6 @@ NOT FOUND /foobar/ in t1.ibd
NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND
NOT FOUND /barfoo/ in t3.ibd
-SET GLOBAL innodb_file_format = `Barracuda`;
-SET GLOBAL innodb_file_per_table = ON;
ALTER TABLE t1 ENGINE InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
index f75268f3290..779eb5917cd 100644
--- a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
@@ -40,7 +40,6 @@ NOT FOUND /author/ in t5.ibd
NOT FOUND /mangled/ in t6.ibd
# t7 ... on expecting NOT FOUND
NOT FOUND /mysql/ in t7.ibd
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
ALTER TABLE t1 ADD COLUMN b int default 2;
ALTER TABLE t2 ADD COLUMN b int default 2;
diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test
index eb587d7ea12..5fec86304b4 100644
--- a/mysql-test/suite/encryption/t/encrypt_and_grep.test
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test
@@ -14,10 +14,7 @@
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
--let SEARCH_RANGE = 10000000
---disable_warnings
SET GLOBAL innodb_file_per_table = ON;
-SET GLOBAL innodb_file_format = `Barracuda`;
---enable_warnings
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
create table t2 (a varchar(255)) engine=innodb;
diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test
index 5423a70f5d9..06d3ff46b81 100644
--- a/mysql-test/suite/encryption/t/innochecksum.test
+++ b/mysql-test/suite/encryption/t/innochecksum.test
@@ -14,12 +14,9 @@ if (!$INNOCHECKSUM) {
--die Need innochecksum binary
}
---disable_warnings
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
---enable_warnings
--echo # Create and populate a tables
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
@@ -56,17 +53,7 @@ let t6_IBD = $MYSQLD_DATADIR/test/t6.ibd;
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let MYSQLD_DATADIR=`select @@datadir`;
---echo # Write file to make mysql-test-run.pl expect the "crash", but don't
---echo # start it until it's told to
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---echo # We give 30 seconds to do a clean shutdown because we do not want
---echo # to redo apply the pages of t1.ibd at the time of recovery.
---echo # We want SQL to initiate the first access to t1.ibd.
-shutdown_server;
-
---echo # Wait until disconnected.
---source include/wait_until_disconnected.inc
+--source include/shutdown_mysqld.inc
--echo # Run innochecksum on t1
-- disable_result_log
@@ -277,10 +264,5 @@ EOF
--move_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
--move_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
---echo # Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
-
---echo # Cleanup
+--source include/start_mysqld.inc
DROP TABLE t1, t2, t3, t4, t5, t6;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change.opt
new file mode 100644
index 00000000000..d3f298d3335
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.opt
@@ -0,0 +1,2 @@
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index a8222e6411e..552b9867d69 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -10,6 +10,7 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
@@ -47,10 +48,8 @@ SELECT * FROM t1;
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
-- source include/restart_mysqld.inc
---disable_warnings
---replace_regex /tablespace [0-9]*/tablespace /
+--replace_regex /key_id [1-9][0-9]*/\1 /
DROP TABLE t1;
---enable_warnings
#
# MDEV-8591: Database page corruption on disk or a failed space, Assertion failure in file buf0buf.cc
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change2.opt
new file mode 100644
index 00000000000..d3f298d3335
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.opt
@@ -0,0 +1,2 @@
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
index 07400872f4a..f100c330bad 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -8,12 +8,15 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
# MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key
#
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
+call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
@@ -29,18 +32,18 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t1;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
--error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t1 ENGINE=InnoDB;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
OPTIMIZE TABLE t1;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
CHECK TABLE t1;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
@@ -60,6 +63,12 @@ UNLOCK TABLES;
--error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t1 DISCARD TABLESPACE;
+# Drop table will succeed.
+DROP TABLE t1;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
+ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
@@ -67,7 +76,6 @@ ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
-
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
index 6426bac41a0..d20d3b60913 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
@@ -1,4 +1,6 @@
--loose-innodb-buffer-pool-stats
--loose-innodb-buffer-page
--loose-innodb-buffer-page-lru
---innodb-defragment=1 \ No newline at end of file
+--innodb-defragment=1
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
index 404e5b50426..d2f75a3d6c1 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -7,6 +7,7 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
#
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
# Suppression for builds where file_key_management plugin is linked statically
@@ -25,14 +26,14 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
OPTIMIZE TABLE t1;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
-
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+
+--replace_regex /key_id [1-9][0-9]*/\1 /
CHECK TABLE t1;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations
index e096b023b52..df4560f06e5 100644
--- a/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations
@@ -1,12 +1,4 @@
[crc32]
-loose-innodb-tablespaces-encryption
-loose-innodb-encrypt-tables=on
-loose-innodb-encryption-threads=4
-max_allowed_packet=64K
loose-innodb-checksum-algorithm=crc32
[none]
-loose-innodb-tablespaces-encryption
-loose-innodb-encrypt-tables=on
-loose-innodb-encryption-threads=4
-max_allowed_packet=64K
loose-innodb-checksum-algorithm=none
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.opt b/mysql-test/suite/encryption/t/innodb-compressed-blob.opt
new file mode 100644
index 00000000000..061212b3034
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.opt
@@ -0,0 +1,6 @@
+--max-allowed-packet=64K
+--innodb-tablespaces-encryption
+--innodb-encrypt-tables=on
+--innodb-encryption-threads=4
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.opt b/mysql-test/suite/encryption/t/innodb-encryption-disable.opt
new file mode 100644
index 00000000000..d3f298d3335
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.opt
@@ -0,0 +1,2 @@
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
index 26ceea9e986..4d0aa04bc56 100644
--- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -7,6 +7,7 @@
# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
#
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
diff --git a/mysql-test/suite/encryption/t/innodb-first-page-read.test b/mysql-test/suite/encryption/t/innodb-first-page-read.test
index d661e4565d2..c86e16c52b8 100644
--- a/mysql-test/suite/encryption/t/innodb-first-page-read.test
+++ b/mysql-test/suite/encryption/t/innodb-first-page-read.test
@@ -2,11 +2,6 @@
-- source include/have_file_key_management_plugin.inc
-- source include/not_embedded.inc
---disable_warnings
-SET GLOBAL innodb_file_format = `Barracuda`;
-SET GLOBAL innodb_file_per_table = ON;
---enable_warnings
-
FLUSH STATUS;
create database innodb_test;
diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.opt b/mysql-test/suite/encryption/t/innodb-force-corrupt.opt
new file mode 100644
index 00000000000..d3f298d3335
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.opt
@@ -0,0 +1,2 @@
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
index 2e5d877f7c0..dffabaf97f1 100644
--- a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
@@ -6,15 +6,10 @@
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
---disable_query_log
---disable_warnings
let $encryption = `SELECT @@innodb_encrypt_tables`;
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
---enable_warnings
---enable_query_log
create database enctests;
use enctests;
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.opt b/mysql-test/suite/encryption/t/innodb-missing-key.opt
index 02691695cbd..5e144bc2d3c 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.opt
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.opt
@@ -2,4 +2,5 @@
--innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
-
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
index f86640b617c..0b81d37ac50 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.test
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -7,6 +7,7 @@
# MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing
#
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
index 343128e8803..2de0bdb3241 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
@@ -3,3 +3,5 @@
--innodb-tablespaces-encryption
--innodb-encryption-threads=2
--innodb-default-encryption-key-id=4
+--innodb-purge-rseg-truncate-frequency=1
+--skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.test b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
index 502a3828835..484246dbe32 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-badkey.test
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
@@ -22,10 +22,7 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
--source include/wait_condition.inc
---disable_warnings
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
---enable_warnings
create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed;
diff --git a/mysql-test/suite/encryption/t/innodb-scrub-log.test b/mysql-test/suite/encryption/t/innodb-scrub-log.test
index 36ecc88b99a..e8149b6b3ff 100644
--- a/mysql-test/suite/encryption/t/innodb-scrub-log.test
+++ b/mysql-test/suite/encryption/t/innodb-scrub-log.test
@@ -1,7 +1,7 @@
--source include/have_innodb.inc
#
-# MDEV-11705: InnoDB: Failing assertion: (&log_sys->mutex)->is_owned() if server started with innodb-scrub-log
+# MDEV-11705: InnoDB: Failing assertion: (&log_sys.mutex)->is_owned() if server started with innodb-scrub-log
#
create table t1(a int not null primary key auto_increment,
diff --git a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test
index bd14def69f9..ad1a9ea8671 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test
@@ -2,14 +2,10 @@
-- source include/have_example_key_management_plugin.inc
-- source include/not_embedded.inc
---disable_query_log
let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`;
let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`;
---enable_query_log
---disable_warnings
SET GLOBAL innodb_encryption_threads = 4;
---enable_warnings
# zlib
set global innodb_compression_algorithm = 1;
diff --git a/mysql-test/suite/encryption/t/innodb_encryption.test b/mysql-test/suite/encryption/t/innodb_encryption.test
index cd844af0649..a1abfb51462 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption.test
@@ -23,10 +23,10 @@ SET GLOBAL innodb_encrypt_tables = ON;
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--echo # Success!
@@ -40,10 +40,10 @@ SET GLOBAL innodb_encrypt_tables = off;
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--echo # Success!
@@ -61,10 +61,10 @@ SET GLOBAL innodb_encrypt_tables = on;
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--echo # Success!
@@ -78,10 +78,10 @@ SET GLOBAL innodb_encryption_threads=@start_global_value;
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--echo # Success!
--echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
@@ -92,7 +92,7 @@ SHOW VARIABLES LIKE 'innodb_encrypt%';
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
-AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
+AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
index b67428fbfb3..22755571618 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
@@ -105,11 +105,6 @@ SELECT COUNT(1) FROM t3;
--source include/start_mysqld.inc
---disable_warnings
-SET GLOBAL innodb_file_format = `Barracuda`;
-SET GLOBAL innodb_file_per_table = ON;
---enable_warnings
-
ALTER TABLE t1 ENGINE InnoDB;
SHOW CREATE TABLE t1;
ALTER TABLE t2 ENGINE InnoDB;
diff --git a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
index b222e1882d5..9f61bf118aa 100644
--- a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
+++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
@@ -75,10 +75,7 @@ set autocommit=1;
-- source include/start_mysqld.inc
---disable_warnings
-SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
---enable_warnings
ALTER TABLE t1 ADD COLUMN b int default 2;
ALTER TABLE t2 ADD COLUMN b int default 2;
diff --git a/mysql-test/suite/engines/funcs/r/sq_error.result b/mysql-test/suite/engines/funcs/r/sq_error.result
index 2090f4b9cd4..6b00bf6c921 100644
--- a/mysql-test/suite/engines/funcs/r/sq_error.result
+++ b/mysql-test/suite/engines/funcs/r/sq_error.result
@@ -15,8 +15,6 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARCHAR(100),c3 FLOAT);
@@ -34,8 +32,6 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 BINARY(100),c3 FLOAT);
@@ -53,8 +49,6 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARBINARY(100),c3 FLOAT);
@@ -72,7 +66,5 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
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 3e057d48ec9..6df58122051 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
@@ -6,4 +6,4 @@
# Requires statement logging
source include/have_binlog_format_row.inc;
-source extra/rpl_tests/rpl_max_relay_size.test;
+source suite/rpl/include/rpl_max_relay_size.test;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_reset_slave.test b/mysql-test/suite/engines/funcs/t/rpl_row_reset_slave.test
index a970c161153..5c2ba774543 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_reset_slave.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_reset_slave.test
@@ -1,5 +1,5 @@
# TBF - difference in row level logging
# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
-- source include/have_binlog_format_row.inc
--- source extra/rpl_tests/rpl_reset_slave.test
+-- source suite/rpl/include/rpl_reset_slave.test
diff --git a/mysql-test/suite/engines/funcs/t/rpl_stm_max_relay_size.test b/mysql-test/suite/engines/funcs/t/rpl_stm_max_relay_size.test
index 950aa8b322a..da1921ec262 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_stm_max_relay_size.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_stm_max_relay_size.test
@@ -5,7 +5,7 @@
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/rpl_tests/rpl_max_relay_size.test
+-- source suite/rpl/include/rpl_max_relay_size.test
# End of 4.1 tests
#
diff --git a/mysql-test/suite/engines/funcs/t/rpl_stm_reset_slave.test b/mysql-test/suite/engines/funcs/t/rpl_stm_reset_slave.test
index 6a99d4e1613..63ff768b4f3 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_stm_reset_slave.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_stm_reset_slave.test
@@ -1,6 +1,6 @@
# TBF - difference in row level logging
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/rpl_tests/rpl_reset_slave.test
+-- source suite/rpl/include/rpl_reset_slave.test
# End of 4.1 tests
#
diff --git a/mysql-test/suite/engines/funcs/t/sq_error.test b/mysql-test/suite/engines/funcs/t/sq_error.test
index a9b72008c74..6776e92be63 100644
--- a/mysql-test/suite/engines/funcs/t/sq_error.test
+++ b/mysql-test/suite/engines/funcs/t/sq_error.test
@@ -19,8 +19,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
---error 1093
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARCHAR(100),c3 FLOAT);
@@ -38,8 +36,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
---error 1093
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 BINARY(100),c3 FLOAT);
@@ -57,8 +53,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
---error 1093
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARBINARY(100),c3 FLOAT);
@@ -76,8 +70,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
---error 1093
-UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result
index c0f3224e26f..f167712d048 100644
--- a/mysql-test/suite/engines/iuds/r/insert_decimal.result
+++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result
@@ -1151,7 +1151,7 @@ total_rows min_value max_value sum avg
7 -100000.00000 100000.00000 -99.15000 -16.525000509
SELECT count(*) as total_rows, min(c3) as min_value, max(c3) as max_value, sum(c3) as sum, avg(c3) as avg FROM t1;
total_rows min_value max_value sum avg
-7 -0.10000000149011612 111111112 111211212.95000306 18535202.15833384
+7 -0.1 111111000 111211212.95000306 18535202.15833384
SELECT count(*) as total_rows, min(c1) as min_value, max(c1) as max_value, sum(c1) as sum, avg(c1) as avg FROM t2;
total_rows min_value max_value sum avg
30 -10000000000 10000000000 31322222339 1044074077.9667
@@ -1160,7 +1160,7 @@ total_rows min_value max_value sum avg
30 0 10000000000 43444444564 1448148152.1333
SELECT count(*) as total_rows, min(c3) as min_value, max(c3) as max_value, sum(c3) as sum, avg(c3) as avg FROM t2;
total_rows min_value max_value sum avg
-30 -3.4028234663852886e38 3.4028234663852886e38 1.0208470399155866e39 3.4028234663852886e37
+30 -3.40282e38 3.40282e38 1.0208470399155866e39 3.4028234663852886e37
SELECT * FROM t1;
c1 c2 c3 c4
0.00000 -0.10000 -0.1 13
diff --git a/mysql-test/suite/engines/iuds/r/insert_number.result b/mysql-test/suite/engines/iuds/r/insert_number.result
index 1355812649a..564ce8d3401 100644
--- a/mysql-test/suite/engines/iuds/r/insert_number.result
+++ b/mysql-test/suite/engines/iuds/r/insert_number.result
@@ -34324,12 +34324,8 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 1 2 3 4 5
-0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 1 2 3 4 5
-0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
@@ -34491,12 +34487,8 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 31 32 33 34 35
-0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 31 32 33 34 35
-0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
@@ -34751,12 +34743,8 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 1 2 3 4 5
-0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 1 2 3 4 5
-0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
@@ -34918,12 +34906,8 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 31 32 33 34 35
-0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
-0 -9223372036854775808 31 32 33 34 35
-0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result
index 732fb9c4151..1cd2a62cb56 100644
--- a/mysql-test/suite/engines/iuds/r/update_delete_number.result
+++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result
@@ -980,7 +980,6 @@ drop table mt1, mt2, mt3;
create table mt1 (col1 int);
create table mt2 (col1 int);
update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1;
-ERROR HY000: Table 'mt1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1;
ERROR HY000: Table 'mt1' is specified twice, both as a target for 'DELETE' and as a separate source for data
drop table mt1,mt2;
diff --git a/mysql-test/suite/engines/iuds/t/update_delete_number.test b/mysql-test/suite/engines/iuds/t/update_delete_number.test
index c58746d59f4..ce3f90140b2 100644
--- a/mysql-test/suite/engines/iuds/t/update_delete_number.test
+++ b/mysql-test/suite/engines/iuds/t/update_delete_number.test
@@ -495,7 +495,6 @@ drop table mt1, mt2, mt3;
# multi* unique updating table check
create table mt1 (col1 int);
create table mt2 (col1 int);
--- error ER_UPDATE_TABLE_USED
update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1;
-- error ER_UPDATE_TABLE_USED
delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1;
diff --git a/mysql-test/suite/federated/federated_bug_585688.result b/mysql-test/suite/federated/federated_bug_585688.result
index 84c08944ce0..b317a1eb2a1 100644
--- a/mysql-test/suite/federated/federated_bug_585688.result
+++ b/mysql-test/suite/federated/federated_bug_585688.result
@@ -27,14 +27,14 @@ Field Type Null Key Default Extra
a text YES NULL
connection conn_3;
show table status from federated;
-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 FEDERATED 10 Dynamic 5 20 X X X X X X X X latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 FEDERATED 10 Dynamic 5 20 X X X X X X X X latin1_swedish_ci NULL 0 N
disconnect conn_2;
connect conn_4,127.0.0.1,root,,,$MASTER_MYPORT;
connection conn_4;
show table status from federated;
-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 FEDERATED 10 Dynamic 5 20 X X X X X X X X latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 FEDERATED 10 Dynamic 5 20 X X X X X X X X latin1_swedish_ci NULL 0 N
disconnect conn_3;
disconnect conn_4;
connection master;
diff --git a/mysql-test/suite/federated/federated_partition.result b/mysql-test/suite/federated/federated_partition.result
index a2d5fcffd9b..c8a61d825b6 100644
--- a/mysql-test/suite/federated/federated_partition.result
+++ b/mysql-test/suite/federated/federated_partition.result
@@ -10,7 +10,8 @@ create table federated.t1_1 (s1 int primary key) engine=myisam;
create table federated.t1_2 (s1 int primary key) engine=innodb;
connection master;
create table t1 (s1 int primary key) engine=federated
-partition by list (s1)
+CONNECTION="remember_this"
+ partition by list (s1)
(partition p1 values in (1,3)
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_1',
partition p2 values in (2,4)
@@ -20,7 +21,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`s1` int(11) NOT NULL,
PRIMARY KEY (`s1`)
-) ENGINE=FEDERATED DEFAULT CHARSET=latin1
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='remember_this'
PARTITION BY LIST (`s1`)
(PARTITION `p1` VALUES IN (1,3) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_1' ENGINE = FEDERATED,
PARTITION `p2` VALUES IN (2,4) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_2' ENGINE = FEDERATED)
diff --git a/mysql-test/suite/federated/federated_partition.test b/mysql-test/suite/federated/federated_partition.test
index ef1e27ec505..47110b5eebf 100644
--- a/mysql-test/suite/federated/federated_partition.test
+++ b/mysql-test/suite/federated/federated_partition.test
@@ -25,6 +25,7 @@ create table federated.t1_2 (s1 int primary key) engine=innodb;
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create table t1 (s1 int primary key) engine=federated
+ CONNECTION="remember_this"
partition by list (s1)
(partition p1 values in (1,3)
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_1',
diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result
index 84dcb0d0a8c..8345f56dba9 100644
--- a/mysql-test/suite/federated/federatedx.result
+++ b/mysql-test/suite/federated/federatedx.result
@@ -2283,6 +2283,22 @@ connection default;
connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
+#
+# MDEV-21049 Segfault in create federatedx table with empty hostname
+#
+connection master;
+CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+CONNECTION='mysql://root@:SLAVE_PORT/federated/t1';
+ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: 'root' hostname: 'localhost'
+connection slave;
+CREATE TABLE federated.t1(x int);
+connection master;
+CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+CONNECTION='mysql://root@:SLAVE_PORT/federated/t1';
+DROP TABLE federated.t1;
+connection slave;
+DROP TABLE federated.t1;
+connection default;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test
index 29d1eaddc26..fcc0178c024 100644
--- a/mysql-test/suite/federated/federatedx.test
+++ b/mysql-test/suite/federated/federatedx.test
@@ -2010,4 +2010,25 @@ connection master;
--error ER_CANT_CREATE_FEDERATED_TABLE
eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+--echo #
+--echo # MDEV-21049 Segfault in create federatedx table with empty hostname
+--echo #
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--error ER_CANT_CREATE_FEDERATED_TABLE
+eval CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+ CONNECTION='mysql://root@:$SLAVE_MYPORT/federated/t1';
+
+connection slave;
+CREATE TABLE federated.t1(x int);
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+ CONNECTION='mysql://root@:$SLAVE_MYPORT/federated/t1';
+
+DROP TABLE federated.t1;
+connection slave;
+DROP TABLE federated.t1;
+connection default;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/federated/federatedx_versioning.result b/mysql-test/suite/federated/federatedx_versioning.result
new file mode 100644
index 00000000000..d9e8a421989
--- /dev/null
+++ b/mysql-test/suite/federated/federatedx_versioning.result
@@ -0,0 +1,100 @@
+create or replace table t1 (
+x int,
+row_start SYS_TYPE as row start invisible,
+row_end SYS_TYPE as row end invisible,
+period for system_time (row_start, row_end))
+with system versioning;
+create or replace table tf engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t1';
+show create table tf;
+Table Create Table
+tf CREATE TABLE `tf` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` SYS_TYPE INVISIBLE DEFAULT '1971-01-01 00:00:00.000000',
+ `row_end` SYS_TYPE INVISIBLE DEFAULT '1971-01-01 00:00:00.000000'
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:MASTER_MYPORT/test/t1'
+# INSERT
+insert into t1 values (1);
+select * from tf;
+x
+1
+insert into tf (x) values (2);
+select * from t1;
+x
+1
+2
+select * from tf;
+x
+1
+2
+# UPDATE
+update tf set x= x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+x check_row(row_start, row_end)
+1 HISTORICAL ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+4 CURRENT ROW
+# DELETE
+delete from tf;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+x check_row(row_start, row_end)
+1 HISTORICAL ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 HISTORICAL ROW
+select * from tf;
+x
+# TRUNCATE
+truncate tf;
+select * from t1 for system_time all;
+x
+# REPLACE
+create or replace table t2 (
+id int primary key, y int,
+row_start SYS_TYPE as row start invisible,
+row_end SYS_TYPE as row end invisible,
+period for system_time (row_start, row_end))
+with system versioning;
+create or replace table t2f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t2';
+insert t2f (id, y) values (1, 2);
+replace t2f (id, y) values (1, 3);
+select *, check_row(row_start, row_end) from t2 for system_time all
+order by y;
+id y check_row(row_start, row_end)
+1 2 HISTORICAL ROW
+1 3 CURRENT ROW
+# VIEW
+create or replace view vt1 as select * from tf;
+insert into vt1 values (3);
+update vt1 set x= x + 1;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+x check_row(row_start, row_end)
+3 HISTORICAL ROW
+4 CURRENT ROW
+delete from vt1;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+x check_row(row_start, row_end)
+3 HISTORICAL ROW
+4 HISTORICAL ROW
+# multi-UPDATE
+truncate t1;
+truncate t2;
+insert into t1 values (1);
+insert into t2 values (2, 2);
+update tf, t2f set tf.x= 11, t2f.y= 22;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+x check_row(row_start, row_end)
+1 HISTORICAL ROW
+11 CURRENT ROW
+select *, check_row(row_start, row_end) from t2 for system_time all
+order by y;
+id y check_row(row_start, row_end)
+2 2 HISTORICAL ROW
+2 22 CURRENT ROW
+drop view vt1;
+drop tables t1, t2, t2f, tf;
diff --git a/mysql-test/suite/federated/federatedx_versioning.test b/mysql-test/suite/federated/federatedx_versioning.test
new file mode 100644
index 00000000000..44999522a4d
--- /dev/null
+++ b/mysql-test/suite/federated/federatedx_versioning.test
@@ -0,0 +1,78 @@
+--source include/not_embedded.inc
+--source have_federatedx.inc
+--source suite/versioning/engines.inc
+--source suite/versioning/common.inc
+
+--replace_result $sys_datatype_expl SYS_TYPE
+eval create or replace table t1 (
+ x int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end))
+with system versioning;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval create or replace table tf engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1';
+--replace_result $MASTER_MYPORT MASTER_MYPORT $sys_datatype_expl SYS_TYPE 19710101000000 "'1971-01-01 00:00:00.000000'" " NOT NULL" ""
+show create table tf;
+--echo # INSERT
+insert into t1 values (1);
+select * from tf;
+insert into tf (x) values (2);
+select * from t1;
+select * from tf;
+
+--echo # UPDATE
+update tf set x= x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+
+--echo # DELETE
+delete from tf;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+select * from tf;
+
+--echo # TRUNCATE
+truncate tf;
+select * from t1 for system_time all;
+
+--echo # REPLACE
+--replace_result $sys_datatype_expl SYS_TYPE
+eval create or replace table t2 (
+ id int primary key, y int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end))
+with system versioning;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval create or replace table t2f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t2';
+insert t2f (id, y) values (1, 2);
+replace t2f (id, y) values (1, 3);
+select *, check_row(row_start, row_end) from t2 for system_time all
+order by y;
+
+--echo # VIEW
+create or replace view vt1 as select * from tf;
+insert into vt1 values (3);
+update vt1 set x= x + 1;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+delete from vt1;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+
+--echo # multi-UPDATE
+truncate t1;
+truncate t2;
+insert into t1 values (1);
+insert into t2 values (2, 2);
+update tf, t2f set tf.x= 11, t2f.y= 22;
+select *, check_row(row_start, row_end) from t1 for system_time all
+order by x;
+select *, check_row(row_start, row_end) from t2 for system_time all
+order by y;
+
+drop view vt1;
+drop tables t1, t2, t2f, tf;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/federated/timestamps.result b/mysql-test/suite/federated/timestamps.result
new file mode 100644
index 00000000000..9f3be82a4ec
--- /dev/null
+++ b/mysql-test/suite/federated/timestamps.result
@@ -0,0 +1,64 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
+CREATE DATABASE federated;
+connection slave;
+CREATE DATABASE federated;
+connection slave;
+set global time_zone='Europe/Moscow';
+set time_zone='Europe/Moscow';
+create table federated.t1 (dt datetime, ts timestamp, unique(ts));
+connection master;
+set time_zone='+01:00';
+create table t1 engine=federated connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+set @@timestamp=1;
+insert t1 values (now(), now());
+set @@timestamp=2147483647;
+insert t1 values (now(), now());
+set @@timestamp=1067121000;
+insert t1 values (now(), now());
+set @@timestamp=1067124600;
+insert t1 values (now(), now());
+set @@timestamp=0;
+select * from t1;
+dt ts
+1970-01-01 01:00:01 1970-01-01 01:00:01
+2038-01-19 04:14:07 2038-01-19 04:14:07
+2003-10-25 23:30:00 2003-10-25 23:30:00
+2003-10-26 00:30:00 2003-10-26 00:30:00
+delete from t1 where ts='1970-01-01 01:00:01';
+select * from t1;
+dt ts
+2038-01-19 04:14:07 2038-01-19 04:14:07
+2003-10-25 23:30:00 2003-10-25 23:30:00
+2003-10-26 00:30:00 2003-10-26 00:30:00
+insert t1 values ('1970-01-01 01:00:01', now());
+update t1 set ts=dt;
+select * from t1;
+dt ts
+1970-01-01 01:00:01 1970-01-01 01:00:01
+2038-01-19 04:14:07 2038-01-19 04:14:07
+2003-10-25 23:30:00 2003-10-25 23:30:00
+2003-10-26 00:30:00 2003-10-26 00:30:00
+select * from t1 where ts='2003-10-25 23:30:00';
+dt ts
+2003-10-25 23:30:00 2003-10-25 23:30:00
+select * from t1 where ts='2003-10-26 00:30:00';
+dt ts
+2003-10-26 00:30:00 2003-10-26 00:30:00
+connection slave;
+select * from federated.t1;
+dt ts
+1970-01-01 01:00:01 1970-01-01 03:00:01
+2038-01-19 04:14:07 2038-01-19 06:14:07
+2003-10-25 23:30:00 2003-10-26 02:30:00
+2003-10-26 00:30:00 2003-10-26 02:30:00
+set global time_zone=default;
+connection master;
+drop table t1;
+connection master;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+connection slave;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/timestamps.test b/mysql-test/suite/federated/timestamps.test
new file mode 100644
index 00000000000..7b46b797f2f
--- /dev/null
+++ b/mysql-test/suite/federated/timestamps.test
@@ -0,0 +1,45 @@
+source have_federatedx.inc;
+source include/federated.inc;
+
+connection slave;
+set global time_zone='Europe/Moscow';
+set time_zone='Europe/Moscow';
+create table federated.t1 (dt datetime, ts timestamp, unique(ts));
+
+connection master;
+set time_zone='+01:00';
+replace_result $SLAVE_MYPORT SLAVE_PORT;
+eval create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+set @@timestamp=1; # min value
+insert t1 values (now(), now());
+set @@timestamp=2147483647; # max value
+insert t1 values (now(), now());
+set @@timestamp=1067121000; # DST ambiguous (in Europe/Moscow)
+insert t1 values (now(), now());
+set @@timestamp=1067124600; # DST ambiguous (in Europe/Moscow)
+insert t1 values (now(), now());
+set @@timestamp=0;
+
+# reads
+select * from t1;
+
+# deletes
+delete from t1 where ts='1970-01-01 01:00:01';
+select * from t1;
+
+# updates
+insert t1 values ('1970-01-01 01:00:01', now());
+update t1 set ts=dt;
+select * from t1;
+
+# index lookups
+select * from t1 where ts='2003-10-25 23:30:00';
+select * from t1 where ts='2003-10-26 00:30:00';
+
+connection slave;
+select * from federated.t1;
+set global time_zone=default;
+connection master;
+drop table t1;
+source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
index 71030a2b1d8..ba390dfb4f5 100644
--- a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
@@ -75,7 +75,8 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog,
table_schema, table_name, column_name
FROM information_schema.key_column_usage
-WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
+WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL
+ORDER BY BINARY table_schema, BINARY table_name, BINARY column_name, BINARY constraint_name;
--echo ########################################################################################
diff --git a/mysql-test/suite/funcs_1/datadict/is_schemata.inc b/mysql-test/suite/funcs_1/datadict/is_schemata.inc
index bbdbbcd44af..267d3c272b9 100644
--- a/mysql-test/suite/funcs_1/datadict/is_schemata.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_schemata.inc
@@ -60,7 +60,8 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
# Show that CATALOG_NAME and SQL_PATH are always NULL.
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
-WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
+WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL
+ORDER BY schema_name;
--echo ###############################################################################
diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
index fdfdad31392..5dda419ab82 100644
--- a/mysql-test/suite/funcs_1/datadict/is_triggers.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
@@ -88,7 +88,8 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
SELECT * FROM information_schema.triggers
WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
- OR action_reference_new_table IS NOT NULL;
+ OR action_reference_new_table IS NOT NULL
+ORDER BY trigger_schema, trigger_name;
--echo ##################################################################################
diff --git a/mysql-test/suite/funcs_1/datadict/is_views.inc b/mysql-test/suite/funcs_1/datadict/is_views.inc
index bdba03f3632..cb3444e308a 100644
--- a/mysql-test/suite/funcs_1/datadict/is_views.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_views.inc
@@ -159,12 +159,14 @@ CREATE USER 'testuser1'@'localhost';
# Check just created VIEW
SELECT * FROM information_schema.views
-WHERE table_name LIKE 't1_%';
+WHERE table_name LIKE 't1_%'
+ORDER BY table_schema, table_name;
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_%';
+WHERE table_name LIKE 't1_%'
+ORDER BY table_schema, table_name;
DROP VIEW test.t1_view1;
DROP VIEW test.t1_view2;
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
index a2e701cc5fa..99a4340c571 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
@@ -159,7 +159,7 @@ eval SHOW CREATE TABLE $table;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 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 17 TID
eval SELECT $columns FROM $table $select_where ORDER BY id;
@@ -180,7 +180,7 @@ eval SHOW CREATE TABLE $table;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 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 17 TID
eval SELECT $columns FROM $table $select_where ORDER BY id;
@@ -207,7 +207,7 @@ SHOW GRANTS;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -220,7 +220,7 @@ SHOW GRANTS;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -244,7 +244,7 @@ SHOW GRANTS;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -267,7 +267,7 @@ SHOW GRANTS;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -294,7 +294,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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -316,7 +316,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -339,7 +339,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -387,7 +387,7 @@ SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -409,7 +409,7 @@ SHOW GRANTS;
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -433,7 +433,7 @@ GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -458,7 +458,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_result Execute Query
--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 17 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 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 a3e3bf57a99..fa6ed4049d6 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -92,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> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
@@ -160,7 +160,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> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -203,7 +203,7 @@ echo
#----------------------------------------------------------------------------
;
connection con1;
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -229,7 +229,7 @@ let $wait_condition= SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST
--source include/wait_condition.inc
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> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -281,7 +281,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> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -341,7 +341,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> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
UNLOCK TABLES;
#
@@ -388,7 +388,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> 17 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
diff --git a/mysql-test/suite/funcs_1/datadict/tables2.inc b/mysql-test/suite/funcs_1/datadict/tables2.inc
index 1dc00e5b0f7..2d19eb8b3dd 100644
--- a/mysql-test/suite/funcs_1/datadict/tables2.inc
+++ b/mysql-test/suite/funcs_1/datadict/tables2.inc
@@ -30,7 +30,7 @@ let $innodb_pattern = 'InnoDB free';
# We do not unify the engine name here, because the rowformat is
# specific to the engine.
--replace_result Dynamic DYNAMIC_OR_PAGE Page DYNAMIC_OR_PAGE MyISAM MYISAM_OR_MARIA Aria MYISAM_OR_MARIA
---replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#"
+--replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#" 22 "#MIL#"
eval
SELECT *,
LEFT( table_comment,
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 fd8e0ff338c..737335afddd 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -857,7 +857,7 @@ my_varbinary_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -871,7 +871,7 @@ my_binary_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -885,7 +885,7 @@ my_varchar_1000, id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -899,7 +899,7 @@ my_char_30, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
index 405b7ab62b0..ffa30f4d012 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
@@ -264,7 +264,7 @@ agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
CALL sp_ins_3();
SELECT row_count();
row_count()
-1
+3
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
@@ -317,7 +317,7 @@ COUNT( f1 ) f1
4 updated
SELECT row_count();
row_count()
-3
+7
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
@@ -380,7 +380,7 @@ row_count() after delete
2
SELECT row_count();
row_count()
-0
+8
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
index 77fabeaef77..2bc3f46821d 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
@@ -253,7 +253,7 @@ Testcase 3.5.1.10:
------------------
CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trg7_1' already exists
drop trigger trg7_1;
Testcase 3.5.1.?:
@@ -266,7 +266,7 @@ create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
for each row set new.f1 ='trig t2';
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trig' already exists
insert into t1 value ('insert to t1',1);
select * from t1;
f1 f2
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 98f599da3e5..9f9bf1ca4de 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -78,14 +78,14 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -168,12 +168,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection no_privs_424a;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -209,7 +209,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
connection default;
@@ -233,22 +233,22 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -276,8 +276,8 @@ drop trigger trg4b_1;
connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
@@ -314,22 +314,22 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
@@ -349,8 +349,8 @@ drop trigger trg4c_1;
connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
@@ -377,21 +377,21 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
@@ -412,8 +412,8 @@ drop trigger trg4d_1;
connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
@@ -441,12 +441,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -478,7 +478,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
@@ -502,23 +502,23 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -537,8 +537,8 @@ drop trigger trg5b_1;
connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -564,23 +564,23 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -595,8 +595,8 @@ drop trigger trg5c_1;
connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -617,23 +617,23 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -648,8 +648,8 @@ drop trigger trg5d_1;
connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -674,9 +674,9 @@ grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_353x;
select current_user;
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 b29c0271fdc..c869b5cc5bc 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -14,16 +14,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant select on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant select,insert on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
@@ -45,8 +45,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -96,8 +96,8 @@ root@localhost
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
no trigger privilege on db level for drop:
------------------------------------------
@@ -152,8 +152,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -182,9 +182,9 @@ create table t1 (f1 char(20)) engine= innodb;
grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `no_priv_db`.* TO `test_yesprivs`@`localhost`
use db with trigger privilege on db level and without...:
---------------------------------------------------------
@@ -285,13 +285,13 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -329,8 +329,8 @@ insert2-yes
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -366,8 +366,8 @@ trig 1_2-yes
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
no trigger privilege on table level for drop:
---------------------------------------------
@@ -421,8 +421,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
connection no_privs;
select current_user;
@@ -458,15 +458,15 @@ create table t2 (f1 char(20)) engine= innodb;
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_noprivs`@`localhost`
use table with trigger privilege and without...:
------------------------------------------------
@@ -543,14 +543,14 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant ALL on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_privs;
@@ -603,7 +603,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -622,7 +622,7 @@ current_user
root@localhost
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
@@ -656,8 +656,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -720,7 +720,7 @@ trig 1_2-yes
grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connection yes_privs;
select current_user;
current_user
@@ -811,9 +811,9 @@ grant ALL on priv1_db.* to test_yesprivs@localhost;
grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
@@ -821,9 +821,9 @@ grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT ON `priv2_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -888,9 +888,9 @@ revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -928,10 +928,10 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -976,10 +976,10 @@ root@localhost
grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1069,8 +1069,8 @@ grant select
on priv_db.t1 to test_useprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1103,8 +1103,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1134,8 +1134,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1166,8 +1166,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1199,8 +1199,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1233,8 +1233,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1272,8 +1272,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1336,8 +1336,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1379,9 +1379,9 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
@@ -1416,8 +1416,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1474,16 +1474,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -1539,10 +1539,10 @@ revoke UPDATE(f1) on priv_db.t2
from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1691,9 +1691,9 @@ grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1734,9 +1734,9 @@ grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
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 81ead0c9346..4753efd1794 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
@@ -245,7 +245,7 @@ Testcase 3.5.5.3:
Create view vw3 as select f118 from tb3;
Create trigger trg3 before INSERT
on vw3 for each row set new.f118='s';
-ERROR HY000: 'test.vw3' is not BASE TABLE
+ERROR HY000: 'test.vw3' is not of type 'BASE TABLE'
drop view vw3;
Testcase 3.5.5.4:
@@ -459,7 +459,7 @@ Create trigger trg_3_406010_2 AFTER DELETE
on tb3 for each row set @test_var=@test_var+50;
Create trigger trg_3_406010_1 AFTER INSERT
on tb3 for each row set @test_var=@test_var+1;
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trg_3_406010_1' already exists
select @test_var;
@test_var
1
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index 1316988ffc3..90d72b451b9 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -3520,12 +3520,12 @@ f1
DROP TRIGGER tr1 ;
SET @a:=0 ;
CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ;
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
RENAME TABLE v1 TO v2;
RENAME VIEW v2 TO v1;
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 'VIEW v2 TO v1' at line 1
ALTER TABLE v2 RENAME AS v1;
-ERROR HY000: 'test.v2' is not BASE TABLE
+ERROR HY000: 'test.v2' is not of type 'BASE TABLE'
ALTER VIEW v1 RENAME AS v2;
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 'RENAME AS v2' at line 1
DROP TABLE IF EXISTS t1, t2 ;
@@ -3535,12 +3535,12 @@ CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE );
CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
ALTER TABLE t1 ADD PRIMARY KEY(f1);
ALTER TABLE v1 ADD PRIMARY KEY(f1);
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
ALTER VIEW v1 ADD PRIMARY KEY(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 'ADD PRIMARY KEY(f1)' at line 1
CREATE INDEX t1_idx ON t1(f3);
CREATE INDEX v1_idx ON v1(f3);
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
DROP TABLE t1;
DROP VIEW v1;
@@ -3551,11 +3551,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
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 'or REPLACE AS Select * from tb2 my_table' at line 1
CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50;
-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 'CASCADED CHECK OPTION AS Select *
+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 'WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50;
-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 'LOCAL CHECK OPTION AS Select *
+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 'WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
SELECT * FROM tb2 my_table CREATE VIEW As v1;
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 'CREATE VIEW As v1' at line 1
@@ -3585,7 +3585,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
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 'CHECK OPTION WITH CASCADED' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-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 'CASCADED CHECK OPTION
+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 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
@@ -3614,7 +3614,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
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 'CHECK OPTION WITH LOCAL' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-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 'CASCADED CHECK OPTION
+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 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
@@ -4085,9 +4085,9 @@ Drop view test.v1 ;
Testcase 3.3.1.14
--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
+ERROR HY000: 'test.tb2' is not of type 'VIEW'
CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
+ERROR HY000: 'test.tb2' is not of type 'VIEW'
Testcase 3.3.1.15
--------------------------------------------------------------------------------
@@ -4314,7 +4314,7 @@ CREATE VIEW v2 AS Select * from test.v1;
ERROR 42S02: Table 'test.v1' doesn't exist
DROP VIEW IF EXISTS v2;
Warnings:
-Note 1051 Unknown table 'test.v2'
+Note 4092 Unknown VIEW: 'test.v2'
Testcase 3.3.1.25
--------------------------------------------------------------------------------
@@ -7566,7 +7566,7 @@ Call sp1() ;
ERROR 42000: PROCEDURE test.sp1 does not exist
Drop view if exists test.v1 ;
Warnings:
-Note 1051 Unknown table 'test.v1'
+Note 4092 Unknown VIEW: 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
@@ -21307,12 +21307,12 @@ CREATE TABLE t1 ( f1 VARCHAR(1000) ) ENGINE = innodb ;
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW v1;
DROP VIEW v1;
-ERROR 42S02: Unknown table 'test.v1'
+ERROR 42S02: Unknown VIEW: 'test.v1'
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
-Note 1051 Unknown table 'test.v1'
+Note 4092 Unknown VIEW: 'test.v1'
Testcase 3.3.1.68
--------------------------------------------------------------------------------
@@ -21324,31 +21324,31 @@ CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top CASCADE ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base CASCADE ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top RESTRICT ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base RESTRICT ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
Testcase 3.3.1.69, 3.3.1.70, 3.3.1.A5
@@ -21365,7 +21365,7 @@ ERROR 42S02: Table 'test.v1' doesn't exist
SHOW CREATE TABLE v1 ;
ERROR 42S02: Table 'test.v1' doesn't exist
SHOW TABLE STATUS like 'v1' ;
-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
+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 Max_index_length Temporary
SHOW TABLES LIKE 'v1';
Tables_in_test (v1)
SHOW COLUMNS FROM v1;
diff --git a/mysql-test/suite/funcs_1/r/is_basics_mixed.result b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
index 770435475a3..95fc5ae59c3 100644
--- a/mysql-test/suite/funcs_1/r/is_basics_mixed.result
+++ b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
@@ -128,7 +128,7 @@ CREATE USER 'testuser1'@'localhost';
GRANT ALL ON *.* TO testuser1@localhost;
SHOW GRANTS FOR testuser1@localhost;
Grants for testuser1@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'testuser1'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `testuser1`@`localhost`
connect testuser1, localhost, testuser1, , test;
USE information_schema;
CREATE TABLE schemata ( c1 INT );
@@ -341,12 +341,14 @@ CREATE SQL SECURITY INVOKER VIEW db_datadict.v2 AS
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
-FROM db_datadict.v2;
+FROM db_datadict.v2
+ORDER BY TABLE_NAME;
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
db_datadict t1 BASE TABLE
db_datadict v2 VIEW
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
-FROM information_schema.tables WHERE table_schema = 'db_datadict';
+FROM information_schema.tables WHERE table_schema = 'db_datadict'
+ORDER BY TABLE_NAME;
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
db_datadict t1 BASE TABLE
db_datadict v2 VIEW
diff --git a/mysql-test/suite/funcs_1/r/is_check_constraints.result b/mysql-test/suite/funcs_1/r/is_check_constraints.result
index 4d7c7b446e6..1b54135e355 100644
--- a/mysql-test/suite/funcs_1/r/is_check_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_check_constraints.result
@@ -1,12 +1,12 @@
#
-# MDEV-17323: Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTS to 10.2
+# MDEV-14474: Create INFORMATION_SCHEMA.CHECK_CONSTRAINTS
#
CREATE user boo1;
GRANT select,create,alter,drop on foo.* to boo1;
SHOW GRANTS for boo1;
Grants for boo1@%
-GRANT USAGE ON *.* TO 'boo1'@'%'
-GRANT SELECT, CREATE, DROP, ALTER ON `foo`.* TO 'boo1'@'%'
+GRANT USAGE ON *.* TO `boo1`@`%`
+GRANT SELECT, CREATE, DROP, ALTER ON `foo`.* TO `boo1`@`%`
CREATE user boo2;
create database foo;
CONNECT con1,localhost, boo1,, foo;
@@ -130,8 +130,8 @@ INSERT INTO t1 VALUES (1, 2), (2, 3);
GRANT SELECT (a) ON t1 TO foo;
SHOW GRANTS FOR foo;
Grants for foo@%
-GRANT USAGE ON *.* TO 'foo'@'%'
-GRANT SELECT (a) ON `db`.`t1` TO 'foo'@'%'
+GRANT USAGE ON *.* TO `foo`@`%`
+GRANT SELECT (a) ON `db`.`t1` TO `foo`@`%`
SELECT * FROM information_schema.check_constraints;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
def db t1 CONSTRAINT_1 `b` > 0
diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges.result b/mysql-test/suite/funcs_1/r/is_column_privileges.result
index a56ef002935..b6be9118048 100644
--- a/mysql-test/suite/funcs_1/r/is_column_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_column_privileges.result
@@ -140,6 +140,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict CREATE TEMPORARY TABLES NO
'testuser3'@'localhost' def db_datadict CREATE VIEW NO
'testuser3'@'localhost' def db_datadict DELETE NO
+'testuser3'@'localhost' def db_datadict DELETE HISTORY NO
'testuser3'@'localhost' def db_datadict DROP NO
'testuser3'@'localhost' def db_datadict EVENT NO
'testuser3'@'localhost' def db_datadict EXECUTE NO
@@ -195,8 +196,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -204,8 +205,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection default;
GRANT SELECT (f1,f3) ON db_datadict.my_table TO 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
@@ -216,9 +217,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -228,9 +229,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
@@ -243,9 +244,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -256,9 +257,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
SELECT f1, f3 FROM db_datadict.my_table;
ERROR 42S22: Unknown column 'f3' in 'field list'
connection default;
@@ -272,9 +273,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -285,9 +286,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
DROP TABLE db_datadict.my_table;
SELECT * FROM information_schema.column_privileges
@@ -299,9 +300,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -312,9 +313,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
@@ -323,8 +324,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -332,8 +333,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result
index 982f4de5116..f1c784e2839 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -106,6 +106,7 @@ table_catalog table_schema table_name column_name
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
###############################################################################
# Testcase 3.2.6.2 + 3.2.6.3: INFORMATION_SCHEMA.COLUMNS accessible information
###############################################################################
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 9a7280f6fbe..fbca906a9fb 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -427,9 +427,9 @@ def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) u
def test tb1 f2 2 NULL YES char 0 0 NULL NULL NULL latin1 latin1_bin char(0) select,insert,update,references NEVER NULL
def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
+def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
@@ -543,9 +543,9 @@ def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) un
def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
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 a34668daff3..808836ab119 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -261,18 +261,19 @@ def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 '' NO varchar 20 60 NULL NU
def information_schema PLUGINS PLUGIN_VERSION 2 '' NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select NEVER NULL
def information_schema PROCESSLIST COMMAND 5 '' NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select NEVER NULL
def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
-def information_schema PROCESSLIST EXAMINED_ROWS 14 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL
+def information_schema PROCESSLIST EXAMINED_ROWS 15 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL
def information_schema PROCESSLIST HOST 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select NEVER NULL
-def information_schema PROCESSLIST INFO_BINARY 16 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select NEVER NULL
+def information_schema PROCESSLIST INFO_BINARY 17 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select NEVER NULL
+def information_schema PROCESSLIST MAX_MEMORY_USED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
def information_schema PROCESSLIST MEMORY_USED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select NEVER NULL
-def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
+def information_schema PROCESSLIST QUERY_ID 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
-def information_schema PROCESSLIST TID 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
+def information_schema PROCESSLIST TID 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL
def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select NEVER NULL
def information_schema PROCESSLIST USER 2 '' NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select NEVER NULL
@@ -312,7 +313,7 @@ def information_schema ROUTINES ROUTINE_COMMENT 27 '' NO longtext 4294967295 429
def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select NEVER NULL
def information_schema ROUTINES ROUTINE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema ROUTINES ROUTINE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES ROUTINE_TYPE 5 '' NO varchar 9 27 NULL NULL NULL utf8 utf8_general_ci varchar(9) select NEVER NULL
+def information_schema ROUTINES ROUTINE_TYPE 5 '' NO varchar 13 39 NULL NULL NULL utf8 utf8_general_ci varchar(13) select NEVER NULL
def information_schema ROUTINES SECURITY_TYPE 23 '' NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) select NEVER NULL
def information_schema ROUTINES SPECIFIC_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema ROUTINES SQL_DATA_ACCESS 21 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
@@ -377,6 +378,7 @@ def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL
def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
+def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select NEVER NULL
def information_schema TABLES TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL
def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select NEVER NULL
@@ -385,6 +387,7 @@ def information_schema TABLES TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL u
def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema TABLES TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema TABLES TABLE_TYPE 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
+def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1) select NEVER NULL
def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
@@ -807,6 +810,7 @@ NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(7)
+NULL information_schema PROCESSLIST MAX_MEMORY_USED bigint NULL NULL NULL NULL bigint(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
@@ -826,7 +830,7 @@ NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema ROUTINES ROUTINE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema ROUTINES ROUTINE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ROUTINES ROUTINE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 9 27 utf8 utf8_general_ci varchar(9)
+3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 13 39 utf8 utf8_general_ci varchar(13)
3.0000 information_schema ROUTINES DATA_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH int NULL NULL NULL NULL int(21)
NULL information_schema ROUTINES CHARACTER_OCTET_LENGTH int NULL NULL NULL NULL int(21)
@@ -922,6 +926,8 @@ NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
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)
+NULL information_schema TABLES MAX_INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
+3.0000 information_schema TABLES TEMPORARY varchar 1 3 utf8 utf8_general_ci varchar(1)
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)
3.0000 information_schema TABLESPACES TABLESPACE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
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 ac3130d58b0..ca3cac7f0fc 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
@@ -261,18 +261,19 @@ def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 '' NO varchar 20 60 NULL NU
def information_schema PLUGINS PLUGIN_VERSION 2 '' NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) NEVER NULL
def information_schema PROCESSLIST COMMAND 5 '' NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) NEVER NULL
def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
-def information_schema PROCESSLIST EXAMINED_ROWS 14 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL
+def information_schema PROCESSLIST EXAMINED_ROWS 15 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL
def information_schema PROCESSLIST HOST 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext NEVER NULL
-def information_schema PROCESSLIST INFO_BINARY 16 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
+def information_schema PROCESSLIST INFO_BINARY 17 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
+def information_schema PROCESSLIST MAX_MEMORY_USED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
def information_schema PROCESSLIST MEMORY_USED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) NEVER NULL
-def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
+def information_schema PROCESSLIST QUERY_ID 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
-def information_schema PROCESSLIST TID 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
+def information_schema PROCESSLIST TID 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL
def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) NEVER NULL
def information_schema PROCESSLIST USER 2 '' NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) NEVER NULL
@@ -312,7 +313,7 @@ def information_schema ROUTINES ROUTINE_COMMENT 27 '' NO longtext 4294967295 429
def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext NEVER NULL
def information_schema ROUTINES ROUTINE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema ROUTINES ROUTINE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES ROUTINE_TYPE 5 '' NO varchar 9 27 NULL NULL NULL utf8 utf8_general_ci varchar(9) NEVER NULL
+def information_schema ROUTINES ROUTINE_TYPE 5 '' NO varchar 13 39 NULL NULL NULL utf8 utf8_general_ci varchar(13) NEVER NULL
def information_schema ROUTINES SECURITY_TYPE 23 '' NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) NEVER NULL
def information_schema ROUTINES SPECIFIC_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema ROUTINES SQL_DATA_ACCESS 21 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
@@ -377,6 +378,7 @@ def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL
def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
+def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) NEVER NULL
def information_schema TABLES TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) NEVER NULL
def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) NEVER NULL
@@ -385,6 +387,7 @@ def information_schema TABLES TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL u
def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema TABLES TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema TABLES TABLE_TYPE 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
+def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1) NEVER NULL
def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
@@ -807,6 +810,7 @@ NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(7)
+NULL information_schema PROCESSLIST MAX_MEMORY_USED bigint NULL NULL NULL NULL bigint(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
@@ -826,7 +830,7 @@ NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema ROUTINES ROUTINE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema ROUTINES ROUTINE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ROUTINES ROUTINE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 9 27 utf8 utf8_general_ci varchar(9)
+3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 13 39 utf8 utf8_general_ci varchar(13)
3.0000 information_schema ROUTINES DATA_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH int NULL NULL NULL NULL int(21)
NULL information_schema ROUTINES CHARACTER_OCTET_LENGTH int NULL NULL NULL NULL int(21)
@@ -922,6 +926,8 @@ NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
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)
+NULL information_schema TABLES MAX_INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
+3.0000 information_schema TABLES TEMPORARY varchar 1 3 utf8 utf8_general_ci varchar(1)
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)
3.0000 information_schema TABLESPACES TABLESPACE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
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 e94d4c9123a..5eaa5b08cc2 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -434,9 +434,9 @@ def test tb1 f19 11 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) u
def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
def test tb1 f20 12 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb1 f21 13 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb1 f22 14 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb1 f23 15 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f24 16 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb1 f22 14 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
+def test tb1 f23 15 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb1 f24 16 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
def test tb1 f25 17 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def test tb1 f26 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
def test tb1 f27 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
@@ -538,9 +538,9 @@ def test tb3 f135 12 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) un
def test tb3 f136 13 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f137 14 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f138 15 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb3 f139 16 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb3 f140 17 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f141 18 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb3 f139 16 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
+def test tb3 f140 17 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb3 f141 18 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f142 19 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def test tb3 f143 20 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
def test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
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 c4e11e3f48b..4426583ac4c 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -476,9 +476,9 @@ def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) u
def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
+def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
@@ -600,9 +600,9 @@ def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) un
def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
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 ae2b05c058e..6faa8d7b51a 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
@@ -476,9 +476,9 @@ def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) u
def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) NEVER NULL
def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) NEVER NULL
-def test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL
-def test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
-def test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
+def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL
+def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
+def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL
@@ -600,9 +600,9 @@ def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) un
def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) NEVER NULL
-def test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL
-def test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
-def test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
+def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL
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 69972256078..a8e8cd33e8f 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -27,6 +27,7 @@ def mysql db Create_routine_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_gen
def mysql db Create_tmp_table_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql db Create_view_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql db Db 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references NEVER NULL
+def mysql db Delete_history_priv 23 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql db Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql db Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql db Event_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
@@ -60,7 +61,7 @@ def mysql event modified 9 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NUL
def mysql event name 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references NEVER NULL
def mysql event on_completion 14 'DROP' NO enum 8 24 NULL NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE') select,insert,update,references NEVER NULL
def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql event sql_mode 15 '' NO set 494 1482 NULL NULL NULL utf8 utf8_general_ci 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') select,insert,update,references NEVER NULL
+def mysql event sql_mode 15 '' NO set 539 1617 NULL NULL NULL utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT') select,insert,update,references NEVER NULL
def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
def mysql event status 13 'ENABLED' NO enum 18 54 NULL NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') select,insert,update,references NEVER NULL
def mysql event time_zone 18 'SYSTEM' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references NEVER NULL
@@ -133,6 +134,7 @@ def mysql innodb_table_stats sum_of_other_index_sizes 6 NULL NO bigint NULL NULL
def mysql innodb_table_stats table_name 2 NULL NO varchar 199 597 NULL NULL NULL utf8 utf8_bin varchar(199) PRI select,insert,update,references NEVER NULL
def mysql plugin dl 2 '' NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
def mysql plugin name 1 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) PRI select,insert,update,references NEVER NULL
+def mysql proc aggregate 21 'NONE' NO enum 5 15 NULL NULL NULL utf8 utf8_general_ci enum('NONE','GROUP') select,insert,update,references NEVER NULL
def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references NEVER NULL
@@ -151,14 +153,14 @@ def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL
def mysql proc security_type 8 'DEFINER' NO enum 7 21 NULL NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references NEVER NULL
def mysql proc specific_name 4 '' NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references NEVER NULL
def mysql proc sql_data_access 6 'CONTAINS_SQL' NO enum 17 51 NULL NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references NEVER NULL
-def mysql proc sql_mode 15 '' NO set 494 1482 NULL NULL NULL utf8 utf8_general_ci 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') select,insert,update,references NEVER NULL
-def mysql proc type 3 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI select,insert,update,references NEVER NULL
+def mysql proc sql_mode 15 '' NO set 539 1617 NULL NULL NULL utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT') select,insert,update,references NEVER NULL
+def mysql proc type 3 NULL NO enum 12 36 NULL NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI select,insert,update,references NEVER NULL
def mysql procs_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references NEVER NULL
def mysql procs_priv Grantor 6 '' NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL select,insert,update,references NEVER NULL
def mysql procs_priv Host 1 '' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references NEVER NULL
def mysql procs_priv Proc_priv 7 '' NO set 27 81 NULL NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references NEVER NULL
def mysql procs_priv Routine_name 4 '' NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references NEVER NULL
-def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references NEVER NULL
+def mysql procs_priv Routine_type 5 NULL NO enum 12 36 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI select,insert,update,references NEVER NULL
def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
def mysql procs_priv User 3 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references NEVER NULL
def mysql proxies_priv Grantor 6 '' NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL select,insert,update,references NEVER NULL
@@ -199,7 +201,7 @@ def mysql tables_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(6
def mysql tables_priv Grantor 5 '' NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL select,insert,update,references NEVER NULL
def mysql tables_priv Host 1 '' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references NEVER NULL
def mysql tables_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql tables_priv Table_priv 7 '' NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') select,insert,update,references NEVER NULL
+def mysql tables_priv Table_priv 7 '' NO set 121 363 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') select,insert,update,references NEVER NULL
def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
def mysql tables_priv User 3 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references NEVER NULL
def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL
@@ -219,16 +221,22 @@ def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NUL
def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
+def mysql transaction_registry begin_timestamp 3 '0000-00-00 00:00:00.000000' NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) MUL select,insert,update,references NEVER NULL
+def mysql transaction_registry commit_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned UNI select,insert,update,references NEVER NULL
+def mysql transaction_registry commit_timestamp 4 '0000-00-00 00:00:00.000000' NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) MUL select,insert,update,references NEVER NULL
+def mysql transaction_registry isolation_level 5 NULL NO enum 16 48 NULL NULL NULL utf8 utf8_bin enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') select,insert,update,references NEVER NULL
+def mysql transaction_registry transaction_id 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references NEVER NULL
def mysql user Alter_priv 17 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Alter_routine_priv 28 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text select,insert,update,references NEVER NULL
+def mysql user authentication_string 43 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text select,insert,update,references NEVER NULL
def mysql user Create_priv 8 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Create_routine_priv 27 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Create_tablespace_priv 32 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
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 NEVER NULL
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 NEVER NULL
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 NEVER NULL
-def mysql user default_role 45 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) select,insert,update,references NEVER NULL
+def mysql user default_role 46 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) select,insert,update,references NEVER NULL
+def mysql user Delete_history_priv 33 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
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 NEVER NULL
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 NEVER NULL
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 NEVER NULL
@@ -238,16 +246,16 @@ def mysql user Grant_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci
def mysql user Host 1 '' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references NEVER NULL
def mysql user Index_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Insert_priv 5 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql user is_role 44 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
+def mysql user is_role 45 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
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 NEVER NULL
-def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references NEVER NULL
-def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references NEVER NULL
-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 NEVER NULL
-def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references NEVER NULL
-def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
+def mysql user max_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references NEVER NULL
+def mysql user max_questions 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references NEVER NULL
+def mysql user max_statement_time 47 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) select,insert,update,references NEVER NULL
+def mysql user max_updates 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references NEVER NULL
+def mysql user max_user_connections 41 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def mysql user Password 3 '' NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41) select,insert,update,references NEVER NULL
-def mysql user password_expired 43 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql user plugin 41 '' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references NEVER NULL
+def mysql user password_expired 44 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
+def mysql user plugin 42 '' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references NEVER NULL
def mysql user Process_priv 12 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user References_priv 15 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Reload_priv 10 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
@@ -257,14 +265,14 @@ def mysql user Select_priv 4 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci
def mysql user Show_db_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Show_view_priv 26 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Shutdown_priv 11 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql user ssl_cipher 34 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def mysql user ssl_type 33 '' NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references NEVER NULL
+def mysql user ssl_cipher 35 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
+def mysql user ssl_type 34 '' NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references NEVER NULL
def mysql user Super_priv 19 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Trigger_priv 31 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user Update_priv 6 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NEVER NULL
def mysql user User 2 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references NEVER NULL
-def mysql user x509_issuer 35 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def mysql user x509_subject 36 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
+def mysql user x509_issuer 36 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
+def mysql user x509_subject 37 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -377,6 +385,7 @@ NULL mysql column_stats hist_size tinyint NULL NULL NULL NULL tinyint(3) unsigne
3.0000 mysql db Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql db Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql db Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql db Delete_history_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql event db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql event name char 64 192 utf8 utf8_general_ci char(64)
1.0000 mysql event body longblob 4294967295 4294967295 NULL NULL longblob
@@ -391,7 +400,7 @@ NULL mysql event starts datetime NULL NULL NULL NULL datetime
NULL mysql event ends datetime NULL NULL NULL NULL datetime
3.0000 mysql event status enum 18 54 utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')
3.0000 mysql event on_completion enum 8 24 utf8 utf8_general_ci enum('DROP','PRESERVE')
-3.0000 mysql event sql_mode set 494 1482 utf8 utf8_general_ci 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')
+3.0000 mysql event sql_mode set 539 1617 utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT')
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
NULL mysql event originator int NULL NULL NULL NULL int(10) unsigned
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
@@ -470,7 +479,7 @@ NULL mysql innodb_table_stats sum_of_other_index_sizes bigint NULL NULL NULL NUL
3.0000 mysql plugin dl varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64)
-3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE')
+3.0000 mysql proc type enum 12 36 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY')
3.0000 mysql proc specific_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql proc language enum 3 9 utf8 utf8_general_ci enum('SQL')
3.0000 mysql proc sql_data_access enum 17 51 utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
@@ -482,17 +491,18 @@ NULL mysql innodb_table_stats sum_of_other_index_sizes bigint NULL NULL NULL NUL
3.0000 mysql proc definer char 141 423 utf8 utf8_bin char(141)
NULL mysql proc created timestamp NULL NULL NULL NULL timestamp
NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
-3.0000 mysql proc sql_mode set 494 1482 utf8 utf8_general_ci 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')
+3.0000 mysql proc sql_mode set 539 1617 utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT')
1.0000 mysql proc comment text 65535 65535 utf8 utf8_bin text
3.0000 mysql proc character_set_client char 32 96 utf8 utf8_bin char(32)
3.0000 mysql proc collation_connection char 32 96 utf8 utf8_bin char(32)
3.0000 mysql proc db_collation char 32 96 utf8 utf8_bin char(32)
1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
+3.0000 mysql proc aggregate enum 5 15 utf8 utf8_general_ci enum('NONE','GROUP')
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql procs_priv User char 80 240 utf8 utf8_bin char(80)
3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_general_ci char(64)
-3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE')
+3.0000 mysql procs_priv Routine_type enum 12 36 utf8 utf8_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY')
3.0000 mysql procs_priv Grantor char 141 423 utf8 utf8_bin char(141)
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
@@ -535,7 +545,7 @@ NULL mysql slow_log rows_affected int NULL NULL NULL NULL int(11)
3.0000 mysql tables_priv Table_name char 64 192 utf8 utf8_bin char(64)
3.0000 mysql tables_priv Grantor char 141 423 utf8 utf8_bin char(141)
NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp
-3.0000 mysql tables_priv Table_priv set 98 294 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
+3.0000 mysql tables_priv Table_priv set 121 363 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows')
3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
3.0000 mysql table_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
3.0000 mysql table_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
@@ -554,6 +564,11 @@ NULL mysql time_zone_transition_type Transition_type_id int NULL NULL NULL NULL
NULL mysql time_zone_transition_type Offset int NULL NULL NULL NULL int(11)
NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(3) unsigned
3.0000 mysql time_zone_transition_type Abbreviation char 8 24 utf8 utf8_general_ci char(8)
+NULL mysql transaction_registry transaction_id bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql transaction_registry commit_id bigint NULL NULL NULL NULL bigint(20) unsigned
+NULL mysql transaction_registry begin_timestamp timestamp NULL NULL NULL NULL timestamp(6)
+NULL mysql transaction_registry commit_timestamp timestamp NULL NULL NULL NULL timestamp(6)
+3.0000 mysql transaction_registry isolation_level enum 16 48 utf8 utf8_bin enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE')
3.0000 mysql user Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql user User char 80 240 utf8 utf8_bin char(80)
1.0000 mysql user Password char 41 41 latin1 latin1_bin char(41)
@@ -586,6 +601,7 @@ NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(
3.0000 mysql user Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user Create_tablespace_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql user Delete_history_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob
1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob
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 87ff00d346f..8e8d632fa22 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
@@ -27,6 +27,7 @@ def mysql db Create_routine_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_gen
def mysql db Create_tmp_table_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql db Create_view_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql db Db 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI NEVER NULL
+def mysql db Delete_history_priv 23 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql db Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql db Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql db Event_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
@@ -60,7 +61,7 @@ def mysql event modified 9 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NUL
def mysql event name 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI NEVER NULL
def mysql event on_completion 14 'DROP' NO enum 8 24 NULL NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE') NEVER NULL
def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql event sql_mode 15 '' NO set 494 1482 NULL NULL NULL utf8 utf8_general_ci 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') NEVER NULL
+def mysql event sql_mode 15 '' NO set 539 1617 NULL NULL NULL utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT') NEVER NULL
def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
def mysql event status 13 'ENABLED' NO enum 18 54 NULL NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NEVER NULL
def mysql event time_zone 18 'SYSTEM' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) NEVER NULL
@@ -119,6 +120,7 @@ def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL i
def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI NEVER NULL
def mysql plugin dl 2 '' NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) NEVER NULL
def mysql plugin name 1 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) PRI NEVER NULL
+def mysql proc aggregate 21 'NONE' NO enum 5 15 NULL NULL NULL utf8 utf8_general_ci enum('NONE','GROUP') NEVER NULL
def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) NEVER NULL
@@ -137,14 +139,14 @@ def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL
def mysql proc security_type 8 'DEFINER' NO enum 7 21 NULL NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') NEVER NULL
def mysql proc specific_name 4 '' NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) NEVER NULL
def mysql proc sql_data_access 6 'CONTAINS_SQL' NO enum 17 51 NULL NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NEVER NULL
-def mysql proc sql_mode 15 '' NO set 494 1482 NULL NULL NULL utf8 utf8_general_ci 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') NEVER NULL
-def mysql proc type 3 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI NEVER NULL
+def mysql proc sql_mode 15 '' NO set 539 1617 NULL NULL NULL utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT') NEVER NULL
+def mysql proc type 3 NULL NO enum 12 36 NULL NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI NEVER NULL
def mysql procs_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI NEVER NULL
def mysql procs_priv Grantor 6 '' NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL NEVER NULL
def mysql procs_priv Host 1 '' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI NEVER NULL
def mysql procs_priv Proc_priv 7 '' NO set 27 81 NULL NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') NEVER NULL
def mysql procs_priv Routine_name 4 '' NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI NEVER NULL
-def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI NEVER NULL
+def mysql procs_priv Routine_type 5 NULL NO enum 12 36 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI NEVER NULL
def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
def mysql procs_priv User 3 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI NEVER NULL
def mysql proxies_priv Grantor 6 '' NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL NEVER NULL
@@ -185,7 +187,7 @@ def mysql tables_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(6
def mysql tables_priv Grantor 5 '' NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL NEVER NULL
def mysql tables_priv Host 1 '' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI NEVER NULL
def mysql tables_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI NEVER NULL
-def mysql tables_priv Table_priv 7 '' NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') NEVER NULL
+def mysql tables_priv Table_priv 7 '' NO set 121 363 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') NEVER NULL
def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
def mysql tables_priv User 3 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI NEVER NULL
def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
@@ -207,14 +209,15 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU
def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
def mysql user Alter_priv 17 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Alter_routine_priv 28 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
-def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text NEVER NULL
+def mysql user authentication_string 43 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text NEVER NULL
def mysql user Create_priv 8 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Create_routine_priv 27 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Create_tablespace_priv 32 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Create_tmp_table_priv 20 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Create_user_priv 29 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Create_view_priv 25 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
-def mysql user default_role 45 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) NEVER NULL
+def mysql user default_role 46 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) NEVER NULL
+def mysql user Delete_history_priv 33 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Event_priv 30 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
@@ -224,16 +227,16 @@ def mysql user Grant_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci
def mysql user Host 1 '' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI NEVER NULL
def mysql user Index_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Insert_priv 5 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
-def mysql user is_role 44 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
+def mysql user is_role 45 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Lock_tables_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
-def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned NEVER NULL
-def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned NEVER NULL
-def mysql user max_statement_time 46 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) NEVER NULL
-def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned NEVER NULL
-def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
+def mysql user max_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned NEVER NULL
+def mysql user max_questions 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned NEVER NULL
+def mysql user max_statement_time 47 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) NEVER NULL
+def mysql user max_updates 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned NEVER NULL
+def mysql user max_user_connections 41 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
def mysql user Password 3 '' NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41) NEVER NULL
-def mysql user password_expired 43 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
-def mysql user plugin 41 '' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) NEVER NULL
+def mysql user password_expired 44 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
+def mysql user plugin 42 '' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) NEVER NULL
def mysql user Process_priv 12 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user References_priv 15 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Reload_priv 10 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
@@ -243,17 +246,18 @@ def mysql user Select_priv 4 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci
def mysql user Show_db_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Show_view_priv 26 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Shutdown_priv 11 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
-def mysql user ssl_cipher 34 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
-def mysql user ssl_type 33 '' NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') NEVER NULL
+def mysql user ssl_cipher 35 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
+def mysql user ssl_type 34 '' NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') NEVER NULL
def mysql user Super_priv 19 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Trigger_priv 31 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user Update_priv 6 'N' NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') NEVER NULL
def mysql user User 2 '' NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI NEVER NULL
-def mysql user x509_issuer 35 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
-def mysql user x509_subject 36 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
+def mysql user x509_issuer 36 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
+def mysql user x509_subject 37 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -278,6 +282,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
@@ -298,6 +303,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
@@ -319,6 +325,7 @@ NULL tinyint NULL NULL
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
@@ -375,6 +382,7 @@ NULL mysql column_stats hist_size tinyint NULL NULL NULL NULL tinyint(3) unsigne
3.0000 mysql db Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql db Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql db Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql db Delete_history_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql event db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql event name char 64 192 utf8 utf8_general_ci char(64)
1.0000 mysql event body longblob 4294967295 4294967295 NULL NULL longblob
@@ -389,7 +397,7 @@ NULL mysql event starts datetime NULL NULL NULL NULL datetime
NULL mysql event ends datetime NULL NULL NULL NULL datetime
3.0000 mysql event status enum 18 54 utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')
3.0000 mysql event on_completion enum 8 24 utf8 utf8_general_ci enum('DROP','PRESERVE')
-3.0000 mysql event sql_mode set 494 1482 utf8 utf8_general_ci 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')
+3.0000 mysql event sql_mode set 539 1617 utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT')
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
NULL mysql event originator int NULL NULL NULL NULL int(10) unsigned
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
@@ -454,7 +462,7 @@ NULL mysql index_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
3.0000 mysql plugin dl varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64)
-3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE')
+3.0000 mysql proc type enum 12 36 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY')
3.0000 mysql proc specific_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql proc language enum 3 9 utf8 utf8_general_ci enum('SQL')
3.0000 mysql proc sql_data_access enum 17 51 utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
@@ -466,17 +474,18 @@ NULL mysql index_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
3.0000 mysql proc definer char 141 423 utf8 utf8_bin char(141)
NULL mysql proc created timestamp NULL NULL NULL NULL timestamp
NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
-3.0000 mysql proc sql_mode set 494 1482 utf8 utf8_general_ci 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')
+3.0000 mysql proc sql_mode set 539 1617 utf8 utf8_general_ci 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','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT')
1.0000 mysql proc comment text 65535 65535 utf8 utf8_bin text
3.0000 mysql proc character_set_client char 32 96 utf8 utf8_bin char(32)
3.0000 mysql proc collation_connection char 32 96 utf8 utf8_bin char(32)
3.0000 mysql proc db_collation char 32 96 utf8 utf8_bin char(32)
1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
+3.0000 mysql proc aggregate enum 5 15 utf8 utf8_general_ci enum('NONE','GROUP')
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql procs_priv User char 80 240 utf8 utf8_bin char(80)
3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_general_ci char(64)
-3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE')
+3.0000 mysql procs_priv Routine_type enum 12 36 utf8 utf8_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY')
3.0000 mysql procs_priv Grantor char 141 423 utf8 utf8_bin char(141)
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
@@ -519,7 +528,7 @@ NULL mysql slow_log rows_affected int NULL NULL NULL NULL int(11)
3.0000 mysql tables_priv Table_name char 64 192 utf8 utf8_bin char(64)
3.0000 mysql tables_priv Grantor char 141 423 utf8 utf8_bin char(141)
NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp
-3.0000 mysql tables_priv Table_priv set 98 294 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
+3.0000 mysql tables_priv Table_priv set 121 363 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows')
3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
3.0000 mysql table_stats db_name varchar 64 192 utf8 utf8_bin varchar(64)
3.0000 mysql table_stats table_name varchar 64 192 utf8 utf8_bin varchar(64)
@@ -570,6 +579,7 @@ NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(
3.0000 mysql user Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user Create_tablespace_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql user Delete_history_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob
1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob
@@ -587,3 +597,4 @@ NULL mysql user max_statement_time decimal NULL NULL NULL NULL decimal(12,6)
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
index fa2a738788e..5c126a48419 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
@@ -73,18 +73,19 @@ REFERENCED_COLUMN_NAME varchar(64) YES NULL
SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog,
table_schema, table_name, column_name
FROM information_schema.key_column_usage
-WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
+WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL
+ORDER BY BINARY table_schema, BINARY table_name, BINARY column_name, BINARY constraint_name;
constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name
+def mysql PRIMARY def mysql column_stats column_name
def mysql PRIMARY def mysql column_stats db_name
def mysql PRIMARY def mysql column_stats table_name
-def mysql PRIMARY def mysql column_stats column_name
-def mysql PRIMARY def mysql columns_priv Host
+def mysql PRIMARY def mysql columns_priv Column_name
def mysql PRIMARY def mysql columns_priv Db
-def mysql PRIMARY def mysql columns_priv User
+def mysql PRIMARY def mysql columns_priv Host
def mysql PRIMARY def mysql columns_priv Table_name
-def mysql PRIMARY def mysql columns_priv Column_name
-def mysql PRIMARY def mysql db Host
+def mysql PRIMARY def mysql columns_priv User
def mysql PRIMARY def mysql db Db
+def mysql PRIMARY def mysql db Host
def mysql PRIMARY def mysql db User
def mysql PRIMARY def mysql event db
def mysql PRIMARY def mysql event name
@@ -99,41 +100,41 @@ def mysql PRIMARY def mysql help_relation help_keyword_id
def mysql PRIMARY def mysql help_relation help_topic_id
def mysql PRIMARY def mysql help_topic help_topic_id
def mysql name def mysql help_topic name
-def mysql PRIMARY def mysql host Host
def mysql PRIMARY def mysql host Db
+def mysql PRIMARY def mysql host Host
def mysql PRIMARY def mysql index_stats db_name
-def mysql PRIMARY def mysql index_stats table_name
def mysql PRIMARY def mysql index_stats index_name
def mysql PRIMARY def mysql index_stats prefix_arity
+def mysql PRIMARY def mysql index_stats table_name
def mysql PRIMARY def mysql innodb_index_stats database_name
-def mysql PRIMARY def mysql innodb_index_stats table_name
def mysql PRIMARY def mysql innodb_index_stats index_name
def mysql PRIMARY def mysql innodb_index_stats stat_name
+def mysql PRIMARY def mysql innodb_index_stats table_name
def mysql PRIMARY def mysql innodb_table_stats database_name
def mysql PRIMARY def mysql innodb_table_stats table_name
def mysql PRIMARY def mysql plugin name
def mysql PRIMARY def mysql proc db
def mysql PRIMARY def mysql proc name
def mysql PRIMARY def mysql proc type
-def mysql PRIMARY def mysql procs_priv Host
def mysql PRIMARY def mysql procs_priv Db
-def mysql PRIMARY def mysql procs_priv User
+def mysql PRIMARY def mysql procs_priv Host
def mysql PRIMARY def mysql procs_priv Routine_name
def mysql PRIMARY def mysql procs_priv Routine_type
+def mysql PRIMARY def mysql procs_priv User
def mysql PRIMARY def mysql proxies_priv Host
-def mysql PRIMARY def mysql proxies_priv User
def mysql PRIMARY def mysql proxies_priv Proxied_host
def mysql PRIMARY def mysql proxies_priv Proxied_user
+def mysql PRIMARY def mysql proxies_priv User
def mysql Host def mysql roles_mapping Host
-def mysql Host def mysql roles_mapping User
def mysql Host def mysql roles_mapping Role
+def mysql Host def mysql roles_mapping User
def mysql PRIMARY def mysql servers Server_name
def mysql PRIMARY def mysql table_stats db_name
def mysql PRIMARY def mysql table_stats table_name
-def mysql PRIMARY def mysql tables_priv Host
def mysql PRIMARY def mysql tables_priv Db
-def mysql PRIMARY def mysql tables_priv User
+def mysql PRIMARY def mysql tables_priv Host
def mysql PRIMARY def mysql tables_priv Table_name
+def mysql PRIMARY def mysql tables_priv User
def mysql PRIMARY def mysql time_zone Time_zone_id
def mysql PRIMARY def mysql time_zone_leap_second Transition_time
def mysql PRIMARY def mysql time_zone_name Name
@@ -141,6 +142,8 @@ def mysql PRIMARY def mysql time_zone_transition Time_zone_id
def mysql PRIMARY def mysql time_zone_transition Transition_time
def mysql PRIMARY def mysql time_zone_transition_type Time_zone_id
def mysql PRIMARY def mysql time_zone_transition_type Transition_type_id
+def mysql commit_id def mysql transaction_registry commit_id
+def mysql PRIMARY def mysql transaction_registry transaction_id
def mysql PRIMARY def mysql user Host
def mysql PRIMARY def mysql user User
########################################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result b/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result
index 4a6114f3da3..d41f7395483 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result
@@ -73,18 +73,19 @@ REFERENCED_COLUMN_NAME varchar(64) YES NULL
SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog,
table_schema, table_name, column_name
FROM information_schema.key_column_usage
-WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
+WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL
+ORDER BY BINARY table_schema, BINARY table_name, BINARY column_name, BINARY constraint_name;
constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name
+def mysql PRIMARY def mysql column_stats column_name
def mysql PRIMARY def mysql column_stats db_name
def mysql PRIMARY def mysql column_stats table_name
-def mysql PRIMARY def mysql column_stats column_name
-def mysql PRIMARY def mysql columns_priv Host
+def mysql PRIMARY def mysql columns_priv Column_name
def mysql PRIMARY def mysql columns_priv Db
-def mysql PRIMARY def mysql columns_priv User
+def mysql PRIMARY def mysql columns_priv Host
def mysql PRIMARY def mysql columns_priv Table_name
-def mysql PRIMARY def mysql columns_priv Column_name
-def mysql PRIMARY def mysql db Host
+def mysql PRIMARY def mysql columns_priv User
def mysql PRIMARY def mysql db Db
+def mysql PRIMARY def mysql db Host
def mysql PRIMARY def mysql db User
def mysql PRIMARY def mysql event db
def mysql PRIMARY def mysql event name
@@ -99,41 +100,41 @@ def mysql PRIMARY def mysql help_relation help_keyword_id
def mysql PRIMARY def mysql help_relation help_topic_id
def mysql PRIMARY def mysql help_topic help_topic_id
def mysql name def mysql help_topic name
-def mysql PRIMARY def mysql host Host
def mysql PRIMARY def mysql host Db
+def mysql PRIMARY def mysql host Host
def mysql PRIMARY def mysql index_stats db_name
-def mysql PRIMARY def mysql index_stats table_name
def mysql PRIMARY def mysql index_stats index_name
def mysql PRIMARY def mysql index_stats prefix_arity
+def mysql PRIMARY def mysql index_stats table_name
def mysql PRIMARY def mysql innodb_index_stats database_name
-def mysql PRIMARY def mysql innodb_index_stats table_name
def mysql PRIMARY def mysql innodb_index_stats index_name
def mysql PRIMARY def mysql innodb_index_stats stat_name
+def mysql PRIMARY def mysql innodb_index_stats table_name
def mysql PRIMARY def mysql innodb_table_stats database_name
def mysql PRIMARY def mysql innodb_table_stats table_name
def mysql PRIMARY def mysql plugin name
def mysql PRIMARY def mysql proc db
def mysql PRIMARY def mysql proc name
def mysql PRIMARY def mysql proc type
-def mysql PRIMARY def mysql procs_priv Host
def mysql PRIMARY def mysql procs_priv Db
-def mysql PRIMARY def mysql procs_priv User
+def mysql PRIMARY def mysql procs_priv Host
def mysql PRIMARY def mysql procs_priv Routine_name
def mysql PRIMARY def mysql procs_priv Routine_type
+def mysql PRIMARY def mysql procs_priv User
def mysql PRIMARY def mysql proxies_priv Host
-def mysql PRIMARY def mysql proxies_priv User
def mysql PRIMARY def mysql proxies_priv Proxied_host
def mysql PRIMARY def mysql proxies_priv Proxied_user
+def mysql PRIMARY def mysql proxies_priv User
def mysql Host def mysql roles_mapping Host
-def mysql Host def mysql roles_mapping User
def mysql Host def mysql roles_mapping Role
+def mysql Host def mysql roles_mapping User
def mysql PRIMARY def mysql servers Server_name
def mysql PRIMARY def mysql table_stats db_name
def mysql PRIMARY def mysql table_stats table_name
-def mysql PRIMARY def mysql tables_priv Host
def mysql PRIMARY def mysql tables_priv Db
-def mysql PRIMARY def mysql tables_priv User
+def mysql PRIMARY def mysql tables_priv Host
def mysql PRIMARY def mysql tables_priv Table_name
+def mysql PRIMARY def mysql tables_priv User
def mysql PRIMARY def mysql time_zone Time_zone_id
def mysql PRIMARY def mysql time_zone_leap_second Transition_time
def mysql PRIMARY def mysql time_zone_name Name
@@ -141,6 +142,8 @@ def mysql PRIMARY def mysql time_zone_transition Time_zone_id
def mysql PRIMARY def mysql time_zone_transition Transition_time
def mysql PRIMARY def mysql time_zone_transition_type Time_zone_id
def mysql PRIMARY def mysql time_zone_transition_type Transition_type_id
+def mysql commit_id def mysql transaction_registry commit_id
+def mysql PRIMARY def mysql transaction_registry transaction_id
def mysql PRIMARY def mysql user Host
def mysql PRIMARY def mysql user User
########################################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result
index aadf89d89f5..5f8e965de84 100644
--- a/mysql-test/suite/funcs_1/r/is_routines.result
+++ b/mysql-test/suite/funcs_1/r/is_routines.result
@@ -33,7 +33,7 @@ SPECIFIC_NAME varchar(64) NO
ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
-ROUTINE_TYPE varchar(9) NO
+ROUTINE_TYPE varchar(13) NO
DATA_TYPE varchar(64) NO
CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
CHARACTER_OCTET_LENGTH int(21) YES NULL
@@ -67,7 +67,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`ROUTINE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '',
- `ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT '',
+ `ROUTINE_TYPE` varchar(13) NOT NULL DEFAULT '',
`DATA_TYPE` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL,
`CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL,
@@ -101,7 +101,7 @@ SPECIFIC_NAME varchar(64) NO
ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
-ROUTINE_TYPE varchar(9) NO
+ROUTINE_TYPE varchar(13) NO
DATA_TYPE varchar(64) NO
CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
CHARACTER_OCTET_LENGTH int(21) YES NULL
diff --git a/mysql-test/suite/funcs_1/r/is_routines_embedded.result b/mysql-test/suite/funcs_1/r/is_routines_embedded.result
index 193265433aa..ec68057eaa1 100644
--- a/mysql-test/suite/funcs_1/r/is_routines_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_routines_embedded.result
@@ -33,7 +33,7 @@ SPECIFIC_NAME varchar(64) NO
ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
-ROUTINE_TYPE varchar(9) NO
+ROUTINE_TYPE varchar(13) NO
DATA_TYPE varchar(64) NO
CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
CHARACTER_OCTET_LENGTH int(21) YES NULL
@@ -67,7 +67,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`ROUTINE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '',
- `ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT '',
+ `ROUTINE_TYPE` varchar(13) NOT NULL DEFAULT '',
`DATA_TYPE` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL,
`CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL,
@@ -101,7 +101,7 @@ SPECIFIC_NAME varchar(64) NO
ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
-ROUTINE_TYPE varchar(9) NO
+ROUTINE_TYPE varchar(13) NO
DATA_TYPE varchar(64) NO
CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
CHARACTER_OCTET_LENGTH int(21) YES NULL
@@ -197,8 +197,8 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
-check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
+check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DropGeometryColumn def mysql DropGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
@@ -213,8 +213,8 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
-check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
+check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DropGeometryColumn def mysql DropGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
@@ -229,8 +229,8 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
-check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
+check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DropGeometryColumn def mysql DropGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges.result b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
index cf9b70308de..8669b2873ed 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
@@ -68,6 +68,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE
''@'%' def test CREATE ROUTINE
''@'%' def test EVENT
''@'%' def test TRIGGER
+''@'%' def test DELETE HISTORY
''@'%' def test\_% SELECT
''@'%' def test\_% INSERT
''@'%' def test\_% UPDATE
@@ -84,6 +85,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE
''@'%' def test\_% CREATE ROUTINE
''@'%' def test\_% EVENT
''@'%' def test\_% TRIGGER
+''@'%' def test\_% DELETE HISTORY
###############################################################################
# Testcase 3.2.15.2-3.2.15.4 INFORMATION_SCHEMA.SCHEMA_PRIVILEGES accessibility
###############################################################################
@@ -122,10 +124,10 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict_4 SELECT YES
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT INSERT ON `db_datadict_1`.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT INSERT ON `db_datadict_2`.`t1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connect testuser2, localhost, testuser2, , test;
@@ -145,10 +147,10 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_3`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_1`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser2`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -163,16 +165,16 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict_4 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT INSERT ON `db_datadict_1`.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT INSERT ON `db_datadict_2`.`t1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_3`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_1`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser2`@`localhost`
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP DATABASE db_datadict_1;
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
index 38257899a4b..2b285395cff 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
@@ -16,6 +16,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' def test CREATE TEMPORARY TABLES NO
''@'%' def test CREATE VIEW NO
''@'%' def test DELETE NO
+''@'%' def test DELETE HISTORY NO
''@'%' def test DROP NO
''@'%' def test EVENT NO
''@'%' def test INDEX NO
diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result
index d0f2b734f7e..6db6ac8f150 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata.result
@@ -51,7 +51,8 @@ DEFAULT_COLLATION_NAME varchar(32) NO
SQL_PATH varchar(512) YES NULL
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
-WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
+WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL
+ORDER BY schema_name;
catalog_name schema_name sql_path
def information_schema NULL
def mtr NULL
diff --git a/mysql-test/suite/funcs_1/r/is_schemata_embedded.result b/mysql-test/suite/funcs_1/r/is_schemata_embedded.result
index 5f48c030c16..bc993e8dc9f 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata_embedded.result
@@ -51,7 +51,8 @@ DEFAULT_COLLATION_NAME varchar(32) NO
SQL_PATH varchar(512) YES NULL
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
-WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
+WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL
+ORDER BY schema_name;
catalog_name schema_name sql_path
def information_schema NULL
def mtr NULL
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index 749b09fa87d..76f3b03d018 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -83,16 +83,17 @@ INDEX_TYPE varchar(16) NO
COMMENT varchar(16) YES NULL
INDEX_COMMENT varchar(1024) NO
SELECT table_catalog, table_schema, table_name, index_schema, index_name
-FROM information_schema.statistics WHERE table_catalog IS NOT NULL;
+FROM information_schema.statistics WHERE table_catalog IS NOT NULL
+ORDER BY table_schema, table_name, index_schema, index_name;
table_catalog table_schema table_name index_schema index_name
-def mysql column_stats mysql PRIMARY
-def mysql column_stats mysql PRIMARY
-def mysql column_stats mysql PRIMARY
def mysql columns_priv mysql PRIMARY
def mysql columns_priv mysql PRIMARY
def mysql columns_priv mysql PRIMARY
def mysql columns_priv mysql PRIMARY
def mysql columns_priv mysql PRIMARY
+def mysql column_stats mysql PRIMARY
+def mysql column_stats mysql PRIMARY
+def mysql column_stats mysql PRIMARY
def mysql db mysql PRIMARY
def mysql db mysql PRIMARY
def mysql db mysql PRIMARY
@@ -102,14 +103,14 @@ def mysql event mysql PRIMARY
def mysql func mysql PRIMARY
def mysql gtid_slave_pos mysql PRIMARY
def mysql gtid_slave_pos mysql PRIMARY
-def mysql help_category mysql PRIMARY
def mysql help_category mysql name
-def mysql help_keyword mysql PRIMARY
+def mysql help_category mysql PRIMARY
def mysql help_keyword mysql name
+def mysql help_keyword mysql PRIMARY
def mysql help_relation mysql PRIMARY
def mysql help_relation mysql PRIMARY
-def mysql help_topic mysql PRIMARY
def mysql help_topic mysql name
+def mysql help_topic mysql PRIMARY
def mysql host mysql PRIMARY
def mysql host mysql PRIMARY
def mysql index_stats mysql PRIMARY
@@ -120,28 +121,28 @@ def mysql plugin mysql PRIMARY
def mysql proc mysql PRIMARY
def mysql proc mysql PRIMARY
def mysql proc mysql PRIMARY
+def mysql procs_priv mysql Grantor
def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql PRIMARY
-def mysql procs_priv mysql Grantor
+def mysql proxies_priv mysql Grantor
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
-def mysql proxies_priv mysql Grantor
def mysql roles_mapping mysql Host
def mysql roles_mapping mysql Host
def mysql roles_mapping mysql Host
def mysql servers mysql PRIMARY
-def mysql table_stats mysql PRIMARY
-def mysql table_stats mysql PRIMARY
+def mysql tables_priv mysql Grantor
def mysql tables_priv mysql PRIMARY
def mysql tables_priv mysql PRIMARY
def mysql tables_priv mysql PRIMARY
def mysql tables_priv mysql PRIMARY
-def mysql tables_priv mysql Grantor
+def mysql table_stats mysql PRIMARY
+def mysql table_stats mysql PRIMARY
def mysql time_zone mysql PRIMARY
def mysql time_zone_leap_second mysql PRIMARY
def mysql time_zone_name mysql PRIMARY
@@ -154,6 +155,7 @@ def mysql user mysql PRIMARY
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
####################################################################################
# Testcase 3.2.14.2 + 3.2.14.3: INFORMATION_SCHEMA.STATISTICS accessible information
####################################################################################
@@ -194,10 +196,10 @@ def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
@@ -205,7 +207,7 @@ ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connect testuser2, localhost, testuser2, , test;
@@ -217,7 +219,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection default;
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost';
@@ -237,12 +239,12 @@ def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
@@ -256,9 +258,9 @@ def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connection testuser2;
@@ -270,13 +272,13 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection default;
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
@@ -288,8 +290,8 @@ def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
index dc3ed5f9839..31fb460f9aa 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
@@ -77,6 +77,11 @@ def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL
def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql begin_timestamp 1 begin_timestamp A #CARD# NULL NULL BTREE
+def mysql transaction_registry 0 mysql commit_id 1 commit_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql commit_timestamp 1 commit_timestamp A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql commit_timestamp 2 transaction_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 0 mysql PRIMARY 1 transaction_id A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
connect testuser1,localhost,testuser1,,db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
index cbc9a8f17ce..c81052321f8 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
@@ -77,6 +77,11 @@ def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL
def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql begin_timestamp 1 begin_timestamp A #CARD# NULL NULL BTREE
+def mysql transaction_registry 0 mysql commit_id 1 commit_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql commit_timestamp 1 commit_timestamp A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql commit_timestamp 2 transaction_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 0 mysql PRIMARY 1 transaction_id A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
connect testuser1,localhost,testuser1,,db_datadict;
@@ -154,6 +159,11 @@ def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL
def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql begin_timestamp 1 begin_timestamp A #CARD# NULL NULL BTREE
+def mysql transaction_registry 0 mysql commit_id 1 commit_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql commit_timestamp 1 commit_timestamp A #CARD# NULL NULL BTREE
+def mysql transaction_registry 1 mysql commit_timestamp 2 transaction_id A #CARD# NULL NULL BTREE
+def mysql transaction_registry 0 mysql PRIMARY 1 transaction_id A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
connection default;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index 0553b4344c8..a5f7b39d166 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -55,21 +55,22 @@ CONSTRAINT_TYPE varchar(64) NO
SELECT constraint_catalog, constraint_schema, constraint_name,
table_schema, table_name
FROM information_schema.table_constraints
-WHERE constraint_catalog IS NOT NULL;
+WHERE constraint_catalog IS NOT NULL
+ORDER BY constraint_schema, table_name, constraint_name;
constraint_catalog constraint_schema constraint_name table_schema table_name
-def mysql PRIMARY mysql column_stats
def mysql PRIMARY mysql columns_priv
+def mysql PRIMARY mysql column_stats
def mysql PRIMARY mysql db
def mysql PRIMARY mysql event
def mysql PRIMARY mysql func
def mysql PRIMARY mysql gtid_slave_pos
-def mysql PRIMARY mysql help_category
def mysql name mysql help_category
-def mysql PRIMARY mysql help_keyword
+def mysql PRIMARY mysql help_category
def mysql name mysql help_keyword
+def mysql PRIMARY mysql help_keyword
def mysql PRIMARY mysql help_relation
-def mysql PRIMARY mysql help_topic
def mysql name mysql help_topic
+def mysql PRIMARY mysql help_topic
def mysql PRIMARY mysql host
def mysql PRIMARY mysql index_stats
def mysql PRIMARY mysql innodb_index_stats
@@ -80,13 +81,15 @@ def mysql PRIMARY mysql procs_priv
def mysql PRIMARY mysql proxies_priv
def mysql Host mysql roles_mapping
def mysql PRIMARY mysql servers
-def mysql PRIMARY mysql table_stats
def mysql PRIMARY mysql tables_priv
+def mysql PRIMARY mysql table_stats
def mysql PRIMARY mysql time_zone
def mysql PRIMARY mysql time_zone_leap_second
def mysql PRIMARY mysql time_zone_name
def mysql PRIMARY mysql time_zone_transition
def mysql PRIMARY mysql time_zone_transition_type
+def mysql commit_id mysql transaction_registry
+def mysql PRIMARY mysql transaction_registry
def mysql PRIMARY mysql user
#########################################################################################
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.TABLE_CONSTRAINTS accessible information
@@ -106,8 +109,8 @@ CREATE USER 'testuser1'@'localhost';
GRANT SELECT(f5) ON db_datadict.t1 TO 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
@@ -130,8 +133,8 @@ t2 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
connect testuser1, localhost, testuser1, , db_datadict;
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
index e54de0671a2..b56c5115f16 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
@@ -37,6 +37,8 @@ def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
def mysql PRIMARY mysql time_zone_name PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
+def mysql commit_id mysql transaction_registry UNIQUE
+def mysql PRIMARY mysql transaction_registry PRIMARY KEY
def mysql PRIMARY mysql user PRIMARY KEY
connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.table_constraints
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
index 58a2373b66d..b40bc0ea0c7 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
@@ -37,6 +37,8 @@ def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
def mysql PRIMARY mysql time_zone_name PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
+def mysql commit_id mysql transaction_registry UNIQUE
+def mysql PRIMARY mysql transaction_registry PRIMARY KEY
def mysql PRIMARY mysql user PRIMARY KEY
connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.table_constraints
@@ -73,6 +75,8 @@ def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
def mysql PRIMARY mysql time_zone_name PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
+def mysql commit_id mysql transaction_registry UNIQUE
+def mysql PRIMARY mysql transaction_registry PRIMARY KEY
def mysql PRIMARY mysql user PRIMARY KEY
connection default;
disconnect testuser1;
diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result
index 340aead9aba..2c0942f44f1 100644
--- a/mysql-test/suite/funcs_1/r/is_table_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result
@@ -84,9 +84,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict tb1 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT, CREATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `db_datadict`.`tb1` TO `testuser1`@`localhost`
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
@@ -96,6 +96,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict tb1 CREATE YES
'testuser2'@'localhost' def db_datadict tb1 CREATE VIEW YES
'testuser2'@'localhost' def db_datadict tb1 DELETE YES
+'testuser2'@'localhost' def db_datadict tb1 DELETE HISTORY YES
'testuser2'@'localhost' def db_datadict tb1 DROP YES
'testuser2'@'localhost' def db_datadict tb1 INDEX YES
'testuser2'@'localhost' def db_datadict tb1 INSERT YES
@@ -106,8 +107,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict tb1 UPDATE YES
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO `testuser2`@`localhost` WITH GRANT OPTION
connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
@@ -116,8 +117,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
-GRANT USAGE ON *.* TO 'testuser3'@'localhost'
-GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
+GRANT USAGE ON *.* TO `testuser3`@`localhost`
+GRANT SELECT ON `db_datadict`.`tb3` TO `testuser3`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -131,6 +132,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict tb1 CREATE YES
'testuser2'@'localhost' def db_datadict tb1 CREATE VIEW YES
'testuser2'@'localhost' def db_datadict tb1 DELETE YES
+'testuser2'@'localhost' def db_datadict tb1 DELETE HISTORY YES
'testuser2'@'localhost' def db_datadict tb1 DROP YES
'testuser2'@'localhost' def db_datadict tb1 INDEX YES
'testuser2'@'localhost' def db_datadict tb1 INSERT YES
@@ -142,17 +144,17 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT, CREATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `db_datadict`.`tb1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO `testuser2`@`localhost` WITH GRANT OPTION
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
-GRANT USAGE ON *.* TO 'testuser3'@'localhost'
-GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
+GRANT USAGE ON *.* TO `testuser3`@`localhost`
+GRANT SELECT ON `db_datadict`.`tb3` TO `testuser3`@`localhost`
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
@@ -184,6 +186,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def test t1_table CREATE NO
'testuser1'@'localhost' def test t1_table CREATE VIEW NO
'testuser1'@'localhost' def test t1_table DELETE NO
+'testuser1'@'localhost' def test t1_table DELETE HISTORY NO
'testuser1'@'localhost' def test t1_table DROP NO
'testuser1'@'localhost' def test t1_table INDEX NO
'testuser1'@'localhost' def test t1_table INSERT NO
@@ -196,6 +199,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def test t1_view CREATE NO
'testuser1'@'localhost' def test t1_view CREATE VIEW NO
'testuser1'@'localhost' def test t1_view DELETE NO
+'testuser1'@'localhost' def test t1_view DELETE HISTORY NO
'testuser1'@'localhost' def test t1_view DROP NO
'testuser1'@'localhost' def test t1_view INDEX NO
'testuser1'@'localhost' def test t1_view INSERT NO
@@ -222,9 +226,9 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost
-GRANT USAGE ON *.* TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
+GRANT USAGE ON *.* TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost`
SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges
WHERE table_name LIKE 't1_%'
ORDER BY table_schema,table_name;
@@ -242,9 +246,9 @@ test t1_table
test t1_view
SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost
-GRANT USAGE ON *.* TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
+GRANT USAGE ON *.* TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost`
REVOKE ALL PRIVILEGES ON test.t1_table FROM 'the_user'@'localhost';
REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost';
DROP VIEW test.t1_view;
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 75809a3b77a..739d00eacb9 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -49,6 +49,8 @@ TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
+MAX_INDEX_LENGTH bigint(21) unsigned YES NULL
+TEMPORARY varchar(1) YES NULL
SHOW CREATE TABLE information_schema.TABLES;
Table Create Table
TABLES CREATE TEMPORARY TABLE `TABLES` (
@@ -72,7 +74,9 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
`CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
- `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
+ `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT '',
+ `MAX_INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL,
+ `TEMPORARY` varchar(1) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLES;
Field Type Null Key Default Extra
@@ -97,6 +101,8 @@ TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
+MAX_INDEX_LENGTH bigint(21) unsigned YES NULL
+TEMPORARY varchar(1) YES NULL
SELECT table_catalog, table_schema, table_name
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name
@@ -128,11 +134,11 @@ CREATE VIEW v3 AS SELECT * FROM tb3;
GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost';
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -142,9 +148,9 @@ v3
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -152,9 +158,9 @@ tb3
connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb3
@@ -162,11 +168,11 @@ v3
connection default;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -215,6 +221,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM #CS#
CREATE_OPTIONS
TABLE_COMMENT Initial Comment
+MAX_INDEX_LENGTH 0
+TEMPORARY N
SELECT table_name FROM information_schema.tables
WHERE table_name LIKE 't1_my_table%';
table_name
@@ -368,6 +376,8 @@ TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
TABLE_COMMENT VIEW
+MAX_INDEX_LENGTH NULL
+TEMPORARY NULL
DROP VIEW test.t1_my_tablex;
SELECT table_name FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
diff --git a/mysql-test/suite/funcs_1/r/is_tables_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_embedded.result
index c42645f3536..4d54128e5b0 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_embedded.result
@@ -49,6 +49,8 @@ TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
+MAX_INDEX_LENGTH bigint(21) unsigned YES NULL
+TEMPORARY varchar(1) YES NULL
SHOW CREATE TABLE information_schema.TABLES;
Table Create Table
TABLES CREATE TEMPORARY TABLE `TABLES` (
@@ -72,7 +74,9 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
`CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
- `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
+ `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT '',
+ `MAX_INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL,
+ `TEMPORARY` varchar(1) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLES;
Field Type Null Key Default Extra
@@ -97,6 +101,8 @@ TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
+MAX_INDEX_LENGTH bigint(21) unsigned YES NULL
+TEMPORARY varchar(1) YES NULL
SELECT table_catalog, table_schema, table_name
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name
@@ -128,11 +134,11 @@ CREATE VIEW v3 AS SELECT * FROM tb3;
GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost';
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -142,11 +148,11 @@ v3
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -156,11 +162,11 @@ v3
connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -170,11 +176,11 @@ v3
connection default;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# 0 N
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW NULL NULL
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -223,6 +229,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM #CS#
CREATE_OPTIONS
TABLE_COMMENT Initial Comment
+MAX_INDEX_LENGTH 0
+TEMPORARY N
SELECT table_name FROM information_schema.tables
WHERE table_name LIKE 't1_my_table%';
table_name
@@ -376,6 +384,8 @@ TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
TABLE_COMMENT VIEW
+MAX_INDEX_LENGTH NULL
+TEMPORARY NULL
DROP VIEW test.t1_my_tablex;
SELECT table_name FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
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 0e2389771b2..5274f58a8ef 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
@@ -36,6 +36,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -59,6 +61,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -82,6 +86,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
@@ -126,6 +132,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -149,6 +157,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
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 9022e057ae5..5fee1e0050a 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -33,6 +33,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -56,6 +58,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -79,6 +83,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -102,6 +108,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -125,6 +133,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -148,6 +158,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -171,6 +183,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -194,6 +208,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -217,6 +233,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -240,6 +258,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -263,6 +283,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -286,6 +308,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -309,6 +333,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -332,6 +358,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -355,6 +383,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -378,6 +408,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -401,6 +433,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -424,6 +458,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -447,6 +483,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -470,6 +508,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -493,6 +533,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -516,6 +558,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -539,6 +583,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -562,6 +608,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -585,6 +633,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -608,6 +658,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -631,6 +683,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -654,6 +708,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -677,6 +733,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -700,6 +758,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -723,6 +783,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -746,6 +808,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -769,6 +833,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -792,6 +858,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -815,6 +883,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -838,6 +908,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -861,6 +933,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -884,6 +958,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -907,6 +983,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -930,6 +1008,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -953,6 +1033,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
DROP USER testuser1@localhost;
@@ -992,6 +1074,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1015,6 +1099,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1038,6 +1124,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1061,6 +1149,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1084,6 +1174,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1107,6 +1199,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1130,6 +1224,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1153,6 +1249,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1176,6 +1274,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1199,6 +1299,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1222,6 +1324,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1245,6 +1349,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1268,6 +1374,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1291,6 +1399,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1314,6 +1424,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1337,6 +1449,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1360,6 +1474,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1383,6 +1499,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1406,6 +1524,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1429,6 +1549,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1452,6 +1574,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1475,6 +1599,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1498,6 +1624,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1521,6 +1649,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1544,6 +1674,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1567,6 +1699,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1590,6 +1724,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1613,6 +1749,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1636,6 +1774,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1659,6 +1799,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1682,6 +1824,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1705,6 +1849,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1728,6 +1874,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1751,6 +1899,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1774,6 +1924,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1797,6 +1949,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1820,6 +1974,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1843,6 +1999,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1866,6 +2024,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1889,6 +2049,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1912,6 +2074,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
connection default;
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 9022e057ae5..5fee1e0050a 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
@@ -33,6 +33,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -56,6 +58,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -79,6 +83,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -102,6 +108,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -125,6 +133,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -148,6 +158,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -171,6 +183,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -194,6 +208,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -217,6 +233,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -240,6 +258,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -263,6 +283,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -286,6 +308,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -309,6 +333,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -332,6 +358,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -355,6 +383,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -378,6 +408,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -401,6 +433,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -424,6 +458,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -447,6 +483,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -470,6 +508,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -493,6 +533,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -516,6 +558,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -539,6 +583,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -562,6 +608,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -585,6 +633,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -608,6 +658,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -631,6 +683,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -654,6 +708,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -677,6 +733,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -700,6 +758,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -723,6 +783,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -746,6 +808,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -769,6 +833,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -792,6 +858,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -815,6 +883,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -838,6 +908,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -861,6 +933,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -884,6 +958,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -907,6 +983,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -930,6 +1008,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -953,6 +1033,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
DROP USER testuser1@localhost;
@@ -992,6 +1074,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1015,6 +1099,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1038,6 +1124,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1061,6 +1149,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1084,6 +1174,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1107,6 +1199,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1130,6 +1224,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1153,6 +1249,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1176,6 +1274,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1199,6 +1299,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1222,6 +1324,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1245,6 +1349,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1268,6 +1374,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1291,6 +1399,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1314,6 +1424,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1337,6 +1449,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1360,6 +1474,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1383,6 +1499,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1406,6 +1524,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1429,6 +1549,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1452,6 +1574,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1475,6 +1599,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1498,6 +1624,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1521,6 +1649,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1544,6 +1674,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1567,6 +1699,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1590,6 +1724,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1613,6 +1749,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1636,6 +1774,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1659,6 +1799,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1682,6 +1824,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1705,6 +1849,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1728,6 +1874,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1751,6 +1899,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1774,6 +1924,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1797,6 +1949,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1820,6 +1974,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1843,6 +1999,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1866,6 +2024,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1889,6 +2049,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1912,6 +2074,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
user_comment
Separator -----------------------------------------------------
connection default;
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 2ee21898085..73beadf644c 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_memory.result
@@ -37,6 +37,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -60,6 +62,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -83,6 +87,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
@@ -127,6 +133,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -150,6 +158,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
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 5ccd8377cb1..6c2e9307d78 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
@@ -37,6 +37,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -60,6 +62,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -83,6 +87,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
@@ -127,6 +133,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -150,6 +158,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
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 5a1b6df84cb..9b2cb07f391 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
@@ -37,6 +37,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -60,6 +62,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -83,6 +87,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
@@ -127,6 +133,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -150,6 +158,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -173,6 +183,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
SHOW TABLES FROM test1;
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 81eca31f35d..ea565e14b7a 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -31,6 +31,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Column privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -54,6 +56,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Columns
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -77,6 +81,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Database privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -100,6 +106,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Events
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -123,6 +131,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment User defined functions
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -146,6 +156,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment General log
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -169,6 +181,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Replication slave GTID position
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -192,6 +206,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help categories
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -215,6 +231,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help keywords
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -238,6 +256,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment keyword-topic relation
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -261,6 +281,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help topics
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -284,6 +306,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Host privileges; Merged with database privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -307,6 +331,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Indexes
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -330,6 +356,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -353,6 +381,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -376,6 +406,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment MySQL plugins
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -399,6 +431,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Stored Procedures
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -422,6 +456,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Procedure privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -445,6 +481,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment User proxy privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -468,6 +506,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Granted roles
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -491,6 +531,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment MySQL Foreign Servers table
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -514,6 +556,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Slow log
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -537,6 +581,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Table privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -560,6 +606,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Tables
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -583,6 +631,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zones
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -606,6 +656,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Leap seconds information for time zones
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -629,6 +681,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone names
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -652,6 +706,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone transitions
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -675,10 +731,37 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone transition types
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME transaction_registry
+TABLE_TYPE BASE TABLE
+ENGINE InnoDB
+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_bin
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME user
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -698,6 +781,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Users and global privileges
Separator -----------------------------------------------------
DROP USER testuser1@localhost;
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 d81b16e6e8e..5d6c063fbd8 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
@@ -31,6 +31,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Column privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -54,6 +56,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Columns
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -77,6 +81,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Database privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -100,6 +106,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Events
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -123,6 +131,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment User defined functions
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -146,6 +156,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment General log
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -169,6 +181,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Replication slave GTID position
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -192,6 +206,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help categories
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -215,6 +231,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help keywords
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -238,6 +256,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment keyword-topic relation
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -261,6 +281,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help topics
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -284,6 +306,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Host privileges; Merged with database privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -307,6 +331,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Indexes
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -330,6 +356,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -353,6 +381,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -376,6 +406,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment MySQL plugins
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -399,6 +431,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Stored Procedures
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -422,6 +456,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Procedure privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -445,6 +481,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment User proxy privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -468,6 +506,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Granted roles
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -491,6 +531,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment MySQL Foreign Servers table
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -514,6 +556,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Slow log
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -537,6 +581,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Table privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -560,6 +606,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Tables
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -583,6 +631,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zones
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -606,6 +656,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Leap seconds information for time zones
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -629,6 +681,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone names
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -652,6 +706,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone transitions
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -675,10 +731,37 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone transition types
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME transaction_registry
+TABLE_TYPE BASE TABLE
+ENGINE InnoDB
+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_bin
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME user
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -698,6 +781,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Users and global privileges
Separator -----------------------------------------------------
DROP USER testuser1@localhost;
@@ -735,6 +820,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Column privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -758,6 +845,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Columns
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -781,6 +870,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Database privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -804,6 +895,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Events
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -827,6 +920,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment User defined functions
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -850,6 +945,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment General log
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -873,6 +970,8 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Replication slave GTID position
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -896,6 +995,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help categories
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -919,6 +1020,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help keywords
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -942,6 +1045,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment keyword-topic relation
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -965,6 +1070,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment help topics
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -988,6 +1095,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Host privileges; Merged with database privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1011,6 +1120,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Indexes
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1034,6 +1145,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1057,6 +1170,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1080,6 +1195,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment MySQL plugins
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1103,6 +1220,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Stored Procedures
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1126,6 +1245,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Procedure privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1149,6 +1270,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment User proxy privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1172,6 +1295,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Granted roles
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1195,6 +1320,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment MySQL Foreign Servers table
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1218,6 +1345,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Slow log
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1241,6 +1370,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Table privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1264,6 +1395,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Statistics on Tables
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1287,6 +1420,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zones
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1310,6 +1445,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Leap seconds information for time zones
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1333,6 +1470,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone names
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1356,6 +1495,8 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone transitions
Separator -----------------------------------------------------
TABLE_CATALOG def
@@ -1379,10 +1520,37 @@ TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Time zone transition types
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME transaction_registry
+TABLE_TYPE BASE TABLE
+ENGINE InnoDB
+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_bin
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME user
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -1402,6 +1570,8 @@ TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY N
user_comment Users and global privileges
Separator -----------------------------------------------------
connection default;
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index dee6e2a8d52..d9ba88cba5a 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -105,7 +105,8 @@ DATABASE_COLLATION varchar(32) NO
SELECT * FROM information_schema.triggers
WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
-OR action_reference_new_table IS NOT NULL;
+OR action_reference_new_table IS NOT NULL
+ORDER BY trigger_schema, 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 mtr gs_insert INSERT def mtr global_suppressions 1 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
def mtr ts_insert INSERT def mtr test_suppressions 1 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -144,8 +145,8 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@l
connect testuser2, localhost, testuser2, , db_datadict;
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `db_datadict`.`t1` TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, DELETE HISTORY ON `db_datadict`.`t1` TO `testuser2`@`localhost`
# No TRIGGER Privilege --> no result for query
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
@@ -155,8 +156,8 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
connect testuser3, localhost, testuser3, , test;
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
-GRANT TRIGGER ON *.* TO 'testuser3'@'localhost'
-GRANT SELECT ON `db_datadict`.`t1` TO 'testuser3'@'localhost'
+GRANT TRIGGER ON *.* TO `testuser3`@`localhost`
+GRANT SELECT ON `db_datadict`.`t1` TO `testuser3`@`localhost`
# TRIGGER Privilege + SELECT Privilege on t1 --> result for query
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
@@ -168,7 +169,7 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@l
connect testuser4, localhost, testuser4, , test;
SHOW GRANTS FOR 'testuser4'@'localhost';
Grants for testuser4@localhost
-GRANT TRIGGER ON *.* TO 'testuser4'@'localhost'
+GRANT TRIGGER ON *.* TO `testuser4`@`localhost`
# TRIGGER Privilege + no SELECT Privilege on t1 --> result for query
SELECT * FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser4'@'localhost' for table 't1'
diff --git a/mysql-test/suite/funcs_1/r/is_triggers_embedded.result b/mysql-test/suite/funcs_1/r/is_triggers_embedded.result
index a22b942c158..6ec9e7868ce 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers_embedded.result
@@ -105,7 +105,8 @@ DATABASE_COLLATION varchar(32) NO
SELECT * FROM information_schema.triggers
WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
-OR action_reference_new_table IS NOT NULL;
+OR action_reference_new_table IS NOT NULL
+ORDER BY trigger_schema, 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 mtr gs_insert INSERT def mtr global_suppressions 1 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
def mtr ts_insert INSERT def mtr test_suppressions 1 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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 a300a1f73e7..4ef7c18d627 100644
--- a/mysql-test/suite/funcs_1/r/is_user_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result
@@ -119,6 +119,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -165,6 +166,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -211,6 +213,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -281,6 +284,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -327,6 +331,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -373,6 +378,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -429,6 +435,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -475,6 +482,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -521,6 +529,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -537,9 +546,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT, UPDATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
# Now add SELECT on *.* to testuser1;
connection default;
@@ -599,6 +608,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -645,6 +655,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -691,6 +702,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -761,6 +773,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -807,6 +820,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -853,6 +867,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -909,6 +924,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -955,6 +971,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1001,6 +1018,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1017,9 +1035,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT SELECT ON *.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT, UPDATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1037,7 +1055,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser2@localhost
-GRANT INSERT, UPDATE ON *.* TO 'testuser2'@'localhost'
+GRANT INSERT, UPDATE ON *.* TO `testuser2`@`localhost`
connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1051,7 +1069,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser3'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser3@localhost
-GRANT USAGE ON *.* TO 'testuser3'@'localhost'
+GRANT USAGE ON *.* TO `testuser3`@`localhost`
# Revoke privileges from testuser1;
connection default;
@@ -1109,6 +1127,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1155,6 +1174,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1201,6 +1221,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1228,7 +1249,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_55 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_55'
SELECT * FROM information_schema.user_privileges
@@ -1243,7 +1264,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_66'
@@ -1304,6 +1325,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1350,6 +1372,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1396,6 +1419,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1452,6 +1476,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1498,6 +1523,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1544,6 +1570,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1560,9 +1587,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_56 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_56'
USE db_datadict;
@@ -1607,6 +1634,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1653,6 +1681,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1699,6 +1728,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1715,9 +1745,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
CREATE TABLE tb_57 ( c1 TEXT )
ENGINE = <other_engine_type>;
@@ -1777,6 +1807,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1823,6 +1854,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1869,6 +1901,7 @@ Create_user_priv N
Event_priv N
Trigger_priv N
Create_tablespace_priv N
+Delete_history_priv N
ssl_type
ssl_cipher
x509_issuer
@@ -1896,7 +1929,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_58 ( c1 TEXT )
ENGINE = <other_engine_type>;
USE db_datadict;
@@ -1928,7 +1961,7 @@ PRIVILEGE_TYPE USAGE
IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
@@ -1942,7 +1975,7 @@ PRIVILEGE_TYPE FILE
IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'
+GRANT SELECT, FILE ON *.* TO `testuser1`@`localhost`
DROP USER 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result
index cc50b8033f0..62ec33c8340 100644
--- a/mysql-test/suite/funcs_1/r/is_views.result
+++ b/mysql-test/suite/funcs_1/r/is_views.result
@@ -128,13 +128,15 @@ ENGINE = <engine_type>;
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
SELECT * FROM information_schema.views
-WHERE table_name LIKE 't1_%';
+WHERE table_name LIKE 't1_%'
+ORDER BY table_schema, table_name;
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_%';
+WHERE table_name LIKE 't1_%'
+ORDER BY table_schema, table_name;
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
diff --git a/mysql-test/suite/funcs_1/r/is_views_embedded.result b/mysql-test/suite/funcs_1/r/is_views_embedded.result
index 1f2e23c3610..c382370e892 100644
--- a/mysql-test/suite/funcs_1/r/is_views_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_views_embedded.result
@@ -131,13 +131,15 @@ ENGINE = <engine_type>;
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
SELECT * FROM information_schema.views
-WHERE table_name LIKE 't1_%';
+WHERE table_name LIKE 't1_%'
+ORDER BY table_schema, table_name;
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_%';
+WHERE table_name LIKE 't1_%'
+ORDER BY table_schema, table_name;
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
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 a5595259881..74dc4557f50 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -858,7 +858,7 @@ my_varbinary_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -872,7 +872,7 @@ my_binary_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -886,7 +886,7 @@ my_varchar_1000, id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -900,7 +900,7 @@ my_char_30, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
index 0f5fe7cf34c..ef5aa4c8570 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
@@ -265,7 +265,7 @@ agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
CALL sp_ins_3();
SELECT row_count();
row_count()
-1
+3
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
@@ -318,7 +318,7 @@ COUNT( f1 ) f1
4 updated
SELECT row_count();
row_count()
-3
+7
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
@@ -381,7 +381,7 @@ row_count() after delete
2
SELECT row_count();
row_count()
-0
+8
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0102.result b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
index 85da4aa7832..fa35ef6e7ae 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
@@ -254,7 +254,7 @@ Testcase 3.5.1.10:
------------------
CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trg7_1' already exists
drop trigger trg7_1;
Testcase 3.5.1.?:
@@ -267,7 +267,7 @@ create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
for each row set new.f1 ='trig t2';
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trig' already exists
insert into t1 value ('insert to t1',1);
select * from t1;
f1 f2
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index 8fd3e034735..75286115d86 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -78,14 +78,14 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -168,12 +168,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection no_privs_424a;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -209,7 +209,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
connection default;
@@ -233,22 +233,22 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -276,8 +276,8 @@ drop trigger trg4b_1;
connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
@@ -314,22 +314,22 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
@@ -349,8 +349,8 @@ drop trigger trg4c_1;
connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
@@ -377,21 +377,21 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
@@ -412,8 +412,8 @@ drop trigger trg4d_1;
connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
@@ -441,12 +441,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -478,7 +478,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
@@ -502,23 +502,23 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -537,8 +537,8 @@ drop trigger trg5b_1;
connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -564,23 +564,23 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -595,8 +595,8 @@ drop trigger trg5c_1;
connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -617,23 +617,23 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -648,8 +648,8 @@ drop trigger trg5d_1;
connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -674,9 +674,9 @@ grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_353x;
select current_user;
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 83c36c6294f..72c269cb89a 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -15,16 +15,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant select on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant select,insert on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
@@ -46,8 +46,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -97,8 +97,8 @@ root@localhost
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
no trigger privilege on db level for drop:
------------------------------------------
@@ -153,8 +153,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -183,9 +183,9 @@ create table t1 (f1 char(20)) engine= memory;
grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `no_priv_db`.* TO `test_yesprivs`@`localhost`
use db with trigger privilege on db level and without...:
---------------------------------------------------------
@@ -286,13 +286,13 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -330,8 +330,8 @@ insert2-yes
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -367,8 +367,8 @@ trig 1_2-yes
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
no trigger privilege on table level for drop:
---------------------------------------------
@@ -422,8 +422,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
connection no_privs;
select current_user;
@@ -459,15 +459,15 @@ create table t2 (f1 char(20)) engine= memory;
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_noprivs`@`localhost`
use table with trigger privilege and without...:
------------------------------------------------
@@ -544,14 +544,14 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant ALL on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_privs;
@@ -604,7 +604,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -623,7 +623,7 @@ current_user
root@localhost
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
@@ -657,8 +657,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -721,7 +721,7 @@ trig 1_2-yes
grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connection yes_privs;
select current_user;
current_user
@@ -812,9 +812,9 @@ grant ALL on priv1_db.* to test_yesprivs@localhost;
grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
@@ -822,9 +822,9 @@ grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT ON `priv2_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -889,9 +889,9 @@ revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -929,10 +929,10 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -977,10 +977,10 @@ root@localhost
grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1070,8 +1070,8 @@ grant select
on priv_db.t1 to test_useprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1104,8 +1104,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1135,8 +1135,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1167,8 +1167,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1200,8 +1200,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1234,8 +1234,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1273,8 +1273,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1337,8 +1337,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1380,9 +1380,9 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
@@ -1413,16 +1413,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -1478,10 +1478,10 @@ revoke UPDATE(f1) on priv_db.t2
from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1630,9 +1630,9 @@ grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1673,9 +1673,9 @@ grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
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 72a7cb4f01d..c21c206f118 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
@@ -245,7 +245,7 @@ Testcase 3.5.5.3:
Create view vw3 as select f118 from tb3;
Create trigger trg3 before INSERT
on vw3 for each row set new.f118='s';
-ERROR HY000: 'test.vw3' is not BASE TABLE
+ERROR HY000: 'test.vw3' is not of type 'BASE TABLE'
drop view vw3;
Testcase 3.5.5.4:
@@ -459,7 +459,7 @@ Create trigger trg_3_406010_2 AFTER DELETE
on tb3 for each row set @test_var=@test_var+50;
Create trigger trg_3_406010_1 AFTER INSERT
on tb3 for each row set @test_var=@test_var+1;
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trg_3_406010_1' already exists
select @test_var;
@test_var
1
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index 9f3fbd7bb1a..417c0e85188 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -3521,12 +3521,12 @@ f1
DROP TRIGGER tr1 ;
SET @a:=0 ;
CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ;
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
RENAME TABLE v1 TO v2;
RENAME VIEW v2 TO v1;
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 'VIEW v2 TO v1' at line 1
ALTER TABLE v2 RENAME AS v1;
-ERROR HY000: 'test.v2' is not BASE TABLE
+ERROR HY000: 'test.v2' is not of type 'BASE TABLE'
ALTER VIEW v1 RENAME AS v2;
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 'RENAME AS v2' at line 1
DROP TABLE IF EXISTS t1, t2 ;
@@ -3536,12 +3536,12 @@ CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE );
CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
ALTER TABLE t1 ADD PRIMARY KEY(f1);
ALTER TABLE v1 ADD PRIMARY KEY(f1);
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
ALTER VIEW v1 ADD PRIMARY KEY(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 'ADD PRIMARY KEY(f1)' at line 1
CREATE INDEX t1_idx ON t1(f3);
CREATE INDEX v1_idx ON v1(f3);
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
DROP TABLE t1;
DROP VIEW v1;
@@ -3552,11 +3552,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
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 'or REPLACE AS Select * from tb2 my_table' at line 1
CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50;
-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 'CASCADED CHECK OPTION AS Select *
+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 'WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50;
-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 'LOCAL CHECK OPTION AS Select *
+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 'WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
SELECT * FROM tb2 my_table CREATE VIEW As v1;
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 'CREATE VIEW As v1' at line 1
@@ -3586,7 +3586,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
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 'CHECK OPTION WITH CASCADED' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-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 'CASCADED CHECK OPTION
+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 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
@@ -3615,7 +3615,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
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 'CHECK OPTION WITH LOCAL' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-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 'CASCADED CHECK OPTION
+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 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
@@ -4086,9 +4086,9 @@ Drop view test.v1 ;
Testcase 3.3.1.14
--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
+ERROR HY000: 'test.tb2' is not of type 'VIEW'
CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
+ERROR HY000: 'test.tb2' is not of type 'VIEW'
Testcase 3.3.1.15
--------------------------------------------------------------------------------
@@ -4315,7 +4315,7 @@ CREATE VIEW v2 AS Select * from test.v1;
ERROR 42S02: Table 'test.v1' doesn't exist
DROP VIEW IF EXISTS v2;
Warnings:
-Note 1051 Unknown table 'test.v2'
+Note 4092 Unknown VIEW: 'test.v2'
Testcase 3.3.1.25
--------------------------------------------------------------------------------
@@ -7567,7 +7567,7 @@ Call sp1() ;
ERROR 42000: PROCEDURE test.sp1 does not exist
Drop view if exists test.v1 ;
Warnings:
-Note 1051 Unknown table 'test.v1'
+Note 4092 Unknown VIEW: 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
@@ -21309,12 +21309,12 @@ CREATE TABLE t1 ( f1 VARCHAR(1000) ) ENGINE = memory ;
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW v1;
DROP VIEW v1;
-ERROR 42S02: Unknown table 'test.v1'
+ERROR 42S02: Unknown VIEW: 'test.v1'
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
-Note 1051 Unknown table 'test.v1'
+Note 4092 Unknown VIEW: 'test.v1'
Testcase 3.3.1.68
--------------------------------------------------------------------------------
@@ -21326,31 +21326,31 @@ CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top CASCADE ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base CASCADE ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top RESTRICT ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base RESTRICT ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
Testcase 3.3.1.69, 3.3.1.70, 3.3.1.A5
@@ -21367,7 +21367,7 @@ ERROR 42S02: Table 'test.v1' doesn't exist
SHOW CREATE TABLE v1 ;
ERROR 42S02: Table 'test.v1' doesn't exist
SHOW TABLE STATUS like 'v1' ;
-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
+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 Max_index_length Temporary
SHOW TABLES LIKE 'v1';
Tables_in_test (v1)
SHOW COLUMNS FROM v1;
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 a5595259881..74dc4557f50 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -858,7 +858,7 @@ my_varbinary_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -872,7 +872,7 @@ my_binary_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -886,7 +886,7 @@ my_varchar_1000, id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -900,7 +900,7 @@ my_char_30, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
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 length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select octet_length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
index 0f5fe7cf34c..ef5aa4c8570 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
@@ -265,7 +265,7 @@ agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
CALL sp_ins_3();
SELECT row_count();
row_count()
-1
+3
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
@@ -318,7 +318,7 @@ COUNT( f1 ) f1
4 updated
SELECT row_count();
row_count()
-3
+7
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
@@ -381,7 +381,7 @@ row_count() after delete
2
SELECT row_count();
row_count()
-0
+8
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
index 85da4aa7832..fa35ef6e7ae 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
@@ -254,7 +254,7 @@ Testcase 3.5.1.10:
------------------
CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trg7_1' already exists
drop trigger trg7_1;
Testcase 3.5.1.?:
@@ -267,7 +267,7 @@ create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
for each row set new.f1 ='trig t2';
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trig' already exists
insert into t1 value ('insert to t1',1);
select * from t1;
f1 f2
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index 8fd3e034735..75286115d86 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -78,14 +78,14 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -168,12 +168,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection no_privs_424a;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -209,7 +209,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
connection default;
@@ -233,22 +233,22 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -276,8 +276,8 @@ drop trigger trg4b_1;
connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
@@ -314,22 +314,22 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
@@ -349,8 +349,8 @@ drop trigger trg4c_1;
connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
@@ -377,21 +377,21 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
@@ -412,8 +412,8 @@ drop trigger trg4d_1;
connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
@@ -441,12 +441,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -478,7 +478,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
@@ -502,23 +502,23 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -537,8 +537,8 @@ drop trigger trg5b_1;
connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -564,23 +564,23 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -595,8 +595,8 @@ drop trigger trg5c_1;
connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -617,23 +617,23 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -648,8 +648,8 @@ drop trigger trg5d_1;
connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -674,9 +674,9 @@ grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_353x;
select current_user;
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 a4db9050c86..8b8df4bd694 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -15,16 +15,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant select on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant select,insert on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
@@ -46,8 +46,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -97,8 +97,8 @@ root@localhost
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
no trigger privilege on db level for drop:
------------------------------------------
@@ -153,8 +153,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -183,9 +183,9 @@ create table t1 (f1 char(20)) engine= myisam;
grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `no_priv_db`.* TO `test_yesprivs`@`localhost`
use db with trigger privilege on db level and without...:
---------------------------------------------------------
@@ -286,13 +286,13 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -330,8 +330,8 @@ insert2-yes
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -367,8 +367,8 @@ trig 1_2-yes
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
no trigger privilege on table level for drop:
---------------------------------------------
@@ -422,8 +422,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
connection no_privs;
select current_user;
@@ -459,15 +459,15 @@ create table t2 (f1 char(20)) engine= myisam;
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_noprivs`@`localhost`
use table with trigger privilege and without...:
------------------------------------------------
@@ -544,14 +544,14 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant ALL on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_privs;
@@ -604,7 +604,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -623,7 +623,7 @@ current_user
root@localhost
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
@@ -657,8 +657,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -721,7 +721,7 @@ trig 1_2-yes
grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connection yes_privs;
select current_user;
current_user
@@ -812,9 +812,9 @@ grant ALL on priv1_db.* to test_yesprivs@localhost;
grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
@@ -822,9 +822,9 @@ grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT ON `priv2_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -889,9 +889,9 @@ revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -929,10 +929,10 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -977,10 +977,10 @@ root@localhost
grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1070,8 +1070,8 @@ grant select
on priv_db.t1 to test_useprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1104,8 +1104,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1135,8 +1135,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1167,8 +1167,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1200,8 +1200,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1234,8 +1234,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1273,8 +1273,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1337,8 +1337,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1380,9 +1380,9 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
@@ -1413,16 +1413,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -1478,10 +1478,10 @@ revoke UPDATE(f1) on priv_db.t2
from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1630,9 +1630,9 @@ grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1673,9 +1673,9 @@ grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
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 72a7cb4f01d..c21c206f118 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
@@ -245,7 +245,7 @@ Testcase 3.5.5.3:
Create view vw3 as select f118 from tb3;
Create trigger trg3 before INSERT
on vw3 for each row set new.f118='s';
-ERROR HY000: 'test.vw3' is not BASE TABLE
+ERROR HY000: 'test.vw3' is not of type 'BASE TABLE'
drop view vw3;
Testcase 3.5.5.4:
@@ -459,7 +459,7 @@ Create trigger trg_3_406010_2 AFTER DELETE
on tb3 for each row set @test_var=@test_var+50;
Create trigger trg_3_406010_1 AFTER INSERT
on tb3 for each row set @test_var=@test_var+1;
-ERROR HY000: Trigger already exists
+ERROR HY000: Trigger 'test.trg_3_406010_1' already exists
select @test_var;
@test_var
1
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 a1d59e1c2f9..efd5ee1c568 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views-big.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result
@@ -4023,12 +4023,12 @@ f1
DROP TRIGGER tr1 ;
SET @a:=0 ;
CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ;
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
RENAME TABLE v1 TO v2;
RENAME VIEW v2 TO v1;
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 'VIEW v2 TO v1' at line 1
ALTER TABLE v2 RENAME AS v1;
-ERROR HY000: 'test.v2' is not BASE TABLE
+ERROR HY000: 'test.v2' is not of type 'BASE TABLE'
ALTER VIEW v1 RENAME AS v2;
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 'RENAME AS v2' at line 1
DROP TABLE IF EXISTS t1, t2 ;
@@ -4038,12 +4038,12 @@ CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE );
CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
ALTER TABLE t1 ADD PRIMARY KEY(f1);
ALTER TABLE v1 ADD PRIMARY KEY(f1);
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
ALTER VIEW v1 ADD PRIMARY KEY(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 'ADD PRIMARY KEY(f1)' at line 1
CREATE INDEX t1_idx ON t1(f3);
CREATE INDEX v1_idx ON v1(f3);
-ERROR HY000: 'test.v1' is not BASE TABLE
+ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
DROP TABLE t1;
DROP VIEW v1;
@@ -4054,11 +4054,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
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 'or REPLACE AS Select * from tb2 my_table' at line 1
CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50;
-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 'CASCADED CHECK OPTION AS Select *
+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 'WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50;
-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 'LOCAL CHECK OPTION AS Select *
+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 'WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
SELECT * FROM tb2 my_table CREATE VIEW As v1;
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 'CREATE VIEW As v1' at line 1
@@ -4088,7 +4088,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
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 'CHECK OPTION WITH CASCADED' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-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 'CASCADED CHECK OPTION
+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 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
@@ -4117,7 +4117,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
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 'CHECK OPTION WITH LOCAL' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-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 'CASCADED CHECK OPTION
+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 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
@@ -4604,9 +4604,9 @@ Drop view test.v1 ;
Testcase 3.3.1.14
--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
+ERROR HY000: 'test.tb2' is not of type 'VIEW'
CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
+ERROR HY000: 'test.tb2' is not of type 'VIEW'
Testcase 3.3.1.15
--------------------------------------------------------------------------------
@@ -4784,7 +4784,7 @@ CREATE VIEW v2 AS Select * from test.v1;
ERROR 42S02: Table 'test.v1' doesn't exist
DROP VIEW IF EXISTS v2;
Warnings:
-Note 1051 Unknown table 'test.v2'
+Note 4092 Unknown VIEW: 'test.v2'
Testcase 3.3.1.25
--------------------------------------------------------------------------------
@@ -8387,7 +8387,7 @@ Call sp1() ;
ERROR 42000: PROCEDURE test.sp1 does not exist
Drop view if exists test.v1 ;
Warnings:
-Note 1051 Unknown table 'test.v1'
+Note 4092 Unknown VIEW: 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
@@ -22984,12 +22984,12 @@ CREATE TABLE t1 ( f1 VARCHAR(1000) ) ENGINE = myisam ;
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW v1;
DROP VIEW v1;
-ERROR 42S02: Unknown table 'test.v1'
+ERROR 42S02: Unknown VIEW: 'test.v1'
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
-Note 1051 Unknown table 'test.v1'
+Note 4092 Unknown VIEW: 'test.v1'
Testcase 3.3.1.68
--------------------------------------------------------------------------------
@@ -23001,31 +23001,31 @@ CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top CASCADE ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base CASCADE ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top RESTRICT ;
DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'test.v1_top'
+ERROR 42S02: Unknown VIEW: 'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base RESTRICT ;
DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'test.v1_base'
+ERROR 42S02: Unknown VIEW: 'test.v1_base'
DROP VIEW v1_top;
Testcase 3.3.1.69, 3.3.1.70, 3.3.1.A5
@@ -23042,7 +23042,7 @@ ERROR 42S02: Table 'test.v1' doesn't exist
SHOW CREATE TABLE v1 ;
ERROR 42S02: Table 'test.v1' doesn't exist
SHOW TABLE STATUS like 'v1' ;
-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
+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 Max_index_length Temporary
SHOW TABLES LIKE 'v1';
Tables_in_test (v1)
SHOW COLUMNS FROM v1;
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 6680e045558..f3f561fd479 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
@@ -37,6 +37,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
+ `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
@@ -44,12 +45,12 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) 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 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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_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
@@ -73,7 +74,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -116,6 +117,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
+ `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
@@ -123,10 +125,10 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) 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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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
@@ -149,7 +151,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE processlist;
@@ -185,13 +187,13 @@ SHOW/SELECT shows only the processes (1) of the user.
connection con100;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
-ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist 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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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.
@@ -199,17 +201,17 @@ SHOW/SELECT shows all processes/threads.
connect con101,localhost,ddicttestuser1,ddictpass,information_schema;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
@@ -225,19 +227,19 @@ SHOW/SELECT shows all processes/threads.
connect anonymous1,localhost,"''",,information_schema;
SHOW GRANTS;
Grants for @localhost
-GRANT PROCESS ON *.* TO ''@'localhost'
+GRANT PROCESS ON *.* TO ``@`localhost`
SHOW processlist;
Id User Host db Command Time State Info Progress
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 Sleep TIME NULL TIME_MS
-ID HOST_NAME information_schema Query TIME init SHOW processlist 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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -252,17 +254,17 @@ ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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
+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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -277,11 +279,11 @@ Again only the processes of the anonymous user are visible.
####################################################################################
SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
-GRANT USAGE ON *.* TO ''@'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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -295,19 +297,19 @@ Only the processes of ddicttestuser1 user are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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 Sleep TIME NULL TIME_MS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist 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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -322,21 +324,21 @@ Only the processes of ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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 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
+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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -350,7 +352,7 @@ Try to grant PROCESS privilege to user ddicttestuser2 without having it.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
####################################################################################
@@ -366,7 +368,7 @@ Grant PROCESS privilege to user ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS, SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
####################################################################################
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
@@ -375,7 +377,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections
####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
Grants for ddicttestuser2@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -388,20 +390,20 @@ 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 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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -415,15 +417,15 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser2@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -438,7 +440,7 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
SHOW processlist;
@@ -450,17 +452,17 @@ 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 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
+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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -477,7 +479,7 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -488,18 +490,18 @@ 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 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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_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 09f9d231144..a68e62e4642 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -37,6 +37,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
+ `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
@@ -44,12 +45,12 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) 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 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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_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
@@ -73,7 +74,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -116,6 +117,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
+ `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
@@ -123,10 +125,10 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
) 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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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
@@ -149,7 +151,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE processlist;
@@ -185,13 +187,13 @@ SHOW/SELECT shows only the processes (1) of the user.
connection con100;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
-ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist 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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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.
@@ -199,17 +201,17 @@ SHOW/SELECT shows all processes/threads.
connect con101,localhost,ddicttestuser1,ddictpass,information_schema;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
@@ -225,19 +227,19 @@ SHOW/SELECT shows all processes/threads.
connect anonymous1,localhost,"''",,information_schema;
SHOW GRANTS;
Grants for @localhost
-GRANT PROCESS ON *.* TO ''@'localhost'
+GRANT PROCESS ON *.* TO ``@`localhost`
SHOW processlist;
Id User Host db Command Time State Info Progress
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 Sleep TIME NULL TIME_MS
-ID HOST_NAME information_schema Query TIME init SHOW processlist 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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -252,17 +254,17 @@ ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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
+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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -277,11 +279,11 @@ Again only the processes of the anonymous user are visible.
####################################################################################
SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
-GRANT USAGE ON *.* TO ''@'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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -295,19 +297,19 @@ Only the processes of ddicttestuser1 user are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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 Sleep TIME NULL TIME_MS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist 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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -322,21 +324,21 @@ Only the processes of ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
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 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
+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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -350,7 +352,7 @@ Try to grant PROCESS privilege to user ddicttestuser2 without having it.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
####################################################################################
@@ -366,7 +368,7 @@ Grant PROCESS privilege to user ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS, SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
####################################################################################
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
@@ -375,7 +377,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections
####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
Grants for ddicttestuser2@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -388,20 +390,20 @@ 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 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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -415,15 +417,15 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser2@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -438,7 +440,7 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
SHOW processlist;
@@ -450,17 +452,17 @@ 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 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
+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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -477,7 +479,7 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -488,18 +490,18 @@ 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 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
+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 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
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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 MAX_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 MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_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 f935f7770b8..ad109501f98 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
@@ -25,6 +25,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
+ `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
@@ -34,11 +35,11 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
#--------------------------------------------------------------------------
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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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>
+<ID> root <HOST_NAME> test Query <TIME> Init SHOW FULL PROCESSLIST <TIME_MS>
SET @default_id = CONNECTION_ID();
SELECT COUNT(*) = 1 AS "Expect exact one connection with this id"
FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = @default_id;
@@ -79,12 +80,12 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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
+<ID> root <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
SELECT ID,TIME INTO @test_user_con1_id,@time FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE COMMAND = 'Sleep' AND USER = 'test_user';
@@ -112,11 +113,11 @@ Expect 1
connection con1;
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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
# Ensure that the user test_user sees all connections with his username.
#----------------------------------------------------------------------------
@@ -126,13 +127,13 @@ connection default;
connection con2;
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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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
-<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
connection default;
SELECT ID INTO @test_user_con2_id FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID <> @test_user_con1_id
@@ -149,13 +150,13 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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> <MAX_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
+<ID> root <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 0.000
SELECT STATE, TIME, INFO INTO @state, @time, @info
@@ -192,10 +193,10 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
connection con2;
# Pull("reap") the result set from the statement executed with "send".
@@ -222,10 +223,10 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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> <MAX_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 48fcc0a5553..169053cb6be 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
@@ -25,6 +25,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
+ `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
@@ -34,11 +35,11 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
#--------------------------------------------------------------------------
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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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>
+<ID> root <HOST_NAME> test Query <TIME> Init SHOW FULL PROCESSLIST <TIME_MS>
SET @default_id = CONNECTION_ID();
SELECT COUNT(*) = 1 AS "Expect exact one connection with this id"
FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = @default_id;
@@ -79,12 +80,12 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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
+<ID> root <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
SELECT ID,TIME INTO @test_user_con1_id,@time FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE COMMAND = 'Sleep' AND USER = 'test_user';
@@ -112,11 +113,11 @@ Expect 1
connection con1;
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 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 USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
# Ensure that the user test_user sees all connections with his username.
#----------------------------------------------------------------------------
@@ -126,13 +127,13 @@ connection default;
connection con2;
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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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
-<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
connection default;
SELECT ID INTO @test_user_con2_id FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID <> @test_user_con1_id
@@ -149,13 +150,13 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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> <MAX_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
+<ID> root <HOST_NAME> information_schema Query <TIME> Init SHOW FULL PROCESSLIST 0.000
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 0.000
SELECT STATE, TIME, INFO INTO @state, @time, @info
@@ -192,10 +193,10 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
connection con2;
# Pull("reap") the result set from the statement executed with "send".
@@ -222,10 +223,10 @@ connection default;
# 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 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>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_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> <MAX_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> <MAX_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> <MAX_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 ac48e20eaed..8818303e83c 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -1771,48 +1771,48 @@ Testcase 4.1.9:
drop procedure
--------------------------------------------------------------------------------
SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
DROP PROCEDURE IF EXISTS sp9;
SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
CREATE PROCEDURE sp9()SELECT * from t1;
SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
+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 aggregate
+db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 NONE
DROP PROCEDURE sp9;
SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
CREATE PROCEDURE sp9()SELECT * from t1;
SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
+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 aggregate
+db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 NONE
DROP PROCEDURE IF EXISTS sp9;
SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
Testcase 4.1.10:
----------------
DROP FUNCTION
--------------------------------------------------------------------------------
SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
DROP FUNCTION IF EXISTS fn10;
SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
CREATE FUNCTION fn10() returns int return 100;
SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100
+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 aggregate
+db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100 NONE
DROP FUNCTION fn10;
SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
CREATE FUNCTION fn10() returns int return 100;
SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100
+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 aggregate
+db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100 NONE
DROP FUNCTION IF EXISTS fn10;
SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
Testcase 4.1.11:
----------------
@@ -2807,7 +2807,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 with()
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 '()
+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 'with()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE write()
SELECT * from t1 where f2=f1;
@@ -4476,7 +4476,7 @@ CREATE PROCEDURE sp1()
for:BEGIN
SELECT @x;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'for:BEGIN
+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 ':BEGIN
SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
@@ -5595,7 +5595,7 @@ CREATE PROCEDURE sp1()
values:BEGIN
SELECT @x;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'values:BEGIN
+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 ':BEGIN
SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
@@ -9219,7 +9219,7 @@ CREATE PROCEDURE sp1()
BEGIN
declare with char;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'char;
+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 'with char;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
@@ -11547,9 +11547,8 @@ BEGIN
declare with condition for sqlstate '02000';
declare exit handler for with set @var2 = 1;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1;
-END' at line 3
+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 'with condition for sqlstate '02000';
+declare exit handler for with set @var2 ...' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
@@ -13649,7 +13648,7 @@ CREATE PROCEDURE sp1( )
BEGIN
declare with handler for sqlstate '02000' set @var2 = 1;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 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 'with handler for sqlstate '02000' set @var2 = 1;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
@@ -16138,15 +16137,15 @@ insert into t43 values('abcde', 'a!@#$%^&*(');
CREATE PROCEDURE d1.sp4()
SELECT * from d1.t43;
SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43
+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 aggregate
+d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43 NONE
USE db_storedproc;
DROP DATABASE d1;
CREATE DATABASE d1;
USE d1;
create table t44(a char(5), b char(10));
SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
USE db_storedproc;
DROP DATABASE d1;
@@ -16188,8 +16187,8 @@ CREATE PROCEDURE sp8 ( n char(20) ) sql security DEFINER comment 'initial'
USE d2;
alter procedure d1.sp8 sql security DEFINER comment 'updated';
SELECT * from mysql.proc where specific_name='sp8' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
+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 aggregate
+d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n NONE
Testcase 4.4.9:
--------------------------------------------------------------------------------
@@ -16205,7 +16204,7 @@ END//
USE d2;
alter function d1.fn2 sql security DEFINER comment 'updated';
SELECT * from mysql.proc where specific_name='fn2' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
d1 fn2 FUNCTION fn2 SQL CONTAINS_SQL NO DEFINER n int int(11) BEGIN
declare a int;
set a = 0.9 * n;
@@ -16214,7 +16213,7 @@ END root@localhost modified created updated latin1 latin1_swedish_ci latin1_swe
declare a int;
set a = 0.9 * n;
return a;
-END
+END NONE
Testcase 4.4.10:
--------------------------------------------------------------------------------
@@ -16224,7 +16223,7 @@ SELECT * from t1 where t1.f1 = n;
USE d2;
DROP PROCEDURE d1.sp9;
SELECT * from mysql.proc where specific_name='sp9' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
Testcase 4.4.11:
--------------------------------------------------------------------------------
@@ -16238,7 +16237,7 @@ END//
USE d2;
DROP FUNCTION d1.fn3;
SELECT * from mysql.proc where specific_name='fn3' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+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 aggregate
USE db_storedproc;
DROP DATABASE d1;
DROP DATABASE d2;
diff --git a/mysql-test/suite/funcs_1/t/is_basics_mixed.test b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
index 2bbd751a010..bed3f633212 100644
--- a/mysql-test/suite/funcs_1/t/is_basics_mixed.test
+++ b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
@@ -287,9 +287,11 @@ CREATE SQL SECURITY INVOKER VIEW db_datadict.v2 AS
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
-FROM db_datadict.v2;
+FROM db_datadict.v2
+ORDER BY TABLE_NAME;
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
-FROM information_schema.tables WHERE table_schema = 'db_datadict';
+FROM information_schema.tables WHERE table_schema = 'db_datadict'
+ORDER BY TABLE_NAME;
GRANT SELECT ON db_datadict.v2 to testuser2@localhost;
#
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
diff --git a/mysql-test/suite/funcs_1/t/is_check_constraints.test b/mysql-test/suite/funcs_1/t/is_check_constraints.test
index eadfd817832..b539de67f73 100644
--- a/mysql-test/suite/funcs_1/t/is_check_constraints.test
+++ b/mysql-test/suite/funcs_1/t/is_check_constraints.test
@@ -1,8 +1,9 @@
--source include/have_innodb.inc
--source include/not_embedded.inc
--echo #
---echo # MDEV-17323: Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTS to 10.2
+--echo # MDEV-14474: Create INFORMATION_SCHEMA.CHECK_CONSTRAINTS
--echo #
+
CREATE user boo1;
GRANT select,create,alter,drop on foo.* to boo1;
SHOW GRANTS for boo1;
diff --git a/mysql-test/suite/funcs_1/t/is_statistics.test b/mysql-test/suite/funcs_1/t/is_statistics.test
index 3cdc5568960..3d7f23a7b2c 100644
--- a/mysql-test/suite/funcs_1/t/is_statistics.test
+++ b/mysql-test/suite/funcs_1/t/is_statistics.test
@@ -78,7 +78,8 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
# Show that TABLE_CATALOG is always NULL.
SELECT table_catalog, table_schema, table_name, index_schema, index_name
-FROM information_schema.statistics WHERE table_catalog IS NOT NULL;
+FROM information_schema.statistics WHERE table_catalog IS NOT NULL
+ORDER BY table_schema, table_name, index_schema, index_name;
--echo ####################################################################################
diff --git a/mysql-test/suite/funcs_1/t/is_table_constraints.test b/mysql-test/suite/funcs_1/t/is_table_constraints.test
index 96853edac2c..cf8d3fbf2d2 100644
--- a/mysql-test/suite/funcs_1/t/is_table_constraints.test
+++ b/mysql-test/suite/funcs_1/t/is_table_constraints.test
@@ -68,8 +68,8 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
SELECT constraint_catalog, constraint_schema, constraint_name,
table_schema, table_name
FROM information_schema.table_constraints
-WHERE constraint_catalog IS NOT NULL;
-
+WHERE constraint_catalog IS NOT NULL
+ORDER BY constraint_schema, table_name, constraint_name;
--echo #########################################################################################
--echo # Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.TABLE_CONSTRAINTS accessible information
diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc
index 54e7f2af54b..573d72022fb 100644
--- a/mysql-test/suite/funcs_1/views/views_master.inc
+++ b/mysql-test/suite/funcs_1/views/views_master.inc
@@ -764,7 +764,7 @@ CREATE VIEW test.v2 AS SELECT * FROM test.t0;
CREATE VIEW test2.v2 AS SELECT * FROM test2.t0;
# Some additional tests on the just created objects to show that they are
-# accessable and do have the expected content.
+# accessible and do have the expected content.
# INSERTs with full qualified table
INSERT INTO test.t1 VALUES('test.t1 - 1');
INSERT INTO test2.t1 VALUES('test2.t1 - 1');
@@ -2745,7 +2745,7 @@ CREATE VIEW v1 AS SELECT f1 FROM t1;
# DROP VIEW
DROP VIEW v1;
---error ER_BAD_TABLE_ERROR
+--error ER_UNKNOWN_VIEW
DROP VIEW v1;
CREATE VIEW v1 AS SELECT f1 FROM t1;
@@ -2792,7 +2792,7 @@ while ($num1)
# DROP VIEW v1_top < |RESTRICD|CASCADE> must be successful.
eval $aux1 ;
# Check, that v1_top really no more exists + cleanup for the second sub test
- --error ER_BAD_TABLE_ERROR
+ --error ER_UNKNOWN_VIEW
DROP VIEW v1_top;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
diff --git a/mysql-test/suite/funcs_2/include/check_charset.inc b/mysql-test/suite/funcs_2/include/check_charset.inc
index bf2f2db610b..a6f827e14cc 100644
--- a/mysql-test/suite/funcs_2/include/check_charset.inc
+++ b/mysql-test/suite/funcs_2/include/check_charset.inc
@@ -17,7 +17,7 @@ if ($std_cset)
eval CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET $cset COLLATE $coll) ENGINE=$engine_type CHARACTER SET $cset COLLATE $coll;
}
---replace_column 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 16 # 17 # 18 #
+--replace_column 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS LIKE 't1';
--disable_warnings
diff --git a/mysql-test/suite/funcs_2/r/innodb_charset.result b/mysql-test/suite/funcs_2/r/innodb_charset.result
index a9434845472..1ce5972eccc 100644
--- a/mysql-test/suite/funcs_2/r/innodb_charset.result
+++ b/mysql-test/suite/funcs_2/r/innodb_charset.result
@@ -3,8 +3,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_bin) ENGINE=InnoDB CHARACTER SET armscii8 COLLATE armscii8_bin;
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 InnoDB # # # # # # # # # # # # armscii8_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # armscii8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -233,8 +233,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_general_ci) ENGINE=InnoDB CHARACTER SET armscii8 COLLATE armscii8_general_ci;
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 InnoDB # # # # # # # # # # # # armscii8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # armscii8_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -463,8 +463,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_bin) ENGINE=InnoDB CHARACTER SET ascii COLLATE ascii_bin;
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 InnoDB # # # # # # # # # # # # ascii_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # ascii_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -693,8 +693,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_general_ci) ENGINE=InnoDB CHARACTER SET ascii COLLATE ascii_general_ci;
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 InnoDB # # # # # # # # # # # # ascii_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # ascii_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -923,8 +923,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_bin) ENGINE=InnoDB CHARACTER SET big5 COLLATE big5_bin;
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 InnoDB # # # # # # # # # # # # big5_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # big5_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1027,8 +1027,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_chinese_ci) ENGINE=InnoDB CHARACTER SET big5 COLLATE big5_chinese_ci;
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 InnoDB # # # # # # # # # # # # big5_chinese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # big5_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1131,8 +1131,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES binary;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET binary) ENGINE=InnoDB CHARACTER SET binary;
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 InnoDB # # # # # # # # # # # # binary # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # binary # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1361,8 +1361,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_bin) ENGINE=InnoDB CHARACTER SET cp1250 COLLATE cp1250_bin;
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 InnoDB # # # # # # # # # # # # cp1250_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1250_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1591,8 +1591,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci) ENGINE=InnoDB CHARACTER SET cp1250 COLLATE cp1250_croatian_ci;
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 InnoDB # # # # # # # # # # # # cp1250_croatian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1250_croatian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1821,8 +1821,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_czech_cs) ENGINE=InnoDB CHARACTER SET cp1250 COLLATE cp1250_czech_cs;
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 InnoDB # # # # # # # # # # # # cp1250_czech_cs # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1250_czech_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -2051,8 +2051,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_general_ci) ENGINE=InnoDB CHARACTER SET cp1250 COLLATE cp1250_general_ci;
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 InnoDB # # # # # # # # # # # # cp1250_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1250_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
A0 1
@@ -2281,8 +2281,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bin) ENGINE=InnoDB CHARACTER SET cp1251 COLLATE cp1251_bin;
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 InnoDB # # # # # # # # # # # # cp1251_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1251_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2511,8 +2511,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci) ENGINE=InnoDB CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci;
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 InnoDB # # # # # # # # # # # # cp1251_bulgarian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1251_bulgarian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2741,8 +2741,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_ci) ENGINE=InnoDB CHARACTER SET cp1251 COLLATE cp1251_general_ci;
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 InnoDB # # # # # # # # # # # # cp1251_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1251_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2971,8 +2971,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_cs) ENGINE=InnoDB CHARACTER SET cp1251 COLLATE cp1251_general_cs;
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 InnoDB # # # # # # # # # # # # cp1251_general_cs # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1251_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3201,8 +3201,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci) ENGINE=InnoDB CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci;
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 InnoDB # # # # # # # # # # # # cp1251_ukrainian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1251_ukrainian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -3431,8 +3431,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_bin) ENGINE=InnoDB CHARACTER SET cp1256 COLLATE cp1256_bin;
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 InnoDB # # # # # # # # # # # # cp1256_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1256_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3661,8 +3661,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_general_ci) ENGINE=InnoDB CHARACTER SET cp1256 COLLATE cp1256_general_ci;
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 InnoDB # # # # # # # # # # # # cp1256_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1256_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3891,8 +3891,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_bin) ENGINE=InnoDB CHARACTER SET cp1257 COLLATE cp1257_bin;
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 InnoDB # # # # # # # # # # # # cp1257_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1257_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4121,8 +4121,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_general_ci) ENGINE=InnoDB CHARACTER SET cp1257 COLLATE cp1257_general_ci;
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 InnoDB # # # # # # # # # # # # cp1257_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1257_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4351,8 +4351,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci) ENGINE=InnoDB CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci;
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 InnoDB # # # # # # # # # # # # cp1257_lithuanian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp1257_lithuanian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4581,8 +4581,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_bin) ENGINE=InnoDB CHARACTER SET cp850 COLLATE cp850_bin;
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 InnoDB # # # # # # # # # # # # cp850_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp850_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4811,8 +4811,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_general_ci) ENGINE=InnoDB CHARACTER SET cp850 COLLATE cp850_general_ci;
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 InnoDB # # # # # # # # # # # # cp850_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp850_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5041,8 +5041,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_bin) ENGINE=InnoDB CHARACTER SET cp852 COLLATE cp852_bin;
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 InnoDB # # # # # # # # # # # # cp852_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp852_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5271,8 +5271,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_general_ci) ENGINE=InnoDB CHARACTER SET cp852 COLLATE cp852_general_ci;
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 InnoDB # # # # # # # # # # # # cp852_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp852_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5501,8 +5501,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_bin) ENGINE=InnoDB CHARACTER SET cp866 COLLATE cp866_bin;
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 InnoDB # # # # # # # # # # # # cp866_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp866_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5731,8 +5731,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_general_ci) ENGINE=InnoDB CHARACTER SET cp866 COLLATE cp866_general_ci;
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 InnoDB # # # # # # # # # # # # cp866_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp866_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5961,8 +5961,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_bin) ENGINE=InnoDB CHARACTER SET cp932 COLLATE cp932_bin;
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 InnoDB # # # # # # # # # # # # cp932_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp932_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6128,8 +6128,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_japanese_ci) ENGINE=InnoDB CHARACTER SET cp932 COLLATE cp932_japanese_ci;
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 InnoDB # # # # # # # # # # # # cp932_japanese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # cp932_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6295,8 +6295,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_bin) ENGINE=InnoDB CHARACTER SET dec8 COLLATE dec8_bin;
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 InnoDB # # # # # # # # # # # # dec8_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # dec8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6525,8 +6525,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_swedish_ci) ENGINE=InnoDB CHARACTER SET dec8 COLLATE dec8_swedish_ci;
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 InnoDB # # # # # # # # # # # # dec8_swedish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # dec8_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6755,8 +6755,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_bin) ENGINE=InnoDB CHARACTER SET eucjpms COLLATE eucjpms_bin;
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 InnoDB # # # # # # # # # # # # eucjpms_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # eucjpms_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6859,8 +6859,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci) ENGINE=InnoDB CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci;
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 InnoDB # # # # # # # # # # # # eucjpms_japanese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # eucjpms_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6963,8 +6963,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_bin) ENGINE=InnoDB CHARACTER SET euckr COLLATE euckr_bin;
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 InnoDB # # # # # # # # # # # # euckr_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # euckr_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7067,8 +7067,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_korean_ci) ENGINE=InnoDB CHARACTER SET euckr COLLATE euckr_korean_ci;
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 InnoDB # # # # # # # # # # # # euckr_korean_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # euckr_korean_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7171,8 +7171,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_bin) ENGINE=InnoDB CHARACTER SET gb2312 COLLATE gb2312_bin;
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 InnoDB # # # # # # # # # # # # gb2312_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # gb2312_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7275,8 +7275,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci) ENGINE=InnoDB CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
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 InnoDB # # # # # # # # # # # # gb2312_chinese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # gb2312_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7379,8 +7379,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_bin) ENGINE=InnoDB CHARACTER SET gbk COLLATE gbk_bin;
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 InnoDB # # # # # # # # # # # # gbk_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # gbk_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7483,8 +7483,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_chinese_ci) ENGINE=InnoDB CHARACTER SET gbk COLLATE gbk_chinese_ci;
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 InnoDB # # # # # # # # # # # # gbk_chinese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # gbk_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7587,8 +7587,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_bin) ENGINE=InnoDB CHARACTER SET geostd8 COLLATE geostd8_bin;
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 InnoDB # # # # # # # # # # # # geostd8_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # geostd8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7817,8 +7817,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_general_ci) ENGINE=InnoDB CHARACTER SET geostd8 COLLATE geostd8_general_ci;
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 InnoDB # # # # # # # # # # # # geostd8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # geostd8_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8047,8 +8047,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_bin) ENGINE=InnoDB CHARACTER SET greek COLLATE greek_bin;
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 InnoDB # # # # # # # # # # # # greek_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # greek_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8277,8 +8277,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_general_ci) ENGINE=InnoDB CHARACTER SET greek COLLATE greek_general_ci;
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 InnoDB # # # # # # # # # # # # greek_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # greek_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8507,8 +8507,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_bin) ENGINE=InnoDB CHARACTER SET hebrew COLLATE hebrew_bin;
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 InnoDB # # # # # # # # # # # # hebrew_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # hebrew_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8737,8 +8737,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_general_ci) ENGINE=InnoDB CHARACTER SET hebrew COLLATE hebrew_general_ci;
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 InnoDB # # # # # # # # # # # # hebrew_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # hebrew_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8967,8 +8967,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_bin) ENGINE=InnoDB CHARACTER SET hp8 COLLATE hp8_bin;
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 InnoDB # # # # # # # # # # # # hp8_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # hp8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9197,8 +9197,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_english_ci) ENGINE=InnoDB CHARACTER SET hp8 COLLATE hp8_english_ci;
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 InnoDB # # # # # # # # # # # # hp8_english_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # hp8_english_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9427,8 +9427,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_bin) ENGINE=InnoDB CHARACTER SET keybcs2 COLLATE keybcs2_bin;
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 InnoDB # # # # # # # # # # # # keybcs2_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # keybcs2_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9657,8 +9657,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_general_ci) ENGINE=InnoDB CHARACTER SET keybcs2 COLLATE keybcs2_general_ci;
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 InnoDB # # # # # # # # # # # # keybcs2_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # keybcs2_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9887,8 +9887,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_bin) ENGINE=InnoDB CHARACTER SET koi8r COLLATE koi8r_bin;
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 InnoDB # # # # # # # # # # # # koi8r_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # koi8r_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10117,8 +10117,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_general_ci) ENGINE=InnoDB CHARACTER SET koi8r COLLATE koi8r_general_ci;
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 InnoDB # # # # # # # # # # # # koi8r_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # koi8r_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10347,8 +10347,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_bin) ENGINE=InnoDB CHARACTER SET koi8u COLLATE koi8u_bin;
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 InnoDB # # # # # # # # # # # # koi8u_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # koi8u_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10577,8 +10577,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_general_ci) ENGINE=InnoDB CHARACTER SET koi8u COLLATE koi8u_general_ci;
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 InnoDB # # # # # # # # # # # # koi8u_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # koi8u_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -10807,8 +10807,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_bin) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_bin;
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 InnoDB # # # # # # # # # # # # latin1_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11037,8 +11037,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_danish_ci) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_danish_ci;
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 InnoDB # # # # # # # # # # # # latin1_danish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_danish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11267,8 +11267,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_ci) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_general_ci;
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 InnoDB # # # # # # # # # # # # latin1_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11497,8 +11497,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_cs) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_general_cs;
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 InnoDB # # # # # # # # # # # # latin1_general_cs # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11727,8 +11727,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german1_ci) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_german1_ci;
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 InnoDB # # # # # # # # # # # # latin1_german1_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_german1_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11957,8 +11957,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german2_ci) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_german2_ci;
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 InnoDB # # # # # # # # # # # # latin1_german2_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_german2_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12187,8 +12187,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_spanish_ci) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_spanish_ci;
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 InnoDB # # # # # # # # # # # # latin1_spanish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_spanish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12417,8 +12417,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_swedish_ci) ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_swedish_ci;
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 InnoDB # # # # # # # # # # # # latin1_swedish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin1_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12647,8 +12647,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_bin) ENGINE=InnoDB CHARACTER SET latin2 COLLATE latin2_bin;
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 InnoDB # # # # # # # # # # # # latin2_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin2_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12877,8 +12877,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_croatian_ci) ENGINE=InnoDB CHARACTER SET latin2 COLLATE latin2_croatian_ci;
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 InnoDB # # # # # # # # # # # # latin2_croatian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin2_croatian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13107,8 +13107,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_czech_cs) ENGINE=InnoDB CHARACTER SET latin2 COLLATE latin2_czech_cs;
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 InnoDB # # # # # # # # # # # # latin2_czech_cs # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin2_czech_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
2E 1
@@ -13337,8 +13337,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_general_ci) ENGINE=InnoDB CHARACTER SET latin2 COLLATE latin2_general_ci;
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 InnoDB # # # # # # # # # # # # latin2_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin2_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13567,8 +13567,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_hungarian_ci) ENGINE=InnoDB CHARACTER SET latin2 COLLATE latin2_hungarian_ci;
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 InnoDB # # # # # # # # # # # # latin2_hungarian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin2_hungarian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -13797,8 +13797,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_bin) ENGINE=InnoDB CHARACTER SET latin5 COLLATE latin5_bin;
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 InnoDB # # # # # # # # # # # # latin5_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin5_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14027,8 +14027,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_turkish_ci) ENGINE=InnoDB CHARACTER SET latin5 COLLATE latin5_turkish_ci;
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 InnoDB # # # # # # # # # # # # latin5_turkish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin5_turkish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14257,8 +14257,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_bin) ENGINE=InnoDB CHARACTER SET latin7 COLLATE latin7_bin;
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 InnoDB # # # # # # # # # # # # latin7_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin7_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14487,8 +14487,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_estonian_cs) ENGINE=InnoDB CHARACTER SET latin7 COLLATE latin7_estonian_cs;
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 InnoDB # # # # # # # # # # # # latin7_estonian_cs # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin7_estonian_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
80 1
@@ -14717,8 +14717,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_ci) ENGINE=InnoDB CHARACTER SET latin7 COLLATE latin7_general_ci;
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 InnoDB # # # # # # # # # # # # latin7_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin7_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -14947,8 +14947,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_cs) ENGINE=InnoDB CHARACTER SET latin7 COLLATE latin7_general_cs;
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 InnoDB # # # # # # # # # # # # latin7_general_cs # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # latin7_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -15177,8 +15177,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_bin) ENGINE=InnoDB CHARACTER SET macce COLLATE macce_bin;
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 InnoDB # # # # # # # # # # # # macce_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # macce_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15407,8 +15407,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_general_ci) ENGINE=InnoDB CHARACTER SET macce COLLATE macce_general_ci;
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 InnoDB # # # # # # # # # # # # macce_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # macce_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15637,8 +15637,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_bin) ENGINE=InnoDB CHARACTER SET macroman COLLATE macroman_bin;
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 InnoDB # # # # # # # # # # # # macroman_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # macroman_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15867,8 +15867,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_general_ci) ENGINE=InnoDB CHARACTER SET macroman COLLATE macroman_general_ci;
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 InnoDB # # # # # # # # # # # # macroman_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # macroman_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16097,8 +16097,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_bin) ENGINE=InnoDB CHARACTER SET sjis COLLATE sjis_bin;
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 InnoDB # # # # # # # # # # # # sjis_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # sjis_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16264,8 +16264,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_japanese_ci) ENGINE=InnoDB CHARACTER SET sjis COLLATE sjis_japanese_ci;
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 InnoDB # # # # # # # # # # # # sjis_japanese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # sjis_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16431,8 +16431,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_bin) ENGINE=InnoDB CHARACTER SET swe7 COLLATE swe7_bin;
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 InnoDB # # # # # # # # # # # # swe7_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # swe7_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16661,8 +16661,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_swedish_ci) ENGINE=InnoDB CHARACTER SET swe7 COLLATE swe7_swedish_ci;
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 InnoDB # # # # # # # # # # # # swe7_swedish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # swe7_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16891,8 +16891,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_bin) ENGINE=InnoDB CHARACTER SET tis620 COLLATE tis620_bin;
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 InnoDB # # # # # # # # # # # # tis620_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # tis620_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17121,8 +17121,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_thai_ci) ENGINE=InnoDB CHARACTER SET tis620 COLLATE tis620_thai_ci;
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 InnoDB # # # # # # # # # # # # tis620_thai_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # tis620_thai_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17351,8 +17351,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_bin) ENGINE=InnoDB CHARACTER SET ujis COLLATE ujis_bin;
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 InnoDB # # # # # # # # # # # # ujis_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # ujis_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17455,8 +17455,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_japanese_ci) ENGINE=InnoDB CHARACTER SET ujis COLLATE ujis_japanese_ci;
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 InnoDB # # # # # # # # # # # # ujis_japanese_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # ujis_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17562,8 +17562,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_bin;
@@ -20103,8 +20103,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
@@ -22644,8 +22644,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
@@ -25185,8 +25185,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_estonian_ci;
@@ -27726,8 +27726,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
@@ -30267,8 +30267,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_hungarian_ci;
@@ -32808,8 +32808,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_icelandic_ci;
@@ -35349,8 +35349,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_latvian_ci;
@@ -37890,8 +37890,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_lithuanian_ci;
@@ -40431,8 +40431,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_persian_ci;
@@ -42972,8 +42972,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_polish_ci;
@@ -45513,8 +45513,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_roman_ci;
@@ -48054,8 +48054,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_romanian_ci;
@@ -50595,8 +50595,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovak_ci;
@@ -53136,8 +53136,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovenian_ci;
@@ -55677,8 +55677,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish2_ci;
@@ -58218,8 +58218,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish_ci;
@@ -60759,8 +60759,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci;
@@ -63300,8 +63300,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_turkish_ci;
@@ -65841,8 +65841,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=InnoDB CHARACTER SET utf8;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
@@ -68381,8 +68381,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_bin) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
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 InnoDB # # # # # # # # # # # # utf8_bin # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_bin # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -70920,8 +70920,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_czech_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_czech_ci;
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 InnoDB # # # # # # # # # # # # utf8_czech_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_czech_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -73459,8 +73459,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_danish_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_danish_ci;
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 InnoDB # # # # # # # # # # # # utf8_danish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_danish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -75998,8 +75998,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_estonian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_estonian_ci;
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 InnoDB # # # # # # # # # # # # utf8_estonian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_estonian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -78537,8 +78537,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;
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 InnoDB # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -81076,8 +81076,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_hungarian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_hungarian_ci;
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 InnoDB # # # # # # # # # # # # utf8_hungarian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_hungarian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -83615,8 +83615,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_icelandic_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_icelandic_ci;
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 InnoDB # # # # # # # # # # # # utf8_icelandic_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_icelandic_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -86154,8 +86154,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_latvian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_latvian_ci;
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 InnoDB # # # # # # # # # # # # utf8_latvian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_latvian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -88693,8 +88693,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_lithuanian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_lithuanian_ci;
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 InnoDB # # # # # # # # # # # # utf8_lithuanian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_lithuanian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -91232,8 +91232,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_persian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_persian_ci;
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 InnoDB # # # # # # # # # # # # utf8_persian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_persian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -93771,8 +93771,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_polish_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_polish_ci;
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 InnoDB # # # # # # # # # # # # utf8_polish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_polish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -96310,8 +96310,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_roman_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_roman_ci;
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 InnoDB # # # # # # # # # # # # utf8_roman_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_roman_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -98849,8 +98849,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_romanian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_romanian_ci;
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 InnoDB # # # # # # # # # # # # utf8_romanian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_romanian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -101388,8 +101388,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovak_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_slovak_ci;
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 InnoDB # # # # # # # # # # # # utf8_slovak_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_slovak_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -103927,8 +103927,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovenian_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci;
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 InnoDB # # # # # # # # # # # # utf8_slovenian_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_slovenian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -106466,8 +106466,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish2_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_spanish2_ci;
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 InnoDB # # # # # # # # # # # # utf8_spanish2_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_spanish2_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -109005,8 +109005,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_spanish_ci;
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 InnoDB # # # # # # # # # # # # utf8_spanish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_spanish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -111544,8 +111544,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_swedish_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_swedish_ci;
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 InnoDB # # # # # # # # # # # # utf8_swedish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_swedish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -114083,8 +114083,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_turkish_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_turkish_ci;
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 InnoDB # # # # # # # # # # # # utf8_turkish_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_turkish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -116622,8 +116622,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
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 InnoDB # # # # # # # # # # # # utf8_unicode_ci # # #
+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 Max_index_length Temporary
+t1 InnoDB # # # # # # # # # # # # utf8_unicode_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
diff --git a/mysql-test/suite/funcs_2/r/memory_charset.result b/mysql-test/suite/funcs_2/r/memory_charset.result
index ae7778f3e48..66cdada9b61 100644
--- a/mysql-test/suite/funcs_2/r/memory_charset.result
+++ b/mysql-test/suite/funcs_2/r/memory_charset.result
@@ -3,8 +3,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_bin) ENGINE=Memory CHARACTER SET armscii8 COLLATE armscii8_bin;
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 MEMORY # # # # # # # # # # # # armscii8_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # armscii8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -233,8 +233,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_general_ci) ENGINE=Memory CHARACTER SET armscii8 COLLATE armscii8_general_ci;
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 MEMORY # # # # # # # # # # # # armscii8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # armscii8_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -463,8 +463,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_bin) ENGINE=Memory CHARACTER SET ascii COLLATE ascii_bin;
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 MEMORY # # # # # # # # # # # # ascii_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # ascii_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -693,8 +693,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_general_ci) ENGINE=Memory CHARACTER SET ascii COLLATE ascii_general_ci;
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 MEMORY # # # # # # # # # # # # ascii_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # ascii_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -923,8 +923,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_bin) ENGINE=Memory CHARACTER SET big5 COLLATE big5_bin;
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 MEMORY # # # # # # # # # # # # big5_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # big5_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1027,8 +1027,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_chinese_ci) ENGINE=Memory CHARACTER SET big5 COLLATE big5_chinese_ci;
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 MEMORY # # # # # # # # # # # # big5_chinese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # big5_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1131,8 +1131,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES binary;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET binary) ENGINE=Memory CHARACTER SET binary;
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 MEMORY # # # # # # # # # # # # binary # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # binary # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1361,8 +1361,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_bin) ENGINE=Memory CHARACTER SET cp1250 COLLATE cp1250_bin;
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 MEMORY # # # # # # # # # # # # cp1250_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1250_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1591,8 +1591,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci) ENGINE=Memory CHARACTER SET cp1250 COLLATE cp1250_croatian_ci;
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 MEMORY # # # # # # # # # # # # cp1250_croatian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1250_croatian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1821,8 +1821,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_czech_cs) ENGINE=Memory CHARACTER SET cp1250 COLLATE cp1250_czech_cs;
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 MEMORY # # # # # # # # # # # # cp1250_czech_cs # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1250_czech_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -2051,8 +2051,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_general_ci) ENGINE=Memory CHARACTER SET cp1250 COLLATE cp1250_general_ci;
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 MEMORY # # # # # # # # # # # # cp1250_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1250_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
A0 1
@@ -2281,8 +2281,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bin) ENGINE=Memory CHARACTER SET cp1251 COLLATE cp1251_bin;
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 MEMORY # # # # # # # # # # # # cp1251_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1251_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2511,8 +2511,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci) ENGINE=Memory CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci;
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 MEMORY # # # # # # # # # # # # cp1251_bulgarian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1251_bulgarian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2741,8 +2741,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_ci) ENGINE=Memory CHARACTER SET cp1251 COLLATE cp1251_general_ci;
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 MEMORY # # # # # # # # # # # # cp1251_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1251_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2971,8 +2971,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_cs) ENGINE=Memory CHARACTER SET cp1251 COLLATE cp1251_general_cs;
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 MEMORY # # # # # # # # # # # # cp1251_general_cs # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1251_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3201,8 +3201,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci) ENGINE=Memory CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci;
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 MEMORY # # # # # # # # # # # # cp1251_ukrainian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1251_ukrainian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -3431,8 +3431,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_bin) ENGINE=Memory CHARACTER SET cp1256 COLLATE cp1256_bin;
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 MEMORY # # # # # # # # # # # # cp1256_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1256_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3661,8 +3661,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_general_ci) ENGINE=Memory CHARACTER SET cp1256 COLLATE cp1256_general_ci;
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 MEMORY # # # # # # # # # # # # cp1256_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1256_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3891,8 +3891,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_bin) ENGINE=Memory CHARACTER SET cp1257 COLLATE cp1257_bin;
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 MEMORY # # # # # # # # # # # # cp1257_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1257_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4121,8 +4121,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_general_ci) ENGINE=Memory CHARACTER SET cp1257 COLLATE cp1257_general_ci;
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 MEMORY # # # # # # # # # # # # cp1257_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1257_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4351,8 +4351,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci) ENGINE=Memory CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci;
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 MEMORY # # # # # # # # # # # # cp1257_lithuanian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp1257_lithuanian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4581,8 +4581,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_bin) ENGINE=Memory CHARACTER SET cp850 COLLATE cp850_bin;
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 MEMORY # # # # # # # # # # # # cp850_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp850_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4811,8 +4811,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_general_ci) ENGINE=Memory CHARACTER SET cp850 COLLATE cp850_general_ci;
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 MEMORY # # # # # # # # # # # # cp850_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp850_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5041,8 +5041,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_bin) ENGINE=Memory CHARACTER SET cp852 COLLATE cp852_bin;
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 MEMORY # # # # # # # # # # # # cp852_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp852_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5271,8 +5271,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_general_ci) ENGINE=Memory CHARACTER SET cp852 COLLATE cp852_general_ci;
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 MEMORY # # # # # # # # # # # # cp852_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp852_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5501,8 +5501,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_bin) ENGINE=Memory CHARACTER SET cp866 COLLATE cp866_bin;
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 MEMORY # # # # # # # # # # # # cp866_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp866_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5731,8 +5731,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_general_ci) ENGINE=Memory CHARACTER SET cp866 COLLATE cp866_general_ci;
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 MEMORY # # # # # # # # # # # # cp866_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp866_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5961,8 +5961,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_bin) ENGINE=Memory CHARACTER SET cp932 COLLATE cp932_bin;
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 MEMORY # # # # # # # # # # # # cp932_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp932_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6128,8 +6128,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_japanese_ci) ENGINE=Memory CHARACTER SET cp932 COLLATE cp932_japanese_ci;
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 MEMORY # # # # # # # # # # # # cp932_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # cp932_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6295,8 +6295,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_bin) ENGINE=Memory CHARACTER SET dec8 COLLATE dec8_bin;
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 MEMORY # # # # # # # # # # # # dec8_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # dec8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6525,8 +6525,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_swedish_ci) ENGINE=Memory CHARACTER SET dec8 COLLATE dec8_swedish_ci;
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 MEMORY # # # # # # # # # # # # dec8_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # dec8_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6755,8 +6755,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_bin) ENGINE=Memory CHARACTER SET eucjpms COLLATE eucjpms_bin;
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 MEMORY # # # # # # # # # # # # eucjpms_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # eucjpms_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6859,8 +6859,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci) ENGINE=Memory CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci;
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 MEMORY # # # # # # # # # # # # eucjpms_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # eucjpms_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6963,8 +6963,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_bin) ENGINE=Memory CHARACTER SET euckr COLLATE euckr_bin;
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 MEMORY # # # # # # # # # # # # euckr_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # euckr_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7067,8 +7067,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_korean_ci) ENGINE=Memory CHARACTER SET euckr COLLATE euckr_korean_ci;
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 MEMORY # # # # # # # # # # # # euckr_korean_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # euckr_korean_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7171,8 +7171,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_bin) ENGINE=Memory CHARACTER SET gb2312 COLLATE gb2312_bin;
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 MEMORY # # # # # # # # # # # # gb2312_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # gb2312_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7275,8 +7275,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci) ENGINE=Memory CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
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 MEMORY # # # # # # # # # # # # gb2312_chinese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # gb2312_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7379,8 +7379,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_bin) ENGINE=Memory CHARACTER SET gbk COLLATE gbk_bin;
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 MEMORY # # # # # # # # # # # # gbk_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # gbk_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7483,8 +7483,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_chinese_ci) ENGINE=Memory CHARACTER SET gbk COLLATE gbk_chinese_ci;
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 MEMORY # # # # # # # # # # # # gbk_chinese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # gbk_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7587,8 +7587,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_bin) ENGINE=Memory CHARACTER SET geostd8 COLLATE geostd8_bin;
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 MEMORY # # # # # # # # # # # # geostd8_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # geostd8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7817,8 +7817,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_general_ci) ENGINE=Memory CHARACTER SET geostd8 COLLATE geostd8_general_ci;
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 MEMORY # # # # # # # # # # # # geostd8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # geostd8_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8047,8 +8047,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_bin) ENGINE=Memory CHARACTER SET greek COLLATE greek_bin;
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 MEMORY # # # # # # # # # # # # greek_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # greek_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8277,8 +8277,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_general_ci) ENGINE=Memory CHARACTER SET greek COLLATE greek_general_ci;
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 MEMORY # # # # # # # # # # # # greek_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # greek_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8507,8 +8507,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_bin) ENGINE=Memory CHARACTER SET hebrew COLLATE hebrew_bin;
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 MEMORY # # # # # # # # # # # # hebrew_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # hebrew_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8737,8 +8737,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_general_ci) ENGINE=Memory CHARACTER SET hebrew COLLATE hebrew_general_ci;
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 MEMORY # # # # # # # # # # # # hebrew_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # hebrew_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8967,8 +8967,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_bin) ENGINE=Memory CHARACTER SET hp8 COLLATE hp8_bin;
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 MEMORY # # # # # # # # # # # # hp8_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # hp8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9197,8 +9197,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_english_ci) ENGINE=Memory CHARACTER SET hp8 COLLATE hp8_english_ci;
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 MEMORY # # # # # # # # # # # # hp8_english_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # hp8_english_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9427,8 +9427,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_bin) ENGINE=Memory CHARACTER SET keybcs2 COLLATE keybcs2_bin;
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 MEMORY # # # # # # # # # # # # keybcs2_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # keybcs2_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9657,8 +9657,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_general_ci) ENGINE=Memory CHARACTER SET keybcs2 COLLATE keybcs2_general_ci;
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 MEMORY # # # # # # # # # # # # keybcs2_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # keybcs2_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9887,8 +9887,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_bin) ENGINE=Memory CHARACTER SET koi8r COLLATE koi8r_bin;
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 MEMORY # # # # # # # # # # # # koi8r_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # koi8r_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10117,8 +10117,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_general_ci) ENGINE=Memory CHARACTER SET koi8r COLLATE koi8r_general_ci;
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 MEMORY # # # # # # # # # # # # koi8r_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # koi8r_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10347,8 +10347,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_bin) ENGINE=Memory CHARACTER SET koi8u COLLATE koi8u_bin;
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 MEMORY # # # # # # # # # # # # koi8u_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # koi8u_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10577,8 +10577,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_general_ci) ENGINE=Memory CHARACTER SET koi8u COLLATE koi8u_general_ci;
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 MEMORY # # # # # # # # # # # # koi8u_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # koi8u_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -10807,8 +10807,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_bin) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_bin;
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 MEMORY # # # # # # # # # # # # latin1_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11037,8 +11037,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_danish_ci) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_danish_ci;
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 MEMORY # # # # # # # # # # # # latin1_danish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_danish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11267,8 +11267,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_ci) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_general_ci;
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 MEMORY # # # # # # # # # # # # latin1_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11497,8 +11497,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_cs) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_general_cs;
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 MEMORY # # # # # # # # # # # # latin1_general_cs # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11727,8 +11727,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german1_ci) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_german1_ci;
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 MEMORY # # # # # # # # # # # # latin1_german1_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_german1_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11957,8 +11957,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german2_ci) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_german2_ci;
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 MEMORY # # # # # # # # # # # # latin1_german2_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_german2_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12187,8 +12187,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_spanish_ci) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_spanish_ci;
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 MEMORY # # # # # # # # # # # # latin1_spanish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_spanish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12417,8 +12417,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_swedish_ci) ENGINE=Memory CHARACTER SET latin1 COLLATE latin1_swedish_ci;
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 MEMORY # # # # # # # # # # # # latin1_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin1_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12647,8 +12647,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_bin) ENGINE=Memory CHARACTER SET latin2 COLLATE latin2_bin;
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 MEMORY # # # # # # # # # # # # latin2_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin2_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12877,8 +12877,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_croatian_ci) ENGINE=Memory CHARACTER SET latin2 COLLATE latin2_croatian_ci;
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 MEMORY # # # # # # # # # # # # latin2_croatian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin2_croatian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13107,8 +13107,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_czech_cs) ENGINE=Memory CHARACTER SET latin2 COLLATE latin2_czech_cs;
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 MEMORY # # # # # # # # # # # # latin2_czech_cs # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin2_czech_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
2E 1
@@ -13337,8 +13337,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_general_ci) ENGINE=Memory CHARACTER SET latin2 COLLATE latin2_general_ci;
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 MEMORY # # # # # # # # # # # # latin2_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin2_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13567,8 +13567,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_hungarian_ci) ENGINE=Memory CHARACTER SET latin2 COLLATE latin2_hungarian_ci;
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 MEMORY # # # # # # # # # # # # latin2_hungarian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin2_hungarian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -13797,8 +13797,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_bin) ENGINE=Memory CHARACTER SET latin5 COLLATE latin5_bin;
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 MEMORY # # # # # # # # # # # # latin5_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin5_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14027,8 +14027,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_turkish_ci) ENGINE=Memory CHARACTER SET latin5 COLLATE latin5_turkish_ci;
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 MEMORY # # # # # # # # # # # # latin5_turkish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin5_turkish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14257,8 +14257,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_bin) ENGINE=Memory CHARACTER SET latin7 COLLATE latin7_bin;
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 MEMORY # # # # # # # # # # # # latin7_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin7_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14487,8 +14487,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_estonian_cs) ENGINE=Memory CHARACTER SET latin7 COLLATE latin7_estonian_cs;
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 MEMORY # # # # # # # # # # # # latin7_estonian_cs # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin7_estonian_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
80 1
@@ -14717,8 +14717,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_ci) ENGINE=Memory CHARACTER SET latin7 COLLATE latin7_general_ci;
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 MEMORY # # # # # # # # # # # # latin7_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin7_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -14947,8 +14947,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_cs) ENGINE=Memory CHARACTER SET latin7 COLLATE latin7_general_cs;
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 MEMORY # # # # # # # # # # # # latin7_general_cs # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # latin7_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -15177,8 +15177,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_bin) ENGINE=Memory CHARACTER SET macce COLLATE macce_bin;
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 MEMORY # # # # # # # # # # # # macce_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # macce_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15407,8 +15407,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_general_ci) ENGINE=Memory CHARACTER SET macce COLLATE macce_general_ci;
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 MEMORY # # # # # # # # # # # # macce_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # macce_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15637,8 +15637,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_bin) ENGINE=Memory CHARACTER SET macroman COLLATE macroman_bin;
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 MEMORY # # # # # # # # # # # # macroman_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # macroman_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15867,8 +15867,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_general_ci) ENGINE=Memory CHARACTER SET macroman COLLATE macroman_general_ci;
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 MEMORY # # # # # # # # # # # # macroman_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # macroman_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16097,8 +16097,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_bin) ENGINE=Memory CHARACTER SET sjis COLLATE sjis_bin;
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 MEMORY # # # # # # # # # # # # sjis_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # sjis_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16264,8 +16264,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_japanese_ci) ENGINE=Memory CHARACTER SET sjis COLLATE sjis_japanese_ci;
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 MEMORY # # # # # # # # # # # # sjis_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # sjis_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16431,8 +16431,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_bin) ENGINE=Memory CHARACTER SET swe7 COLLATE swe7_bin;
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 MEMORY # # # # # # # # # # # # swe7_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # swe7_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16661,8 +16661,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_swedish_ci) ENGINE=Memory CHARACTER SET swe7 COLLATE swe7_swedish_ci;
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 MEMORY # # # # # # # # # # # # swe7_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # swe7_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16891,8 +16891,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_bin) ENGINE=Memory CHARACTER SET tis620 COLLATE tis620_bin;
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 MEMORY # # # # # # # # # # # # tis620_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # tis620_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17121,8 +17121,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_thai_ci) ENGINE=Memory CHARACTER SET tis620 COLLATE tis620_thai_ci;
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 MEMORY # # # # # # # # # # # # tis620_thai_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # tis620_thai_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17351,8 +17351,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_bin) ENGINE=Memory CHARACTER SET ujis COLLATE ujis_bin;
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 MEMORY # # # # # # # # # # # # ujis_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # ujis_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17455,8 +17455,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_japanese_ci) ENGINE=Memory CHARACTER SET ujis COLLATE ujis_japanese_ci;
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 MEMORY # # # # # # # # # # # # ujis_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # ujis_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17562,8 +17562,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_bin;
@@ -20103,8 +20103,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
@@ -22644,8 +22644,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
@@ -25185,8 +25185,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_estonian_ci;
@@ -27726,8 +27726,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
@@ -30267,8 +30267,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_hungarian_ci;
@@ -32808,8 +32808,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_icelandic_ci;
@@ -35349,8 +35349,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_latvian_ci;
@@ -37890,8 +37890,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_lithuanian_ci;
@@ -40431,8 +40431,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_persian_ci;
@@ -42972,8 +42972,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_polish_ci;
@@ -45513,8 +45513,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_roman_ci;
@@ -48054,8 +48054,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_romanian_ci;
@@ -50595,8 +50595,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovak_ci;
@@ -53136,8 +53136,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovenian_ci;
@@ -55677,8 +55677,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish2_ci;
@@ -58218,8 +58218,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish_ci;
@@ -60759,8 +60759,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci;
@@ -63300,8 +63300,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_turkish_ci;
@@ -65841,8 +65841,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=Memory CHARACTER SET utf8;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
@@ -68381,8 +68381,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_bin) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_bin;
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 MEMORY # # # # # # # # # # # # utf8_bin # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_bin # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -70920,8 +70920,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_czech_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_czech_ci;
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 MEMORY # # # # # # # # # # # # utf8_czech_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_czech_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -73459,8 +73459,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_danish_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_danish_ci;
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 MEMORY # # # # # # # # # # # # utf8_danish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_danish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -75998,8 +75998,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_estonian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_estonian_ci;
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 MEMORY # # # # # # # # # # # # utf8_estonian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_estonian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -78537,8 +78537,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_general_ci;
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 MEMORY # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_general_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -81076,8 +81076,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_hungarian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_hungarian_ci;
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 MEMORY # # # # # # # # # # # # utf8_hungarian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_hungarian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -83615,8 +83615,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_icelandic_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_icelandic_ci;
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 MEMORY # # # # # # # # # # # # utf8_icelandic_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_icelandic_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -86154,8 +86154,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_latvian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_latvian_ci;
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 MEMORY # # # # # # # # # # # # utf8_latvian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_latvian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -88693,8 +88693,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_lithuanian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_lithuanian_ci;
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 MEMORY # # # # # # # # # # # # utf8_lithuanian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_lithuanian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -91232,8 +91232,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_persian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_persian_ci;
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 MEMORY # # # # # # # # # # # # utf8_persian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_persian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -93771,8 +93771,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_polish_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_polish_ci;
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 MEMORY # # # # # # # # # # # # utf8_polish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_polish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -96310,8 +96310,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_roman_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_roman_ci;
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 MEMORY # # # # # # # # # # # # utf8_roman_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_roman_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -98849,8 +98849,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_romanian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_romanian_ci;
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 MEMORY # # # # # # # # # # # # utf8_romanian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_romanian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -101388,8 +101388,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovak_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_slovak_ci;
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 MEMORY # # # # # # # # # # # # utf8_slovak_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_slovak_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -103927,8 +103927,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovenian_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_slovenian_ci;
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 MEMORY # # # # # # # # # # # # utf8_slovenian_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_slovenian_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -106466,8 +106466,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish2_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_spanish2_ci;
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 MEMORY # # # # # # # # # # # # utf8_spanish2_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_spanish2_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -109005,8 +109005,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_spanish_ci;
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 MEMORY # # # # # # # # # # # # utf8_spanish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_spanish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -111544,8 +111544,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_swedish_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_swedish_ci;
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 MEMORY # # # # # # # # # # # # utf8_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_swedish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -114083,8 +114083,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_turkish_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_turkish_ci;
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 MEMORY # # # # # # # # # # # # utf8_turkish_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_turkish_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -116622,8 +116622,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci) ENGINE=Memory CHARACTER SET utf8 COLLATE utf8_unicode_ci;
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 MEMORY # # # # # # # # # # # # utf8_unicode_ci # # #
+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 Max_index_length Temporary
+t1 MEMORY # # # # # # # # # # # # utf8_unicode_ci # # # 0 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
diff --git a/mysql-test/suite/funcs_2/r/myisam_charset.result b/mysql-test/suite/funcs_2/r/myisam_charset.result
index e1ca3370532..9950b446a63 100644
--- a/mysql-test/suite/funcs_2/r/myisam_charset.result
+++ b/mysql-test/suite/funcs_2/r/myisam_charset.result
@@ -3,8 +3,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_bin) ENGINE=MyISAM CHARACTER SET armscii8 COLLATE armscii8_bin;
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 # # # # # # # # # # # # armscii8_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # armscii8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -233,8 +233,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_general_ci) ENGINE=MyISAM CHARACTER SET armscii8 COLLATE armscii8_general_ci;
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 # # # # # # # # # # # # armscii8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # armscii8_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -463,8 +463,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_bin) ENGINE=MyISAM CHARACTER SET ascii COLLATE ascii_bin;
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 # # # # # # # # # # # # ascii_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # ascii_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -693,8 +693,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_general_ci) ENGINE=MyISAM CHARACTER SET ascii COLLATE ascii_general_ci;
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 # # # # # # # # # # # # ascii_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # ascii_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -923,8 +923,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_bin) ENGINE=MyISAM CHARACTER SET big5 COLLATE big5_bin;
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 # # # # # # # # # # # # big5_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # big5_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1027,8 +1027,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_chinese_ci) ENGINE=MyISAM CHARACTER SET big5 COLLATE big5_chinese_ci;
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 # # # # # # # # # # # # big5_chinese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # big5_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1131,8 +1131,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES binary;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET binary) ENGINE=MyISAM CHARACTER SET binary;
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 # # # # # # # # # # # # binary # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # binary # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1361,8 +1361,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_bin) ENGINE=MyISAM CHARACTER SET cp1250 COLLATE cp1250_bin;
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 # # # # # # # # # # # # cp1250_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1250_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1591,8 +1591,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci) ENGINE=MyISAM CHARACTER SET cp1250 COLLATE cp1250_croatian_ci;
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 # # # # # # # # # # # # cp1250_croatian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1250_croatian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1821,8 +1821,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_czech_cs) ENGINE=MyISAM CHARACTER SET cp1250 COLLATE cp1250_czech_cs;
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 # # # # # # # # # # # # cp1250_czech_cs # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1250_czech_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -2051,8 +2051,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_general_ci) ENGINE=MyISAM CHARACTER SET cp1250 COLLATE cp1250_general_ci;
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 # # # # # # # # # # # # cp1250_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1250_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
A0 1
@@ -2281,8 +2281,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bin) ENGINE=MyISAM CHARACTER SET cp1251 COLLATE cp1251_bin;
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 # # # # # # # # # # # # cp1251_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1251_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2511,8 +2511,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci) ENGINE=MyISAM CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci;
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 # # # # # # # # # # # # cp1251_bulgarian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1251_bulgarian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2741,8 +2741,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_ci) ENGINE=MyISAM CHARACTER SET cp1251 COLLATE cp1251_general_ci;
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 # # # # # # # # # # # # cp1251_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1251_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2971,8 +2971,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_cs) ENGINE=MyISAM CHARACTER SET cp1251 COLLATE cp1251_general_cs;
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 # # # # # # # # # # # # cp1251_general_cs # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1251_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3201,8 +3201,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci) ENGINE=MyISAM CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci;
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 # # # # # # # # # # # # cp1251_ukrainian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1251_ukrainian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -3431,8 +3431,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_bin) ENGINE=MyISAM CHARACTER SET cp1256 COLLATE cp1256_bin;
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 # # # # # # # # # # # # cp1256_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1256_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3661,8 +3661,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_general_ci) ENGINE=MyISAM CHARACTER SET cp1256 COLLATE cp1256_general_ci;
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 # # # # # # # # # # # # cp1256_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1256_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3891,8 +3891,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_bin) ENGINE=MyISAM CHARACTER SET cp1257 COLLATE cp1257_bin;
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 # # # # # # # # # # # # cp1257_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1257_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4121,8 +4121,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_general_ci) ENGINE=MyISAM CHARACTER SET cp1257 COLLATE cp1257_general_ci;
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 # # # # # # # # # # # # cp1257_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1257_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4351,8 +4351,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci) ENGINE=MyISAM CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci;
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 # # # # # # # # # # # # cp1257_lithuanian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp1257_lithuanian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4581,8 +4581,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_bin) ENGINE=MyISAM CHARACTER SET cp850 COLLATE cp850_bin;
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 # # # # # # # # # # # # cp850_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp850_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4811,8 +4811,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_general_ci) ENGINE=MyISAM CHARACTER SET cp850 COLLATE cp850_general_ci;
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 # # # # # # # # # # # # cp850_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp850_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5041,8 +5041,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_bin) ENGINE=MyISAM CHARACTER SET cp852 COLLATE cp852_bin;
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 # # # # # # # # # # # # cp852_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp852_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5271,8 +5271,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_general_ci) ENGINE=MyISAM CHARACTER SET cp852 COLLATE cp852_general_ci;
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 # # # # # # # # # # # # cp852_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp852_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5501,8 +5501,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_bin) ENGINE=MyISAM CHARACTER SET cp866 COLLATE cp866_bin;
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 # # # # # # # # # # # # cp866_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp866_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5731,8 +5731,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_general_ci) ENGINE=MyISAM CHARACTER SET cp866 COLLATE cp866_general_ci;
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 # # # # # # # # # # # # cp866_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp866_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5961,8 +5961,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_bin) ENGINE=MyISAM CHARACTER SET cp932 COLLATE cp932_bin;
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 # # # # # # # # # # # # cp932_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp932_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6128,8 +6128,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_japanese_ci) ENGINE=MyISAM CHARACTER SET cp932 COLLATE cp932_japanese_ci;
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 # # # # # # # # # # # # cp932_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # cp932_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6295,8 +6295,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_bin) ENGINE=MyISAM CHARACTER SET dec8 COLLATE dec8_bin;
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 # # # # # # # # # # # # dec8_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # dec8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6525,8 +6525,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_swedish_ci) ENGINE=MyISAM CHARACTER SET dec8 COLLATE dec8_swedish_ci;
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 # # # # # # # # # # # # dec8_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # dec8_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6755,8 +6755,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_bin) ENGINE=MyISAM CHARACTER SET eucjpms COLLATE eucjpms_bin;
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 # # # # # # # # # # # # eucjpms_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # eucjpms_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6859,8 +6859,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci) ENGINE=MyISAM CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci;
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 # # # # # # # # # # # # eucjpms_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # eucjpms_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6963,8 +6963,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_bin) ENGINE=MyISAM CHARACTER SET euckr COLLATE euckr_bin;
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 # # # # # # # # # # # # euckr_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # euckr_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7067,8 +7067,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_korean_ci) ENGINE=MyISAM CHARACTER SET euckr COLLATE euckr_korean_ci;
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 # # # # # # # # # # # # euckr_korean_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # euckr_korean_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7171,8 +7171,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_bin) ENGINE=MyISAM CHARACTER SET gb2312 COLLATE gb2312_bin;
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 # # # # # # # # # # # # gb2312_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # gb2312_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7275,8 +7275,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci) ENGINE=MyISAM CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
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 # # # # # # # # # # # # gb2312_chinese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # gb2312_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7379,8 +7379,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_bin) ENGINE=MyISAM CHARACTER SET gbk COLLATE gbk_bin;
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 # # # # # # # # # # # # gbk_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # gbk_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7483,8 +7483,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_chinese_ci) ENGINE=MyISAM CHARACTER SET gbk COLLATE gbk_chinese_ci;
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 # # # # # # # # # # # # gbk_chinese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # gbk_chinese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7587,8 +7587,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_bin) ENGINE=MyISAM CHARACTER SET geostd8 COLLATE geostd8_bin;
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 # # # # # # # # # # # # geostd8_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # geostd8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7817,8 +7817,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_general_ci) ENGINE=MyISAM CHARACTER SET geostd8 COLLATE geostd8_general_ci;
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 # # # # # # # # # # # # geostd8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # geostd8_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8047,8 +8047,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_bin) ENGINE=MyISAM CHARACTER SET greek COLLATE greek_bin;
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 # # # # # # # # # # # # greek_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # greek_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8277,8 +8277,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_general_ci) ENGINE=MyISAM CHARACTER SET greek COLLATE greek_general_ci;
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 # # # # # # # # # # # # greek_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # greek_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8507,8 +8507,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_bin) ENGINE=MyISAM CHARACTER SET hebrew COLLATE hebrew_bin;
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 # # # # # # # # # # # # hebrew_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # hebrew_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8737,8 +8737,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_general_ci) ENGINE=MyISAM CHARACTER SET hebrew COLLATE hebrew_general_ci;
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 # # # # # # # # # # # # hebrew_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # hebrew_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8967,8 +8967,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_bin) ENGINE=MyISAM CHARACTER SET hp8 COLLATE hp8_bin;
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 # # # # # # # # # # # # hp8_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # hp8_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9197,8 +9197,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_english_ci) ENGINE=MyISAM CHARACTER SET hp8 COLLATE hp8_english_ci;
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 # # # # # # # # # # # # hp8_english_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # hp8_english_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9427,8 +9427,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_bin) ENGINE=MyISAM CHARACTER SET keybcs2 COLLATE keybcs2_bin;
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 # # # # # # # # # # # # keybcs2_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # keybcs2_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9657,8 +9657,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_general_ci) ENGINE=MyISAM CHARACTER SET keybcs2 COLLATE keybcs2_general_ci;
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 # # # # # # # # # # # # keybcs2_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # keybcs2_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9887,8 +9887,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_bin) ENGINE=MyISAM CHARACTER SET koi8r COLLATE koi8r_bin;
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 # # # # # # # # # # # # koi8r_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # koi8r_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10117,8 +10117,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_general_ci) ENGINE=MyISAM CHARACTER SET koi8r COLLATE koi8r_general_ci;
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 # # # # # # # # # # # # koi8r_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # koi8r_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10347,8 +10347,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_bin) ENGINE=MyISAM CHARACTER SET koi8u COLLATE koi8u_bin;
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 # # # # # # # # # # # # koi8u_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # koi8u_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10577,8 +10577,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_general_ci) ENGINE=MyISAM CHARACTER SET koi8u COLLATE koi8u_general_ci;
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 # # # # # # # # # # # # koi8u_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # koi8u_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -10807,8 +10807,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_bin) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_bin;
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 # # # # # # # # # # # # latin1_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11037,8 +11037,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_danish_ci) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_danish_ci;
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 # # # # # # # # # # # # latin1_danish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_danish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11267,8 +11267,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_ci) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_general_ci;
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 # # # # # # # # # # # # latin1_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11497,8 +11497,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_cs) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_general_cs;
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 # # # # # # # # # # # # latin1_general_cs # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11727,8 +11727,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german1_ci) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_german1_ci;
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 # # # # # # # # # # # # latin1_german1_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_german1_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11957,8 +11957,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german2_ci) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_german2_ci;
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 # # # # # # # # # # # # latin1_german2_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_german2_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12187,8 +12187,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_spanish_ci) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_spanish_ci;
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 # # # # # # # # # # # # latin1_spanish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_spanish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12417,8 +12417,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_swedish_ci) ENGINE=MyISAM CHARACTER SET latin1 COLLATE latin1_swedish_ci;
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 # # # # # # # # # # # # latin1_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin1_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12647,8 +12647,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_bin) ENGINE=MyISAM CHARACTER SET latin2 COLLATE latin2_bin;
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 # # # # # # # # # # # # latin2_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin2_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12877,8 +12877,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_croatian_ci) ENGINE=MyISAM CHARACTER SET latin2 COLLATE latin2_croatian_ci;
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 # # # # # # # # # # # # latin2_croatian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin2_croatian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13107,8 +13107,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_czech_cs) ENGINE=MyISAM CHARACTER SET latin2 COLLATE latin2_czech_cs;
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 # # # # # # # # # # # # latin2_czech_cs # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin2_czech_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
2E 1
@@ -13337,8 +13337,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_general_ci) ENGINE=MyISAM CHARACTER SET latin2 COLLATE latin2_general_ci;
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 # # # # # # # # # # # # latin2_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin2_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13567,8 +13567,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_hungarian_ci) ENGINE=MyISAM CHARACTER SET latin2 COLLATE latin2_hungarian_ci;
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 # # # # # # # # # # # # latin2_hungarian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin2_hungarian_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -13797,8 +13797,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_bin) ENGINE=MyISAM CHARACTER SET latin5 COLLATE latin5_bin;
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 # # # # # # # # # # # # latin5_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin5_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14027,8 +14027,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_turkish_ci) ENGINE=MyISAM CHARACTER SET latin5 COLLATE latin5_turkish_ci;
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 # # # # # # # # # # # # latin5_turkish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin5_turkish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14257,8 +14257,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_bin) ENGINE=MyISAM CHARACTER SET latin7 COLLATE latin7_bin;
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 # # # # # # # # # # # # latin7_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin7_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14487,8 +14487,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_estonian_cs) ENGINE=MyISAM CHARACTER SET latin7 COLLATE latin7_estonian_cs;
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 # # # # # # # # # # # # latin7_estonian_cs # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin7_estonian_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
80 1
@@ -14717,8 +14717,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_ci) ENGINE=MyISAM CHARACTER SET latin7 COLLATE latin7_general_ci;
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 # # # # # # # # # # # # latin7_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin7_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -14947,8 +14947,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_cs) ENGINE=MyISAM CHARACTER SET latin7 COLLATE latin7_general_cs;
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 # # # # # # # # # # # # latin7_general_cs # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # latin7_general_cs # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -15177,8 +15177,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_bin) ENGINE=MyISAM CHARACTER SET macce COLLATE macce_bin;
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 # # # # # # # # # # # # macce_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # macce_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15407,8 +15407,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_general_ci) ENGINE=MyISAM CHARACTER SET macce COLLATE macce_general_ci;
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 # # # # # # # # # # # # macce_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # macce_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15637,8 +15637,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_bin) ENGINE=MyISAM CHARACTER SET macroman COLLATE macroman_bin;
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 # # # # # # # # # # # # macroman_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # macroman_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15867,8 +15867,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_general_ci) ENGINE=MyISAM CHARACTER SET macroman COLLATE macroman_general_ci;
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 # # # # # # # # # # # # macroman_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # macroman_general_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16097,8 +16097,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_bin) ENGINE=MyISAM CHARACTER SET sjis COLLATE sjis_bin;
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 # # # # # # # # # # # # sjis_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # sjis_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16264,8 +16264,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_japanese_ci) ENGINE=MyISAM CHARACTER SET sjis COLLATE sjis_japanese_ci;
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 # # # # # # # # # # # # sjis_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # sjis_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16431,8 +16431,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_bin) ENGINE=MyISAM CHARACTER SET swe7 COLLATE swe7_bin;
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 # # # # # # # # # # # # swe7_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # swe7_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16661,8 +16661,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_swedish_ci) ENGINE=MyISAM CHARACTER SET swe7 COLLATE swe7_swedish_ci;
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 # # # # # # # # # # # # swe7_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # swe7_swedish_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16891,8 +16891,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_bin) ENGINE=MyISAM CHARACTER SET tis620 COLLATE tis620_bin;
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 # # # # # # # # # # # # tis620_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # tis620_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17121,8 +17121,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_thai_ci) ENGINE=MyISAM CHARACTER SET tis620 COLLATE tis620_thai_ci;
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 # # # # # # # # # # # # tis620_thai_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # tis620_thai_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17351,8 +17351,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_bin) ENGINE=MyISAM CHARACTER SET ujis COLLATE ujis_bin;
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 # # # # # # # # # # # # ujis_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # ujis_bin # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17455,8 +17455,8 @@ DROP TABLE IF EXISTS test.t1;
SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_japanese_ci) ENGINE=MyISAM CHARACTER SET ujis COLLATE ujis_japanese_ci;
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 # # # # # # # # # # # # ujis_japanese_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # ujis_japanese_ci # # # # N
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17562,8 +17562,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_bin;
@@ -20103,8 +20103,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
@@ -22644,8 +22644,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
@@ -25185,8 +25185,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_estonian_ci;
@@ -27726,8 +27726,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
@@ -30267,8 +30267,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_hungarian_ci;
@@ -32808,8 +32808,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_icelandic_ci;
@@ -35349,8 +35349,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_latvian_ci;
@@ -37890,8 +37890,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_lithuanian_ci;
@@ -40431,8 +40431,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_persian_ci;
@@ -42972,8 +42972,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_polish_ci;
@@ -45513,8 +45513,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_roman_ci;
@@ -48054,8 +48054,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_romanian_ci;
@@ -50595,8 +50595,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovak_ci;
@@ -53136,8 +53136,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovenian_ci;
@@ -55677,8 +55677,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish2_ci;
@@ -58218,8 +58218,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish_ci;
@@ -60759,8 +60759,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci;
@@ -63300,8 +63300,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_turkish_ci;
@@ -65841,8 +65841,8 @@ USE test;
SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
@@ -68381,8 +68381,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_bin) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
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 # # # # # # # # # # # # utf8_bin # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_bin # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -70920,8 +70920,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_czech_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_czech_ci;
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 # # # # # # # # # # # # utf8_czech_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_czech_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -73459,8 +73459,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_danish_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_danish_ci;
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 # # # # # # # # # # # # utf8_danish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_danish_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -75998,8 +75998,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_estonian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_estonian_ci;
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 # # # # # # # # # # # # utf8_estonian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_estonian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -78537,8 +78537,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
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 # # # # # # # # # # # # utf8_general_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_general_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -81076,8 +81076,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_hungarian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_hungarian_ci;
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 # # # # # # # # # # # # utf8_hungarian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_hungarian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -83615,8 +83615,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_icelandic_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_icelandic_ci;
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 # # # # # # # # # # # # utf8_icelandic_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_icelandic_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -86154,8 +86154,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_latvian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_latvian_ci;
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 # # # # # # # # # # # # utf8_latvian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_latvian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -88693,8 +88693,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_lithuanian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_lithuanian_ci;
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 # # # # # # # # # # # # utf8_lithuanian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_lithuanian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -91232,8 +91232,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_persian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_persian_ci;
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 # # # # # # # # # # # # utf8_persian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_persian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -93771,8 +93771,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_polish_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_polish_ci;
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 # # # # # # # # # # # # utf8_polish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_polish_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -96310,8 +96310,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_roman_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_roman_ci;
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 # # # # # # # # # # # # utf8_roman_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_roman_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -98849,8 +98849,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_romanian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_romanian_ci;
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 # # # # # # # # # # # # utf8_romanian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_romanian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -101388,8 +101388,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovak_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_slovak_ci;
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 # # # # # # # # # # # # utf8_slovak_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_slovak_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -103927,8 +103927,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovenian_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_slovenian_ci;
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 # # # # # # # # # # # # utf8_slovenian_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_slovenian_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -106466,8 +106466,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish2_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_spanish2_ci;
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 # # # # # # # # # # # # utf8_spanish2_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_spanish2_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -109005,8 +109005,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_spanish_ci;
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 # # # # # # # # # # # # utf8_spanish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_spanish_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -111544,8 +111544,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_swedish_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_swedish_ci;
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 # # # # # # # # # # # # utf8_swedish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_swedish_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -114083,8 +114083,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_turkish_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_turkish_ci;
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 # # # # # # # # # # # # utf8_turkish_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_turkish_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -116622,8 +116622,8 @@ CREATE DATABASE test CHARACTER SET utf8;
USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
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 # # # # # # # # # # # # utf8_unicode_ci # # #
+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 Max_index_length Temporary
+t1 MyISAM # # # # # # # # # # # # utf8_unicode_ci # # # 17179868160 N
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 02f1bb5eb1f..8583fd72760 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -5,7 +5,7 @@
# Separate the test case name and the comment with ':'.
#
# <testcasename> : MDEV-<xxxx> <comment>
-#
+#
# Do not use any TAB characters for whitespace.
#
##############################################################################
@@ -24,6 +24,8 @@ galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
galera_var_node_address : MDEV-20485 Galera test failure
galera_wan : MDEV-17259 Test failure on galera.galera_wan
+lp1376747-4 : MDEV-21911 Galera test failure on lp1376747-4
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
sql_log_bin : MDEV-21491 galera.sql_log_bin
+MW-328A : MDEV-22666?
diff --git a/mysql-test/suite/galera/r/GAL-382.result b/mysql-test/suite/galera/r/GAL-382.result
index fb7c229bd56..c16c46d2e58 100644
--- a/mysql-test/suite/galera/r/GAL-382.result
+++ b/mysql-test/suite/galera/r/GAL-382.result
@@ -1,7 +1,11 @@
connection node_1;
create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/MDEV-15443.result b/mysql-test/suite/galera/r/MDEV-15443.result
new file mode 100644
index 00000000000..618e5459878
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-15443.result
@@ -0,0 +1,15 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+connection node_2;
+SELECT * FROM t1;
+f1
+1
+SET GLOBAL wsrep_cluster_address='';
+SET SESSION wsrep_on=0;
+INSERT INTO t1 VALUES (2);
+DELETE FROM t1 WHERE f1 = 2;
+connection node_1;
+INSERT INTO t1 VALUES (2);
+connection node_2;
+connection node_1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-388.result b/mysql-test/suite/galera/r/MW-388.result
index 2785c1d0326..59d499e117d 100644
--- a/mysql-test/suite/galera/r/MW-388.result
+++ b/mysql-test/suite/galera/r/MW-388.result
@@ -10,7 +10,7 @@ INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
INSERT INTO t1 VALUES (3, 'node 1');
END|
SET GLOBAL wsrep_slave_threads = 2;
-SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
+SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
connection node_2;
INSERT INTO t1 VALUES (1, 'node 2');;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
@@ -21,7 +21,7 @@ SET SESSION wsrep_sync_wait = 0;
CALL insert_proc ();;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
-SET GLOBAL debug_dbug = "";
+SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2;
connection node_1;
@@ -41,7 +41,7 @@ connection node_1;
SET GLOBAL wsrep_slave_threads = DEFAULT;
DROP TABLE t1;
DROP PROCEDURE insert_proc;
-SET GLOBAL debug_dbug = "";
+SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';
SELECT @@debug_sync;
@@debug_sync
diff --git a/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result b/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result
index d0fac1e3d14..91f45c93257 100644
--- a/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result
+++ b/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result
@@ -1,4 +1,6 @@
connection node_1;
+connection node_2;
+connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
CREATE PROCEDURE p1 ()
BEGIN
diff --git a/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result b/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result
deleted file mode 100644
index d0fac1e3d14..00000000000
--- a/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result
+++ /dev/null
@@ -1,47 +0,0 @@
-connection node_1;
-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();;
-connection node_2;
-CALL p1();;
-connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
-connection node_2a;
-Killing server ...
-INSERT INTO t1 VALUES (DEFAULT);
-connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
-connection node_1a;
-INSERT INTO t1 VALUES (DEFAULT);
-connection node_1;
-Got one of the listed errors
-connection node_2;
-Got one of the listed errors
-connection node_1a;
-connection node_2a;
-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
-connection node_1a;
-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_forced_binlog_format.result b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
index 2a31893ca1d..3653a311d83 100644
--- a/mysql-test/suite/galera/r/galera_forced_binlog_format.result
+++ b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
@@ -36,8 +36,8 @@ GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO `dummy`@`localhost`
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE testdb_9401;
diff --git a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff
deleted file mode 100644
index fa1b67e7ef3..00000000000
--- a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff
+++ /dev/null
@@ -1,103 +0,0 @@
---- r/galera_ist_innodb_flush_logs.result 2018-09-05 10:34:36.192439933 +0300
-+++ r/galera_ist_innodb_flush_logs.reject 2018-09-17 10:20:06.039150838 +0300
-@@ -86,3 +86,100 @@
- 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_innodb_flush_logs.result b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result
deleted file mode 100644
index 7813b5a58fc..00000000000
--- a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result
+++ /dev/null
@@ -1,96 +0,0 @@
-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;
-Killing server ...
-connection node_1;
-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;
-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;
-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;
-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;
-connection node_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_xtrabackup-v2,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2,debug.rdiff
deleted file mode 100644
index 56bc1fac08c..00000000000
--- a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2,debug.rdiff
+++ /dev/null
@@ -1,114 +0,0 @@
---- r/galera_ist_xtrabackup-v2.result 2018-11-26 17:10:55.580909234 +0200
-+++ r/galera_ist_xtrabackup-v2.reject 2018-11-27 10:20:41.213063054 +0200
-@@ -285,3 +285,111 @@
- 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
-+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;
-+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;
-+Killing server ...
-+connection node_1;
-+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;
-+Performing --wsrep-recover ...
-+connection node_2;
-+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;
-+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';
-+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;
-+connection node_1;
-+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
deleted file mode 100644
index 8a7c02ab1b6..00000000000
--- a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
+++ /dev/null
@@ -1,287 +0,0 @@
-connection node_1;
-connection node_2;
-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;
-Unloading wsrep provider ...
-SET GLOBAL wsrep_provider = 'none';
-connection node_1;
-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;
-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;
-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;
-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;
-connection node_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;
-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;
-Shutting down server ...
-connection node_1;
-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;
-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;
-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;
-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;
-connection node_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;
-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;
-Killing server ...
-connection node_1;
-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;
-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;
-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;
-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;
-connection node_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_roles.result b/mysql-test/suite/galera/r/galera_roles.result
index bef89acfc92..7d6c57e8131 100644
--- a/mysql-test/suite/galera/r/galera_roles.result
+++ b/mysql-test/suite/galera/r/galera_roles.result
@@ -26,8 +26,8 @@ connect foo_node_2,127.0.0.1,foo,,test,$port_2,;
connection foo_node_1;
SHOW GRANTS;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO '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;
@@ -62,8 +62,8 @@ pr1
connection foo_node_2;
SHOW GRANTS;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO '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;
@@ -129,7 +129,7 @@ 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'
+GRANT USAGE ON *.* TO `foo`@`localhost`
SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
ROLE_NAME
NULL
@@ -151,7 +151,7 @@ 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'
+GRANT USAGE ON *.* TO `foo`@`localhost`
SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
ROLE_NAME
NULL
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff
new file mode 100644
index 00000000000..f06da63561a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff
@@ -0,0 +1,116 @@
+--- r/galera_sst_mariabackup_data_dir.result 2018-12-12 13:59:56.525554689 +0100
++++ r/galera_sst_mariabackup_data_dir.reject 2018-12-12 14:33:50.868181956 +0100
+@@ -286,5 +286,113 @@
+ 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
++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;
++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;
++Killing server ...
++connection node_1;
++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;
++Performing --wsrep-recover ...
++connection node_2;
++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;
++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';
++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;
++connection node_1;
++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;
+ disconnect node_2;
+ disconnect node_1;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result
index fdb5883b590..fdb5883b590 100644
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
deleted file mode 100644
index 8b091eb370a..00000000000
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
+++ /dev/null
@@ -1,116 +0,0 @@
---- galera_sst_mariabackup.result
-+++ galera_sst_mariabackup,debug.reject
-@@ -286,5 +286,113 @@
- 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
-+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;
-+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;
-+Killing server ...
-+connection node_1;
-+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;
-+Performing --wsrep-recover ...
-+connection node_2;
-+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;
-+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';
-+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;
-+connection node_1;
-+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;
- disconnect node_2;
- disconnect node_1;
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
deleted file mode 100644
index 990e0a29506..00000000000
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result
+++ /dev/null
@@ -1,3 +0,0 @@
-SELECT 1;
-1
-1
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
deleted file mode 100644
index ac232020037..00000000000
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
+++ /dev/null
@@ -1,103 +0,0 @@
---- r/galera_sst_xtrabackup-v2_data_dir.result 2018-11-19 12:27:24.795221479 +0200
-+++ r/galera_sst_xtrabackup-v2_data_dir.reject 2018-11-19 19:15:38.774008404 +0200
-@@ -260,3 +260,100 @@
- 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_data_dir.result b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result
deleted file mode 100644
index cec0f21ee22..00000000000
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result
+++ /dev/null
@@ -1,262 +0,0 @@
-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;
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
deleted file mode 100644
index 990e0a29506..00000000000
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result
+++ /dev/null
@@ -1,3 +0,0 @@
-SELECT 1;
-1
-1
diff --git a/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-test/suite/galera/r/galera_sync_wait_show.result
index e1d6dd9d61d..def771ff88d 100644
--- a/mysql-test/suite/galera/r/galera_sync_wait_show.result
+++ b/mysql-test/suite/galera/r/galera_sync_wait_show.result
@@ -35,7 +35,7 @@ CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
connection node_2;
SHOW FUNCTION CODE f1;
Pos Instruction
-0 freturn 3 123
+0 freturn int 123
DROP FUNCTION f1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result
index f1d32aa8f69..a7c1e7d6e9d 100644
--- a/mysql-test/suite/galera/r/lp1376747-4.result
+++ b/mysql-test/suite/galera/r/lp1376747-4.result
@@ -3,18 +3,13 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
FLUSH TABLE WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
connection node_2a;
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+# node_1 DDL should not yet be applied
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -24,6 +19,7 @@ t1 CREATE TABLE `t1` (
FLUSH TABLES t1 WITH READ LOCK;;
connection node_2;
UNLOCK TABLES;
+# node_1 DDL should not yet be applied 2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -32,6 +28,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection node_2a;
UNLOCK TABLES;
+# node_1 DDL should be applied 2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/galera/r/versioning_trx_id.result b/mysql-test/suite/galera/r/versioning_trx_id.result
new file mode 100644
index 00000000000..f15916e51a5
--- /dev/null
+++ b/mysql-test/suite/galera/r/versioning_trx_id.result
@@ -0,0 +1,52 @@
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connection node_1;
+create table t1 (a int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) engine=InnoDB with system versioning;
+insert into t1 (a) values (1),(2);
+connection node_2;
+insert into t1 (a) values (3),(4);
+select a from t1;
+a
+1
+2
+3
+4
+select count(*) from mysql.transaction_registry where begin_timestamp='0-0-0';
+count(*)
+0
+select count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+count(*)
+0
+connection node_3;
+insert into t1 (a) values (5),(6);
+select a from t1;
+a
+1
+2
+3
+4
+5
+6
+select count(*) from mysql.transaction_registry where begin_timestamp='0-0-0';
+count(*)
+0
+select count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+count(*)
+0
+connection node_1;
+select a from t1;
+a
+1
+2
+3
+4
+5
+6
+select count(*) from mysql.transaction_registry where begin_timestamp='0-0-0';
+count(*)
+0
+select count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+count(*)
+0
+drop table t1;
+disconnect node_2;
+disconnect node_1;
diff --git a/mysql-test/suite/galera/t/MDEV-15443.cnf b/mysql-test/suite/galera/t/MDEV-15443.cnf
new file mode 100644
index 00000000000..88a08203d01
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-15443.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+[mysqld.1]
+wsrep_auto_increment_control=OFF
+[mysqld.2]
+wsrep_auto_increment_control=OFF
diff --git a/mysql-test/suite/galera/t/MDEV-15443.test b/mysql-test/suite/galera/t/MDEV-15443.test
new file mode 100644
index 00000000000..06a006326d9
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-15443.test
@@ -0,0 +1,53 @@
+#
+# MDEV-15443
+#
+# If transactions are executed into InnoDB without wsrep_on,
+# rseg header trx_id gets incremented and the rseg header
+# corresponding to maximum trx_id may store undefined wsrep XID.
+# When the wsrep XID is read from the storage engine,
+# undefined XID may returned instead the valid one.
+#
+# This test demonstrates the problem by taking a node_2 out
+# of the cluster and writing and deleting a row with
+# wsrep_on=0. When the bug is present, node_2 will fail to
+# rejoin the cluster because an invalid XID is read from the
+# storage engine after startup/recovery.
+#
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+# Initialize table on node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+# Go to node_2, verify that the previous INSERT completed.
+# Take node_2 out of the cluster, insert and delete a record
+# on a table with wsrep_on.
+--connection node_2
+SELECT * FROM t1;
+SET GLOBAL wsrep_cluster_address='';
+SET SESSION wsrep_on=0;
+INSERT INTO t1 VALUES (2);
+DELETE FROM t1 WHERE f1 = 2;
+
+# Shutdown node_2
+--source include/shutdown_mysqld.inc
+
+# On node_1, verify that the node has left the cluster.
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Insert into t1 to enforce IST on node_2 when it is restarted.
+INSERT INTO t1 VALUES (2);
+
+# Restart node_2
+--connection node_2
+--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
+--source include/wait_condition.inc
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-388.test b/mysql-test/suite/galera/t/MW-388.test
index 670674bbae5..b88f53ca8d9 100644
--- a/mysql-test/suite/galera/t/MW-388.test
+++ b/mysql-test/suite/galera/t/MW-388.test
@@ -31,7 +31,7 @@ DELIMITER ;|
# local monitor, and our INSERT remains stuck there.
SET GLOBAL wsrep_slave_threads = 2;
-SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
+SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
--let $expected_cert_failures = `SELECT VARIABLE_VALUE + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'`
@@ -51,7 +51,8 @@ SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_cert_failures FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'
--source include/wait_condition.inc
-SET GLOBAL debug_dbug = "";
+
+SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
--connection node_2
@@ -71,7 +72,7 @@ SET GLOBAL wsrep_slave_threads = DEFAULT;
DROP TABLE t1;
DROP PROCEDURE insert_proc;
-SET GLOBAL debug_dbug = "";
+SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';
# Make sure no pending signals are leftover to surprise subsequent tests.
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf
index 7e557717744..bd6bf9d4f98 100644
--- a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf
@@ -9,4 +9,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore
[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_mariabackup.test b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test
index c8e053dc2b6..d4d8291ae7d 100644
--- a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test
@@ -8,6 +8,10 @@
--source include/have_innodb.inc
--source include/have_mariabackup.inc
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
--connection node_1
--let $connection_id = `SELECT CONNECTION_ID()`
@@ -89,3 +93,7 @@ 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");
+
+--let $node_1=node_1a
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
deleted file mode 100644
index 7da7dd4e73b..00000000000
--- a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
+++ /dev/null
@@ -1,13 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth="root:"
-innodb_safe_truncate=OFF
-
-[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
deleted file mode 100644
index cd7621bfa6e..00000000000
--- a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Test that autoincrement works correctly while the cluster membership
-# is changing and SST takes place.
-#
-
---source include/big_test.inc
---source include/galera_cluster.inc
---source include/have_innodb.inc
---source include/have_xtrabackup.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_binlog_event_max_size_max.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf
index 7d87a0d0078..9315086a3cc 100644
--- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf
@@ -1,7 +1,7 @@
!include ../galera_2nodes.cnf
[mysqld.1]
-binlog-row-event-max-size=4294967295
+binlog-row-event-max-size=4294967040
[mysqld.2]
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
deleted file mode 100644
index b91c897e66e..00000000000
--- a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
+++ /dev/null
@@ -1,15 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth=root:
-innodb_safe_truncate=OFF
-
-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
deleted file mode 100644
index 839383ebfc1..00000000000
--- a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# 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 include/have_xtrabackup.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
deleted file mode 100644
index 52df3814129..00000000000
--- a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
+++ /dev/null
@@ -1,14 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth=root:
-innodb_safe_truncate=OFF
-
-
-[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
deleted file mode 100644
index 34961765008..00000000000
--- a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test
+++ /dev/null
@@ -1,15 +0,0 @@
---source include/big_test.inc
---source include/galera_cluster.inc
---source include/have_innodb.inc
---source include/have_xtrabackup.inc
-
---let $node_1=node_1
---let $node_2=node_2
---source include/auto_increment_offset_save.inc
-
---source suite/galera/include/galera_st_disconnect_slave.inc
---source suite/galera/include/galera_st_shutdown_slave.inc
-
---source suite/galera/include/galera_st_kill_slave.inc
---source suite/galera/include/galera_st_kill_slave_ddl.inc
---source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_load_data.cnf b/mysql-test/suite/galera/t/galera_load_data.cnf
index fd0327e0ecb..14d894fc7d0 100644
--- a/mysql-test/suite/galera/t/galera_load_data.cnf
+++ b/mysql-test/suite/galera/t/galera_load_data.cnf
@@ -1,6 +1,15 @@
!include ../galera_2nodes.cnf
-[mysqld]
+[mysqld.1]
+secure-file-priv = ""
+innodb_file_format ='Barracuda'
+innodb_file_per_table = ON
+innodb_stats_persistent=ON
+innodb_stats_auto_recalc=ON
+innodb_stats_persistent_sample_pages=20
+innodb_stats_sample_pages=8
+
+[mysqld.2]
secure-file-priv = ""
innodb_file_format ='Barracuda'
innodb_file_per_table = ON
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf
new file mode 100644
index 00000000000..aeb2301925e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf
@@ -0,0 +1,17 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+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]
+innodb_data_home_dir=@ENV.MYSQL_TMP_DIR/data_dir_test
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
+streamfmt=xbstream
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.test
new file mode 100644
index 00000000000..aad68460c34
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.test
@@ -0,0 +1,23 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+
+# cleanup temporary database files:
+--remove_files_wildcard $MYSQL_TMP_DIR/data_dir_test *
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
deleted file mode 100644
index af3a7aecec4..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
+++ /dev/null
@@ -1,26 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth="root:"
-wsrep_debug=ON
-innodb_safe_truncate=OFF
-
-[xtrabackup]
-backup-locks
-close-files
-#compact - disabled in xtrabackup 2.4, https://bugs.launchpad.net/percona-xtrabackup/+bug/1192834/comments/29
-# 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
-transferfmt=@ENV.MTR_GALERA_TFMT
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
deleted file mode 100644
index db2b706b6b8..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# 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/galera_cluster.inc
---source include/have_innodb.inc
---source include/have_xtrabackup.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
deleted file mode 100644
index e347e259897..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf
+++ /dev/null
@@ -1,16 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth="root:"
-wsrep_debug=ON
-innodb_safe_truncate=OFF
-
-[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'
-
-[sst]
-transferfmt=@ENV.MTR_GALERA_TFMT
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
deleted file mode 100644
index c270e4d0b19..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
+++ /dev/null
@@ -1,20 +0,0 @@
---source include/big_test.inc
---source include/galera_cluster.inc
---source include/have_innodb.inc
---source include/have_xtrabackup.inc
-
-# Save original auto_increment_offset values.
---let $node_1=node_1
---let $node_2=node_2
---source include/auto_increment_offset_save.inc
-
---source suite/galera/include/galera_st_shutdown_slave.inc
---source suite/galera/include/galera_st_clean_slave.inc
-
---source suite/galera/include/galera_st_kill_slave.inc
---source suite/galera/include/galera_st_kill_slave_ddl.inc
-
-# Restore original auto_increment_offset values.
---source include/auto_increment_offset_restore.inc
-
---source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.cnf
deleted file mode 100644
index 43180173425..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.cnf
+++ /dev/null
@@ -1,17 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth="root:"
-wsrep_debug=ON
-innodb_safe_truncate=OFF
-
-[mysqld.1]
-wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
-
-[mysqld.2]
-innodb_data_home_dir=@ENV.MYSQL_TMP_DIR/rsync_test_2
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
-
-[sst]
-transferfmt=@ENV.MTR_GALERA_TFMT
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.test
deleted file mode 100644
index 135bc2a39f7..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_data_dir.test
+++ /dev/null
@@ -1,23 +0,0 @@
---source include/big_test.inc
---source include/galera_cluster.inc
---source include/have_innodb.inc
---source include/have_xtrabackup.inc
-
-# Save original auto_increment_offset values.
---let $node_1=node_1
---let $node_2=node_2
---source include/auto_increment_offset_save.inc
-
---source suite/galera/include/galera_st_shutdown_slave.inc
---source suite/galera/include/galera_st_clean_slave.inc
-
---source suite/galera/include/galera_st_kill_slave.inc
---source suite/galera/include/galera_st_kill_slave_ddl.inc
-
-# Restore original auto_increment_offset values.
---source include/auto_increment_offset_restore.inc
-
---source include/galera_end.inc
-
-# cleanup temporary database files:
---remove_files_wildcard $MYSQL_TMP_DIR/rsync_test_2 *
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
deleted file mode 100644
index 792b0d15ac4..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
+++ /dev/null
@@ -1,13 +0,0 @@
-!include ../galera_2nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth="root:"
-wsrep_debug=ON
-innodb_safe_truncate=OFF
-
-[SST]
-tkey=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
-tcert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
-encrypt=3
-transferfmt=@ENV.MTR_GALERA_TFMT
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
deleted file mode 100644
index 2f685ca7184..00000000000
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# 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
---source include/have_xtrabackup.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/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test
index 6ae89fe9df4..7cf922b97e5 100644
--- a/mysql-test/suite/galera/t/lp1376747-4.test
+++ b/mysql-test/suite/galera/t/lp1376747-4.test
@@ -17,7 +17,6 @@ INSERT INTO t1 VALUES (1);
--connection node_2
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
FLUSH TABLE WITH READ LOCK;
--connection node_1
@@ -26,16 +25,19 @@ INSERT INTO t1 VALUES (2,3);
--connection node_2a
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
+--echo # node_1 DDL should not yet be applied
SHOW CREATE TABLE t1;
+
--send FLUSH TABLES t1 WITH READ LOCK;
--connection node_2
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%';
--source include/wait_condition.inc
UNLOCK TABLES;
+
+--echo # node_1 DDL should not yet be applied 2
SHOW CREATE TABLE t1;
--connection node_2a
@@ -45,6 +47,10 @@ UNLOCK TABLES;
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--echo # node_1 DDL should be applied 2
SHOW CREATE TABLE t1;
SELECT * from t1;
diff --git a/mysql-test/suite/galera/t/versioning_trx_id.cnf b/mysql-test/suite/galera/t/versioning_trx_id.cnf
new file mode 100644
index 00000000000..f7aecd36bf8
--- /dev/null
+++ b/mysql-test/suite/galera/t/versioning_trx_id.cnf
@@ -0,0 +1 @@
+!include ../galera_4nodes.cnf
diff --git a/mysql-test/suite/galera/t/versioning_trx_id.test b/mysql-test/suite/galera/t/versioning_trx_id.test
new file mode 100644
index 00000000000..175ead265a5
--- /dev/null
+++ b/mysql-test/suite/galera/t/versioning_trx_id.test
@@ -0,0 +1,28 @@
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
+--connection node_1
+create table t1 (a int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) engine=InnoDB with system versioning;
+insert into t1 (a) values (1),(2);
+
+--connection node_2
+insert into t1 (a) values (3),(4);
+select a from t1;
+select count(*) from mysql.transaction_registry where begin_timestamp='0-0-0';
+select count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+
+--connection node_3
+insert into t1 (a) values (5),(6);
+select a from t1;
+select count(*) from mysql.transaction_registry where begin_timestamp='0-0-0';
+select count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+
+--connection node_1
+select a from t1;
+select count(*) from mysql.transaction_registry where begin_timestamp='0-0-0';
+select count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+
+drop table t1;
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result
index 53e35939a79..5a844537327 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result
@@ -4,15 +4,20 @@ VARIABLE_VALUE LIKE '%[::1]%'
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
+connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
DROP TABLE t1;
+connection node_1;
include/assert_grep.inc [Streaming the backup to joiner at \[::1\]]
include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:]
+connection node_2;
include/assert_grep.inc [IST receiver addr using tcp://\[::1\]]
include/assert_grep.inc [Prepared IST receiver, listening at: tcp://\[::1\]]
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result
deleted file mode 100644
index 5665ed5f46a..00000000000
--- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result
+++ /dev/null
@@ -1,22 +0,0 @@
-SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
-VARIABLE_VALUE LIKE '%[::1]%'
-1
-SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 3
-1
-connection node_2;
-SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
-connection node_1;
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-connection node_2;
-SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
-1
-DROP TABLE t1;
-connection node_1;
-include/assert_grep.inc [Streaming the backup to joiner at \[::1\]]
-include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:]
-include/assert_grep.inc [IST receiver addr using tcp://\[::1\]]
-include/assert_grep.inc [Prepared IST receiver, listening at: tcp://\[::1\]]
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf
deleted file mode 100644
index 78fbd793aa0..00000000000
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf
+++ /dev/null
@@ -1,29 +0,0 @@
-!include ../galera_3nodes.cnf
-
-[mysqld]
-wsrep_sst_method=xtrabackup-v2
-wsrep_sst_auth="root:"
-wsrep_node_address=::1
-
-[mysqld.1]
-wsrep-cluster-address=gcomm://
-wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
-wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
-wsrep_node_incoming_address='[::1]:@mysqld.1.port'
-
-[mysqld.2]
-wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
-wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
-wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
-wsrep_node_incoming_address='[::1]:@mysqld.2.port'
-
-[mysqld.3]
-wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
-wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
-wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
-wsrep_node_incoming_address='[::1]:@mysqld.3.port'
-
-[SST]
-transferfmt=@ENV.MTR_GALERA_TFMT
-streamfmt=xbstream
-sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.opt
deleted file mode 100644
index c195dd0f35b..00000000000
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.opt
+++ /dev/null
@@ -1 +0,0 @@
---bind-address=:: --skip-innodb-safe-truncate
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test
deleted file mode 100644
index fd7e0c50887..00000000000
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test
+++ /dev/null
@@ -1,58 +0,0 @@
---source include/galera_cluster.inc
---source include/check_ipv6.inc
-
-# Confirm that initial handshake happened over ipv6
-
-SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
-SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
-# Force IST
-
---connection node_2
-SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
-
---connection node_1
---let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
---source include/wait_condition.inc
-
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-
---connection node_2
-SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
-
---let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
---source include/wait_condition.inc
-
---let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
---source include/wait_condition.inc
-
-SELECT COUNT(*) = 1 FROM t1;
-
-DROP TABLE t1;
-
-# Confirm that key messages around SST and IST reference IPv6
-
---connection node_1
---let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
---let $assert_only_after = CURRENT_TEST
-
---let $assert_count = 2
---let $assert_text = Streaming the backup to joiner at \[::1\]
---let $assert_select = Streaming the backup to joiner at \[::1\]
---source include/assert_grep.inc
-
---let $assert_count = 1
---let $assert_text = async IST sender starting to serve tcp://\[::1\]:
---let $assert_select = async IST sender starting to serve tcp://\[::1\]:
---source include/assert_grep.inc
-
---let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
-
---let $assert_text = IST receiver addr using tcp://\[::1\]
---let $assert_select = IST receiver addr using tcp://\[::1\]
---source include/assert_grep.inc
-
---let $assert_text = Prepared IST receiver, listening at: tcp://\[::1\]
---let $assert_select = Prepared IST receiver, listening at: tcp://\[::1\]
---source include/assert_grep.inc
diff --git a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
index 88091ce42a4..9435551ce6f 100644
--- a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
@@ -111,7 +111,7 @@ create table t1 (a int, b int generated always as (sleep(a)) virtual);
--echo # VALUES()
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
-create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual);
+create table t1 (a varchar(1024), b varchar(1024) generated always as (value(a)) virtual);
--echo # Stored procedures
diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
index 27270654e9b..fa8f2660aef 100644
--- a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
@@ -70,8 +70,8 @@ ERROR HY000: Function or expression 'row_count()' cannot be used in the GENERATE
create table t1 (a int, b int generated always as (sleep(a)) virtual);
ERROR HY000: Function or expression 'sleep()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# VALUES()
-create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual);
-ERROR HY000: Function or expression 'values()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+create table t1 (a varchar(1024), b varchar(1024) generated always as (value(a)) virtual);
+ERROR HY000: Function or expression 'value()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# Stored procedures
create procedure p1()
begin
diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
index 24fd3b988c2..b777bb485de 100644
--- a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
@@ -72,8 +72,8 @@ ERROR HY000: Function or expression 'row_count()' cannot be used in the GENERATE
create table t1 (a int, b int generated always as (sleep(a)) virtual);
ERROR HY000: Function or expression 'sleep()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# VALUES()
-create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual);
-ERROR HY000: Function or expression 'values()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+create table t1 (a varchar(1024), b varchar(1024) generated always as (value(a)) virtual);
+ERROR HY000: Function or expression 'value()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# Stored procedures
create procedure p1()
begin
diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
index ee80e5f605a..a98652248f8 100644
--- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
@@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -94,7 +94,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -114,7 +114,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@@ -136,7 +136,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -158,7 +158,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int generated always as (a % 2) virtual);
@@ -168,7 +168,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
drop table t2;
@@ -191,7 +191,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -203,7 +203,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -216,7 +216,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
index 09e5b617af1..82a879be3f7 100644
--- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
@@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -94,7 +94,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -114,7 +114,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@@ -136,7 +136,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -158,7 +158,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int generated always as (a % 2) virtual);
@@ -168,7 +168,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t2;
@@ -191,7 +191,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -203,7 +203,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -216,7 +216,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
index 04ba512aad9..b46515e1eae 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
@@ -691,6 +691,8 @@ a b c
1 127 0
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t ADD UNIQUE INDEX (c(1));
+Warnings:
+Warning 1264 Out of range value for column 'b' at row 1
SELECT * FROM t WHERE c = '0';
a b c
1 127 0
diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result
index d0a00b6221e..da1ecda5ca7 100644
--- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result
@@ -90,7 +90,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@@ -101,7 +101,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result
index 1ed96d0345b..9165fc31cf7 100644
--- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result
@@ -90,7 +90,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@@ -101,7 +101,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result
index bc9bddad690..81194cf7e13 100644
--- a/mysql-test/suite/gcol/r/gcol_select_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result
@@ -691,8 +691,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
@@ -746,8 +746,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
@@ -802,8 +802,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
@@ -866,8 +866,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result
index d0fe7fbd0d4..05d9fa3a244 100644
--- a/mysql-test/suite/gcol/r/gcol_select_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result
@@ -1102,7 +1102,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 AS t2 STRAIGHT_JOIN t1 FORCE INDEX(b) WHERE t1.b=t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL b NULL NULL NULL 2 Using where
-1 SIMPLE t1 ref b b 5 test.t2.b 2
+1 SIMPLE t1 eq_ref b b 5 test.t2.b 1
EXPLAIN SELECT b FROM t1 FORCE INDEX(b);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL b 5 NULL 2 Using index
@@ -1313,8 +1313,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
@@ -1369,8 +1369,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY,v_idx,v_idx2 PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
@@ -1427,8 +1427,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY,v_idx2 PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
@@ -1494,8 +1494,8 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
index f8f447d493d..fbdd663d721 100644
--- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
@@ -393,7 +393,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert into t1 values (11,default);
@@ -410,7 +410,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert into t1 values (11,default);
@@ -915,7 +915,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) DEFAULT NULL,
- `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL
+ `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,octet_length(`a`),octet_length(`b`),`b`)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('start,','end',default);
select * from t1;
@@ -978,7 +978,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (octet_length(`a`)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('text',default);
select * from t1;
@@ -1142,7 +1142,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (octet_length(`a`)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('text',default);
select * from t1;
diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
index 9db5f0c7c38..c92760f75b5 100644
--- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
@@ -393,7 +393,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert into t1 values (11,default);
@@ -410,7 +410,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert into t1 values (11,default);
@@ -915,7 +915,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) DEFAULT NULL,
- `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL
+ `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,octet_length(`a`),octet_length(`b`),`b`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('start,','end',default);
select * from t1;
@@ -978,7 +978,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (octet_length(`a`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('text',default);
select * from t1;
@@ -1142,7 +1142,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (octet_length(`a`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('text',default);
select * from t1;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
index 523f89fc197..4e8adbd88e6 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
@@ -546,9 +546,9 @@ t1 CREATE TABLE `t1` (
`col2` int(11) NOT NULL,
`col3` int(11) NOT NULL,
`col4` int(11) DEFAULT NULL,
- `col5` int(11) GENERATED ALWAYS AS (`col2` % `col3`) VIRTUAL,
+ `col5` int(11) GENERATED ALWAYS AS (`col2` MOD `col3`) VIRTUAL,
`col7` int(11) GENERATED ALWAYS AS (`col5` * `col5`) VIRTUAL,
- `col8` int(11) GENERATED ALWAYS AS (`col5` % `col5`) VIRTUAL,
+ `col8` int(11) GENERATED ALWAYS AS (`col5` MOD `col5`) VIRTUAL,
`col9` text DEFAULT NULL,
`col6` int(11) DEFAULT NULL,
UNIQUE KEY `uidx` (`col5`)
@@ -895,8 +895,6 @@ DROP TABLE t;
CREATE TABLE t(a TEXT CHARSET UTF8)ENGINE=INNODB;
ALTER TABLE t ADD COLUMN b BLOB GENERATED ALWAYS AS (a) VIRTUAL ;
ALTER TABLE t ADD FULLTEXT INDEX (a) ;
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
ALTER TABLE t ADD INDEX (b(1)) ;
DROP TABLE t;
CREATE TABLE t(a TEXT CHARSET UTF8, FULLTEXT INDEX(a))ENGINE=INNODB;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
index c9d95dae579..a545b66a473 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
@@ -115,7 +115,7 @@ INSERT INTO t1(a, b) VALUES (8, 8);
# enable purge
COMMIT;
# wait for purge to process the deleted/updated records.
-InnoDB 1 transactions not purged
+InnoDB 2 transactions not purged
SET DEBUG_SYNC= 'now SIGNAL purged';
disconnect con1;
connection default;
@@ -208,6 +208,7 @@ DROP TABLE t1, t2;
# MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf
# on table with virtual columns and indexes
#
+InnoDB 0 transactions not purged
SET @saved_dbug= @@GLOBAL.debug_dbug;
set global debug_dbug= "d,ib_purge_virtual_mdev_16222_1,ib_purge_virtual_mdev_16222_2";
create table t1 (
@@ -217,10 +218,10 @@ engine innodb;
insert ignore into t1 (b) values ('foo');
select * into outfile 'load.data' from t1;
load data infile 'load.data' replace into table t1;
-set debug_sync= "now WAIT_FOR latch_released TIMEOUT 1";
+set debug_sync= "now WAIT_FOR latch_released";
set global debug_dbug= @saved_dbug;
drop table t1;
-set debug_sync= "now SIGNAL drop_started WAIT_FOR got_no_such_table TIMEOUT 1";
+set debug_sync= "now SIGNAL drop_started WAIT_FOR got_no_such_table";
create table t1 (
pk serial, vb tinyblob as (b) virtual, b tinyblob,
primary key(pk), index (vb(64)))
@@ -228,7 +229,7 @@ engine innodb;
insert ignore into t1 (b) values ('foo');
select * into outfile 'load.data' from t1;
load data infile 'load.data' replace into table t1;
-set debug_sync= "now WAIT_FOR got_no_such_table TIMEOUT 1";
+set debug_sync= "now WAIT_FOR got_no_such_table";
set global debug_dbug= @saved_dbug;
drop table t1;
set debug_sync=reset;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index cd079544ed0..3918cf95ae1 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -119,8 +119,6 @@ FULLTEXT KEY `ftsic` (`c`,`b`)
Warnings:
Note 1831 Duplicate index `vbidxcol_2`. This is deprecated and will be disallowed in a future release
ALTER TABLE ibstd_08 ADD COLUMN nc07006 BIGINT AUTO_INCREMENT NOT NULL , ADD KEY auto_nc07006(nc07006);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
DROP TABLE ibstd_08;
#
# Bug 22899305 - GCOLS: FAILING ASSERTION: !(COL->PRTYPE & 256)
@@ -183,8 +181,6 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col5x % col6x)
VIRTUAL, ADD FULLTEXT KEY ftidx ( col9 ), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY
CREATE FULLTEXT INDEX idx ON t1(col9);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col5x % col6x)
VIRTUAL, ADD FULLTEXT KEY ftidx ( col9 ), algorithm=inplace;
DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result b/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
index 7ebf25cf072..2e35698e47e 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
@@ -7,8 +7,6 @@ ROW_FORMAT=REDUNDANT;
INSERT INTO t4 SET i=1;
ALTER TABLE t4 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t4 ADD COLUMN k INT, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t4 ADD COLUMN k INT;
ALTER TABLE t4 DROP k, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t4 DROP INDEX v, LOCK=NONE;
@@ -16,8 +14,6 @@ ALTER TABLE t4 DROP k, LOCK=NONE;
INSERT INTO t3 SET i=1;
ALTER TABLE t3 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t3 ADD COLUMN k INT, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t3 ADD COLUMN k INT;
ALTER TABLE t3 DROP k, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t3 DROP INDEX v, LOCK=NONE;
@@ -25,8 +21,6 @@ ALTER TABLE t3 DROP k, LOCK=NONE;
INSERT INTO t2 SET i=1;
ALTER TABLE t2 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t2 ADD COLUMN k INT, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t2 ADD COLUMN k INT;
ALTER TABLE t2 DROP k, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t2 DROP INDEX v, LOCK=NONE;
@@ -34,8 +28,6 @@ ALTER TABLE t2 DROP k, LOCK=NONE;
INSERT INTO t1 SET i=1;
ALTER TABLE t1 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t1 ADD COLUMN k INT, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t1 ADD COLUMN k INT;
ALTER TABLE t1 DROP k, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t1 DROP INDEX v, LOCK=NONE;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
index 83bb5d067f3..00b942739b0 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/have_partition.inc
+--source include/big_test.inc
call mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual");
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.opt b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.opt
index 98a5a463ce4..a1207721427 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.opt
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.opt
@@ -1,2 +1 @@
---loose-innodb-safe-truncate=1
--innodb-purge-threads=1
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
index 238a4937e9f..3d91cd87cb9 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
@@ -156,7 +156,7 @@ INSERT INTO t1(a, b) VALUES (8, 8);
COMMIT;
--echo # wait for purge to process the deleted/updated records.
-let $wait_all_purged=1;
+let $wait_all_purged=2;
--source ../../innodb/include/wait_all_purged.inc
let $wait_all_purged=0;
@@ -264,6 +264,7 @@ DROP TABLE t1, t2;
--echo # on table with virtual columns and indexes
--echo #
+--source suite/innodb/include/wait_all_purged.inc
--let $datadir= `select @@datadir`
SET @saved_dbug= @@GLOBAL.debug_dbug;
set global debug_dbug= "d,ib_purge_virtual_mdev_16222_1,ib_purge_virtual_mdev_16222_2";
@@ -278,23 +279,12 @@ insert ignore into t1 (b) values ('foo');
select * into outfile 'load.data' from t1;
load data infile 'load.data' replace into table t1;
-# FIXME: case does not work on 10.2 as it does not pass this condition:
-#
-# if (!*table)
-# *table= innodb_find_table_for_vc(thd, index->table);
-#
-# in innobase_allocate_row_for_vcol()
-
---disable_warnings
-set debug_sync= "now WAIT_FOR latch_released TIMEOUT 1";
---enable_warnings
+set debug_sync= "now WAIT_FOR latch_released";
set global debug_dbug= @saved_dbug;
drop table t1;
--remove_file $datadir/test/load.data
---disable_warnings
-set debug_sync= "now SIGNAL drop_started WAIT_FOR got_no_such_table TIMEOUT 1";
---enable_warnings
+set debug_sync= "now SIGNAL drop_started WAIT_FOR got_no_such_table";
create table t1 (
pk serial, vb tinyblob as (b) virtual, b tinyblob,
@@ -306,9 +296,7 @@ insert ignore into t1 (b) values ('foo');
select * into outfile 'load.data' from t1;
load data infile 'load.data' replace into table t1;
---disable_warnings
-set debug_sync= "now WAIT_FOR got_no_such_table TIMEOUT 1";
---enable_warnings
+set debug_sync= "now WAIT_FOR got_no_such_table";
# FIXME: Race condition here:
# 1. purge thread goes into sending got_no_such_table
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test b/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
index 8eaefbe5ec0..37ab82c46db 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
@@ -14,9 +14,7 @@ while ($n)
{
eval INSERT INTO t$n SET i=1;
eval ALTER TABLE t$n ADD INDEX(v), LOCK=NONE;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
eval ALTER TABLE t$n ADD COLUMN k INT, LOCK=NONE;
-eval ALTER TABLE t$n ADD COLUMN k INT;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
eval ALTER TABLE t$n DROP k, LOCK=NONE;
eval ALTER TABLE t$n DROP INDEX v, LOCK=NONE;
diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result
index fc42e43f710..9679b48a367 100644
--- a/mysql-test/suite/handler/heap.result
+++ b/mysql-test/suite/handler/heap.result
@@ -1738,7 +1738,7 @@ connection default;
CREATE TABLE t1(a INT, b INT, KEY(a), KEY b using btree (b), KEY ab using btree(a, b)) engine=memory;
INSERT INTO t1 VALUES (2, 20), (2,20), (1, 10), (4, 40), (3, 30), (5,50), (6,50);
HANDLER t1 OPEN;
-HANDLER t1 READ a>=(2) limit 3;
+HANDLER t1 READ a=(2) limit 3;
a b
2 20
2 20
@@ -1841,3 +1841,22 @@ ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this op
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.3 tests
+#
+# MDEV-15813 ASAN use-after-poison in hp_hashnr upon
+# HANDLER READ on a versioned HEAP table
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, CONSTRAINT PRIMARY KEY (a, b), UNIQUE ba(b, a) USING HASH) ENGINE=HEAP;
+INSERT INTO t1 VALUES (1, 10), (2, 20), (3,30), (4,40);
+HANDLER t1 OPEN AS m;
+HANDLER m READ `PRIMARY`= (3,30);
+a b
+3 30
+HANDLER m READ `PRIMARY`> (3,30);
+ERROR HY000: HASH index `PRIMARY` does not support this operation
+HANDLER m READ `ba`= (30,3);
+a b
+3 30
+HANDLER m READ `ba`= (30);
+ERROR HY000: HASH index `ba` does not support this operation
+HANDLER m CLOSE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/handler/heap.test b/mysql-test/suite/handler/heap.test
index bc070cf743f..d60f92daa76 100644
--- a/mysql-test/suite/handler/heap.test
+++ b/mysql-test/suite/handler/heap.test
@@ -18,7 +18,7 @@ CREATE TABLE t1(a INT, b INT, KEY(a), KEY b using btree (b), KEY ab using btree(
INSERT INTO t1 VALUES (2, 20), (2,20), (1, 10), (4, 40), (3, 30), (5,50), (6,50);
HANDLER t1 OPEN;
-HANDLER t1 READ a>=(2) limit 3;
+HANDLER t1 READ a=(2) limit 3;
HANDLER t1 READ a PREV;
HANDLER t1 READ a PREV;
HANDLER t1 READ a PREV;
@@ -85,3 +85,21 @@ HANDLER t1 CLOSE;
DROP TABLE t1;
--echo End of 5.3 tests
+
+--echo #
+--echo # MDEV-15813 ASAN use-after-poison in hp_hashnr upon
+--echo # HANDLER READ on a versioned HEAP table
+--echo #
+
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, CONSTRAINT PRIMARY KEY (a, b), UNIQUE ba(b, a) USING HASH) ENGINE=HEAP;
+INSERT INTO t1 VALUES (1, 10), (2, 20), (3,30), (4,40);
+HANDLER t1 OPEN AS m;
+HANDLER m READ `PRIMARY`= (3,30);
+--error ER_KEY_DOESNT_SUPPORT
+HANDLER m READ `PRIMARY`> (3,30);
+HANDLER m READ `ba`= (30,3);
+--error ER_KEY_DOESNT_SUPPORT
+HANDLER m READ `ba`= (30);
+HANDLER m CLOSE;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/handler/innodb.test b/mysql-test/suite/handler/innodb.test
index d752da7dc31..6527c4bb8bb 100644
--- a/mysql-test/suite/handler/innodb.test
+++ b/mysql-test/suite/handler/innodb.test
@@ -9,11 +9,6 @@
# rename t/innodb_handler.test to t/handler_innodb.test
#
-if (`select plugin_auth_version < "5.6.15" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB before 5.6.15
-}
-
--source include/have_innodb.inc
let $engine_type= InnoDB;
diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result
index a4ac32c16b4..c4a169be185 100644
--- a/mysql-test/suite/handler/interface.result
+++ b/mysql-test/suite/handler/interface.result
@@ -312,3 +312,25 @@ Note 1050 Table 'v' already exists
handler v read next;
ERROR 42S02: Unknown table 'v' in HANDLER
drop view v;
+#
+# MDEV-15813 ASAN use-after-poison in hp_hashnr upon
+# HANDLER READ on a versioned HEAP table
+#
+CREATE TABLE t1 (g GEOMETRY NOT NULL, SPATIAL gi(g));
+INSERT INTO t1 VALUES (POINT(0,0));
+HANDLER t1 OPEN AS h;
+HANDLER h READ `gi`= (10);
+ERROR HY000: SPATIAL index `gi` does not support this operation
+HANDLER h READ `gi`> (10);
+ERROR HY000: SPATIAL index `gi` does not support this operation
+HANDLER h CLOSE;
+DROP TABLE t1;
+CREATE TABLE t1 (w VARCHAR(100), FULLTEXT fk(w));
+INSERT INTO t1 VALUES ('one two three');
+HANDLER t1 OPEN AS h;
+HANDLER h READ `fk`= (10);
+ERROR HY000: FULLTEXT index `fk` does not support this operation
+HANDLER h READ `fk`> (10);
+ERROR HY000: FULLTEXT index `fk` does not support this operation
+HANDLER h CLOSE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/handler/interface.test b/mysql-test/suite/handler/interface.test
index 2f576c9b291..15853dfdbf5 100644
--- a/mysql-test/suite/handler/interface.test
+++ b/mysql-test/suite/handler/interface.test
@@ -354,3 +354,28 @@ execute stmt;
--error ER_UNKNOWN_TABLE
handler v read next;
drop view v;
+
+--echo #
+--echo # MDEV-15813 ASAN use-after-poison in hp_hashnr upon
+--echo # HANDLER READ on a versioned HEAP table
+--echo #
+
+CREATE TABLE t1 (g GEOMETRY NOT NULL, SPATIAL gi(g));
+INSERT INTO t1 VALUES (POINT(0,0));
+HANDLER t1 OPEN AS h;
+--error ER_KEY_DOESNT_SUPPORT
+HANDLER h READ `gi`= (10);
+--error ER_KEY_DOESNT_SUPPORT
+HANDLER h READ `gi`> (10);
+HANDLER h CLOSE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (w VARCHAR(100), FULLTEXT fk(w));
+INSERT INTO t1 VALUES ('one two three');
+HANDLER t1 OPEN AS h;
+--error ER_KEY_DOESNT_SUPPORT
+HANDLER h READ `fk`= (10);
+--error ER_KEY_DOESNT_SUPPORT
+HANDLER h READ `fk`> (10);
+HANDLER h CLOSE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result
index bab4b925972..158dd225bc0 100644
--- a/mysql-test/suite/heap/heap.result
+++ b/mysql-test/suite/heap/heap.result
@@ -715,9 +715,9 @@ drop table t1;
create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
show table status like 't_';
-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 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL 0 N
+t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL 0 N
drop table t1, t2;
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
diff --git a/mysql-test/suite/innodb/include/ibd_convert.pl b/mysql-test/suite/innodb/include/ibd_convert.pl
index bb9dfbe74b8..dfa29ee14d1 100644
--- a/mysql-test/suite/innodb/include/ibd_convert.pl
+++ b/mysql-test/suite/innodb/include/ibd_convert.pl
@@ -15,10 +15,31 @@ sub convert_to_mariadb_101
$badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
$badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE
- substr ($_, 54, 4) = pack("N", $badflags);
- # Replace the innodb_checksum_algorithm=none checksum
- substr ($_, 0, 4) = pack("N", 0xdeadbeef);
- substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
- syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
+ if ($badflags != $flags)
+ {
+ warn "$file: changing $flags to $badflags\n";
+ substr ($_, 54, 4) = pack("N", $badflags);
+ # Compute and replace the innodb_checksum_algorithm=crc32 checksum
+ my $polynomial = 0x82f63b78; # CRC-32C
+ if ($page_size == 1024)
+ {
+ # ROW_FORMAT=COMPRESSED
+ substr($_,0,4)=pack("N",
+ mycrc32(substr($_, 4, 12), 0, $polynomial) ^
+ mycrc32(substr($_, 24, 2), 0, $polynomial) ^
+ mycrc32(substr($_, 34, $page_size - 34), 0,
+ $polynomial));
+ }
+ else
+ {
+ my $ck=pack("N",
+ mycrc32(substr($_, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($_, 38, $page_size - 38 - 8), 0,
+ $polynomial));
+ substr($_, 0, 4) = $ck;
+ substr ($_, $page_size - 8, 4) = $ck;
+ }
+ syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
+ }
close(FILE);
}
diff --git a/mysql-test/suite/innodb/include/innodb-page-compression.inc b/mysql-test/suite/innodb/include/innodb-page-compression.inc
index 150d26e58cb..fec0f0cf01c 100644
--- a/mysql-test/suite/innodb/include/innodb-page-compression.inc
+++ b/mysql-test/suite/innodb/include/innodb-page-compression.inc
@@ -1,10 +1,5 @@
# This test is slow on buildbot.
--source include/big_test.inc
---disable_warnings
-set global innodb_file_format = `Barracuda`;
-set global innodb_file_per_table = on;
---enable_warnings
-
create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
diff --git a/mysql-test/suite/innodb/include/innodb_wl6501_crash.inc b/mysql-test/suite/innodb/include/innodb_wl6501_crash.inc
deleted file mode 100644
index 93eca7ec060..00000000000
--- a/mysql-test/suite/innodb/include/innodb_wl6501_crash.inc
+++ /dev/null
@@ -1,416 +0,0 @@
-#
-# WL#6501: make truncate table atomic
-#
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/big_test.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
-
-# suppress expected warnings.
-call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
-call mtr.add_suppression("Cannot create file '.*'");
-call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
-
-################################################################################
-#
-# Will test following scenarios:
-# 1. Hit crash point while writing redo log.
-# 2. Hit crash point on completion of redo log write.
-# 3. Hit crash point while dropping indexes.
-# 4. Hit crash point on completing drop of all indexes before creation of index
-# is commenced.
-# 5. Hit crash point while creating indexes.
-# 6. Hit crash point after data is updated to system-table and in-memory dict.
-# 7. Hit crash point before/after log checkpoint is done.
-#
-################################################################################
-
-#-----------------------------------------------------------------------------
-#
-# create test-bed
-#
-let $per_table = `select @@innodb_file_per_table`;
-
-eval set global innodb_file_per_table = on;
-let $WL6501_TMP_DIR = `select @@tmpdir`;
-let $WL6501_DATA_DIR = `select @@datadir`;
-let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
-
-#-----------------------------------------------------------------------------
-#
-# 1. Hit crash point while writing redo log.
-#
---echo "1. Hit crash point while writing redo log."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine=innodb row_format=$wl6501_row_fmt
- key_block_size=$wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-#-----------------------------------------------------------------------------
-#
-# 2. Hit crash point on completion of redo log write.
-#
---echo "2. Hit crash point on completion of redo log write."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-#-----------------------------------------------------------------------------
-#
-# 3. Hit crash point while dropping indexes.
-#
---echo "3. Hit crash point while dropping indexes."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-#
-#
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-#
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-#
-#
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-#-----------------------------------------------------------------------------
-#
-# 4. Hit crash point on completing drop of all indexes before creation of index
-# is commenced.
-#
---echo "4. Hit crash point on completing drop of all indexes before creation"
---echo " of index is commenced."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-#-----------------------------------------------------------------------------
-#
-# 5. Hit crash point while creating indexes.
-#
---echo "5. Hit crash point while creating indexes."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-#
-#
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-#
-#
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-#-----------------------------------------------------------------------------
-#
-# 6. Hit crash point after data is updated to system-table and in-memory dict.
-#
---echo "6. Hit crash point after data is updated to system-table and"
---echo " in-memory dict."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-#-----------------------------------------------------------------------------
-#
-# 7. Hit crash point before/after log checkpoint is done.
-#
---echo "7. Hit crash point before/after log checkpoint is done."
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_before_log_removal";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t where f < 2.5;
-drop table t;
-#
-#
-use test;
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-SET innodb_strict_mode=OFF;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_after_truncate_done";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-select * from t;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-select * from t where f < 2.5;
-drop table t;
-
-
-#-----------------------------------------------------------------------------
-#
-# remove test-bed
-#
-eval set global innodb_file_per_table = $per_table;
diff --git a/mysql-test/suite/innodb/include/innodb_wl6501_crash_temp.inc b/mysql-test/suite/innodb/include/innodb_wl6501_crash_temp.inc
deleted file mode 100644
index edec93b875c..00000000000
--- a/mysql-test/suite/innodb/include/innodb_wl6501_crash_temp.inc
+++ /dev/null
@@ -1,98 +0,0 @@
-#
-# WL#6501: make truncate table atomic
-#
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/big_test.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
-
-# suppress expected warnings
-call mtr.add_suppression("does not exist in the InnoDB internal");
-
-################################################################################
-#
-# Will test following scenarios:
-# 1. Hit crash point on completing drop of all indexes before creation of index
-# is commenced.
-# 2. Hit crash point after data is updated to system-table and in-memory dict.
-#
-################################################################################
-
-#-----------------------------------------------------------------------------
-#
-# create test-bed
-#
-let $per_table = `select @@innodb_file_per_table`;
-
-eval set global innodb_file_per_table = on;
-let $WL6501_TMP_DIR = `select @@tmpdir`;
-let $WL6501_DATA_DIR = `select @@datadir`;
-let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
-
-#-----------------------------------------------------------------------------
-#
-# 1. Hit crash point on completing drop of all indexes before creation of index
-# is commenced.
-#
---echo "1. Hit crash point on completing drop of all indexes before creation"
---echo " of index is commenced."
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-set innodb_strict_mode=off;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-
-#-----------------------------------------------------------------------------
-#
-# 2. Hit crash point after data is updated to system-table and in-memory dict.
-#
---echo "2. Hit crash point after data is updated to system-table and"
---echo " in-memory dict."
-eval set global innodb_file_per_table = $wl6501_file_per_table;
-set innodb_strict_mode=off;
---disable_warnings
-eval create $wl6501_temp table t (
- i int, f float, c char,
- primary key pk(i), unique findex(f), index ck(c))
- engine = innodb row_format = $wl6501_row_fmt
- key_block_size = $wl6501_kbs;
---enable_warnings
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-check table t;
-#
-set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
---source include/expect_crash.inc
---error 2013
-truncate table t;
-#
---source include/start_mysqld.inc
-check table t;
-
-#-----------------------------------------------------------------------------
-#
-# remove test-bed
-#
-eval set global innodb_file_per_table = $per_table;
diff --git a/mysql-test/suite/innodb/include/truncate_recover.inc b/mysql-test/suite/innodb/include/truncate_recover.inc
deleted file mode 100644
index fe068afa6e3..00000000000
--- a/mysql-test/suite/innodb/include/truncate_recover.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-begin;
-update t1 set c = 'MariaDB';
-update t1 set c = 'InnoDB';
-eval set global debug_dbug = '+d,$SEARCH_PATTERN';
-commit;
---source include/shutdown_mysqld.inc
---source include/search_pattern_in_file.inc
---source include/start_mysqld.inc
diff --git a/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff b/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
new file mode 100644
index 00000000000..a176a9af29e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
@@ -0,0 +1,155 @@
+--- alter_algorithm.result 2020-04-30 21:39:48.923115511 +0530
++++ alter_algorithm.reject 2020-04-30 21:45:04.131642093 +0530
+@@ -7,43 +7,43 @@
+ INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
+ SELECT @@alter_algorithm;
+ @@alter_algorithm
+-COPY
++INPLACE
+ # All the following cases needs table rebuild
+ # Add and Drop primary key
+ ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Make existing column NULLABLE
+ ALTER TABLE t1 MODIFY f2 INT;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Drop Stored Column
+ ALTER TABLE t1 DROP COLUMN f5;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Add base non-generated column as a last column in the compressed table
+ ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Add base non-generated column but not in the last position
+ ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Force the table to rebuild
+ ALTER TABLE t1 FORCE;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Row format changes
+ ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Engine table
+ ALTER TABLE t1 ENGINE=INNODB;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t1;
+ affected rows: 0
+ CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+@@ -56,22 +56,22 @@
+ FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
+ INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
+ ALTER TABLE t1 ADD INDEX idx1(f4), page_compressed=1;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 DROP INDEX idx, page_compression_level=5;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 ADD UNIQUE INDEX u1(f2);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 DROP INDEX f4, page_compression_level=9;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ SET foreign_key_checks = 0;
+ affected rows: 0
+ ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t2, t1;
+ affected rows: 0
+ CREATE TABLE t1(f1 INT NOT NULL,
+@@ -84,28 +84,27 @@
+ INSERT INTO t1(f1, f2) VALUES(1, 1);
+ # Add column at the end of the table
+ ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL';
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Change virtual column expression
+ ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Add virtual column
+ ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Rename Column
+ ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Rename table
+ ALTER TABLE t1 RENAME t3;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
+ # Drop Virtual Column
+ ALTER TABLE t3 DROP COLUMN vcol;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Column length varies
+ ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20);
+ affected rows: 0
+@@ -113,12 +112,12 @@
+ SET foreign_key_checks = 0;
+ affected rows: 0
+ ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ SET foreign_key_checks = 1;
+ affected rows: 0
+ ALTER TABLE t3 DROP FOREIGN KEY fidx;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t3, t2;
+ affected rows: 0
diff --git a/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff b/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
new file mode 100644
index 00000000000..414b7dc8b0c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
@@ -0,0 +1,142 @@
+--- alter_algorithm.result 2020-04-30 21:39:48.923115511 +0530
++++ alter_algorithm.reject 2020-04-30 21:47:08.245465018 +0530
+@@ -7,43 +7,35 @@
+ INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
+ SELECT @@alter_algorithm;
+ @@alter_algorithm
+-COPY
++INSTANT
+ # All the following cases needs table rebuild
+ # Add and Drop primary key
+ ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Make existing column NULLABLE
+ ALTER TABLE t1 MODIFY f2 INT;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Drop Stored Column
+ ALTER TABLE t1 DROP COLUMN f5;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Add base non-generated column as a last column in the compressed table
+ ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Add base non-generated column but not in the last position
+ ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Force the table to rebuild
+ ALTER TABLE t1 FORCE;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Row format changes
+ ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Engine table
+ ALTER TABLE t1 ENGINE=INNODB;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t1;
+ affected rows: 0
+ CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+@@ -56,22 +48,17 @@
+ FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
+ INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
+ ALTER TABLE t1 ADD INDEX idx1(f4), page_compressed=1;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
+ ALTER TABLE t1 DROP INDEX idx, page_compression_level=5;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
+ ALTER TABLE t1 ADD UNIQUE INDEX u1(f2);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
+ ALTER TABLE t1 DROP INDEX f4, page_compression_level=9;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
+ SET foreign_key_checks = 0;
+ affected rows: 0
+ ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
+ DROP TABLE t2, t1;
+ affected rows: 0
+ CREATE TABLE t1(f1 INT NOT NULL,
+@@ -84,28 +71,27 @@
+ INSERT INTO t1(f1, f2) VALUES(1, 1);
+ # Add column at the end of the table
+ ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL';
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Change virtual column expression
+ ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Add virtual column
+ ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Rename Column
+ ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Rename table
+ ALTER TABLE t1 RENAME t3;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
+ # Drop Virtual Column
+ ALTER TABLE t3 DROP COLUMN vcol;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Column length varies
+ ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20);
+ affected rows: 0
+@@ -113,12 +99,12 @@
+ SET foreign_key_checks = 0;
+ affected rows: 0
+ ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ SET foreign_key_checks = 1;
+ affected rows: 0
+ ALTER TABLE t3 DROP FOREIGN KEY fidx;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t3, t2;
+ affected rows: 0
diff --git a/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff b/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
new file mode 100644
index 00000000000..2aa8c72265a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
@@ -0,0 +1,147 @@
+--- alter_algorithm.result 2020-04-30 21:39:48.923115511 +0530
++++ alter_algorithm.reject 2020-04-30 21:52:10.785967739 +0530
+@@ -7,43 +7,35 @@
+ INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
+ SELECT @@alter_algorithm;
+ @@alter_algorithm
+-COPY
++NOCOPY
+ # All the following cases needs table rebuild
+ # Add and Drop primary key
+ ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Make existing column NULLABLE
+ ALTER TABLE t1 MODIFY f2 INT;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Drop Stored Column
+ ALTER TABLE t1 DROP COLUMN f5;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Add base non-generated column as a last column in the compressed table
+ ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Add base non-generated column but not in the last position
+ ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Force the table to rebuild
+ ALTER TABLE t1 FORCE;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Row format changes
+ ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ # Engine table
+ ALTER TABLE t1 ENGINE=INNODB;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++Got one of the listed errors
+ ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t1;
+ affected rows: 0
+ CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+@@ -56,22 +48,22 @@
+ FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
+ INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
+ ALTER TABLE t1 ADD INDEX idx1(f4), page_compressed=1;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 DROP INDEX idx, page_compression_level=5;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 ADD UNIQUE INDEX u1(f2);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t1 DROP INDEX f4, page_compression_level=9;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ SET foreign_key_checks = 0;
+ affected rows: 0
+ ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t2, t1;
+ affected rows: 0
+ CREATE TABLE t1(f1 INT NOT NULL,
+@@ -84,28 +76,27 @@
+ INSERT INTO t1(f1, f2) VALUES(1, 1);
+ # Add column at the end of the table
+ ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL';
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Change virtual column expression
+ ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Add virtual column
+ ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Rename Column
+ ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Rename table
+ ALTER TABLE t1 RENAME t3;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
+ # Drop Virtual Column
+ ALTER TABLE t3 DROP COLUMN vcol;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ # Column length varies
+ ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20);
+ affected rows: 0
+@@ -113,12 +104,12 @@
+ SET foreign_key_checks = 0;
+ affected rows: 0
+ ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1);
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ SET foreign_key_checks = 1;
+ affected rows: 0
+ ALTER TABLE t3 DROP FOREIGN KEY fidx;
+-affected rows: 1
+-info: Records: 1 Duplicates: 0 Warnings: 0
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 0
+ DROP TABLE t3, t2;
+ affected rows: 0
diff --git a/mysql-test/suite/innodb/r/alter_algorithm.result b/mysql-test/suite/innodb/r/alter_algorithm.result
new file mode 100644
index 00000000000..717d31de6a0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_algorithm.result
@@ -0,0 +1,124 @@
+CREATE TABLE t1(f1 INT NOT NULL,
+f2 INT NOT NULL,
+f3 INT NULL,
+f4 INT as (f2) STORED,
+f5 INT as (f3) STORED,
+PRIMARY KEY(f1))ROW_FORMAT=COMPRESSED, ENGINE=INNODB;
+INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
+SELECT @@alter_algorithm;
+@@alter_algorithm
+COPY
+# All the following cases needs table rebuild
+# Add and Drop primary key
+ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1);
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Make existing column NULLABLE
+ALTER TABLE t1 MODIFY f2 INT;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Drop Stored Column
+ALTER TABLE t1 DROP COLUMN f5;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Add base non-generated column as a last column in the compressed table
+ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Add base non-generated column but not in the last position
+ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Force the table to rebuild
+ALTER TABLE t1 FORCE;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Row format changes
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Engine table
+ALTER TABLE t1 ENGINE=INNODB;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+DROP TABLE t1;
+affected rows: 0
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+f3 INT AS (f2 * f2) VIRTUAL,
+f4 INT NOT NULL UNIQUE,
+f5 INT NOT NULL,
+INDEX idx(f2))ENGINE=INNODB;
+CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
+INDEX(f1),
+FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
+INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
+ALTER TABLE t1 ADD INDEX idx1(f4), page_compressed=1;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 DROP INDEX idx, page_compression_level=5;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD UNIQUE INDEX u1(f2);
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 DROP INDEX f4, page_compression_level=9;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+SET foreign_key_checks = 0;
+affected rows: 0
+ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1);
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+DROP TABLE t2, t1;
+affected rows: 0
+CREATE TABLE t1(f1 INT NOT NULL,
+f2 INT NOT NULL,
+f3 INT AS (f2 * f2) VIRTUAL,
+INDEX idx (f2))engine=innodb;
+CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
+f3 VARCHAR(10),
+INDEX(f1))ENGINE=INNODB;
+INSERT INTO t1(f1, f2) VALUES(1, 1);
+# Add column at the end of the table
+ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL';
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Change virtual column expression
+ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Add virtual column
+ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Rename Column
+ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Rename table
+ALTER TABLE t1 RENAME t3;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Drop Virtual Column
+ALTER TABLE t3 DROP COLUMN vcol;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Column length varies
+ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SET foreign_key_checks = 0;
+affected rows: 0
+ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1);
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+SET foreign_key_checks = 1;
+affected rows: 0
+ALTER TABLE t3 DROP FOREIGN KEY fidx;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+DROP TABLE t3, t2;
+affected rows: 0
diff --git a/mysql-test/suite/innodb/r/alter_algorithm2.result b/mysql-test/suite/innodb/r/alter_algorithm2.result
new file mode 100644
index 00000000000..350c1c51482
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_algorithm2.result
@@ -0,0 +1,76 @@
+CREATE TABLE t1 (a INT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+SET alter_algorithm='INPLACE';
+affected rows: 0
+PREPARE stmt FROM 'ALTER TABLE t1 ADD KEY idx(a)';
+affected rows: 0
+info: Statement prepared
+PREPARE stmt1 FROM 'ALTER TABLE t1 DROP KEY idx';
+affected rows: 0
+info: Statement prepared
+CREATE OR REPLACE PROCEDURE p1()
+BEGIN
+ALTER TABLE t1 ADD KEY idx2(a);
+END|
+affected rows: 0
+CREATE OR REPLACE PROCEDURE p2()
+BEGIN
+ALTER TABLE t1 DROP KEY idx2;
+END|
+affected rows: 0
+SET alter_algorithm='COPY';
+affected rows: 0
+EXECUTE stmt;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+EXECUTE stmt1;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+call p1();
+affected rows: 1
+call p2();
+affected rows: 1
+SET alter_algorithm='NOCOPY';
+affected rows: 0
+EXECUTE stmt;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+EXECUTE stmt1;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+call p1();
+affected rows: 0
+call p2();
+affected rows: 0
+SET alter_algorithm='INSTANT';
+affected rows: 0
+EXECUTE stmt;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
+call p1();
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
+DROP TABLE t1;
+affected rows: 0
+DROP PROCEDURE p1;
+affected rows: 0
+DROP PROCEDURE p2;
+affected rows: 0
+CREATE TABLE t1(id INT PRIMARY KEY,
+col1 INT UNSIGNED NOT NULL UNIQUE)ENGINE=InnoDB;
+affected rows: 0
+INSERT INTO t1 VALUES(1,1),(2,2),(3,3);
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
+SET ALTER_ALGORITHM=INSTANT;
+affected rows: 0
+ALTER TABLE t1 DROP COLUMN col1;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
+ALTER TABLE t1 DROP COLUMN col1, ALGORITHM=NOCOPY;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
+ALTER TABLE t1 DROP COLUMN col1, ALGORITHM=DEFAULT;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 DROP PRIMARY KEY, ALGORITHM=DEFAULT;
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
+DROP TABLE t1;
+affected rows: 0
diff --git a/mysql-test/suite/innodb/r/alter_crash.result b/mysql-test/suite/innodb/r/alter_crash.result
index f00e48157e7..70c2102ee0d 100644
--- a/mysql-test/suite/innodb/r/alter_crash.result
+++ b/mysql-test/suite/innodb/r/alter_crash.result
@@ -49,7 +49,7 @@ ERROR HY000: Lost connection to MySQL server during query
# Restart mysqld after the crash and reconnect.
SELECT * FROM information_schema.innodb_sys_tables
WHERE table_id = ID;
-TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
# Files in datadir after manual recovery.
db.opt
t1.frm
@@ -88,7 +88,7 @@ ERROR HY000: Lost connection to MySQL server during query
# Startup the server after the crash
SELECT * FROM information_schema.innodb_sys_tables
WHERE name LIKE 'test/#sql-%';
-TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
SHOW TABLES;
Tables_in_test
t2
@@ -126,7 +126,7 @@ ERROR HY000: Lost connection to MySQL server during query
# Restart mysqld after the crash and reconnect.
SELECT * FROM information_schema.innodb_sys_tables
WHERE table_id = ID;
-TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
# Files in datadir after manual recovery.
db.opt
t1.frm
@@ -148,3 +148,41 @@ SELECT * FROM t1;
a b d
1 NULL NULL
DROP TABLE t1;
+#
+# MDEV-22637 Rollback of insert fails when column reorder happens
+#
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_TRANS_TABLES', '');
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_ALL_TABLES', '');
+CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
+f3 CHAR(100), f4 CHAR(100))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "This is column2", "This is column3",
+"This is column4");
+set DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
+ALTER TABLE t1 ADD COLUMN f6 int after f3, add primary key(f6, f4(3), f3(3));
+connect con1,localhost,root,,;
+SET DEBUG_SYNC = 'now WAIT_FOR scanned';
+BEGIN;
+INSERT INTO t1(f1, f2) VALUES(2, "This is column2 value");
+ROLLBACK;
+set DEBUG_SYNC = 'now SIGNAL insert_done';
+connection default;
+Warnings:
+Warning 1265 Data truncated for column 'f3' at row 3
+Warning 1265 Data truncated for column 'f4' at row 3
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(100) DEFAULT NULL,
+ `f3` char(100) NOT NULL,
+ `f6` int(11) NOT NULL,
+ `f4` char(100) NOT NULL,
+ PRIMARY KEY (`f6`,`f4`(3),`f3`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+disconnect con1;
+DROP TABLE t1;
+SET DEBUG_SYNC = 'RESET';
+SET SQL_MODE=DEFAULT;
diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result
index f0f5b1c003f..0f2e7b34837 100644
--- a/mysql-test/suite/innodb/r/alter_kill.result
+++ b/mysql-test/suite/innodb/r/alter_kill.result
@@ -2,10 +2,12 @@
# Bug#16720368 INNODB CRASHES ON BROKEN #SQL*.IBD FILE AT STARTUP
#
SET GLOBAL innodb_file_per_table=1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB;
connect con1,localhost,root;
CREATE TABLE bug16720368 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO bug16720368 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+InnoDB 0 transactions not purged
connection default;
# Cleanly shutdown mysqld
disconnect con1;
diff --git a/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff
new file mode 100644
index 00000000000..01db97e59f8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff
@@ -0,0 +1,42 @@
+7,8c7,8
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
+21,22c21,22
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
+35,36c35,36
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
+49,50c49,50
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
+63,64c63,64
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
+77,78c77,78
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
+98,99c98,99
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
diff --git a/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff
new file mode 100644
index 00000000000..e02d235cb72
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff
@@ -0,0 +1,72 @@
+7,10c7
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+13c10
+< 0
+---
+> NULL
+21,24c18
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+27c21
+<
+---
+> NULL
+35,38c29
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+41c32
+<
+---
+> NULL
+49,52c40
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+55c43
+<
+---
+> NULL
+63,66c51
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f3' at row 1
+---
+> ERROR 01000: Data truncated for column 'f3' at row 1
+69c54
+< 2 2 0
+---
+> 2 2 NULL
+77,80c62
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'b' at row 1
+---
+> ERROR 01000: Data truncated for column 'b' at row 1
+83c65
+< 10 0
+---
+> 10 NULL
+98,99c80,81
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+---
+> affected rows: 1
+> info: Records: 1 Duplicates: 0 Warnings: 1
diff --git a/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff
new file mode 100644
index 00000000000..ec97b174bdf
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff
@@ -0,0 +1,66 @@
+7,10c7
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+13c10
+< 0
+---
+> NULL
+21,24c18
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+27c21
+<
+---
+> NULL
+35,38c29
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+41c32
+<
+---
+> NULL
+49,52c40
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f1' at row 1
+---
+> ERROR 01000: Data truncated for column 'f1' at row 1
+55c43
+<
+---
+> NULL
+63,66c51
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'f3' at row 1
+---
+> ERROR 01000: Data truncated for column 'f3' at row 1
+69c54
+< 2 2 0
+---
+> 2 2 NULL
+77,80c62
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'b' at row 1
+---
+> ERROR 01000: Data truncated for column 'b' at row 1
+83c65
+< 10 0
+---
+> 10 NULL
diff --git a/mysql-test/suite/innodb/r/alter_not_null.result b/mysql-test/suite/innodb/r/alter_not_null.result
new file mode 100644
index 00000000000..688493351b8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_not_null.result
@@ -0,0 +1,114 @@
+CREATE TABLE t1(f1 INT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+f1
+NULL
+ALTER TABLE t1 CHANGE f1 f1 INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+SELECT * FROM t1;
+f1
+0
+DROP TABLE t1;
+CREATE TABLE t1(f1 CHAR(10))ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+f1
+NULL
+ALTER TABLE t1 CHANGE f1 f1 CHAR(10) NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+SELECT * FROM t1;
+f1
+
+DROP TABLE t1;
+CREATE TABLE t1(f1 VARCHAR(10))ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+f1
+NULL
+ALTER TABLE t1 CHANGE f1 f1 VARCHAR(20) NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+SELECT * FROM t1;
+f1
+
+DROP TABLE t1;
+CREATE TABLE t1(f1 TEXT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+f1
+NULL
+ALTER TABLE t1 CHANGE f1 f1 TEXT NOT NULL DEFAULT 'abc';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+SELECT * FROM t1;
+f1
+
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, f3 INT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(2, 2, NULL);
+SELECT * FROM t1;
+f1 f2 f3
+2 2 NULL
+ALTER TABLE t1 CHANGE f3 f3 INT NOT NULL DEFAULT (f1 + f2);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'f3' at row 1
+SELECT * FROM t1;
+f1 f2 f3
+2 2 0
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL DEFAULT 0, b TINYINT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(10, NULL);
+SELECT * FROM t1;
+f1 b
+10 NULL
+ALTER TABLE t1 CHANGE b b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+SELECT * FROM t1;
+f1 b
+10 0
+DROP TABLE t1;
+CREATE TABLE t1(a INT, v INT AS (a), c INT, d INT NOT NULL, e INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP COLUMN c, CHANGE COLUMN e e INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, v INT AS (a), d INT NOT NULL, e INT) ENGINE=InnoDB;
+ALTER TABLE t1 FORCE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+DROP TABLE t1;
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, NULL);
+ALTER IGNORE TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c2' at row 1
+SELECT * FROM t1;
+c1 c2
+1 0
+DROP TABLE t1;
+#
+# MDEV-16126 Crash or ASAN heap-buffer-overflow in
+# mach_read_from_n_little_endian upon ALTER TABLE with blob
+#
+CREATE TABLE t1(a INT, v INT AS (a), b INT, c BLOB) ENGINE=InnoDB;
+ALTER TABLE t1 ADD PRIMARY KEY(b);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/alter_not_null_debug,STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null_debug,STRICT.rdiff
new file mode 100644
index 00000000000..09c717c44b0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_not_null_debug,STRICT.rdiff
@@ -0,0 +1,11 @@
+18,21c18
+< affected rows: 0
+< info: Records: 0 Duplicates: 0 Warnings: 1
+< Warnings:
+< Warning 1265 Data truncated for column 'c2' at row 3
+---
+> ERROR 01000: Data truncated for column 'c2' at row 3
+24c21
+< 2 0
+---
+> 2 NULL
diff --git a/mysql-test/suite/innodb/r/alter_not_null_debug.result b/mysql-test/suite/innodb/r/alter_not_null_debug.result
new file mode 100644
index 00000000000..c12f1fbca3d
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_not_null_debug.result
@@ -0,0 +1,78 @@
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 1);
+SET DEBUG_SYNC= 'row_merge_after_scan
+SIGNAL opened WAIT_FOR flushed';
+affected rows: 0
+ALTER TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+connect con1,localhost,root;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+affected rows: 0
+INSERT INTO t1 VALUES(2, NULL);
+affected rows: 1
+UPDATE t1 SET c1 = 3 WHERE c2 = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SET DEBUG_SYNC= 'now SIGNAL flushed';
+affected rows: 0
+connection default;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c2' at row 3
+SELECT * FROM t1;
+c1 c2
+2 0
+3 1
+DROP TABLE t1;
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 1);
+SET DEBUG_SYNC= 'row_merge_after_scan
+SIGNAL opened WAIT_FOR flushed';
+affected rows: 0
+ALTER TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+connection con1;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+affected rows: 0
+INSERT INTO t1 VALUES(2, 3);
+affected rows: 1
+UPDATE t1 SET c1 = 3 WHERE c2 = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SET DEBUG_SYNC= 'now SIGNAL flushed';
+affected rows: 0
+connection default;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t1;
+c1 c2
+2 3
+3 1
+DROP TABLE t1;
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, c3 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 2, 3);
+SET DEBUG_SYNC= 'row_merge_after_scan
+SIGNAL opened WAIT_FOR flushed';
+affected rows: 0
+ALTER IGNORE TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+connection con1;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+affected rows: 0
+UPDATE t1 SET c2= 2 WHERE c1 = 1;
+affected rows: 0
+info: Rows matched: 1 Changed: 0 Warnings: 0
+INSERT INTO t1 VALUES (2, NULL, 4);
+affected rows: 1
+SET DEBUG_SYNC= 'now SIGNAL flushed';
+affected rows: 0
+connection default;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c2' at row 3
+SELECT * FROM t1;
+c1 c2 c3
+1 2 3
+2 0 4
+DROP TABLE t1;
+disconnect con1;
+SET DEBUG_SYNC='RESET';
diff --git a/mysql-test/suite/innodb/r/alter_partitioned.result b/mysql-test/suite/innodb/r/alter_partitioned.result
new file mode 100644
index 00000000000..ee8233be5c1
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_partitioned.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (3),
+PARTITION pb VALUES LESS THAN (5));
+CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (2),
+PARTITION pb VALUES LESS THAN (4));
+ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/alter_primary_key.result b/mysql-test/suite/innodb/r/alter_primary_key.result
new file mode 100644
index 00000000000..afe687871f3
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_primary_key.result
@@ -0,0 +1,26 @@
+#
+# MDEV-23244 ALTER TABLE…ADD PRIMARY KEY fails to flag
+# duplicate key error from concurrent DML
+#
+CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (c CHAR(2) NOT NULL) ENGINE=InnoDB;
+connect con1,localhost,root,,;
+BEGIN;
+INSERT INTO t0 VALUES(1);
+connection default;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
+ALTER TABLE t1 ADD PRIMARY KEY(c(1));
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR dml';
+INSERT INTO t1 VALUES ('ab'),('ac');
+COMMIT;
+SET DEBUG_SYNC='now SIGNAL dml_done';
+disconnect con1;
+connection default;
+ERROR 23000: Duplicate entry 'a' for key 'PRIMARY'
+SET DEBUG_SYNC='RESET';
+SELECT * FROM t1;
+c
+ab
+ac
+DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/r/alter_rename_existing.result b/mysql-test/suite/innodb/r/alter_rename_existing.result
index 881518595de..8fc54adbd10 100644
--- a/mysql-test/suite/innodb/r/alter_rename_existing.result
+++ b/mysql-test/suite/innodb/r/alter_rename_existing.result
@@ -58,15 +58,15 @@ ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=COPY;
# while a blocking t1.ibd file exists.
#
SET GLOBAL innodb_file_per_table=ON;
-ALTER TABLE t1 ADD COLUMN e1 INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
ERROR HY000: Tablespace for table 'test/t1' exists. Please DISCARD the tablespace before IMPORT
-ALTER TABLE t1 ADD COLUMN e2 INT, ALGORITHM=COPY;
+ALTER TABLE t1 FORCE, ALGORITHM=COPY;
ERROR HY000: Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME' (errno: 184 "Tablespace already exists")
#
# Delete the blocking file called MYSQLD_DATADIR/test/t1.ibd
# Move t1 to file-per-table using ALGORITHM=INPLACE with no blocking t1.ibd.
#
-ALTER TABLE t1 ADD COLUMN e INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -74,7 +74,6 @@ t1 CREATE TABLE `t1` (
`b` char(20) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
- `e` int(11) DEFAULT NULL,
UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
diff --git a/mysql-test/suite/innodb/r/alter_varchar_change.result b/mysql-test/suite/innodb/r/alter_varchar_change.result
index 8ffc6e5cfe2..22e8d4fdf69 100644
--- a/mysql-test/suite/innodb/r/alter_varchar_change.result
+++ b/mysql-test/suite/innodb/r/alter_varchar_change.result
@@ -15,7 +15,7 @@ SET @idx1_id = 0;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
@@ -32,7 +32,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
@@ -49,7 +49,7 @@ CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100), f3 VARCHAR(100),
INDEX idx(f2, f3), index idx1(f3, f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), MODIFY f3 VARCHAR(150);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), MODIFY f3 VARCHAR(150), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@@ -72,7 +72,7 @@ CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@@ -93,7 +93,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100), FULLTEXT idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@@ -117,7 +117,7 @@ INDEX idx(f3))ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, repeat('a', 40));
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(100);
+ALTER TABLE t1 MODIFY f2 VARCHAR(100), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@@ -163,7 +163,7 @@ f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(10));
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(10)), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@@ -251,11 +251,11 @@ CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT, ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
-0
+1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -267,11 +267,11 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT, ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
-0
+1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -284,8 +284,6 @@ DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100))ENGINE=INNODB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD FULLTEXT idx(f2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
diff --git a/mysql-test/suite/innodb/r/create-index-debug.result b/mysql-test/suite/innodb/r/create-index-debug.result
index 99f6efe9bfe..9d266c68af3 100644
--- a/mysql-test/suite/innodb/r/create-index-debug.result
+++ b/mysql-test/suite/innodb/r/create-index-debug.result
@@ -10,9 +10,6 @@ CHAR(255) NOT NULL, f13 CHAR(255) NOT NULL, f14 CHAR(255) NOT NULL,f15
CHAR(255) NOT NULL, f16 CHAR(255) NOT NULL, f17 CHAR(255) NOT NULL,f18
CHAR(255) NOT NULL)
ENGINE=INNODB ROW_FORMAT=DYNAMIC;
-Warnings:
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
INSERT INTO t1
VALUES('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r');
INSERT INTO t1 SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/r/ddl_purge.result b/mysql-test/suite/innodb/r/ddl_purge.result
new file mode 100644
index 00000000000..45f4c99e97b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/ddl_purge.result
@@ -0,0 +1,25 @@
+CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+connect con1,localhost,root,,test;
+BEGIN;
+INSERT INTO t0 SET pk=1;
+connect con2,localhost,root,,test;
+BEGIN;
+INSERT INTO t0 SET pk=2;
+connection default;
+SET DEBUG_SYNC='alter_table_inplace_after_lock_downgrade SIGNAL prepared WAIT_FOR logged';
+ALTER TABLE t1 FORCE;
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR prepared';
+INSERT INTO t1 SET pk=1;
+COMMIT;
+disconnect con1;
+connection con2;
+UPDATE t1 SET b=1;
+DELETE FROM t1;
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL logged';
+disconnect con2;
+connection default;
+SET DEBUG_SYNC='RESET';
+DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter.result b/mysql-test/suite/innodb/r/default_row_format_alter.result
index fd88fb5a3fe..1f349e6e2f6 100644
--- a/mysql-test/suite/innodb/r/default_row_format_alter.result
+++ b/mysql-test/suite/innodb/r/default_row_format_alter.result
@@ -5,14 +5,14 @@ SET @row_format = @@GLOBAL.innodb_default_row_format;
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=INNODB;
INSERT INTO t1 VALUES (1, 'abc');
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 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
SET GLOBAL innodb_default_row_format=DYNAMIC;
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
# Here we expect COMPACT because it was explicitly specified at CREATE
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 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
DROP TABLE t1;
####################################
# Check if table rebuilding alter is affected when there is no
@@ -21,15 +21,15 @@ SET GLOBAL innodb_default_row_format = COMPACT;
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, 'abc');
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 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
SET GLOBAL innodb_default_row_format = DYNAMIC;
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
# Here we expect DYNAMIC because there is no explicit ROW_FORMAT and the
# default_row_format is changed to DYNAMIC just before ALTER
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 InnoDB # Dynamic # # # # # # NULL # # NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Dynamic # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
####################################
# Check the row_format effect on ALTER, ALGORITHM=COPY
@@ -37,15 +37,15 @@ SET GLOBAL innodb_default_row_format = REDUNDANT;
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
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 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
SET GLOBAL innoDB_default_row_format = COMPACT;
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
# Because of ALGORITHM=COPY, there is TABLE REBUILD and the table isn't
# created with explicit row_format, so we expect ROW_FORMAT=COMPACT
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 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
###################################
@@ -54,16 +54,16 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
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 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT
+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 Max_index_length Temporary
+t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N
SET GLOBAL innoDB_default_row_format = COMPACT;
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
# Because of ALGORITHM=COPY, there is TABLE REBUILD and the table is
# created with explicit row_format, so we expect original
# ROW_FORMAT=REDUNDANT
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 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT
+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 Max_index_length Temporary
+t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N
DROP TABLE t1;
##################################
@@ -72,14 +72,14 @@ SET GLOBAL innodb_default_row_format=COMPACT;
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT, KEY k1(b(10))) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
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 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
SET GLOBAL innodb_default_row_format=DYNAMIC;
ALTER TABLE t1 DROP INDEX k1;
# Because it is in-place operation, there is no rebuild, so the
# original format has to be retained.
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 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/default_row_format_compatibility.result b/mysql-test/suite/innodb/r/default_row_format_compatibility.result
index e9c82d225b4..5070fa33a2e 100644
--- a/mysql-test/suite/innodb/r/default_row_format_compatibility.result
+++ b/mysql-test/suite/innodb/r/default_row_format_compatibility.result
@@ -1,9 +1,4 @@
SET @row_format = @@GLOBAL.innodb_default_row_format;
-SET @large_prefix = @@GLOBAL.innodb_large_prefix;
-SET @file_format = @@GLOBAL.innodb_file_format;
-SET GLOBAL innodb_file_format = barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# ###########################################################
# Check with Import/Export tablespace with Default_row_format
SET GLOBAL innodb_default_row_format=Compact;
@@ -15,8 +10,8 @@ SELECT @@innodb_file_per_table;
1
CREATE TABLE tab(a INT) ENGINE=InnoDB;
SHOW TABLE STATUS LIKE 'tab';
-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
-tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
INSERT INTO tab VALUES(1);
INSERT INTO tab VALUES(2);
SELECT * FROM tab;
@@ -38,8 +33,8 @@ SELECT @@innodb_default_row_format;
compact
CREATE TABLE tab(a INT) ENGINE=InnoDB;
SHOW TABLE STATUS LIKE 'tab';
-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
-tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
ALTER TABLE tab DISCARD TABLESPACE;
call mtr.add_suppression("InnoDB: Tried to read .* bytes at offset 0");
ALTER TABLE tab IMPORT TABLESPACE;
@@ -52,16 +47,13 @@ a
DROP TABLE tab;
# ###########################################################
SET GLOBAL innodb_default_row_format=Dynamic;
-SET GLOBAL innodb_large_prefix=ON;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SELECT @@innodb_default_row_format;
@@innodb_default_row_format
dynamic
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(3070))) ENGINE= InnoDB;
SHOW TABLE STATUS LIKE 'tab';
-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
-tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
INSERT INTO tab(a,b) VALUES(1,'Check with max column size');
SELECT * FROM tab;
a b
@@ -80,16 +72,16 @@ SELECT @@innodb_default_row_format;
dynamic
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(767))) ENGINE= InnoDB;
SHOW TABLE STATUS LIKE 'tab';
-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
-tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
INSERT INTO tab(a,b) VALUES(1,'Check with max column size');
SELECT * FROM tab;
a b
1 Check with max column size
ALTER TABLE tab ROW_FORMAT=COMPACT;
SHOW TABLE STATUS LIKE 'tab';
-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
-tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT
+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 Max_index_length Temporary
+tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
SELECT * FROM tab;
a b
1 Check with max column size
@@ -99,13 +91,7 @@ a b
1 Check with max column size
ALTER TABLE tab ROW_FORMAT=Dynamic;
SHOW TABLE STATUS LIKE 'tab';
-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
-tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC
+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 Max_index_length Temporary
+tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N
DROP TABLE tab;
SET GLOBAL innodb_default_row_format = @row_format;
-SET GLOBAL innodb_large_prefix = @large_prefix;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SET GLOBAL innodb_file_format = @file_format;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb/r/default_row_format_create,dynamic.rdiff b/mysql-test/suite/innodb/r/default_row_format_create,dynamic.rdiff
index bb23b78213b..fd4a1c8b110 100644
--- a/mysql-test/suite/innodb/r/default_row_format_create,dynamic.rdiff
+++ b/mysql-test/suite/innodb/r/default_row_format_create,dynamic.rdiff
@@ -3,9 +3,9 @@
@@ -1,7 +1,7 @@
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
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 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
-+t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+ 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 Max_index_length Temporary
+-t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
++t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
SHOW TABLE STATUS LIKE 't1';
diff --git a/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff b/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
index 29bc560907e..fbf1d914f5b 100644
--- a/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
@@ -3,17 +3,17 @@
@@ -1,7 +1,7 @@
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
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 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
-+t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+ 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 Max_index_length Temporary
+-t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
++t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
SHOW TABLE STATUS LIKE 't1';
@@ -31,8 +31,9 @@
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB page_compressed=1;
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 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL `page_compressed`=1
+ 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 Max_index_length Temporary
+-t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL `page_compressed`=1 0 N
DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/innodb/r/default_row_format_create.result b/mysql-test/suite/innodb/r/default_row_format_create.result
index d51a63dbd01..262e8bc7f19 100644
--- a/mysql-test/suite/innodb/r/default_row_format_create.result
+++ b/mysql-test/suite/innodb/r/default_row_format_create.result
@@ -1,37 +1,37 @@
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB;
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 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
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 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC
+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 Max_index_length Temporary
+t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N
DROP TABLE t1;
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT;
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 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT
+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 Max_index_length Temporary
+t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT 0 N
DROP TABLE t1;
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
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 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=REDUNDANT
+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 Max_index_length Temporary
+t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N
DROP TABLE t1;
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
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 InnoDB # Compressed # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPRESSED
+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 Max_index_length Temporary
+t1 InnoDB # Compressed # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPRESSED 0 N
TRUNCATE TABLE t1;
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 InnoDB # Compressed # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPRESSED
+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 Max_index_length Temporary
+t1 InnoDB # Compressed # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPRESSED 0 N
DROP TABLE t1;
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB page_compressed=1;
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 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL `page_compressed`=1
+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 Max_index_length Temporary
+t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL `page_compressed`=1 0 N
DROP TABLE IF EXISTS t1;
SET @save_format = @@GLOBAL.innodb_default_row_format;
SET GLOBAL innodb_default_row_format = redundant;
@@ -39,6 +39,6 @@ CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
SET GLOBAL innodb_default_row_format = @save_format;
TRUNCATE TABLE t1;
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 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+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 Max_index_length Temporary
+t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/dml_purge.result b/mysql-test/suite/innodb/r/dml_purge.result
new file mode 100644
index 00000000000..95330b80d33
--- /dev/null
+++ b/mysql-test/suite/innodb/r/dml_purge.result
@@ -0,0 +1,47 @@
+SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+#
+# MDEV-12288 Reset DB_TRX_ID when the history is removed,
+# to speed up MVCC
+#
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+CREATE TABLE t1(a INT PRIMARY KEY, b INT NOT NULL)
+ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
+connect prevent_purge,localhost,root;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+INSERT INTO t1 VALUES(1,2),(3,4);
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET b=-3 WHERE a=3;
+connect con1,localhost,root;
+BEGIN;
+UPDATE t1 SET b=4 WHERE a=3;
+disconnect prevent_purge;
+connection default;
+InnoDB 0 transactions not purged
+disconnect con1;
+FLUSH TABLE t1 FOR EXPORT;
+Clustered index root page contents:
+N_RECS=3; LEVEL=0
+header=0x0100000300c6 (a=0x696e66696d756d00)
+header=0x1000200b0087 (a=0x80000000,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ b=0x80000000,
+ c=NULL(4 bytes))
+header=0x0000100900a6 (a=0x80000001,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ b=0x80000002)
+header=0x000018090074 (a=0x80000003,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ b=0x7ffffffd)
+header=0x040008030000 (a=0x73757072656d756d00)
+UNLOCK TABLES;
+SELECT * FROM t1;
+a b c
+1 2 NULL
+3 -3 NULL
+DROP TABLE t1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/r/fake_changes-7000.result b/mysql-test/suite/innodb/r/fake_changes-7000.result
deleted file mode 100644
index e41020b7d74..00000000000
--- a/mysql-test/suite/innodb/r/fake_changes-7000.result
+++ /dev/null
@@ -1,6 +0,0 @@
-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/file_format_defaults.result b/mysql-test/suite/innodb/r/file_format_defaults.result
index 5ea34ceb7b5..4fd280450aa 100644
--- a/mysql-test/suite/innodb/r/file_format_defaults.result
+++ b/mysql-test/suite/innodb/r/file_format_defaults.result
@@ -5,10 +5,6 @@ SELECT @@innodb_strict_mode;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
1
-SET @file_format = @@GLOBAL.innodb_file_format;
-SET GLOBAL innodb_large_prefix=ON;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET SQL_MODE=strict_all_tables;
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
Warnings:
@@ -22,53 +18,12 @@ tab0 CREATE TABLE `tab0` (
DROP TABLE tab0;
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB KEY_BLOCK_SIZE=2;
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.
-SET GLOBAL innodb_file_format=Antelope;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
-ERROR HY000: Can't create table `test`.`tab0` (errno: 140 "Wrong create options")
-SET GLOBAL innodb_file_format=Default;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
DROP TABLE tab0;
-SELECT @@innodb_file_format;
-@@innodb_file_format
-Barracuda
SET GLOBAL innodb_strict_mode=OFF;
SET GLOBAL innodb_strict_mode=Default;
SELECT @@innodb_strict_mode;
@@innodb_strict_mode
1
-SET GLOBAL innodb_large_prefix=OFF;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@innodb_large_prefix;
-@@innodb_large_prefix
-0
-SET GLOBAL innodb_large_prefix=Default;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@innodb_large_prefix;
-@@innodb_large_prefix
-1
-SET GLOBAL innodb_file_format_max=Default;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@innodb_file_format_max;
-@@innodb_file_format_max
-Antelope
CREATE TABLE tab1(c1 int ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
-SELECT @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-SET GLOBAL innodb_file_format_max=Default;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SET GLOBAL innodb_large_prefix=off;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SET GLOBAL innodb_file_format = @file_format;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
DROP TABLE tab1;
diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result
index 5cbbb5298de..1618540aa96 100644
--- a/mysql-test/suite/innodb/r/foreign-keys.result
+++ b/mysql-test/suite/innodb/r/foreign-keys.result
@@ -110,7 +110,7 @@ SET debug_sync='alter_table_intermediate_table_created SIGNAL ready WAIT_FOR go'
ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE;
connect con1, localhost, root;
SET debug_sync='now WAIT_FOR ready';
-SET lock_wait_timeout=1;
+SET lock_wait_timeout=0;
UPDATE t2 SET pk=10 WHERE pk=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1';
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
index fb4175c0327..37aa6c93fa2 100644
--- a/mysql-test/suite/innodb/r/foreign_key.result
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -237,7 +237,6 @@ ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
Warning 1088 failed to load FOREIGN KEY constraints
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
Warnings:
@@ -264,7 +263,7 @@ SHOW WARNINGS;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t2` not found in the data dictionary near 'FOREIGN KEY (a) REFERENCES t2 (b)'.
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t1`
DROP TABLE t1;
#
# MDEV-18139 ALTER IGNORE ... ADD FOREIGN KEY causes bogus error
diff --git a/mysql-test/suite/innodb/r/group_commit_crash.result b/mysql-test/suite/innodb/r/group_commit_crash.result
index c9daf347ee1..005049df281 100644
--- a/mysql-test/suite/innodb/r/group_commit_crash.result
+++ b/mysql-test/suite/innodb/r/group_commit_crash.result
@@ -123,5 +123,3 @@ delete from t1;
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE setcrash;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
index a3937b5ae3a..846500ad2b1 100644
--- a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
@@ -123,5 +123,3 @@ delete from t1;
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE setcrash;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb/r/ibuf_not_empty.result b/mysql-test/suite/innodb/r/ibuf_not_empty.result
index 7c61e74850b..96aefe29f89 100644
--- a/mysql-test/suite/innodb/r/ibuf_not_empty.result
+++ b/mysql-test/suite/innodb/r/ibuf_not_empty.result
@@ -1,3 +1,4 @@
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(1),
@@ -5,6 +6,7 @@ c INT,
INDEX(b))
ENGINE=InnoDB STATS_PERSISTENT=0;
SET GLOBAL innodb_change_buffering_debug = 1;
+BEGIN;
INSERT INTO t1 VALUES(0,'x',1);
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
@@ -18,6 +20,8 @@ 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;
+COMMIT;
+InnoDB 0 transactions not purged
check table t1;
Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index 'b' contains #### entries, should be 4096.
diff --git a/mysql-test/suite/innodb/r/innodb-16k.result b/mysql-test/suite/innodb/r/innodb-16k.result
index e21381a8c68..14bff3a5eba 100644
--- a/mysql-test/suite/innodb/r/innodb-16k.result
+++ b/mysql-test/suite/innodb/r/innodb-16k.result
@@ -1,7 +1,4 @@
-call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
-SET GLOBAL innodb_large_prefix = OFF;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+call mtr.add_suppression("InnoDB: Cannot add field .* in table");
# Test 1) Show the page size from Information Schema
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
@@ -505,5 +502,3 @@ DROP TABLE t1;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE tlong;
DROP TABLE tlong2;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb/r/innodb-alter-debug.result b/mysql-test/suite/innodb/r/innodb-alter-debug.result
index ee5e681a991..51ba58aa1ef 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-debug.result
@@ -33,7 +33,7 @@ engine = innodb;
insert into t1 select 1, 1;
insert into t1 select 2, 2;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
-alter table t1 add b int, ALGORITHM=inplace;
+alter table t1 force, add b int, ALGORITHM=inplace;
/* connection con1 */
connect con1,localhost,root,,;
SET DEBUG_SYNC = 'now WAIT_FOR s1';
@@ -42,10 +42,10 @@ ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'now SIGNAL s2';
/* connection default */
connection default;
-/* reap */ alter table t1 add b int, ALGORITHM=inplace;
+/* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
-alter table t1 add b int, ALGORITHM=inplace;;
+alter table t1 force, add b int, ALGORITHM=inplace;;
/* connection con1 */
connection con1;
set DEBUG_SYNC = 'now WAIT_FOR s1';
@@ -54,7 +54,7 @@ ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'now SIGNAL s2';
/* connection default */
connection default;
-/* reap */ alter table t1 add b int, ALGORITHM=inplace;
+/* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'RESET';
drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-nullable.result b/mysql-test/suite/innodb/r/innodb-alter-nullable.result
index 7f42c17027f..1d481cf2bfe 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-nullable.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-nullable.result
@@ -49,8 +49,8 @@ connection default;
ALTER TABLE t MODIFY c2 INT NULL, ALGORITHM=INPLACE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE NAME='test/t';
-TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
-# test/t 33 6 # Barracuda Dynamic 0 Single
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+# test/t 33 6 # Dynamic 0 Single
DROP TABLE t;
CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1);
@@ -62,8 +62,8 @@ DROP TABLE t1;
CREATE TABLE t1(c INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL);
ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 1
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
INSERT INTO t1 VALUES (NULL);
@@ -101,8 +101,8 @@ info: Records: 1 Duplicates: 0 Warnings: 1
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
ALTER TABLE t2 MODIFY c INT NOT NULL;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 1
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
ALTER TABLE t3 MODIFY c INT NOT NULL;
@@ -141,8 +141,8 @@ info: Records: 1 Duplicates: 0 Warnings: 1
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
ALTER IGNORE TABLE t2 MODIFY c INT NOT NULL;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 1
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
ALTER IGNORE TABLE t3 MODIFY c INT NOT NULL;
@@ -175,21 +175,20 @@ INSERT INTO t1 SET c=NULL;
INSERT INTO t2 SET c=NULL;
INSERT INTO t3 SET c=NULL;
ALTER TABLE t1 MODIFY c INT NOT NULL;
-ERROR 22004: Invalid use of NULL value
+ERROR 01000: Data truncated for column 'c' at row 1
ALTER TABLE t2 MODIFY c INT NOT NULL;
-ERROR 22004: Invalid use of NULL value
+ERROR 01000: Data truncated for column 'c' at row 1
ALTER TABLE t3 MODIFY c INT NOT NULL;
ERROR 01000: Data truncated for column 'c' at row 1
UPDATE t1 SET c=0;
UPDATE t2 SET c=0;
UPDATE t3 SET c=0;
ALTER TABLE t1 MODIFY c INT NOT NULL;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t2 MODIFY c INT NOT NULL;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
-# MDEV-18819 FIXME: This should not require ALGORITHM=COPY.
ALTER TABLE t3 MODIFY c INT NOT NULL;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
index 3b797559603..b164c3c26b0 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
@@ -8,7 +8,6 @@ CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
ERROR HY000: Lost connection to MySQL server during query
-# Startup the server after the crash
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
index 9659b03d6b2..6934484a488 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
@@ -2,28 +2,35 @@ CREATE TABLE t1 (i1 INT UNSIGNED NULL DEFAULT 42) ENGINE=innodb;
INSERT INTO t1 VALUES(NULL);
ALTER TABLE t1 CHANGE i1 i1 INT UNSIGNED NOT NULL DEFAULT rand(),
ALGORITHM=INPLACE;
-ERROR 22004: Invalid use of NULL value
+ERROR 01000: Data truncated for column 'i1' at row 1
ALTER TABLE t1 CHANGE i1 i1 INT UNSIGNED NOT NULL DEFAULT rand(),
ALGORITHM=COPY;
ERROR 01000: Data truncated for column 'i1' at row 1
ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY(id), ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
+ALTER IGNORE TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY
+SET @old_sql_mode = @@sql_mode;
+SET sql_mode = '';
ALTER TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
-ERROR 22004: Invalid use of NULL value
-ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
-ADD PRIMARY KEY(id);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'i1' at row 1
+SET sql_mode = @old_sql_mode;
+ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
SELECT * FROM t1;
id
-1
+42
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i1 INT UNSIGNED NOT NULL, d1 TIMESTAMP NULL) ENGINE=InnoDB;
SHOW CREATE TABLE t1;
@@ -117,3 +124,18 @@ SELECT DISTINCT (CURRENT_TIMESTAMP()-d4) <= 60 FROM t1;
(CURRENT_TIMESTAMP()-d4) <= 60
1
DROP TABLE t1;
+CREATE TABLE t1(f1 int) ENGINE=InnoDB;
+INSERT INTO t1 SELECT * FROM seq_1_to_4096;
+connect purge_control,localhost,root,,;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+DELETE FROM t1;
+SET sql_mode='STRICT_ALL_TABLES,STRICT_TRANS_TABLES,NO_ZERO_DATE';
+ALTER TABLE t1 ADD f2 DATE NOT NULL, ALGORITHM=INPLACE;
+INSERT INTO t1 VALUES (1, now());
+Warnings:
+Note 1265 Data truncated for column 'f2' at row 1
+ALTER TABLE t1 ADD f3 DATE NOT NULL, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+disconnect purge_control;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 80cf14c1725..3bbc4bd3b63 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -419,8 +419,6 @@ ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation require
ALTER TABLE t1 ADD FULLTEXT INDEX (ct),
CHANGE c1 pk INT, ALTER c2 SET DEFAULT 42, RENAME TO tt,
ALGORITHM=INPLACE, LOCK=SHARED;
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID;
@@ -440,6 +438,27 @@ tt CREATE TABLE `tt` (
PRIMARY KEY (`pk`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+CREATE TABLE tu (
+pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
+FULLTEXT INDEX(t)
+) ENGINE=InnoDB;
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+DROP TABLE tu;
+CREATE TABLE tv (
+pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
+UNIQUE INDEX FTS_DOC_ID_INDEX(FTS_DOC_ID),
+FULLTEXT INDEX(t)
+) ENGINE=InnoDB;
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+DROP TABLE tv;
ALTER TABLE t1o CHANGE c1 dB_row_Id INT, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'dB_row_Id'
ALTER TABLE t1o CHANGE c1 dB_row_Id INT, ALGORITHM=INPLACE;
@@ -464,8 +483,6 @@ ALTER TABLE t1o DROP COLUMN FTS_DOC_ID, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try ALGORITHM=COPY
ALTER TABLE t1o DROP COLUMN FTS_DOC_ID, DROP INDEX ct, ALGORITHM=INPLACE;
ALTER TABLE t1o ADD FULLTEXT INDEX(ct), ADD COLUMN cu TEXT;
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
ALTER TABLE t1o ADD FULLTEXT INDEX(cu), ADD COLUMN FTS_DOC_ID BIGINT,
ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
@@ -481,8 +498,6 @@ ADD COLUMN FTS_DOC_ID BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
ALTER TABLE t1o ADD COLUMN FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
-ALTER TABLE t1o ADD COLUMN FTS_DOC_ID BIGINT UNSIGNED NOT NULL;
ALTER TABLE t1o DROP COLUMN FTS_DOC_ID, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try ALGORITHM=COPY
ALTER TABLE t1o DROP COLUMN FTS_DOC_ID;
@@ -498,7 +513,7 @@ ERROR 42000: Incorrect column name 'FTS_DOC_ID'
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
CREATE TABLE t1n LIKE t1o;
ALTER TABLE t1n ADD FULLTEXT INDEX(ct);
ALTER TABLE t1n CHANGE c1 Fts_DOC_ID INT, ALGORITHM=INPLACE;
@@ -571,7 +586,7 @@ t1n CREATE TABLE `t1n` (
DROP TABLE t1n;
ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL, DROP INDEX ct,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL, DROP INDEX ct;
ALTER TABLE t1o CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
@@ -681,8 +696,6 @@ FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE '%FTS_%' ORDER BY 1, 2;
prefix name
ALTER TABLE t ADD FULLTEXT INDEX(t);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT sc.pos, sc.NAME FROM information_schema.innodb_sys_columns sc
INNER JOIN information_schema.innodb_sys_tables st
ON sc.TABLE_ID=st.TABLE_ID
@@ -1018,8 +1031,6 @@ PRIMARY KEY (id)
COLLATE=utf8_unicode_ci
ROW_FORMAT=COMPRESSED;
ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
DROP INDEX index_ft_body ON notes;
CREATE DATABASE db2;
RENAME TABLE db1.notes TO db2.notes;
diff --git a/mysql-test/suite/innodb/r/innodb-changed-pages.result b/mysql-test/suite/innodb/r/innodb-changed-pages.result
deleted file mode 100644
index 392b5e64e2e..00000000000
--- a/mysql-test/suite/innodb/r/innodb-changed-pages.result
+++ /dev/null
@@ -1,72 +0,0 @@
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 10 AND end_lsn > 20 ;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA . `INNODB_CHANGED_PAGES` AS table1 WHERE ( ( (NOT ( ( ( ( (NOT ( table1 . `page_id` <> table1 . `start_lsn` AND table1 . `space_id` <> 8) AND table1 . `page_id` >= table1 . `end_lsn`) OR table1 . `end_lsn` = table1 . `space_id`) AND table1 . `end_lsn` <> table1 . `page_id`) OR table1 . `end_lsn` < 8) AND table1 . `space_id` >= '2000-06-10 11:33:07.046821') AND table1 . `end_lsn` >= 5) AND table1 . `start_lsn` < 'mm') OR table1 . `end_lsn` != table1 . `end_lsn`) HAVING ( table1 . `start_lsn` < '2005-09-09 01:34:19.012946' OR table1 . `page_id` < 6) ORDER BY table1 . `start_lsn`
-LIMIT 3;
-space_id page_id start_lsn end_lsn
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'mm'
-Warning 1292 Truncated incorrect DOUBLE value: '2005-09-09 01:34:19.012946'
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn > 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn >= 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn > 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn >= 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 and end_lsn < 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 and end_lsn < 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 and end_lsn <= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 and end_lsn <= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn = 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn = 2000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn < 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn < 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn <= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn <= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn < 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn < 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn <= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn <= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn > 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn > 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn >= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn >= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn > 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn > 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn >= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn >= 3000000;
-space_id page_id start_lsn end_lsn
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE (start_lsn > 2000000 and end_lsn < 3000000) or (start_lsn > 4000000 and end_lsn < 5000000);
-space_id page_id start_lsn end_lsn
diff --git a/mysql-test/suite/innodb/r/innodb-corrupted-table.result b/mysql-test/suite/innodb/r/innodb-corrupted-table.result
index 1a8cea06c4c..9a0b3d81810 100644
--- a/mysql-test/suite/innodb/r/innodb-corrupted-table.result
+++ b/mysql-test/suite/innodb/r/innodb-corrupted-table.result
@@ -1,5 +1,5 @@
-call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB.*");
-call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MariaDB.*");
+call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB");
+call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB");
create table t1 (pk int, i int, key(i)) engine=InnoDB;
insert into t1 values (1,1),(2,2);
flush tables;
diff --git a/mysql-test/suite/innodb/r/innodb-fk-warnings.result b/mysql-test/suite/innodb/r/innodb-fk-warnings.result
index e3cf8f7362b..21e7c23d249 100644
--- a/mysql-test/suite/innodb/r/innodb-fk-warnings.result
+++ b/mysql-test/suite/innodb/r/innodb-fk-warnings.result
@@ -27,7 +27,7 @@ show warnings;
Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near ' foreign key a (a) references t1(a)) engine=innodb'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
drop table t1;
create table t1(a int not null primary key, b int) engine=innodb;
create table t2(a int, b int, constraint a foreign key a (a) references t1(a),
@@ -36,7 +36,7 @@ ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint
show warnings;
Level Code Message
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
alter table t2 add constraint b foreign key (b) references t2(b);
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
@@ -44,7 +44,7 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`t2` with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near ' foreign key (b) references t2(b)'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
drop table t2, t1;
create table t1 (f1 integer primary key) engine=innodb;
alter table t1 add constraint c1 foreign key (f1) references t11(f1);
@@ -53,7 +53,7 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t11` not found in the data dictionary near ' foreign key (f1) references t11(f1)'.
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t1`
drop table t1;
create temporary table t1(a int not null primary key, b int, key(b)) engine=innodb;
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
@@ -76,14 +76,14 @@ show warnings;
Level Code Message
Warning 150 Create table `mysqld.1`.`t2` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary near 'foreign key(a) references t1(a)) engine=innodb'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
alter table t1 add foreign key(b) references t1(a);
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
show warnings;
Level Code Message
Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary near 'foreign key(b) references t1(a)'.
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t1`
drop table t1;
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
alter table t1 add foreign key(a,b) references t1(a);
@@ -106,14 +106,14 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. You have defined a SET NULL condition but column 'f1' is defined as NOT NULL in ' foreign key (f1) references t1(f1) on update set null' near ' on update set null'.
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t1`
create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
show warnings;
Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. You have defined a SET NULL condition but column 'a' is defined as NOT NULL in 'foreign key(a) references t1(f1) on delete set null) engine=innodb' near ' on delete set null) engine=innodb'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
drop table t1;
create table t1 (id int not null primary key, f1 int, f2 int, key(f1)) engine=innodb;
create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=innodb;
@@ -122,5 +122,5 @@ show warnings;
Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. Field type or character set for column 'a' does not mach referenced column 'f1' near 'foreign key(a) references t1(f1)) engine=innodb'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result
index a0c14ee6fe4..0a269bad828 100644
--- a/mysql-test/suite/innodb/r/innodb-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-fk.result
@@ -53,7 +53,7 @@ Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary near ' FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
) ENGINE=InnoDB'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
f2 int(11) NOT NULL,
@@ -67,7 +67,7 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary near ' FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE'.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `t2`
drop table t2;
drop table t1;
CREATE DATABASE kg_test1;
diff --git a/mysql-test/suite/innodb/r/innodb-fkcheck.result b/mysql-test/suite/innodb/r/innodb-fkcheck.result
index c6beabb0f50..efa227e4035 100644
--- a/mysql-test/suite/innodb/r/innodb-fkcheck.result
+++ b/mysql-test/suite/innodb/r/innodb-fkcheck.result
@@ -37,7 +37,7 @@ ERROR HY000: Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint
show warnings;
Level Code Message
Error 1005 Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `b`
DROP TABLE IF EXISTS d;
Warnings:
Note 1051 Unknown table 'bug_fk.d'
@@ -76,7 +76,7 @@ ERROR HY000: Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint
show warnings;
Level Code Message
Error 1005 Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `b`
set foreign_key_checks=0;
drop table c;
drop table d;
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
deleted file mode 100644
index 5f098b8ecbf..00000000000
--- a/mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result
+++ /dev/null
@@ -1,4 +0,0 @@
-FLUSH NO_WRITE_TO_BINLOG changed_page_bitmaps;
-select * from information_schema.changed_page_bitmaps;
-dummy
-0
diff --git a/mysql-test/suite/innodb/r/innodb-index-debug.result b/mysql-test/suite/innodb/r/innodb-index-debug.result
index bf2abce989c..daef31d2caa 100644
--- a/mysql-test/suite/innodb/r/innodb-index-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-index-debug.result
@@ -83,7 +83,7 @@ create table t1(k1 int auto_increment primary key,
k2 char(200),k3 char(200))engine=innodb;
SET DEBUG_SYNC= 'row_merge_after_scan
SIGNAL opened WAIT_FOR flushed';
-ALTER TABLE t1 ADD COLUMN k4 int;
+ALTER TABLE t1 FORCE, ADD COLUMN k4 int;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET debug = '+d,row_log_tmpfile_fail';
@@ -95,7 +95,7 @@ SET DEBUG_SYNC= 'now SIGNAL flushed';
SET DEBUG_DBUG = @saved_debug_dbug;
connection con1;
/*con1 reap*/ ALTER TABLE t1 ADD COLUMN k4 int;
-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
+ERROR HY000: Out of memory.
SELECT COUNT(k1),k2,k3 FROM t1 GROUP BY k2,k3;
COUNT(k1) k2 k3
480 aaa bbb
diff --git a/mysql-test/suite/innodb/r/innodb-index-online-fk.result b/mysql-test/suite/innodb/r/innodb-index-online-fk.result
index 4bd4b060ab3..854afd95aaf 100644
--- a/mysql-test/suite/innodb/r/innodb-index-online-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-index-online-fk.result
@@ -127,6 +127,7 @@ SYS_TABLESPACES
SYS_VIRTUAL
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/child
test/parent
INSERT INTO child VALUES(5,4);
@@ -318,12 +319,15 @@ SYS_TABLESPACES
SYS_VIRTUAL
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/child
test/parent
ALTER TABLE child ADD PRIMARY KEY idx (a3), CHANGE a1 a3 INT,
ADD CONSTRAINT fk_1 FOREIGN KEY (a2) REFERENCES parent(b)
ON DELETE SET NULL ON UPDATE CASCADE,
ALGORITHM = INPLACE;
+Warnings:
+Warning 1280 Name 'idx' ignored for PRIMARY key.
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
ID FOR_NAME REF_NAME N_COLS TYPE
test/fk_1 test/child test/parent 1 6
@@ -343,6 +347,7 @@ SYS_TABLESPACES
SYS_VIRTUAL
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/child
test/parent
SHOW CREATE TABLE child;
@@ -360,6 +365,8 @@ ALTER TABLE child ADD PRIMARY KEY idx (a1),
ADD CONSTRAINT fk_1 FOREIGN KEY (a2) REFERENCES parent(b)
ON DELETE SET NULL ON UPDATE CASCADE,
ALGORITHM = INPLACE;
+Warnings:
+Warning 1280 Name 'idx' ignored for PRIMARY key.
SELECT * from information_schema.INNODB_SYS_FOREIGN;
ID FOR_NAME REF_NAME N_COLS TYPE
test/fk_1 test/child test/parent 1 6
@@ -379,6 +386,7 @@ SYS_TABLESPACES
SYS_VIRTUAL
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/child
test/parent
SHOW CREATE TABLE child;
@@ -415,6 +423,7 @@ SYS_TABLESPACES
SYS_VIRTUAL
mysql/innodb_index_stats
mysql/innodb_table_stats
+mysql/transaction_registry
test/child
test/parent
SHOW CREATE TABLE child;
@@ -551,6 +560,8 @@ ADD CONSTRAINT fk_new_1 FOREIGN KEY (a1) REFERENCES parent(b),
ADD CONSTRAINT fk_new_2 FOREIGN KEY (a2) REFERENCES parent(a),
ADD CONSTRAINT fk_new_3 FOREIGN KEY (a3) REFERENCES parent(a),
ALGORITHM = INPLACE;
+Warnings:
+Warning 1280 Name 'idx' ignored for PRIMARY key.
SHOW CREATE TABLE child;
Table Create Table
child CREATE TABLE `child` (
diff --git a/mysql-test/suite/innodb/r/innodb-index-online.result b/mysql-test/suite/innodb/r/innodb-index-online.result
index e42e93e9989..a0227d31393 100644
--- a/mysql-test/suite/innodb/r/innodb-index-online.result
+++ b/mysql-test/suite/innodb/r/innodb-index-online.result
@@ -37,11 +37,15 @@ connection con1;
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG = '+d,innodb_OOM_prepare_inplace_alter';
ALTER TABLE t1 ADD UNIQUE INDEX(c2);
-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
+ERROR HY000: Out of memory.
SET DEBUG_DBUG = @saved_debug_dbug;
SET DEBUG_DBUG = '+d,innodb_OOM_inplace_alter';
CREATE UNIQUE INDEX c2 ON t1(c2);
-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
+ERROR HY000: Out of memory.
+SET DEBUG_DBUG = @saved_debug_dbug;
+SET DEBUG_DBUG = '+d,innodb_OOM_prepare_add_index';
+ALTER TABLE t1 ADD KEY(c2), ADD KEY c3_10(c3(10)), ADD KEY c3_c2(c3(4),c2);
+ERROR HY000: Out of memory.
SET DEBUG_DBUG = @saved_debug_dbug;
CREATE UNIQUE INDEX c2 ON t1(c2);
DROP INDEX c2 ON t1;
diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7513.result b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
index bb3531e3f90..68f06d89036 100644
--- a/mysql-test/suite/innodb/r/innodb-mdev-7513.result
+++ b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("Row size too large (> 8126)*");
CREATE TABLE t1 ( text1 TEXT,
text2 TEXT,
text3 TEXT,
diff --git a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
index 5297f1eb4f1..509d4cd03fb 100644
--- a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
+++ b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
@@ -1,13 +1,13 @@
create table t1(a int not null primary key, b geometry not null) engine=innodb;
-ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b);
-ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
+ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Do not support online operation on table with GIS index. Try ALGORITHM=NOCOPY
show warnings;
Level Code Message
-Error 1846 LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
+Error 1846 ALGORITHM=INSTANT is not supported. Reason: Do not support online operation on table with GIS index. Try ALGORITHM=NOCOPY
show errors;
Level Code Message
-Error 1846 LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
-ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), LOCK=SHARED;
+Error 1846 ALGORITHM=INSTANT is not supported. Reason: Do not support online operation on table with GIS index. Try ALGORITHM=NOCOPY
+ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), LOCK=SHARED, ALGORITHM=NOCOPY;
show warnings;
Level Code Message
show errors;
diff --git a/mysql-test/suite/innodb/r/innodb-page-cleaners.result b/mysql-test/suite/innodb/r/innodb-page-cleaners.result
new file mode 100644
index 00000000000..0954e42cf9f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page-cleaners.result
@@ -0,0 +1,45 @@
+SET @saved_page_cleaners = @@GLOBAL.innodb_page_cleaners;
+create table t1 (a int not null primary key auto_increment,
+b bigint,
+c varchar(200),
+d int,
+key b (b),
+key d (d)) engine=INNODB;
+set GLOBAL innodb_page_cleaners = 4;
+connect con1,localhost,root,,;
+connection con1;
+update t1 set b = b + 5, d = d + 1 where a between 1 and 2000;
+connect con2,localhost,root,,;
+connection con2;
+update t1 set b = b + 5, d = d + 1 where a between 3000 and 5000;
+connect con3,localhost,root,,;
+connection con3;
+update t1 set b = b + 5, d = d + 1 where a between 8000 and 12000;
+connection default;
+set GLOBAL innodb_page_cleaners = 2;
+set GLOBAL innodb_page_cleaners = 4;
+set GLOBAL innodb_page_cleaners = 6;
+connection con1;
+connection con2;
+connection con3;
+connection default;
+set GLOBAL innodb_page_cleaners = 4;
+connection con1;
+update t1 set b = b + 5, d = d + 1 where a between 1 and 2000;
+connection con2;
+update t1 set b = b + 5, d = d + 1 where a between 3000 and 5000;
+connection con3;
+update t1 set b = b + 5, d = d + 1 where a between 8000 and 12000;
+connection default;
+set GLOBAL innodb_page_cleaners = 3;
+set GLOBAL innodb_page_cleaners = 2;
+set GLOBAL innodb_page_cleaners = 1;
+connection con1;
+connection con2;
+connection con3;
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+DROP TABLE t1;
+SET GLOBAL innodb_page_cleaners=@saved_page_cleaners;
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
index 61507ddbe5c..5411f5149d1 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
@@ -147,7 +147,8 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*)
5000
-alter table innodb_normal page_compressed=1 page_compression_level=8;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
Level Code Message
show create table innodb_normal;
@@ -156,6 +157,10 @@ 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, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
show warnings;
Level Code Message
@@ -174,6 +179,7 @@ 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
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_default.result b/mysql-test/suite/innodb/r/innodb-page_compression_default.result
index ca7129fd3eb..8977a149935 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_default.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_default.result
@@ -1,5 +1,3 @@
-set global innodb_file_format = `Barracuda`;
-set global innodb_file_per_table = on;
create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
index 6cef1978ca0..aefb5c8a0be 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
@@ -147,7 +147,8 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*)
5000
-alter table innodb_normal page_compressed=1 page_compression_level=8;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
Level Code Message
show create table innodb_normal;
@@ -156,6 +157,10 @@ 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, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
show warnings;
Level Code Message
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
index c7ab859e102..606de870d7c 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
@@ -147,7 +147,8 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*)
5000
-alter table innodb_normal page_compressed=1 page_compression_level=8;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
Level Code Message
show create table innodb_normal;
@@ -156,6 +157,10 @@ 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, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
show warnings;
Level Code Message
@@ -174,6 +179,7 @@ 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
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
index 379abcc9968..66783c35d6c 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
@@ -147,7 +147,8 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*)
5000
-alter table innodb_normal page_compressed=1 page_compression_level=8;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
Level Code Message
show create table innodb_normal;
@@ -156,6 +157,10 @@ 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, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
show warnings;
Level Code Message
@@ -174,6 +179,7 @@ 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
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
index 6e0ee94e69e..98c353e87e3 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
@@ -1,6 +1,4 @@
set global innodb_compression_algorithm = snappy;
-set global innodb_file_format = `Barracuda`;
-set global innodb_file_per_table = on;
create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
index 33b36428040..439f409ea59 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
@@ -88,8 +88,12 @@ select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
set global innodb_compression_algorithm = 0;
-alter table innodb_compact engine=innodb page_compressed=DEFAULT;
-alter table innodb_dynamic engine=innodb page_compressed=DEFAULT;
+alter table innodb_compact page_compressed=DEFAULT, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_compact page_compressed=DEFAULT;
+alter table innodb_dynamic page_compressed=DEFAULT, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_dynamic page_compressed=DEFAULT;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
index bb9ceb29e17..9dcf676cb3d 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
@@ -147,7 +147,8 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*)
5000
-alter table innodb_normal page_compressed=1 page_compression_level=8;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
Level Code Message
show create table innodb_normal;
@@ -156,6 +157,10 @@ 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, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
show warnings;
Level Code Message
diff --git a/mysql-test/suite/innodb/r/innodb-system-table-view.result b/mysql-test/suite/innodb/r/innodb-system-table-view.result
index 89bddd73145..b8d061d3214 100644
--- a/mysql-test/suite/innodb/r/innodb-system-table-view.result
+++ b/mysql-test/suite/innodb/r/innodb-system-table-view.result
@@ -1,15 +1,18 @@
+SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
SELECT table_id INTO @table_stats_id FROM information_schema.innodb_sys_tables
WHERE name = 'mysql/innodb_table_stats';
SELECT table_id INTO @index_stats_id FROM information_schema.innodb_sys_tables
WHERE name = 'mysql/innodb_index_stats';
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE table_id NOT IN (@table_stats_id, @index_stats_id) ORDER BY table_id;
-TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
-11 SYS_FOREIGN 0 7 0 Antelope Redundant 0 System
-12 SYS_FOREIGN_COLS 0 7 0 Antelope Redundant 0 System
-13 SYS_TABLESPACES 0 6 0 Antelope Redundant 0 System
-14 SYS_DATAFILES 0 5 0 Antelope Redundant 0 System
-15 SYS_VIRTUAL 0 6 0 Antelope Redundant 0 System
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+11 SYS_FOREIGN 0 7 0 Redundant 0 System
+12 SYS_FOREIGN_COLS 0 7 0 Redundant 0 System
+13 SYS_TABLESPACES 0 6 0 Redundant 0 System
+14 SYS_DATAFILES 0 5 0 Redundant 0 System
+15 SYS_VIRTUAL 0 6 0 Redundant 0 System
+18 mysql/transaction_registry 33 8 3 Dynamic 0 Single
SELECT table_id,pos,mtype,prtype,len,name
FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id NOT IN (@table_stats_id, @index_stats_id)
@@ -31,6 +34,11 @@ table_id pos mtype prtype len name
15 0 6 0 8 TABLE_ID
15 1 6 0 4 POS
15 2 6 0 4 BASE_POS
+18 0 6 1800 8 transaction_id
+18 1 6 1800 8 commit_id
+18 2 3 526087 7 begin_timestamp
+18 3 3 526087 7 commit_timestamp
+18 4 6 1022 1 isolation_level
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES
WHERE table_id NOT IN (@table_stats_id, @index_stats_id) ORDER BY index_id;
INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE MERGE_THRESHOLD
@@ -41,6 +49,10 @@ INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE MERGE_THRESHOLD
# SYS_TABLESPACES_SPACE # 3 1 # # 50
# SYS_DATAFILES_SPACE # 3 1 # # 50
# BASE_IDX # 3 3 # # 50
+# PRIMARY # 3 1 # # 50
+# commit_id # 2 1 # # 50
+# begin_timestamp # 0 1 # # 50
+# commit_timestamp # 0 2 # # 50
SELECT index_id,pos,name FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS
WHERE name NOT IN ('database_name', 'table_name', 'index_name', 'stat_name')
ORDER BY index_id, pos;
@@ -55,6 +67,11 @@ index_id pos name
17 0 TABLE_ID
17 1 POS
17 2 BASE_POS
+20 0 transaction_id
+21 0 commit_id
+22 0 begin_timestamp
+23 0 commit_timestamp
+23 1 transaction_id
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
ID FOR_NAME REF_NAME N_COLS TYPE
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
@@ -78,7 +95,7 @@ test/t_dynamic Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t_dynamic.ibd
DROP TABLE t_redundant, t_compact, t_compressed, t_dynamic;
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
count(*)
-7
+8
CREATE TABLE parent (id INT NOT NULL,
PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT,
@@ -93,6 +110,7 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
ID FOR_COL_NAME REF_COL_NAME POS
test/constraint_test parent_id id 0
INSERT INTO parent VALUES(1);
+InnoDB 0 transactions not purged
SELECT name, num_rows, ref_count
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name LIKE "%parent";
@@ -108,6 +126,7 @@ SYS_TABLESPACES 0 6
SYS_VIRTUAL 0 6
mysql/innodb_index_stats 33 11
mysql/innodb_table_stats 33 9
+mysql/transaction_registry 33 8
test/child 33 5
test/parent 33 4
SELECT name, n_fields
@@ -153,6 +172,7 @@ INSERT INTO parent VALUES(1, 9);
SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
id newid
1 9
+InnoDB 0 transactions not purged
SELECT name, num_rows, ref_count
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name LIKE "%parent";
@@ -160,3 +180,4 @@ name num_rows ref_count
test/parent 1 2
DROP TABLE child;
DROP TABLE parent;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result
index 0b36913dbb1..8b6c2324431 100644
--- a/mysql-test/suite/innodb/r/innodb-table-online.result
+++ b/mysql-test/suite/innodb/r/innodb-table-online.result
@@ -42,7 +42,7 @@ connection con1;
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG = '+d,innodb_OOM_prepare_inplace_alter';
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
-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
+ERROR HY000: Out of memory.
SET SESSION DEBUG = @saved_debug_dbug;
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
@@ -50,7 +50,7 @@ SET SESSION DEBUG = '+d,innodb_OOM_inplace_alter';
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
-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
+ERROR HY000: Out of memory.
SET SESSION DEBUG = @saved_debug_dbug;
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
@@ -396,17 +396,11 @@ UPDATE t1 SET c3 = NULL WHERE c3 = '';
SET lock_wait_timeout = 1;
ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5));
ERROR 42000: Key column 'c22f' doesn't exist in table
-SET @old_sql_mode = @@sql_mode;
-SET @@sql_mode = 'STRICT_TRANS_TABLES';
-ALTER TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
+ALTER IGNORE TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
ALGORITHM = INPLACE;
-ERROR 22004: Invalid use of NULL value
-ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
-ERROR 22004: Invalid use of NULL value
-SET @@sql_mode = @old_sql_mode;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY
UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0';
-SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)),
ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST;
@@ -419,8 +413,7 @@ INSERT INTO t1 VALUES(33101,347,NULL,'');
SET DEBUG_SYNC = 'now SIGNAL ins_done0';
# session con1
connection con1;
-ERROR 22004: Invalid use of NULL value
-SET @@sql_mode = @old_sql_mode;
+ERROR 01000: Data truncated for column 'c3' at row 323
# session default
connection default;
ROLLBACK;
diff --git a/mysql-test/suite/innodb/r/innodb-timeout.result b/mysql-test/suite/innodb/r/innodb-timeout.result
index f252ebac314..52ed1a6f9b4 100644
--- a/mysql-test/suite/innodb/r/innodb-timeout.result
+++ b/mysql-test/suite/innodb/r/innodb-timeout.result
@@ -57,3 +57,63 @@ disconnect a;
connection default;
drop table t1;
set global innodb_lock_wait_timeout=<initial_timeout>;
+#
+# MDEV-11379 - AliSQL: [Feature] Issue#8: SELECT FOR UPDATE WAIT
+#
+CREATE TABLE t1 (c1 INT, c2 INT) ENGINE=InnoDB;
+INSERT INTO t1 (c1,c2) values (1,1),(2,2),(3,3),(4,4);
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+ERROR HY000: View's SELECT contains a '[NO]WAIT' clause
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+ERROR HY000: View's SELECT contains a '[NO]WAIT' clause
+CREATE PROCEDURE p1() SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+ERROR 0A000: [NO]WAIT is not allowed in stored procedures
+CREATE PROCEDURE p1() SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+ERROR 0A000: [NO]WAIT is not allowed in stored procedures
+connect con1,localhost,root,,;
+LOCK TABLE t1 WRITE;
+connect con2,localhost,root,,;
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+PREPARE stmt FROM 'SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT';
+EXECUTE stmt;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM 'SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0';
+EXECUTE stmt;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+DEALLOCATE PREPARE stmt;
+connection con1;
+INSERT INTO t1 VALUES(5,5);
+UNLOCK TABLES;
+set AUTOCOMMIT=0;
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
+connection con2;
+set AUTOCOMMIT=0;
+SET INNODB_LOCK_WAIT_TIMEOUT=1;
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
+UPDATE t1 SET c2=5 WHERE c1=4;
+COMMIT;
+set AUTOCOMMIT=0;
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
+c1 c2
+4 5
+connection con2;
+set AUTOCOMMIT=0;
+SET INNODB_LOCK_WAIT_TIMEOUT=1;
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 10;
+connection con1;
+COMMIT;
+connection con2;
+disconnect con1;
+disconnect con2;
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
index de97d933ad9..4b2df7eb287 100644
--- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result
+++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
@@ -6,6 +6,8 @@ wdraw_rsn varchar(4) NOT NULL DEFAULT '',
admit_term char(4) NOT NULL DEFAULT '',
CONSTRAINT gso_grad_supr_pky PRIMARY KEY (uw_id, term)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1280 Name 'gso_grad_supr_pky' ignored for PRIMARY key.
INSERT INTO `gso_grad_supr` VALUES ('1031',2,'CSM','','1009');
INSERT INTO `gso_grad_supr` VALUES ('1035',2,'CSM','ACAD','1009');
CREATE TABLE IF NOT EXISTS grad_degree (
@@ -23,6 +25,8 @@ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginn
deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1280 Name 'grad_degree_stu_plan_admit_pky' ignored for PRIMARY key.
SHOW CREATE TABLE grad_degree;
Table Create Table
grad_degree CREATE TABLE `grad_degree` (
@@ -129,6 +133,8 @@ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginn
deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1280 Name 'grad_degree_stu_plan_admit_pky' ignored for PRIMARY key.
SHOW CREATE TABLE grad_degree;
Table Create Table
grad_degree CREATE TABLE `grad_degree` (
@@ -263,6 +269,8 @@ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginn
deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1280 Name 'grad_degree_stu_plan_admit_pky' ignored for PRIMARY key.
SHOW CREATE TABLE grad_degree;
Table Create Table
grad_degree CREATE TABLE `grad_degree` (
@@ -339,8 +347,6 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(12), c INT AS (a) VIRTUAL) ENGINE=InnoDB;
INSERT INTO t1 (a,b) VALUES (1,'foo');
ALTER TABLE t1 ADD FULLTEXT KEY(b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM t1;
a b c
1 foo 1
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
index da064b83be6..7de37cbc868 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
@@ -320,7 +320,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_1";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -333,7 +333,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_2";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -346,7 +346,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_4";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -359,7 +359,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_5";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -372,7 +372,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_6";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -385,7 +385,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_7";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -398,7 +398,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_8";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -411,7 +411,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_9";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
@@ -424,7 +424,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_10";
ALTER TABLE t1 IMPORT TABLESPACE;
-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
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
diff --git a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
index 936809cb63a..6af968313e5 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
@@ -700,8 +700,6 @@ ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation require
ALTER TABLE t1 ADD FULLTEXT INDEX (ct),
CHANGE c1 pk INT, ALTER c2 SET DEFAULT 42, RENAME TO tt,
ALGORITHM=INPLACE, LOCK=SHARED;
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
### files in MYSQL_DATA_DIR/test
FTS_AUX_INDEX_1.isl
FTS_AUX_INDEX_2.isl
@@ -783,11 +781,9 @@ ERROR 42000: Incorrect column name 'FTS_Doc_ID'
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
CREATE TABLE t1n LIKE t1o;
ALTER TABLE t1n ADD FULLTEXT INDEX(ct);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
### files in MYSQL_DATA_DIR/test
FTS_AUX_INDEX_1.isl
FTS_AUX_INDEX_2.isl
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 921f9880d47..233023e63c2 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -2297,15 +2297,9 @@ a b
20 NULL
drop table t1;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
-SET GLOBAL innodb_large_prefix=OFF;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table t1 (v varchar(65530), key(v));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-SET GLOBAL innodb_large_prefix=default;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+Warning 1071 Specified key was too long; max key length is 3072 bytes
drop table t1;
create table t1 (v varchar(65536));
Warnings:
@@ -2470,55 +2464,6 @@ t9 CREATE TABLE `t9` (
KEY `col1` (`col1`,`col2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
-SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
-SET GLOBAL innodb_large_prefix=OFF;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create table t1 (col1 varchar(768), index(col1))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t2 (col1 varbinary(768), index(col1))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t3 (col1 text, index(col1(768)))
-character set = latin1 engine = innodb;
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-create table t4 (col1 blob, index(col1(768)))
-character set = latin1 engine = innodb;
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-SET GLOBAL innodb_large_prefix=default;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `col1` varchar(768) DEFAULT NULL,
- KEY `col1` (`col1`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2, t3, t4;
-set global innodb_large_prefix=OFF;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create table t1 (col1 varchar(768) primary key)
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t2 (col1 varbinary(768) primary key)
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t3 (col1 text, primary key(col1(768)))
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t4 (col1 blob, primary key(col1(768)))
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-SET sql_mode = default;
-set global innodb_large_prefix=default;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE t1
(
id INT PRIMARY KEY
diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result
index 40b9c7515c2..15d72b74922 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -1,3 +1,6 @@
+# Ensure that purge will not crash on the table after we corrupt it.
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+SET GLOBAL innodb_fast_shutdown=0;
# Create and populate the table to be corrupted
set global innodb_file_per_table=ON;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/r/innodb_bug30113362.result b/mysql-test/suite/innodb/r/innodb_bug30113362.result
index 57dff622211..9d43053b281 100644
--- a/mysql-test/suite/innodb/r/innodb_bug30113362.result
+++ b/mysql-test/suite/innodb/r/innodb_bug30113362.result
@@ -8,7 +8,7 @@ a00 CHAR(255) NOT NULL DEFAULT 'a',
a01 CHAR(255) NOT NULL DEFAULT 'a',
a02 CHAR(255) NOT NULL DEFAULT 'a',
b INT NOT NULL DEFAULT 0,
-CONSTRAINT pkey PRIMARY KEY(a00, a01, a02)
+PRIMARY KEY(a00, a01, a02)
) charset latin1 ENGINE = InnoDB COMMENT='MERGE_THRESHOLD=45';
SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
CREATE PROCEDURE data_load_t1()
diff --git a/mysql-test/suite/innodb/r/innodb_bug47167.result b/mysql-test/suite/innodb/r/innodb_bug47167.result
deleted file mode 100644
index 14977539b3b..00000000000
--- a/mysql-test/suite/innodb/r/innodb_bug47167.result
+++ /dev/null
@@ -1,32 +0,0 @@
-set @old_innodb_file_format_max=@@innodb_file_format_max;
-select @old_innodb_file_format_max;
-@old_innodb_file_format_max
-Barracuda
-set global innodb_file_format_max = Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-set global innodb_file_format_max = DEFAULT;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Antelope
-set global innodb_file_format_max = @old_innodb_file_format_max;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-set global innodb_file_format_max = cheetah;
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah'
-set global innodb_file_format_max = Bear;
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Bear'
-set global innodb_file_format_max = on;
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'ON'
-set global innodb_file_format_max = off;
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'off'
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb/r/innodb_bug51378.result b/mysql-test/suite/innodb/r/innodb_bug51378.result
index 532fd703af6..2ffd533279b 100644
--- a/mysql-test/suite/innodb/r/innodb_bug51378.result
+++ b/mysql-test/suite/innodb/r/innodb_bug51378.result
@@ -28,6 +28,8 @@ bug51378 CREATE TABLE `bug51378` (
UNIQUE KEY `idx2` (`col1`,`col2`(31))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table bug51378 add primary key idx3(col1, col2(31));
+Warnings:
+Warning 1280 Name 'idx3' ignored for PRIMARY key.
SHOW CREATE TABLE bug51378;
Table Create Table
bug51378 CREATE TABLE `bug51378` (
diff --git a/mysql-test/suite/innodb/r/innodb_bug60229.result b/mysql-test/suite/innodb/r/innodb_bug60229.result
index a3971876193..588f3855764 100644
--- a/mysql-test/suite/innodb/r/innodb_bug60229.result
+++ b/mysql-test/suite/innodb/r/innodb_bug60229.result
@@ -4,6 +4,8 @@ DOB VARCHAR(50) NOT NULL,
NAME NVARCHAR(255) NOT NULL,
CONSTRAINT PK_PERSON PRIMARY KEY (PERSON_ID, DOB)
)Engine=InnoDB;
+Warnings:
+Warning 1280 Name 'PK_PERSON' ignored for PRIMARY key.
CREATE TABLE PHOTO (
PERSON_ID VARCHAR(50) NOT NULL,
DOB VARCHAR(50) NOT NULL,
@@ -11,6 +13,8 @@ PHOTO_DETAILS VARCHAR(50) NULL,
CONSTRAINT PK_PHOTO PRIMARY KEY (PERSON_ID, DOB),
CONSTRAINT FK_PHOTO_2_PERSON FOREIGN KEY (PERSON_ID, DOB) REFERENCES PERSON (PERSON_ID, DOB)
)Engine=InnoDB;
+Warnings:
+Warning 1280 Name 'PK_PHOTO' ignored for PRIMARY key.
CREATE TABLE ADDRESS (
PERSON_ID VARCHAR(50) NOT NULL,
DOB VARCHAR(50) NOT NULL,
@@ -19,6 +23,8 @@ ADDRESS_DETAILS NVARCHAR(250) NULL,
CONSTRAINT PK_ADDRESS PRIMARY KEY (PERSON_ID, DOB, ADDRESS_ID),
CONSTRAINT FK_ADDRESS_2_PERSON FOREIGN KEY (PERSON_ID, DOB) REFERENCES PERSON (PERSON_ID, DOB) ON DELETE CASCADE
)Engine=InnoDB;
+Warnings:
+Warning 1280 Name 'PK_ADDRESS' ignored for PRIMARY key.
INSERT INTO PERSON VALUES("10", "11011999", "John");
INSERT INTO PHOTO VALUES("10", "11011999", "new photo");
DROP TABLE PHOTO;
diff --git a/mysql-test/suite/innodb/r/innodb_bug84958.result b/mysql-test/suite/innodb/r/innodb_bug84958.result
index 4076999415f..b721c73a0fc 100644
--- a/mysql-test/suite/innodb/r/innodb_bug84958.result
+++ b/mysql-test/suite/innodb/r/innodb_bug84958.result
@@ -51,7 +51,7 @@ connection default;
# Connect to default and record how many pages were accessed
# when selecting the record using the secondary key.
#
-InnoDB 3 transactions not purged
+InnoDB 4 transactions not purged
SET @num_pages_1 = num_pages_get();
SELECT * FROM t1 force index (b);
a b c
diff --git a/mysql-test/suite/innodb/r/innodb_bulk_create_index_flush.result b/mysql-test/suite/innodb/r/innodb_bulk_create_index_flush.result
index c795ee044e6..d2b812642f6 100644
--- a/mysql-test/suite/innodb/r/innodb_bulk_create_index_flush.result
+++ b/mysql-test/suite/innodb/r/innodb_bulk_create_index_flush.result
@@ -33,7 +33,7 @@ ERROR 70100: Query execution was interrupted
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
-ALTER TABLE t1 ADD COLUMN content TEXT;
+ALTER TABLE t1 ADD COLUMN content TEXT, FORCE;
ERROR 70100: Query execution was interrupted
CHECK TABLE t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
deleted file mode 100644
index 48f330f90fe..00000000000
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ /dev/null
@@ -1,66 +0,0 @@
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-1
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-set global innodb_file_format=antelope;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format=barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format=cheetah;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'cheetah'
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=default;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=on;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON'
-set global innodb_file_format=off;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off'
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format_max=antelope;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format_max=barracuda;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format_max=cheetah;
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah'
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-set global innodb_file_format_max=default;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Antelope
-set global innodb_file_format=on;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON'
-set global innodb_file_format=off;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off'
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Antelope
-set global innodb_file_format_max=antelope;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format_check=off;
-ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result
index f7e0899d2d7..f8b02bb163a 100644
--- a/mysql-test/suite/innodb/r/innodb_gis.result
+++ b/mysql-test/suite/innodb/r/innodb_gis.result
@@ -507,8 +507,8 @@ down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersects
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
diff --git a/mysql-test/suite/innodb/r/innodb_information_schema.result b/mysql-test/suite/innodb/r/innodb_information_schema.result
index 36c76b03bd0..766d5f47c2d 100644
--- a/mysql-test/suite/innodb/r/innodb_information_schema.result
+++ b/mysql-test/suite/innodb/r/innodb_information_schema.result
@@ -42,11 +42,10 @@ trx_isolation_level varchar(16) NO
trx_unique_checks int(1) NO 0
trx_foreign_key_checks int(1) NO 0
trx_last_foreign_key_error varchar(256) YES NULL
-trx_adaptive_hash_latched int(1) NO 0
trx_is_read_only int(1) NO 0
trx_autocommit_non_locking int(1) NO 0
trx_state trx_weight trx_tables_in_use trx_tables_locked trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks
-RUNNING 4 0 1 7 1 0 REPEATABLE READ 1 1
+RUNNING 3 0 1 5 1 0 REPEATABLE READ 1 1
trx_isolation_level trx_unique_checks trx_foreign_key_checks
SERIALIZABLE 0 0
trx_state trx_isolation_level trx_last_foreign_key_error
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 0272ecd82b5..d7a78f8ec90 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -238,14 +238,14 @@ select 1, max(1) from t1i where 1=99;
1 NULL
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
+1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t1m, t2i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
+1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t2i;
count(*) min(7) max(7)
@@ -1165,8 +1165,6 @@ a b
drop table t1,t2;
create table t1(f1 varchar(800) binary not null, key(f1))
character set utf8 collate utf8_general_ci;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
insert into t1 values('aaa');
drop table t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
@@ -1546,13 +1544,11 @@ create table t1(a text) engine=innodb default charset=utf8;
insert into t1 values('aaa');
set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for
alter table t1 add index(a(1024));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT NULL,
- KEY `a` (`a`(255))
+ KEY `a` (`a`(1024))
) ENGINE=InnoDB DEFAULT CHARSET=utf8
drop table t1;
CREATE TABLE t1 (
@@ -1857,7 +1853,7 @@ explain
select b from t1 where a not in (select max(b) from t1,t2 group by a) group by a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
-2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found
+2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 Const row not found
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1
set optimizer_switch=@save_optimizer_switch;
DROP TABLE t1,t2;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
index ccb2e4f012e..a43649f4067 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
@@ -1,6 +1,3 @@
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE worklog5743 (
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
PRIMARY KEY (col_1_text(3072))
@@ -31,6 +28,7 @@ COUNT(*)
1
START TRANSACTION;
connection default;
+SET GLOBAL innodb_fast_shutdown=3;
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
@@ -56,6 +54,7 @@ worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
1 1
connection default;
+SET GLOBAL innodb_fast_shutdown=3;
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
@@ -79,6 +78,7 @@ worklog5743;
col_1_text = REPEAT("b", 3500) col_2_text = REPEAT("o", 3500)
1 1
connection default;
+SET GLOBAL innodb_fast_shutdown=3;
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index d4428c13eef..015bfe9dcef 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -1,5 +1,5 @@
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_is_read_only trx_autocommit_non_locking
+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_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;
@@ -97,7 +97,7 @@ buffer_LRU_batch_flush_avg_time_thread buffer 0 NULL NULL NULL 0 NULL NULL NULL
buffer_flush_adaptive_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for adaptive flushing recently.
buffer_LRU_batch_flush_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for LRU batch flushing recently.
buffer_flush_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Avg time (ms) spent for flushing recently.
-buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Numner of adaptive flushes passed during the recent Avg period.
+buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of adaptive flushes passed during the recent Avg period.
buffer_LRU_batch_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of LRU batch flushes passed during the recent Avg period.
buffer_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of flushes passed during the recent Avg period.
buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Total loops in LRU get free.
@@ -356,7 +356,7 @@ 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 SPACE_TYPE
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
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;
@@ -384,7 +384,7 @@ 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 SPACE_TYPE FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE
+SPACE NAME FLAG ROW_FORMAT PAGE_SIZE ZIP_PAGE_SIZE SPACE_TYPE FS_BLOCK_SIZE FILE_SIZE ALLOCATED_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;
@@ -405,6 +405,6 @@ 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
+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_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_wl6326.result b/mysql-test/suite/innodb/r/innodb_wl6326.result
index fa093581e56..e0574a6b7b1 100644
--- a/mysql-test/suite/innodb/r/innodb_wl6326.result
+++ b/mysql-test/suite/innodb/r/innodb_wl6326.result
@@ -13,7 +13,7 @@ a05 CHAR(255) NOT NULL DEFAULT 'a',
a06 CHAR(255) NOT NULL DEFAULT 'a',
b INT NOT NULL DEFAULT 0
) ENGINE = InnoDB;
-ALTER TABLE t1 ADD CONSTRAINT pkey PRIMARY KEY(
+ALTER TABLE t1 ADD PRIMARY KEY(
a00,
a01,
a02,
diff --git a/mysql-test/suite/innodb/r/innodb_xtradb_compat.result b/mysql-test/suite/innodb/r/innodb_xtradb_compat.result
deleted file mode 100644
index 5722120356a..00000000000
--- a/mysql-test/suite/innodb/r/innodb_xtradb_compat.result
+++ /dev/null
@@ -1,313 +0,0 @@
-select @@innodb_adaptive_hash_index_partitions, @@innodb_adaptive_hash_index_parts;
-@@innodb_adaptive_hash_index_partitions @@innodb_adaptive_hash_index_parts
-16 16
-set global innodb_adaptive_hash_index_partitions=1;
-ERROR HY000: Variable 'innodb_adaptive_hash_index_partitions' is a read only variable
-select @@innodb_buffer_pool_populate;
-@@innodb_buffer_pool_populate
-1
-set global innodb_buffer_pool_populate=1;
-ERROR HY000: Variable 'innodb_buffer_pool_populate' is a read only variable
-select @@innodb_cleaner_eviction_factor;
-@@innodb_cleaner_eviction_factor
-1
-set global innodb_cleaner_eviction_factor=1;
-Warnings:
-Warning 1287 Using innodb_cleaner_eviction_factor is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_eviction_factor;
-@@innodb_cleaner_eviction_factor
-1
-select @@innodb_cleaner_flush_chunk_size;
-@@innodb_cleaner_flush_chunk_size
-16
-set global innodb_cleaner_flush_chunk_size=8;
-Warnings:
-Warning 1287 Using innodb_cleaner_flush_chunk_size is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_flush_chunk_size;
-@@innodb_cleaner_flush_chunk_size
-16
-select @@innodb_cleaner_free_list_lwm;
-@@innodb_cleaner_free_list_lwm
-1
-set global innodb_cleaner_free_list_lwm=1;
-Warnings:
-Warning 1287 Using innodb_cleaner_free_list_lwm is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_free_list_lwm;
-@@innodb_cleaner_free_list_lwm
-1
-select @@innodb_cleaner_lru_chunk_size;
-@@innodb_cleaner_lru_chunk_size
-1
-set global innodb_cleaner_lru_chunk_size=8;
-Warnings:
-Warning 1287 Using innodb_cleaner_lru_chunk_size is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_lru_chunk_size;
-@@innodb_cleaner_lru_chunk_size
-1
-select @@innodb_cleaner_lsn_age_factor;
-@@innodb_cleaner_lsn_age_factor
-HIGH_CHECKPOINT
-set global innodb_cleaner_lsn_age_factor=HIGH_CHECKPOINT;
-Warnings:
-Warning 1287 Using innodb_cleaner_lsn_age_factor is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_lsn_age_factor;
-@@innodb_cleaner_lsn_age_factor
-HIGH_CHECKPOINT
-select @@innodb_cleaner_max_flush_time;
-@@innodb_cleaner_max_flush_time
-1
-set global innodb_cleaner_max_flush_time=1;
-Warnings:
-Warning 1287 Using innodb_cleaner_max_flush_time is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_max_flush_time;
-@@innodb_cleaner_max_flush_time
-1
-select @@innodb_cleaner_max_lru_time;
-@@innodb_cleaner_max_lru_time
-1
-set global innodb_cleaner_max_lru_time=1;
-Warnings:
-Warning 1287 Using innodb_cleaner_max_lru_time is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_cleaner_max_lru_time;
-@@innodb_cleaner_max_lru_time
-1
-select @@innodb_corrupt_table_action;
-@@innodb_corrupt_table_action
-salvage
-set global innodb_corrupt_table_action=salvage;
-Warnings:
-Warning 1287 Using innodb_corrupt_table_action is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_corrupt_table_action;
-@@innodb_corrupt_table_action
-salvage
-select @@innodb_empty_free_list_algorithm;
-@@innodb_empty_free_list_algorithm
-BACKOFF
-set global innodb_empty_free_list_algorithm=BACKOFF;
-Warnings:
-Warning 1287 Using innodb_empty_free_list_algorithm is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_empty_free_list_algorithm;
-@@innodb_empty_free_list_algorithm
-BACKOFF
-select @@innodb_fake_changes;
-@@innodb_fake_changes
-1
-set global innodb_fake_changes=1;
-Warnings:
-Warning 1287 Using innodb_fake_changes is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_fake_changes;
-@@innodb_fake_changes
-1
-# @@innodb_file_io_threads is absent
-select @@innodb_foreground_preflush;
-@@innodb_foreground_preflush
-EXPONENTIAL_BACKOFF
-set global innodb_foreground_preflush=EXPONENTIAL_BACKOFF;
-Warnings:
-Warning 1287 Using innodb_foreground_preflush is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_foreground_preflush;
-@@innodb_foreground_preflush
-EXPONENTIAL_BACKOFF
-select @@innodb_kill_idle_transaction;
-@@innodb_kill_idle_transaction
-1
-set global innodb_kill_idle_transaction=1;
-Warnings:
-Warning 1287 Using innodb_kill_idle_transaction is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_kill_idle_transaction;
-@@innodb_kill_idle_transaction
-1
-select @@innodb_locking_fake_changes;
-@@innodb_locking_fake_changes
-1
-set global innodb_locking_fake_changes=1;
-Warnings:
-Warning 1287 Using innodb_locking_fake_changes is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_locking_fake_changes;
-@@innodb_locking_fake_changes
-1
-select @@innodb_log_arch_expire_sec;
-@@innodb_log_arch_expire_sec
-1
-set global innodb_log_arch_expire_sec=1;
-Warnings:
-Warning 1287 Using innodb_log_arch_expire_sec is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_log_arch_expire_sec;
-@@innodb_log_arch_expire_sec
-1
-select @@innodb_log_block_size;
-@@innodb_log_block_size
-16
-set global innodb_log_block_size= 8;
-ERROR HY000: Variable 'innodb_log_block_size' is a read only variable
-select @@innodb_log_checksum_algorithm, @@innodb_log_checksums;
-@@innodb_log_checksum_algorithm @@innodb_log_checksums
-STRICT_INNODB 1
-set global innodb_log_checksum_algorithm=NONE;
-Warnings:
-Warning 1287 Using innodb_log_checksum_algorithm is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_log_checksum_algorithm, @@innodb_log_checksums;
-@@innodb_log_checksum_algorithm @@innodb_log_checksums
-STRICT_INNODB 1
-set global innodb_log_checksum_algorithm=STRICT_INNODB;
-Warnings:
-Warning 1287 Using innodb_log_checksum_algorithm is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_log_checksum_algorithm, @@innodb_log_checksums;
-@@innodb_log_checksum_algorithm @@innodb_log_checksums
-STRICT_INNODB 1
-select @@innodb_max_bitmap_file_size;
-@@innodb_max_bitmap_file_size
-1
-set global innodb_max_bitmap_file_size=1;
-Warnings:
-Warning 1287 Using innodb_max_bitmap_file_size is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_max_bitmap_file_size;
-@@innodb_max_bitmap_file_size
-1
-select @@innodb_max_changed_pages;
-@@innodb_max_changed_pages
-1
-set global innodb_max_changed_pages=1;
-Warnings:
-Warning 1287 Using innodb_max_changed_pages is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_max_changed_pages;
-@@innodb_max_changed_pages
-1
-select @@innodb_mirrored_log_groups;
-@@innodb_mirrored_log_groups
-8
-set global innodb_mirrored_log_groups= 4;
-ERROR HY000: Variable 'innodb_mirrored_log_groups' is a read only variable
-select @@innodb_priority_cleaner;
-@@innodb_priority_cleaner
-1
-set global innodb_priority_cleaner=1;
-Warnings:
-Warning 1287 Using innodb_priority_cleaner is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_priority_cleaner;
-@@innodb_priority_cleaner
-1
-select @@innodb_priority_io;
-@@innodb_priority_io
-1
-set global innodb_priority_io=1;
-Warnings:
-Warning 1287 Using innodb_priority_io is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_priority_io;
-@@innodb_priority_io
-1
-select @@innodb_priority_master;
-@@innodb_priority_master
-1
-set global innodb_priority_master=1;
-Warnings:
-Warning 1287 Using innodb_priority_master is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_priority_master;
-@@innodb_priority_master
-1
-select @@innodb_priority_purge;
-@@innodb_priority_purge
-1
-set global innodb_priority_purge=1;
-Warnings:
-Warning 1287 Using innodb_priority_purge is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_priority_purge;
-@@innodb_priority_purge
-1
-select @@innodb_sched_priority_cleaner;
-@@innodb_sched_priority_cleaner
-16
-set global innodb_sched_priority_cleaner=8;
-Warnings:
-Warning 1287 Using innodb_sched_priority_cleaner is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_sched_priority_cleaner;
-@@innodb_sched_priority_cleaner
-16
-select @@innodb_sched_priority_io;
-@@innodb_sched_priority_io
-16
-set global innodb_sched_priority_io=8;
-Warnings:
-Warning 1287 Using innodb_sched_priority_io is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_sched_priority_io;
-@@innodb_sched_priority_io
-16
-select @@innodb_sched_priority_master;
-@@innodb_sched_priority_master
-16
-set global innodb_sched_priority_master=8;
-Warnings:
-Warning 1287 Using innodb_sched_priority_master is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_sched_priority_master;
-@@innodb_sched_priority_master
-16
-select @@innodb_sched_priority_purge;
-@@innodb_sched_priority_purge
-16
-set global innodb_sched_priority_purge=8;
-Warnings:
-Warning 1287 Using innodb_sched_priority_purge is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_sched_priority_purge;
-@@innodb_sched_priority_purge
-16
-select @@innodb_show_locks_held;
-@@innodb_show_locks_held
-16
-set global innodb_show_locks_held=8;
-Warnings:
-Warning 1287 Using innodb_show_locks_held is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_show_locks_held;
-@@innodb_show_locks_held
-16
-select @@innodb_show_verbose_locks;
-@@innodb_show_verbose_locks
-1
-set global innodb_show_verbose_locks=1;
-Warnings:
-Warning 1287 Using innodb_show_verbose_locks is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_show_verbose_locks;
-@@innodb_show_verbose_locks
-1
-select @@innodb_track_changed_pages;
-@@innodb_track_changed_pages
-1
-set global innodb_track_changed_pages=1;
-ERROR HY000: Variable 'innodb_track_changed_pages' is a read only variable
-select @@innodb_track_redo_log_now;
-@@innodb_track_redo_log_now
-1
-set global innodb_track_redo_log_now=1;
-Warnings:
-Warning 1287 Using innodb_track_redo_log_now is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_track_redo_log_now;
-@@innodb_track_redo_log_now
-1
-select @@innodb_use_global_flush_log_at_trx_commit;
-@@innodb_use_global_flush_log_at_trx_commit
-1
-set global innodb_use_global_flush_log_at_trx_commit=1;
-Warnings:
-Warning 1287 Using innodb_use_global_flush_log_at_trx_commit is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_use_global_flush_log_at_trx_commit;
-@@innodb_use_global_flush_log_at_trx_commit
-1
-select @@innodb_use_stacktrace;
-@@innodb_use_stacktrace
-1
-set global innodb_use_stacktrace=1;
-ERROR HY000: Variable 'innodb_use_stacktrace' is a read only variable
-select @@innodb_log_archive;
-@@innodb_log_archive
-1
-set global innodb_log_archive=1;
-Warnings:
-Warning 1287 Using innodb_log_archive is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
-select @@innodb_log_archive;
-@@innodb_log_archive
-1
-select @@innodb_log_arch_dir;
-@@innodb_log_arch_dir
-ttt
-set global innodb_log_arch_dir="ttt";
-ERROR HY000: Variable 'innodb_log_arch_dir' is a read only variable
-FOUND 36 /Using [A-Za-z\-]* is deprecated and the parameter may be removed in future releases. Ignoning the parameter./ in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/instant_alter,32k.rdiff b/mysql-test/suite/innodb/r/instant_alter,32k.rdiff
new file mode 100644
index 00000000000..37c3c479e68
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter,32k.rdiff
@@ -0,0 +1,113 @@
+--- instant_alter.result
++++ instant_alter,32k.result
+@@ -2,7 +2,7 @@
+ # MDEV-11369: Instant ADD COLUMN for InnoDB
+ #
+ CREATE TABLE t(a INT UNIQUE)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+-ALTER TABLE t ADD e INT, ROW_FORMAT=COMPRESSED;
++ALTER TABLE t ADD e INT, ROW_FORMAT=DYNAMIC;
+ INSERT INTO t SET a=1;
+ SET @old_instant=
+ (SELECT variable_value FROM information_schema.global_status
+@@ -33,17 +33,17 @@
+ `c` int(11) NOT NULL,
+ `d` int(11) NOT NULL,
+ UNIQUE KEY `a` (`a`)
+-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
++) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+ SELECT variable_value-@old_instant instants
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_instant_alter_column';
+ instants
+-0
++1
+ SELECT variable_value-@old_instant instants
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_instant_alter_column';
+ instants
+-0
++1
+ DROP TABLE t;
+ connect analyze, localhost, root;
+ connection default;
+@@ -374,7 +374,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -397,7 +397,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++5
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -410,7 +410,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
+@@ -734,7 +734,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -757,7 +757,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++5
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -770,7 +770,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
+@@ -1094,7 +1094,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -1117,7 +1117,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++5
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -1130,7 +1130,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
diff --git a/mysql-test/suite/innodb/r/instant_alter,4k.rdiff b/mysql-test/suite/innodb/r/instant_alter,4k.rdiff
new file mode 100644
index 00000000000..e333e77aa1e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter,4k.rdiff
@@ -0,0 +1,306 @@
+--- instant_alter.result
++++ instant_alter,4k.result
+@@ -243,7 +243,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++6
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -253,7 +253,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ BEGIN;
+ UPDATE t2 SET d1 = repeat(id, 200);
+@@ -264,7 +264,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -274,7 +274,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ ALTER TABLE t2 DROP p;
+ affected rows: 0
+@@ -322,8 +322,14 @@
+ affected rows: 0
+ info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
++ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1979. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
++SET innodb_strict_mode = OFF;
+ affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 0
++ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
++affected rows: 0
++info: Records: 0 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1979). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ INSERT INTO t3 SET id=4;
+ ERROR HY000: Field 'c2' doesn't have a default value
+ INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
+@@ -336,7 +342,9 @@
+ ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
+ CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
+ affected rows: 4
+-info: Records: 4 Duplicates: 0 Warnings: 0
++info: Records: 4 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1979). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ INSERT INTO t3 SET id=5, c2=9;
+ Warnings:
+ Note 1265 Data truncated for column 'c7' at row 1
+@@ -350,7 +358,9 @@
+ 5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business
+ ALTER TABLE t3 DROP c3, DROP c7;
+ affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 0
++info: Records: 0 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1979). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ SELECT * FROM t3;
+ id c2 c4 c5 c6 c8 phrase b
+ 1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+@@ -378,6 +388,8 @@
+ (id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
+ p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
+ ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
++Warnings:
++Warning 139 Row size too large (> 1979). 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.
+ BEGIN;
+ INSERT INTO big
+ SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
+@@ -395,13 +407,15 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++8
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+ d3 TIMESTAMP NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp);
+ affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 0
++info: Records: 0 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1979). 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.
+ CHECKSUM TABLE big;
+ Table Checksum
+ test.big 1705165209
+@@ -418,7 +432,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++28
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -431,7 +445,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++8
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,t4,big;
+@@ -730,7 +744,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++6
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -740,7 +754,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ BEGIN;
+ UPDATE t2 SET d1 = repeat(id, 200);
+@@ -751,7 +765,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -761,7 +775,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ ALTER TABLE t2 DROP p;
+ affected rows: 0
+@@ -810,7 +824,9 @@
+ info: Records: 0 Duplicates: 0 Warnings: 0
+ ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
+ affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 0
++info: Records: 0 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ INSERT INTO t3 SET id=4;
+ ERROR HY000: Field 'c2' doesn't have a default value
+ INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
+@@ -823,7 +839,9 @@
+ ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
+ CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
+ affected rows: 4
+-info: Records: 4 Duplicates: 0 Warnings: 0
++info: Records: 4 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ INSERT INTO t3 SET id=5, c2=9;
+ Warnings:
+ Note 1265 Data truncated for column 'c7' at row 1
+@@ -837,7 +855,9 @@
+ 5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business
+ ALTER TABLE t3 DROP c3, DROP c7;
+ affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 0
++info: Records: 0 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ SELECT * FROM t3;
+ id c2 c4 c5 c6 c8 phrase b
+ 1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+@@ -865,6 +885,8 @@
+ (id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
+ p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
+ ENGINE=InnoDB ROW_FORMAT=COMPACT;
++Warnings:
++Warning 139 Row size too large (> 1982). 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.
+ BEGIN;
+ INSERT INTO big
+ SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
+@@ -882,13 +904,15 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++7
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+ d3 TIMESTAMP NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp);
+ affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 0
++info: Records: 0 Duplicates: 0 Warnings: 1
++Warnings:
++Warning 139 Row size too large (> 1982). 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.
+ CHECKSUM TABLE big;
+ Table Checksum
+ test.big 1705165209
+@@ -905,7 +929,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++23
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -918,7 +942,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++7
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,t4,big;
+@@ -1217,7 +1241,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++6
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -1227,7 +1251,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ BEGIN;
+ UPDATE t2 SET d1 = repeat(id, 200);
+@@ -1238,7 +1262,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -1248,7 +1272,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++4
+ connection default;
+ ALTER TABLE t2 DROP p;
+ affected rows: 0
+@@ -1369,7 +1393,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++7
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -1392,7 +1416,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++23
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -1405,7 +1429,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++7
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,t4,big;
+@@ -1523,6 +1547,6 @@
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_instant_alter_column';
+ instants
+-60
++61
+ SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
+ SET GLOBAL innodb_file_format = @saved_format;
diff --git a/mysql-test/suite/innodb/r/instant_alter,64k.rdiff b/mysql-test/suite/innodb/r/instant_alter,64k.rdiff
new file mode 100644
index 00000000000..d9a398fc8c8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter,64k.rdiff
@@ -0,0 +1,113 @@
+--- instant_alter.result
++++ instant_alter,64k.result
+@@ -2,7 +2,7 @@
+ # MDEV-11369: Instant ADD COLUMN for InnoDB
+ #
+ CREATE TABLE t(a INT UNIQUE)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+-ALTER TABLE t ADD e INT, ROW_FORMAT=COMPRESSED;
++ALTER TABLE t ADD e INT, ROW_FORMAT=DYNAMIC;
+ INSERT INTO t SET a=1;
+ SET @old_instant=
+ (SELECT variable_value FROM information_schema.global_status
+@@ -33,17 +33,17 @@
+ `c` int(11) NOT NULL,
+ `d` int(11) NOT NULL,
+ UNIQUE KEY `a` (`a`)
+-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
++) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+ SELECT variable_value-@old_instant instants
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_instant_alter_column';
+ instants
+-0
++1
+ SELECT variable_value-@old_instant instants
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_instant_alter_column';
+ instants
+-0
++1
+ DROP TABLE t;
+ connect analyze, localhost, root;
+ connection default;
+@@ -374,7 +374,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -397,7 +397,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++3
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -410,7 +410,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
+@@ -734,7 +734,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -757,7 +757,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++3
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -770,7 +770,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
+@@ -1094,7 +1094,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -1117,7 +1117,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++3
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -1130,7 +1130,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++1
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
diff --git a/mysql-test/suite/innodb/r/instant_alter,8k.rdiff b/mysql-test/suite/innodb/r/instant_alter,8k.rdiff
new file mode 100644
index 00000000000..b96262866e5
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter,8k.rdiff
@@ -0,0 +1,191 @@
+--- instant_alter.result
++++ instant_alter,8k.result
+@@ -240,7 +240,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++5
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -250,7 +250,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ BEGIN;
+ UPDATE t2 SET d1 = repeat(id, 200);
+@@ -261,7 +261,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -271,7 +271,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ ALTER TABLE t2 DROP p;
+ affected rows: 0
+@@ -374,7 +374,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++5
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -397,7 +397,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++13
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -410,7 +410,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++5
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
+@@ -600,7 +600,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++5
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -610,7 +610,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ BEGIN;
+ UPDATE t2 SET d1 = repeat(id, 200);
+@@ -621,7 +621,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -631,7 +631,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ ALTER TABLE t2 DROP p;
+ affected rows: 0
+@@ -734,7 +734,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++5
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -757,7 +757,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++13
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -770,7 +770,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++5
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
+@@ -960,7 +960,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++5
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -970,7 +970,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ BEGIN;
+ UPDATE t2 SET d1 = repeat(id, 200);
+@@ -981,7 +981,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ ROLLBACK;
+ connection analyze;
+@@ -991,7 +991,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/t2';
+ clust_index_size
+-1
++3
+ connection default;
+ ALTER TABLE t2 DROP p;
+ affected rows: 0
+@@ -1094,7 +1094,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++5
+ connection default;
+ ALTER TABLE big ADD COLUMN
+ (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+@@ -1117,7 +1117,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-7
++13
+ connection default;
+ ROLLBACK;
+ CHECKSUM TABLE big;
+@@ -1130,7 +1130,7 @@
+ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+ WHERE name = 'test/big';
+ clust_index_size
+-3
++5
+ connection default;
+ InnoDB 0 transactions not purged
+ DROP TABLE t1,t2,t3,big;
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
new file mode 100644
index 00000000000..1a818531756
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -0,0 +1,1507 @@
+#
+# MDEV-11369: Instant ADD COLUMN for InnoDB
+#
+SET @saved_allowance = @@GLOBAL.innodb_instant_alter_column_allowed;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+call mtr.add_suppression("Cannot add field `.*` in table `test`.`.*` because after adding it, the row size is");
+CREATE TABLE t(a INT UNIQUE)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+ALTER TABLE t ADD e INT, ROW_FORMAT=COMPRESSED;
+INSERT INTO t SET a=1;
+SET @old_instant=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column');
+ALTER TABLE t ADD b INT NOT NULL, ALGORITHM=COPY;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+ALTER TABLE t ADD c INT NOT NULL, FORCE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+instants
+0
+ALTER TABLE t ADD d INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t;
+a e b c d
+1 NULL 0 0 0
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `e` int(11) DEFAULT NULL,
+ `b` int(11) NOT NULL,
+ `c` int(11) NOT NULL,
+ `d` int(11) NOT NULL,
+ UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+instants
+0
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+instants
+0
+DROP TABLE t;
+connect analyze, localhost, root;
+connection default;
+SET timestamp = 42;
+SET time_zone='+03:00';
+SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+SET @old_instant=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column');
+CREATE TABLE t1
+(id INT PRIMARY KEY, c2 INT UNIQUE,
+c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
+SPATIAL INDEX(c3)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 (id, c2) values(1,1);
+SELECT id,c2,ST_AsText(c3) c3 FROM t1;
+id c2 c3
+1 1 POINT(3 4)
+ALTER TABLE t1 ADD COLUMN (
+d1 INT, d2 INT UNSIGNED DEFAULT 10, d3 VARCHAR(20) NOT NULL DEFAULT 'abcde',
+d4 TIMESTAMP NOT NULL DEFAULT current_timestamp());
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD INDEX(d3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+BEGIN;
+UPDATE t1 SET d3='';
+ROLLBACK;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, d4 FROM t1;
+id c2 c3 d1 d2 d3 d4
+1 1 POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+INSERT INTO t1 (id) VALUES(2),(3),(4),(5),(6);
+ALTER TABLE t1 CHANGE d1 d1 INT DEFAULT 5, CHANGE d2 d2 INT DEFAULT 15,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'fghij',
+CHANGE d4 dfour TIMESTAMP NOT NULL DEFAULT now();
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 0
+UPDATE t1 SET d3='foo' WHERE id = 2;
+UPDATE t1 SET d3=DEFAULT WHERE id = 4;
+INSERT INTO t1 SET id = 7;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, dfour FROM t1;
+id c2 c3 d1 d2 d3 dfour
+1 1 POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+2 NULL POINT(3 4) NULL 10 foo 1970-01-01 03:00:42
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+4 NULL POINT(3 4) NULL 10 fghij 1970-01-01 03:00:42
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+6 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+7 NULL POINT(3 4) 5 15 fghij 1970-01-01 03:00:42
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+ALTER TABLE t1 ADD COLUMN e1 INT AS (id * 3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN e2 VARCHAR(30) AS (d3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN e3 INT AS (id * 2);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'foobar',
+ADD COLUMN (d5 CHAR(20) DEFAULT 'hijkl', d6 INT DEFAULT -12345, d7 INT),
+DROP INDEX d3;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t1 SET id = 8;
+UPDATE t1 SET d3 = 'yyyyy' WHERE id = 1;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 2;
+BEGIN;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 3;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+3 NULL POINT(3 4) NULL 10 xxxxx 1970-01-01 03:00:42 9 xxxxx 6 hijkl -12345 NULL
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL
+BEGIN;
+UPDATE t1 SET d7 = NULL WHERE ID = 5;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET d7 = NULL, d6 = 10 WHERE id = 5;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl 10 NULL
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL
+ALTER TABLE t1 ADD COLUMN (f1 VARCHAR(20) AS (concat('x', e2)) STORED);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN (d8 VARCHAR(20) DEFAULT 'omnopq');
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7, f1, d8 FROM t1;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7 f1 d8
+1 1 POINT(3 4) NULL 10 yyyyy 1970-01-01 03:00:42 3 yyyyy 2 hijkl -12345 NULL xyyyyy omnopq
+2 NULL POINT(3 4) NULL 10 xxxxx 1970-01-01 03:00:42 6 xxxxx 4 hijkl -12345 NULL xxxxxx omnopq
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL xabcde omnopq
+4 NULL POINT(3 4) NULL 10 fghij 1970-01-01 03:00:42 12 fghij 8 hijkl -12345 NULL xfghij omnopq
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL xabcde omnopq
+6 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 18 abcde 12 hijkl -12345 NULL xabcde omnopq
+7 NULL POINT(3 4) 5 15 fghij 1970-01-01 03:00:42 21 fghij 14 hijkl -12345 NULL xfghij omnopq
+8 NULL POINT(3 4) 5 15 foobar 1970-01-01 03:00:42 24 foobar 16 hijkl -12345 NULL xfoobar omnopq
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` point NOT NULL DEFAULT st_geometryfromtext('POINT(3 4)'),
+ `d1` int(11) DEFAULT 5,
+ `d2` int(11) DEFAULT 15,
+ `d3` varchar(20) NOT NULL DEFAULT 'foobar',
+ `dfour` timestamp NOT NULL DEFAULT current_timestamp(),
+ `e1` int(11) GENERATED ALWAYS AS (`id` * 3) VIRTUAL,
+ `e2` varchar(30) GENERATED ALWAYS AS (`d3`) VIRTUAL,
+ `e3` int(11) GENERATED ALWAYS AS (`id` * 2) VIRTUAL,
+ `d5` char(20) DEFAULT 'hijkl',
+ `d6` int(11) DEFAULT -12345,
+ `d7` int(11) DEFAULT NULL,
+ `f1` varchar(20) GENERATED ALWAYS AS (concat('x',`e2`)) STORED,
+ `d8` varchar(20) DEFAULT 'omnopq',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`),
+ SPATIAL KEY `c3` (`c3`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+ALTER TABLE t1
+CHANGE c2 c2 INT DEFAULT 42,
+CHANGE d1 d1 INT DEFAULT 1,
+CHANGE d2 d2 INT DEFAULT 20,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'boofar';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t1 SET id=9;
+ALTER TABLE t1 DROP c3;
+affected rows: 9
+info: Records: 9 Duplicates: 0 Warnings: 0
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT 42,
+ `d1` int(11) DEFAULT 1,
+ `d2` int(11) DEFAULT 20,
+ `d3` varchar(20) NOT NULL DEFAULT 'boofar',
+ `dfour` timestamp NOT NULL DEFAULT current_timestamp(),
+ `e1` int(11) GENERATED ALWAYS AS (`id` * 3) VIRTUAL,
+ `e2` varchar(30) GENERATED ALWAYS AS (`d3`) VIRTUAL,
+ `e3` int(11) GENERATED ALWAYS AS (`id` * 2) VIRTUAL,
+ `d5` char(20) DEFAULT 'hijkl',
+ `d6` int(11) DEFAULT -12345,
+ `d7` int(11) DEFAULT NULL,
+ `f1` varchar(20) GENERATED ALWAYS AS (concat('x',`e2`)) STORED,
+ `d8` varchar(20) DEFAULT 'omnopq',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+SELECT * FROM t1;
+id c2 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7 f1 d8
+1 1 NULL 10 yyyyy 1970-01-01 03:00:42 3 yyyyy 2 hijkl -12345 NULL xyyyyy omnopq
+2 NULL NULL 10 xxxxx 1970-01-01 03:00:42 6 xxxxx 4 hijkl -12345 NULL xxxxxx omnopq
+3 NULL NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL xabcde omnopq
+4 NULL NULL 10 fghij 1970-01-01 03:00:42 12 fghij 8 hijkl -12345 NULL xfghij omnopq
+5 NULL NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL xabcde omnopq
+6 NULL NULL 10 abcde 1970-01-01 03:00:42 18 abcde 12 hijkl -12345 NULL xabcde omnopq
+7 NULL 5 15 fghij 1970-01-01 03:00:42 21 fghij 14 hijkl -12345 NULL xfghij omnopq
+8 NULL 5 15 foobar 1970-01-01 03:00:42 24 foobar 16 hijkl -12345 NULL xfoobar omnopq
+9 42 1 20 boofar 1970-01-01 03:00:42 27 boofar 18 hijkl -12345 NULL xboofar omnopq
+CREATE TABLE t2
+(id INT primary key, c1 VARCHAR(4000),
+p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+SPATIAL INDEX(p))
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+BEGIN;
+INSERT INTO t2 SET id=1, c1=REPEAT('a', 4000);
+INSERT INTO t2 SET id=2, c1=REPEAT('a', 4000), p=ST_GeomFromText('POINT(1 1)');
+COMMIT;
+ALTER TABLE t2 ADD COLUMN d1 VARCHAR(2000) DEFAULT REPEAT('asdf',500);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c1, ST_AsText(p) p, d1 FROM t2;
+id c1 p d1
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa LINESTRING(0 0,0 1,1 1) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa POINT(1 1) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+BEGIN;
+UPDATE t2 SET c1 = repeat(id, 4000);
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+BEGIN;
+UPDATE t2 SET d1 = repeat(id, 200);
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ALTER TABLE t2 DROP p;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t2;
+id c1 d1
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+CREATE TABLE t3
+(id INT PRIMARY KEY, c2 INT UNSIGNED NOT NULL UNIQUE,
+c3 POLYGON NOT NULL DEFAULT ST_PolyFromText('POLYGON((1 1,2 2,3 3,1 1))'),
+SPATIAL INDEX(c3))
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t3(id,c2) VALUES(1,1),(2,2),(3,3);
+SELECT id, c2, ST_AsText(c3) c3 FROM t3;
+id c2 c3
+1 1 POLYGON((1 1,2 2,3 3,1 1))
+2 2 POLYGON((1 1,2 2,3 3,1 1))
+3 3 POLYGON((1 1,2 2,3 3,1 1))
+ALTER TABLE t3 ADD COLUMN
+(c4 DATETIME DEFAULT current_timestamp(),
+c5 TIMESTAMP NOT NULL DEFAULT current_timestamp(),
+c6 POINT);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6 FROM t3;
+id c2 c3 c4 c5 c6
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+affected rows: 3
+ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
+id c2 c3 c4 c5 c6 c7 c8
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+ALTER TABLE t3 ADD COLUMN t TEXT CHARSET utf8
+DEFAULT 'The quick brown fox jumps over the lazy dog';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t3 SET id=4;
+ERROR HY000: Field 'c2' doesn't have a default value
+INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
+affected rows: 1
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c8' at row 1
+SET innodb_strict_mode = OFF;
+affected rows: 0
+ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
+CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
+affected rows: 4
+info: Records: 4 Duplicates: 0 Warnings: 0
+INSERT INTO t3 SET id=5, c2=9;
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c8' at row 1
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8, phrase, b FROM t3;
+id c2 c3 c4 c5 c6 c7 c8 phrase b
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+4 0 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog 😱
+5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business
+ALTER TABLE t3 DROP c3, DROP c7;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t3;
+id c2 c4 c5 c6 c8 phrase b
+1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+2 2 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+3 3 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+4 0 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog 😱
+5 9 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 ääH binary line of business
+CREATE TABLE t4
+(id INT, foo INT DEFAULT 0, c1 VARCHAR(4000),
+p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+PRIMARY KEY(id,foo))
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000)), (2, REPEAT('a', 4000));
+ALTER TABLE t4 ADD COLUMN d1 INT;
+BEGIN;
+UPDATE t4 SET c1 = repeat('1', 4000), foo=1 WHERE id=1;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000));
+UPDATE t4 SET c1 = repeat('2', 4000), foo=1 WHERE id=2;
+ROLLBACK;
+BEGIN;
+UPDATE t4 SET d1 = 1,foo=2 WHERE id=1;
+INSERT INTO t4 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000));
+COMMIT;
+CREATE TABLE big
+(id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
+p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+BEGIN;
+INSERT INTO big
+SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
+SET @i:=1;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+COMMIT;
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+3
+connection default;
+ALTER TABLE big ADD COLUMN
+(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+d3 TIMESTAMP NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECKSUM TABLE big;
+Table Checksum
+test.big 1705165209
+BEGIN;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+CHECKSUM TABLE big;
+Table Checksum
+test.big 385477733
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+7
+connection default;
+ROLLBACK;
+CHECKSUM TABLE big;
+Table Checksum
+test.big 1705165209
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+3
+connection default;
+InnoDB 0 transactions not purged
+DROP TABLE t1,t2,t3,t4,big;
+CREATE TABLE t1 (a VARCHAR(1) PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 SET a='a';
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 0;
+UPDATE t1 SET b = 1;
+INSERT INTO t1 SET a='a';
+ERROR 23000: Duplicate entry 'a' for key 'PRIMARY'
+SELECT * FROM t1;
+a b
+a 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY(b) REFERENCES t1(a))
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 SET a=1;
+INSERT INTO t2 SET b=1;
+ALTER TABLE t2 ADD COLUMN a INT, DROP FOREIGN KEY t2_ibfk_1;
+ALTER TABLE t2 ADD INDEX(a);
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY
+SET foreign_key_checks=0;
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ALTER TABLE t2 ADD CONSTRAINT fk FOREIGN KEY(b) REFERENCES t1(a),
+ALGORITHM=INSTANT;
+SET foreign_key_checks=1;
+ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
+ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t1 check status OK
+DROP TABLE t2, t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 SET a = 1;
+ALTER TABLE t1 ADD COLUMN b TEXT;
+BEGIN;
+UPDATE t1 SET b = REPEAT('1', 32768);
+UPDATE t1 SET a = 2;
+INSERT INTO t1 SET a = 1;
+SELECT a,LENGTH(b) FROM t1;
+a LENGTH(b)
+1 NULL
+2 32768
+DELETE FROM t1;
+COMMIT;
+InnoDB 0 transactions not purged
+DROP TABLE t1;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 VALUES (7);
+ALTER TABLE t1 ADD COLUMN c INT NOT NULL DEFAULT 0;
+ALTER TABLE t1 ADD INDEX (c);
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4,0),(7,77);
+COMMIT;
+BEGIN;
+DELETE FROM t1 WHERE a=7;
+UPDATE t1 SET a=7;
+COMMIT;
+SELECT * FROM t1 FORCE INDEX(PRIMARY);
+a c
+7 0
+SELECT * FROM t1 FORCE INDEX(c);
+a c
+7 0
+DELETE FROM t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET innodb_strict_mode = ON;
+CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+ALTER TABLE t1 ADD d TEXT;
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 SET a=42;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
+ALTER TABLE t1 MODIFY a INT DEFAULT 0;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 MODIFY a INT DEFAULT NULL, ALGORITHM=INSTANT;
+DROP TABLE t1;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+CREATE TABLE t1
+(id INT PRIMARY KEY, c2 INT UNIQUE,
+c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
+SPATIAL INDEX(c3)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 (id, c2) values(1,1);
+SELECT id,c2,ST_AsText(c3) c3 FROM t1;
+id c2 c3
+1 1 POINT(3 4)
+ALTER TABLE t1 ADD COLUMN (
+d1 INT, d2 INT UNSIGNED DEFAULT 10, d3 VARCHAR(20) NOT NULL DEFAULT 'abcde',
+d4 TIMESTAMP NOT NULL DEFAULT current_timestamp());
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD INDEX(d3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+BEGIN;
+UPDATE t1 SET d3='';
+ROLLBACK;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, d4 FROM t1;
+id c2 c3 d1 d2 d3 d4
+1 1 POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+INSERT INTO t1 (id) VALUES(2),(3),(4),(5),(6);
+ALTER TABLE t1 CHANGE d1 d1 INT DEFAULT 5, CHANGE d2 d2 INT DEFAULT 15,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'fghij',
+CHANGE d4 dfour TIMESTAMP NOT NULL DEFAULT now();
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 0
+UPDATE t1 SET d3='foo' WHERE id = 2;
+UPDATE t1 SET d3=DEFAULT WHERE id = 4;
+INSERT INTO t1 SET id = 7;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, dfour FROM t1;
+id c2 c3 d1 d2 d3 dfour
+1 1 POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+2 NULL POINT(3 4) NULL 10 foo 1970-01-01 03:00:42
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+4 NULL POINT(3 4) NULL 10 fghij 1970-01-01 03:00:42
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+6 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+7 NULL POINT(3 4) 5 15 fghij 1970-01-01 03:00:42
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+ALTER TABLE t1 ADD COLUMN e1 INT AS (id * 3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN e2 VARCHAR(30) AS (d3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN e3 INT AS (id * 2);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'foobar',
+ADD COLUMN (d5 CHAR(20) DEFAULT 'hijkl', d6 INT DEFAULT -12345, d7 INT),
+DROP INDEX d3;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t1 SET id = 8;
+UPDATE t1 SET d3 = 'yyyyy' WHERE id = 1;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 2;
+BEGIN;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 3;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+3 NULL POINT(3 4) NULL 10 xxxxx 1970-01-01 03:00:42 9 xxxxx 6 hijkl -12345 NULL
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL
+BEGIN;
+UPDATE t1 SET d7 = NULL WHERE ID = 5;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET d7 = NULL, d6 = 10 WHERE id = 5;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl 10 NULL
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL
+ALTER TABLE t1 ADD COLUMN (f1 VARCHAR(20) AS (concat('x', e2)) STORED);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN (d8 VARCHAR(20) DEFAULT 'omnopq');
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7, f1, d8 FROM t1;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7 f1 d8
+1 1 POINT(3 4) NULL 10 yyyyy 1970-01-01 03:00:42 3 yyyyy 2 hijkl -12345 NULL xyyyyy omnopq
+2 NULL POINT(3 4) NULL 10 xxxxx 1970-01-01 03:00:42 6 xxxxx 4 hijkl -12345 NULL xxxxxx omnopq
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL xabcde omnopq
+4 NULL POINT(3 4) NULL 10 fghij 1970-01-01 03:00:42 12 fghij 8 hijkl -12345 NULL xfghij omnopq
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL xabcde omnopq
+6 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 18 abcde 12 hijkl -12345 NULL xabcde omnopq
+7 NULL POINT(3 4) 5 15 fghij 1970-01-01 03:00:42 21 fghij 14 hijkl -12345 NULL xfghij omnopq
+8 NULL POINT(3 4) 5 15 foobar 1970-01-01 03:00:42 24 foobar 16 hijkl -12345 NULL xfoobar omnopq
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` point NOT NULL DEFAULT st_geometryfromtext('POINT(3 4)'),
+ `d1` int(11) DEFAULT 5,
+ `d2` int(11) DEFAULT 15,
+ `d3` varchar(20) NOT NULL DEFAULT 'foobar',
+ `dfour` timestamp NOT NULL DEFAULT current_timestamp(),
+ `e1` int(11) GENERATED ALWAYS AS (`id` * 3) VIRTUAL,
+ `e2` varchar(30) GENERATED ALWAYS AS (`d3`) VIRTUAL,
+ `e3` int(11) GENERATED ALWAYS AS (`id` * 2) VIRTUAL,
+ `d5` char(20) DEFAULT 'hijkl',
+ `d6` int(11) DEFAULT -12345,
+ `d7` int(11) DEFAULT NULL,
+ `f1` varchar(20) GENERATED ALWAYS AS (concat('x',`e2`)) STORED,
+ `d8` varchar(20) DEFAULT 'omnopq',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`),
+ SPATIAL KEY `c3` (`c3`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+ALTER TABLE t1
+CHANGE c2 c2 INT DEFAULT 42,
+CHANGE d1 d1 INT DEFAULT 1,
+CHANGE d2 d2 INT DEFAULT 20,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'boofar';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t1 SET id=9;
+ALTER TABLE t1 DROP c3;
+affected rows: 9
+info: Records: 9 Duplicates: 0 Warnings: 0
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT 42,
+ `d1` int(11) DEFAULT 1,
+ `d2` int(11) DEFAULT 20,
+ `d3` varchar(20) NOT NULL DEFAULT 'boofar',
+ `dfour` timestamp NOT NULL DEFAULT current_timestamp(),
+ `e1` int(11) GENERATED ALWAYS AS (`id` * 3) VIRTUAL,
+ `e2` varchar(30) GENERATED ALWAYS AS (`d3`) VIRTUAL,
+ `e3` int(11) GENERATED ALWAYS AS (`id` * 2) VIRTUAL,
+ `d5` char(20) DEFAULT 'hijkl',
+ `d6` int(11) DEFAULT -12345,
+ `d7` int(11) DEFAULT NULL,
+ `f1` varchar(20) GENERATED ALWAYS AS (concat('x',`e2`)) STORED,
+ `d8` varchar(20) DEFAULT 'omnopq',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+SELECT * FROM t1;
+id c2 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7 f1 d8
+1 1 NULL 10 yyyyy 1970-01-01 03:00:42 3 yyyyy 2 hijkl -12345 NULL xyyyyy omnopq
+2 NULL NULL 10 xxxxx 1970-01-01 03:00:42 6 xxxxx 4 hijkl -12345 NULL xxxxxx omnopq
+3 NULL NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL xabcde omnopq
+4 NULL NULL 10 fghij 1970-01-01 03:00:42 12 fghij 8 hijkl -12345 NULL xfghij omnopq
+5 NULL NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL xabcde omnopq
+6 NULL NULL 10 abcde 1970-01-01 03:00:42 18 abcde 12 hijkl -12345 NULL xabcde omnopq
+7 NULL 5 15 fghij 1970-01-01 03:00:42 21 fghij 14 hijkl -12345 NULL xfghij omnopq
+8 NULL 5 15 foobar 1970-01-01 03:00:42 24 foobar 16 hijkl -12345 NULL xfoobar omnopq
+9 42 1 20 boofar 1970-01-01 03:00:42 27 boofar 18 hijkl -12345 NULL xboofar omnopq
+CREATE TABLE t2
+(id INT primary key, c1 VARCHAR(4000),
+p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+SPATIAL INDEX(p))
+ENGINE=InnoDB ROW_FORMAT=COMPACT;
+BEGIN;
+INSERT INTO t2 SET id=1, c1=REPEAT('a', 4000);
+INSERT INTO t2 SET id=2, c1=REPEAT('a', 4000), p=ST_GeomFromText('POINT(1 1)');
+COMMIT;
+ALTER TABLE t2 ADD COLUMN d1 VARCHAR(2000) DEFAULT REPEAT('asdf',500);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c1, ST_AsText(p) p, d1 FROM t2;
+id c1 p d1
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa LINESTRING(0 0,0 1,1 1) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa POINT(1 1) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+BEGIN;
+UPDATE t2 SET c1 = repeat(id, 4000);
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+BEGIN;
+UPDATE t2 SET d1 = repeat(id, 200);
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ALTER TABLE t2 DROP p;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t2;
+id c1 d1
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+CREATE TABLE t3
+(id INT PRIMARY KEY, c2 INT UNSIGNED NOT NULL UNIQUE,
+c3 POLYGON NOT NULL DEFAULT ST_PolyFromText('POLYGON((1 1,2 2,3 3,1 1))'),
+SPATIAL INDEX(c3))
+ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t3(id,c2) VALUES(1,1),(2,2),(3,3);
+SELECT id, c2, ST_AsText(c3) c3 FROM t3;
+id c2 c3
+1 1 POLYGON((1 1,2 2,3 3,1 1))
+2 2 POLYGON((1 1,2 2,3 3,1 1))
+3 3 POLYGON((1 1,2 2,3 3,1 1))
+ALTER TABLE t3 ADD COLUMN
+(c4 DATETIME DEFAULT current_timestamp(),
+c5 TIMESTAMP NOT NULL DEFAULT current_timestamp(),
+c6 POINT);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6 FROM t3;
+id c2 c3 c4 c5 c6
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+affected rows: 3
+ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
+id c2 c3 c4 c5 c6 c7 c8
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+ALTER TABLE t3 ADD COLUMN t TEXT CHARSET utf8
+DEFAULT 'The quick brown fox jumps over the lazy dog';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t3 SET id=4;
+ERROR HY000: Field 'c2' doesn't have a default value
+INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
+affected rows: 1
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c8' at row 1
+SET innodb_strict_mode = OFF;
+affected rows: 0
+ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
+CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
+affected rows: 4
+info: Records: 4 Duplicates: 0 Warnings: 0
+INSERT INTO t3 SET id=5, c2=9;
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c8' at row 1
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8, phrase, b FROM t3;
+id c2 c3 c4 c5 c6 c7 c8 phrase b
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+4 0 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog 😱
+5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business
+ALTER TABLE t3 DROP c3, DROP c7;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t3;
+id c2 c4 c5 c6 c8 phrase b
+1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+2 2 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+3 3 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+4 0 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog 😱
+5 9 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 ääH binary line of business
+CREATE TABLE t4
+(id INT, foo INT DEFAULT 0, c1 VARCHAR(4000),
+p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+PRIMARY KEY(id,foo))
+ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000)), (2, REPEAT('a', 4000));
+ALTER TABLE t4 ADD COLUMN d1 INT;
+BEGIN;
+UPDATE t4 SET c1 = repeat('1', 4000), foo=1 WHERE id=1;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000));
+UPDATE t4 SET c1 = repeat('2', 4000), foo=1 WHERE id=2;
+ROLLBACK;
+BEGIN;
+UPDATE t4 SET d1 = 1,foo=2 WHERE id=1;
+INSERT INTO t4 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000));
+COMMIT;
+CREATE TABLE big
+(id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
+p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
+ENGINE=InnoDB ROW_FORMAT=COMPACT;
+BEGIN;
+INSERT INTO big
+SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
+SET @i:=1;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+COMMIT;
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+3
+connection default;
+ALTER TABLE big ADD COLUMN
+(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+d3 TIMESTAMP NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECKSUM TABLE big;
+Table Checksum
+test.big 1705165209
+BEGIN;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+CHECKSUM TABLE big;
+Table Checksum
+test.big 385477733
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+7
+connection default;
+ROLLBACK;
+CHECKSUM TABLE big;
+Table Checksum
+test.big 1705165209
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+3
+connection default;
+InnoDB 0 transactions not purged
+DROP TABLE t1,t2,t3,t4,big;
+CREATE TABLE t1 (a VARCHAR(1) PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 SET a='a';
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 0;
+UPDATE t1 SET b = 1;
+INSERT INTO t1 SET a='a';
+ERROR 23000: Duplicate entry 'a' for key 'PRIMARY'
+SELECT * FROM t1;
+a b
+a 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY(b) REFERENCES t1(a))
+ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 SET a=1;
+INSERT INTO t2 SET b=1;
+ALTER TABLE t2 ADD COLUMN a INT, DROP FOREIGN KEY t2_ibfk_1;
+ALTER TABLE t2 ADD INDEX(a);
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY
+SET foreign_key_checks=0;
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ALTER TABLE t2 ADD CONSTRAINT fk FOREIGN KEY(b) REFERENCES t1(a),
+ALGORITHM=INSTANT;
+SET foreign_key_checks=1;
+ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
+ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t1 check status OK
+DROP TABLE t2, t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 SET a = 1;
+ALTER TABLE t1 ADD COLUMN b TEXT;
+BEGIN;
+UPDATE t1 SET b = REPEAT('1', 32768);
+UPDATE t1 SET a = 2;
+INSERT INTO t1 SET a = 1;
+SELECT a,LENGTH(b) FROM t1;
+a LENGTH(b)
+1 NULL
+2 32768
+DELETE FROM t1;
+COMMIT;
+InnoDB 0 transactions not purged
+DROP TABLE t1;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 VALUES (7);
+ALTER TABLE t1 ADD COLUMN c INT NOT NULL DEFAULT 0;
+ALTER TABLE t1 ADD INDEX (c);
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4,0),(7,77);
+COMMIT;
+BEGIN;
+DELETE FROM t1 WHERE a=7;
+UPDATE t1 SET a=7;
+COMMIT;
+SELECT * FROM t1 FORCE INDEX(PRIMARY);
+a c
+7 0
+SELECT * FROM t1 FORCE INDEX(c);
+a c
+7 0
+DELETE FROM t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET innodb_strict_mode = ON;
+CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+ALTER TABLE t1 ADD d TEXT;
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 SET a=42;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
+ALTER TABLE t1 MODIFY a INT DEFAULT 0;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 MODIFY a INT DEFAULT NULL, ALGORITHM=INSTANT;
+DROP TABLE t1;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+CREATE TABLE t1
+(id INT PRIMARY KEY, c2 INT UNIQUE,
+c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
+SPATIAL INDEX(c3)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 (id, c2) values(1,1);
+SELECT id,c2,ST_AsText(c3) c3 FROM t1;
+id c2 c3
+1 1 POINT(3 4)
+ALTER TABLE t1 ADD COLUMN (
+d1 INT, d2 INT UNSIGNED DEFAULT 10, d3 VARCHAR(20) NOT NULL DEFAULT 'abcde',
+d4 TIMESTAMP NOT NULL DEFAULT current_timestamp());
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD INDEX(d3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+BEGIN;
+UPDATE t1 SET d3='';
+ROLLBACK;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, d4 FROM t1;
+id c2 c3 d1 d2 d3 d4
+1 1 POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+INSERT INTO t1 (id) VALUES(2),(3),(4),(5),(6);
+ALTER TABLE t1 CHANGE d1 d1 INT DEFAULT 5, CHANGE d2 d2 INT DEFAULT 15,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'fghij',
+CHANGE d4 dfour TIMESTAMP NOT NULL DEFAULT now();
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 0
+UPDATE t1 SET d3='foo' WHERE id = 2;
+UPDATE t1 SET d3=DEFAULT WHERE id = 4;
+INSERT INTO t1 SET id = 7;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, dfour FROM t1;
+id c2 c3 d1 d2 d3 dfour
+1 1 POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+2 NULL POINT(3 4) NULL 10 foo 1970-01-01 03:00:42
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+4 NULL POINT(3 4) NULL 10 fghij 1970-01-01 03:00:42
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+6 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42
+7 NULL POINT(3 4) 5 15 fghij 1970-01-01 03:00:42
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+ALTER TABLE t1 ADD COLUMN e1 INT AS (id * 3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN e2 VARCHAR(30) AS (d3);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN e3 INT AS (id * 2);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'foobar',
+ADD COLUMN (d5 CHAR(20) DEFAULT 'hijkl', d6 INT DEFAULT -12345, d7 INT),
+DROP INDEX d3;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t1 SET id = 8;
+UPDATE t1 SET d3 = 'yyyyy' WHERE id = 1;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 2;
+BEGIN;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 3;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+3 NULL POINT(3 4) NULL 10 xxxxx 1970-01-01 03:00:42 9 xxxxx 6 hijkl -12345 NULL
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL
+BEGIN;
+UPDATE t1 SET d7 = NULL WHERE ID = 5;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET d7 = NULL, d6 = 10 WHERE id = 5;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl 10 NULL
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL
+ALTER TABLE t1 ADD COLUMN (f1 VARCHAR(20) AS (concat('x', e2)) STORED);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 ADD COLUMN (d8 VARCHAR(20) DEFAULT 'omnopq');
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7, f1, d8 FROM t1;
+id c2 c3 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7 f1 d8
+1 1 POINT(3 4) NULL 10 yyyyy 1970-01-01 03:00:42 3 yyyyy 2 hijkl -12345 NULL xyyyyy omnopq
+2 NULL POINT(3 4) NULL 10 xxxxx 1970-01-01 03:00:42 6 xxxxx 4 hijkl -12345 NULL xxxxxx omnopq
+3 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL xabcde omnopq
+4 NULL POINT(3 4) NULL 10 fghij 1970-01-01 03:00:42 12 fghij 8 hijkl -12345 NULL xfghij omnopq
+5 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL xabcde omnopq
+6 NULL POINT(3 4) NULL 10 abcde 1970-01-01 03:00:42 18 abcde 12 hijkl -12345 NULL xabcde omnopq
+7 NULL POINT(3 4) 5 15 fghij 1970-01-01 03:00:42 21 fghij 14 hijkl -12345 NULL xfghij omnopq
+8 NULL POINT(3 4) 5 15 foobar 1970-01-01 03:00:42 24 foobar 16 hijkl -12345 NULL xfoobar omnopq
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` point NOT NULL DEFAULT st_geometryfromtext('POINT(3 4)'),
+ `d1` int(11) DEFAULT 5,
+ `d2` int(11) DEFAULT 15,
+ `d3` varchar(20) NOT NULL DEFAULT 'foobar',
+ `dfour` timestamp NOT NULL DEFAULT current_timestamp(),
+ `e1` int(11) GENERATED ALWAYS AS (`id` * 3) VIRTUAL,
+ `e2` varchar(30) GENERATED ALWAYS AS (`d3`) VIRTUAL,
+ `e3` int(11) GENERATED ALWAYS AS (`id` * 2) VIRTUAL,
+ `d5` char(20) DEFAULT 'hijkl',
+ `d6` int(11) DEFAULT -12345,
+ `d7` int(11) DEFAULT NULL,
+ `f1` varchar(20) GENERATED ALWAYS AS (concat('x',`e2`)) STORED,
+ `d8` varchar(20) DEFAULT 'omnopq',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`),
+ SPATIAL KEY `c3` (`c3`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+ALTER TABLE t1
+CHANGE c2 c2 INT DEFAULT 42,
+CHANGE d1 d1 INT DEFAULT 1,
+CHANGE d2 d2 INT DEFAULT 20,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'boofar';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t1 SET id=9;
+ALTER TABLE t1 DROP c3;
+affected rows: 9
+info: Records: 9 Duplicates: 0 Warnings: 0
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT 42,
+ `d1` int(11) DEFAULT 1,
+ `d2` int(11) DEFAULT 20,
+ `d3` varchar(20) NOT NULL DEFAULT 'boofar',
+ `dfour` timestamp NOT NULL DEFAULT current_timestamp(),
+ `e1` int(11) GENERATED ALWAYS AS (`id` * 3) VIRTUAL,
+ `e2` varchar(30) GENERATED ALWAYS AS (`d3`) VIRTUAL,
+ `e3` int(11) GENERATED ALWAYS AS (`id` * 2) VIRTUAL,
+ `d5` char(20) DEFAULT 'hijkl',
+ `d6` int(11) DEFAULT -12345,
+ `d7` int(11) DEFAULT NULL,
+ `f1` varchar(20) GENERATED ALWAYS AS (concat('x',`e2`)) STORED,
+ `d8` varchar(20) DEFAULT 'omnopq',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+SELECT * FROM t1;
+id c2 d1 d2 d3 dfour e1 e2 e3 d5 d6 d7 f1 d8
+1 1 NULL 10 yyyyy 1970-01-01 03:00:42 3 yyyyy 2 hijkl -12345 NULL xyyyyy omnopq
+2 NULL NULL 10 xxxxx 1970-01-01 03:00:42 6 xxxxx 4 hijkl -12345 NULL xxxxxx omnopq
+3 NULL NULL 10 abcde 1970-01-01 03:00:42 9 abcde 6 hijkl -12345 NULL xabcde omnopq
+4 NULL NULL 10 fghij 1970-01-01 03:00:42 12 fghij 8 hijkl -12345 NULL xfghij omnopq
+5 NULL NULL 10 abcde 1970-01-01 03:00:42 15 abcde 10 hijkl -12345 NULL xabcde omnopq
+6 NULL NULL 10 abcde 1970-01-01 03:00:42 18 abcde 12 hijkl -12345 NULL xabcde omnopq
+7 NULL 5 15 fghij 1970-01-01 03:00:42 21 fghij 14 hijkl -12345 NULL xfghij omnopq
+8 NULL 5 15 foobar 1970-01-01 03:00:42 24 foobar 16 hijkl -12345 NULL xfoobar omnopq
+9 42 1 20 boofar 1970-01-01 03:00:42 27 boofar 18 hijkl -12345 NULL xboofar omnopq
+CREATE TABLE t2
+(id INT primary key, c1 VARCHAR(4000),
+p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+SPATIAL INDEX(p))
+ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+BEGIN;
+INSERT INTO t2 SET id=1, c1=REPEAT('a', 4000);
+INSERT INTO t2 SET id=2, c1=REPEAT('a', 4000), p=ST_GeomFromText('POINT(1 1)');
+COMMIT;
+ALTER TABLE t2 ADD COLUMN d1 VARCHAR(2000) DEFAULT REPEAT('asdf',500);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c1, ST_AsText(p) p, d1 FROM t2;
+id c1 p d1
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa LINESTRING(0 0,0 1,1 1) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa POINT(1 1) asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+BEGIN;
+UPDATE t2 SET c1 = repeat(id, 4000);
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+BEGIN;
+UPDATE t2 SET d1 = repeat(id, 200);
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+clust_index_size
+1
+connection default;
+ALTER TABLE t2 DROP p;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t2;
+id c1 d1
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
+CREATE TABLE t3
+(id INT PRIMARY KEY, c2 INT UNSIGNED NOT NULL UNIQUE,
+c3 POLYGON NOT NULL DEFAULT ST_PolyFromText('POLYGON((1 1,2 2,3 3,1 1))'),
+SPATIAL INDEX(c3))
+ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3(id,c2) VALUES(1,1),(2,2),(3,3);
+SELECT id, c2, ST_AsText(c3) c3 FROM t3;
+id c2 c3
+1 1 POLYGON((1 1,2 2,3 3,1 1))
+2 2 POLYGON((1 1,2 2,3 3,1 1))
+3 3 POLYGON((1 1,2 2,3 3,1 1))
+ALTER TABLE t3 ADD COLUMN
+(c4 DATETIME DEFAULT current_timestamp(),
+c5 TIMESTAMP NOT NULL DEFAULT current_timestamp(),
+c6 POINT);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6 FROM t3;
+id c2 c3 c4 c5 c6
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL
+affected rows: 3
+ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
+id c2 c3 c4 c5 c6 c7 c8
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
+ALTER TABLE t3 ADD COLUMN t TEXT CHARSET utf8
+DEFAULT 'The quick brown fox jumps over the lazy dog';
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+INSERT INTO t3 SET id=4;
+ERROR HY000: Field 'c2' doesn't have a default value
+INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
+affected rows: 1
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c8' at row 1
+SET innodb_strict_mode = OFF;
+affected rows: 0
+ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
+CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
+affected rows: 4
+info: Records: 4 Duplicates: 0 Warnings: 0
+INSERT INTO t3 SET id=5, c2=9;
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c8' at row 1
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8, phrase, b FROM t3;
+id c2 c3 c4 c5 c6 c7 c8 phrase b
+1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+2 2 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+3 3 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog
+4 0 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 The quick brown fox jumps over the lazy dog 😱
+5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business
+ALTER TABLE t3 DROP c3, DROP c7;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t3;
+id c2 c4 c5 c6 c8 phrase b
+1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+2 2 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+3 3 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
+4 0 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog 😱
+5 9 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 ääH binary line of business
+CREATE TABLE t4
+(id INT, foo INT DEFAULT 0, c1 VARCHAR(4000),
+p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+PRIMARY KEY(id,foo))
+ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000)), (2, REPEAT('a', 4000));
+ALTER TABLE t4 ADD COLUMN d1 INT;
+BEGIN;
+UPDATE t4 SET c1 = repeat('1', 4000), foo=1 WHERE id=1;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000));
+UPDATE t4 SET c1 = repeat('2', 4000), foo=1 WHERE id=2;
+ROLLBACK;
+BEGIN;
+UPDATE t4 SET d1 = 1,foo=2 WHERE id=1;
+INSERT INTO t4 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000));
+COMMIT;
+CREATE TABLE big
+(id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
+p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
+ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+BEGIN;
+INSERT INTO big
+SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
+SET @i:=1;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+COMMIT;
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+3
+connection default;
+ALTER TABLE big ADD COLUMN
+(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+d3 TIMESTAMP NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECKSUM TABLE big;
+Table Checksum
+test.big 1705165209
+BEGIN;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+CHECKSUM TABLE big;
+Table Checksum
+test.big 385477733
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+7
+connection default;
+ROLLBACK;
+CHECKSUM TABLE big;
+Table Checksum
+test.big 1705165209
+connection analyze;
+ANALYZE TABLE big;
+Table Op Msg_type Msg_text
+test.big analyze status OK
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+clust_index_size
+3
+connection default;
+InnoDB 0 transactions not purged
+DROP TABLE t1,t2,t3,t4,big;
+CREATE TABLE t1 (a VARCHAR(1) PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 SET a='a';
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 0;
+UPDATE t1 SET b = 1;
+INSERT INTO t1 SET a='a';
+ERROR 23000: Duplicate entry 'a' for key 'PRIMARY'
+SELECT * FROM t1;
+a b
+a 1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY(b) REFERENCES t1(a))
+ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 SET a=1;
+INSERT INTO t2 SET b=1;
+ALTER TABLE t2 ADD COLUMN a INT, DROP FOREIGN KEY t2_ibfk_1;
+ALTER TABLE t2 ADD INDEX(a);
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY
+SET foreign_key_checks=0;
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ALTER TABLE t2 ADD CONSTRAINT fk FOREIGN KEY(b) REFERENCES t1(a),
+ALGORITHM=INSTANT;
+SET foreign_key_checks=1;
+ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
+ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t1 check status OK
+DROP TABLE t2, t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 SET a = 1;
+ALTER TABLE t1 ADD COLUMN b TEXT;
+BEGIN;
+UPDATE t1 SET b = REPEAT('1', 32768);
+UPDATE t1 SET a = 2;
+INSERT INTO t1 SET a = 1;
+SELECT a,LENGTH(b) FROM t1;
+a LENGTH(b)
+1 NULL
+2 32768
+DELETE FROM t1;
+COMMIT;
+InnoDB 0 transactions not purged
+DROP TABLE t1;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 VALUES (7);
+ALTER TABLE t1 ADD COLUMN c INT NOT NULL DEFAULT 0;
+ALTER TABLE t1 ADD INDEX (c);
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4,0),(7,77);
+COMMIT;
+BEGIN;
+DELETE FROM t1 WHERE a=7;
+UPDATE t1 SET a=7;
+COMMIT;
+SELECT * FROM t1 FORCE INDEX(PRIMARY);
+a c
+7 0
+SELECT * FROM t1 FORCE INDEX(c);
+a c
+7 0
+DELETE FROM t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET innodb_strict_mode = ON;
+CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ALTER TABLE t1 ADD d TEXT;
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 SET a=42;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
+ALTER TABLE t1 MODIFY a INT DEFAULT 0;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t1 MODIFY a INT DEFAULT NULL, ALGORITHM=INSTANT;
+DROP TABLE t1;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+disconnect analyze;
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+instants
+60
+SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
+SET GLOBAL innodb_instant_alter_column_allowed = @saved_allowance;
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result
new file mode 100644
index 00000000000..7b658df6565
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result
@@ -0,0 +1,204 @@
+#
+# MDEV-17821 Assertion `!page_rec_is_supremum(rec)' failed
+# in btr_pcur_store_position
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY, c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2);
+ALTER TABLE t1 ADD COLUMN f VARCHAR(255);
+ALTER TABLE t1 DROP COLUMN f;
+DELETE FROM t1;
+HANDLER t1 OPEN;
+HANDLER t1 READ `PRIMARY` <= (3);
+pk c
+DROP TABLE t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT,
+f1 CHAR(32),
+f2 CHAR(32),
+f3 CHAR(32),
+f4 INT,
+f5 CHAR(32),
+f6 INT,
+f7 INT,
+f8 INT,
+PRIMARY KEY (pk),
+UNIQUE (f6)
+) ENGINE=InnoDB;
+INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES
+('reality', 'llt', 'within', -1996816384, 'j', 160, 7, -1822687232),
+('h', 'j', 'j', 251, 'civilian', NULL, 211, NULL),
+('ltq', 'b', 'mud', 111, 'v', 90, 0, NULL),
+('toxic', 'breakfast', 'series', 2, 'x', NULL, 118, 2),
+('h', 'n', 'vision', 84, 'n', NULL, 197, 103),
+('h', 'tq', 'q', 6, 'bet', -1927151616, -446038016, 3),
+('pocket', 'qjt', 'jtl', 0, 'blink', NULL, 12, 0),
+('k', 'uv', 'exist', 37, 'g', 149, -1610219520, NULL),
+('parent', 'motion', 'u', 70, 'promote', NULL, 178, NULL),
+('get', 'convict', 'liquid', -780337152, 'd', NULL, 4, NULL),
+('vp', 'px', 'xi', -631111680, 'support', NULL, 8, NULL),
+('ck', 'z', 'minority', 8, 'k', NULL, 864878592, NULL),
+('kxx', 'g', 'container', 1, 'cholesterol', NULL, 4, 1404436480),
+('xxv', 'rail', 'j', 219, 'serious', NULL, -816119808, 62),
+('x', 'v', 'vr', 146, 'm', 16, 170, -1765867520),
+('age', 'm', 'q', -1251278848, 'rte', 6, 224, NULL),
+('discrimination', 't', 'q', 31, 'exl', 0, 2, 244),
+('water', 'x', 'ldb', 98, 'r', 235, 4, 63),
+('d', 'db', 'p', 248, 'so-called', 102, -255524864, 198),
+('last', 'bz', 'us', 0, 'experienced', 137, 240, 134),
+('q', 'z', 'attract', 67, 'code', 67, 75, 1758920704),
+('yellow', 'c', 'u', 6, 'v', 1731985408, 528154624, 2),
+('cognitive', 'he', 'protective', 590020608, 'sentence', NULL, 4, 102),
+('eih', 'l', 'ih', 1266024448, 'traditionally', NULL, 190, NULL),
+('pine', 'i', 'y', 6, 'glimpse', 214, 7, -1486880768),
+('jo', 'everyone', 'ol', 0, 'lj', NULL, 1, 0),
+('blood', 'f', 'scientist', 54, 'j', 1341128704, 168, NULL),
+('z', 'brief', 'ambassador', 115, 'ygp', 82, 129, NULL),
+('gp', 'severe', 'consist', 7, 'p', -1829961728, 602669056, 154),
+('admit', 'poetry', 'x', 116, 'enemy', 174, -2128543744, -407764992),
+('s', 'norm', 'decide', 2055667712, 'rtz', NULL, 99, -1233715200),
+('tzg', 'f', 'beg', 2016280576, 'w', NULL, -643825664, 137),
+('zgg', 'x', 'f', 148, 'y', -987496448, -708116480, 8),
+('attorney', 'perfectly', 's', 49, 'z', -1865285632, 56, -1518534656),
+('concentrate', 's', 'k', -1028849664, 'tir', 83, -1592459264, 1820065792),
+('t', 'sacrifice', 'ir', -2143879168, 'recipe', 156, 217, NULL),
+('wdf', 'd', 'f', 137, 'empty', NULL, 188, NULL),
+('o', 'customer', 'qd', -2135293952, 'z', 1527840768, 227, -1174929408),
+('d', 'qow', 'o', 1472266240, 'whe', NULL, 7, 197),
+('deny', 'reputation', 'dutch', 59, 'v', 124, 2, 191),
+('m', 'liver', 'fv', 0, 'policy', 781582336, 198574080, 177),
+('vk', 'kx', 'immigrant', -1452736512, 'x', 163, 76, 6) ,
+('j', 'ru', 'r', 67, 'joke', NULL, 3, NULL),
+('o', 'u', 'a', -569442304, 'uz', NULL, 933298176, NULL),
+('g', 'zb', 'c', -1694760960, 'fish', 18, -390463488, 1),
+('bb', 'o', 'b', 6, 'z', 9, 12, NULL),
+('compelling', 'xe', 'debut', 89, 'e', -734724096, 119, 175),
+('md', 'r', 'object', 1046478848, 'frequently', 915537920, 0, 1506410496),
+('dwn', 'wnz', 'x', 1767571456, 'nz', 241, -882180096, 9),
+('zvf', 'vfo', 'g', -844824576, 'w', NULL, 1, 9),
+('w', 'pose', 'r', 1029308416, 'a', -48627712, 1756168192, NULL),
+('o', 'jwp', 'patient', 172, 'i', 297140224, 45809664, 3),
+('w', 'p', 'american', 450297856, 'z', 20, 4, 186),
+('ridiculous', 'helpful', 'vy', -2022899712, 'conspiracy', NULL, 162, -264634368),
+('t', 'g', 'spite', 289931264, 'y', 4, 13, NULL),
+('performer', 'i', 'tomato', -1519386624, 'mz', 8, 87, 106),
+('m', 'z', 'hang', 3, 'crowded', -537919488, 1, 2),
+('fu', 'uot', 'j', 1, 'o', 179, 220, -2084569088),
+('ts', 'n', 'su', 1, 'o', 198, 9, 68),
+('ball', 'halfway', 'uf', 40, 'l', 145948672, 9, 149),
+('hunting', 'n', 'teenager', 0, 'neat', 209, 2044461056, 68),
+('independent', 'along', 'fpn', 5, 'pn', 3, 1353252864, 217),
+('p', 'presumably', 'n', -1977548800, 'balanced', 1909260288, 197, NULL),
+('pink', 'h', 'tear', 8, 'n', 254, 8, 1006305280),
+('tyy', 'n', 'yyr', 1107820544, 'yr', NULL, 0, 219),
+('u', 'retirement', 'thread', -2083192832, 'rx', -678232064, 209, 1048969216),
+('xk', 'kb', 'z', 9, 'ba', 218, 7, 8),
+('a', 'plenty', 'forget', 36, 'c', 215, 2027094016, NULL),
+('i', 'compromise', 'n', -1090256896, 'o', 10, 66, 1872887808),
+('x', 'disappointment', 'cognitive', 753860608, 'ua', 77, 123, 10),
+('e', 'added', 'aub', 2, 'u', NULL, 9, 92),
+('bc', 'h', 'n', 146, 'master', NULL, 1003945984, NULL),
+('execution', 'f', 'cgp', 574423040, 'gp', 2, -518782976, -1189085184),
+('pv', 'bad', 'v', 132, 'r', 195, 6, 5),
+('modify', 'participation', 'vol', 237, 'j', -842924032, 88, -747765760),
+('substantially', 'i', 'congressional', 2, 'edit', NULL, 1003159552, NULL),
+('tell', 'forty', 'v', -910098432, 'd', 43, 3, NULL),
+('crawl', 'ad', 'respect', -1851195392, 'p', 72, -1709047808, 1343225856),
+('w', 'reception', 'fiber', 56, 's', NULL, 2, -993787904),
+('successful', 'instruct', 'dug', 2, 'u', 7, -411500544, NULL),
+('appointment', 'pregnant', 'weird', 2, 'r', NULL, -897384448, 76),
+('g', 'j', 'thin', 663617536, 'oan', 1, 7, NULL),
+('secretary', 'a', 'o', 103, 'nj', 1977745408, -1291124736, -1314521088),
+('g', 'jq', 'q', 1875116032, 'blame', NULL, 1, 4),
+('oj', 'j', 'breast', 150, 'c', NULL, 3, NULL),
+('rd', 'm', 'comprehensive', 1723334656, 't', NULL, 155, -312344576) ,
+('a', 'd', 'criminal', -1155137536, 'airplane', 242, -662896640, 1),
+('fast', 'i', 'k', -386662400, 'zxe', NULL, 7, 119),
+('xe', 'mouse', 'c', -205717504, 'ew', NULL, -729612288, 86),
+('hang', 'j', 'o', 3, 'hungry', NULL, 200, 49),
+('expense', 'z', 'sum', 2, 'gob', -472055808, -538181632, NULL),
+('nest', 'o', 'k', 116, 'weak', NULL, 223, NULL);
+INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES ('impact', 'b', 'h', 185, 'fj', 7, 7, 3);
+ERROR 23000: Duplicate entry '7' for key 'f6'
+ALTER TABLE t1 ADD COLUMN filler VARCHAR(255) DEFAULT '';
+SELECT * FROM t1 INTO OUTFILE 'load.data';
+UPDATE IGNORE t1 SET pk = 0;
+LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1;
+HANDLER t1 OPEN AS h;
+HANDLER h READ `PRIMARY` PREV WHERE 0;
+pk f1 f2 f3 f4 f5 f6 f7 f8 filler
+HANDLER h CLOSE;
+DROP TABLE t1;
+#
+# MDEV-19630 ALTER TABLE ... ADD COLUMN damages foreign keys
+# which are pointed to the table being altered
+#
+CREATE TABLE t1(f1 int not null, primary key(f1))engine=innodb;
+CREATE TABLE t2(f1 INT AUTO_INCREMENT NOT NULL, f2 INT NOT NULL,
+status ENUM ('a', 'b', 'c'), INDEX idx1(f2),
+PRIMARY KEY(f1),
+FOREIGN KEY (f2) REFERENCES t1(f1))ENGINE=InnoDB;
+ALTER TABLE t1 CHANGE f1 f1_id INT NOT NULL, ADD f3 VARCHAR(255) DEFAULT NULL;
+ALTER TABLE t1 CHANGE f1_id f1 INT NOT NULL;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f3` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` int(11) NOT NULL AUTO_INCREMENT,
+ `f2` int(11) NOT NULL,
+ `status` enum('a','b','c') DEFAULT NULL,
+ PRIMARY KEY (`f1`),
+ KEY `idx1` (`f2`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t2 CHANGE status status VARCHAR(20) DEFAULT NULL;
+DROP TABLE t2, t1;
+#
+# MDEV-20938 Double free of dict_foreign_t during instant ALTER TABLE
+#
+CREATE TABLE t1 (id INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT UNSIGNED PRIMARY KEY, b INT UNSIGNED UNIQUE,
+FOREIGN KEY fk1 (b) REFERENCES t1 (id)) ENGINE=InnoDB;
+ALTER TABLE t2
+DROP FOREIGN KEY fk1,
+CHANGE b d INT UNSIGNED,
+ADD c INT;
+DROP TABLE t2, t1;
+#
+# MDEV-22446 InnoDB aborts while adding instant column
+# for discarded tablespace
+#
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT NOT NULL DEFAULT 0)ENGINE=InnoDB;
+INSERT INTO t1(c1) VALUES(1);
+ALTER TABLE t1 ADD COLUMN c3 INT DEFAULT 10;
+FLUSH TABLES t1 FOR EXPORT;
+backup: t1
+UNLOCK TABLES;
+DROP TABLE t1;
+CREATE TABLE t1(c1 INT NOT NULL)Engine=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1 ADD COLUMN c2 INT NOT NULL;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t1`
+ALTER TABLE t1 ADD COLUMN c3 INT DEFAULT 10;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t1`
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) NOT NULL,
+ `c3` int(11) DEFAULT 10
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2 c3
+1 0 10
+DROP TABLE t1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/innodb/r/instant_alter_crash.result b/mysql-test/suite/innodb/r/instant_alter_crash.result
new file mode 100644
index 00000000000..dde97d084d4
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_crash.result
@@ -0,0 +1,114 @@
+FLUSH TABLES;
+#
+# MDEV-11369: Instant ADD COLUMN for InnoDB
+#
+CREATE TABLE t1(id INT PRIMARY KEY, c2 INT UNIQUE)
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES(0,2);
+INSERT INTO t2 VALUES(2,1);
+ALTER TABLE t2 ADD COLUMN (c3 TEXT NOT NULL DEFAULT 'De finibus bonorum');
+BEGIN;
+INSERT INTO t2 VALUES(3,4,'accusantium doloremque laudantium');
+connect ddl, localhost, root;
+SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
+ALTER TABLE t1 ADD COLUMN (c3 TEXT NOT NULL DEFAULT ' et malorum');
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR ddl';
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+COMMIT;
+# Kill the server
+disconnect ddl;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+SELECT * FROM t1;
+id c2
+0 2
+SELECT * FROM t2;
+id c2 c3
+2 1 De finibus bonorum
+3 4 accusantium doloremque laudantium
+BEGIN;
+DELETE FROM t1;
+ROLLBACK;
+InnoDB 0 transactions not purged
+INSERT INTO t2 VALUES (64,42,'De finibus bonorum'), (347,33101,' et malorum');
+connect ddl, localhost, root;
+SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
+ALTER TABLE t2 ADD COLUMN (c4 TEXT NOT NULL DEFAULT ' et malorum');
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR ddl';
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+DELETE FROM t1;
+# Kill the server
+disconnect ddl;
+SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+FOUND 2 /\[Note\] InnoDB: Rolled back recovered transaction / in mysqld.1.err
+SELECT * FROM t1;
+id c2
+SELECT * FROM t2;
+id c2 c3
+2 1 De finibus bonorum
+3 4 accusantium doloremque laudantium
+64 42 De finibus bonorum
+347 33101 et malorum
+BEGIN;
+INSERT INTO t1 SET id=1;
+DELETE FROM t2;
+ROLLBACK;
+InnoDB 0 transactions not purged
+FLUSH TABLE t1,t2 FOR EXPORT;
+t1 clustered index root page(type 17855):
+N_RECS=0; LEVEL=0
+header=0x010000030074 (id=0x696e66696d756d00)
+header=0x010008030000 (id=0x73757072656d756d00)
+t2 clustered index root page(type 18):
+N_RECS=5; LEVEL=0
+header=0x010000030088 (id=0x696e66696d756d00)
+header=0x1000100b00b9 (id=0x80000000,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ c2=NULL(4 bytes),
+ c3=0x44652066696e6962757320626f6e6f72756d)
+header=0x0000180900d9 (id=0x80000002,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ c2=0x80000001)
+header=0x0000200b0119 (id=0x80000003,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ c2=0x80000004,
+ c3=0x6163637573616e7469756d20646f6c6f72656d717565206c617564616e7469756d)
+header=0x000028090139 (id=0x80000040,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ c2=0x8000002a)
+header=0x0000300b0074 (id=0x8000015b,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ c2=0x8000814d,
+ c3=0x206574206d616c6f72756d)
+header=0x060008030000 (id=0x73757072656d756d00)
+UNLOCK TABLES;
+DELETE FROM t2;
+InnoDB 0 transactions not purged
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` text NOT NULL DEFAULT 'De finibus bonorum',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `c2` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+DROP TABLE t1,t2;
+db.opt
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@saved_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
new file mode 100644
index 00000000000..49365b6e9be
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -0,0 +1,284 @@
+SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c1 INT,
+c2 VARCHAR(255),
+c3 VARCHAR(255),
+c4 INT,
+c5 INT,
+c6 INT,
+c7 VARCHAR(255),
+c8 TIMESTAMP NULL
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL,1,NULL,'foo',NULL,1,NULL,NULL,'2011-11-11 00:00:00');
+ALTER TABLE t1 ADD COLUMN f INT;
+REPLACE INTO t1 (c7) VALUES ('bar');
+CREATE TABLE t2 (i INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (-1),(1);
+ALTER TABLE t2 ADD COLUMN j INT;
+BEGIN;
+DELETE FROM t2;
+ROLLBACK;
+TRUNCATE TABLE t2;
+INSERT INTO t2 VALUES (1,2);
+CREATE TABLE t3 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t3 () VALUES ();
+ALTER TABLE t3 ADD COLUMN f INT;
+UPDATE t3 SET pk = DEFAULT;
+SELECT * FROM t3;
+pk f
+0 NULL
+CREATE TABLE t4 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (0);
+ALTER TABLE t4 ADD COLUMN b INT;
+SELECT COUNT(*)>0 FROM INFORMATION_SCHEMA.COLUMNS
+LEFT JOIN t4 ON (NUMERIC_SCALE = pk);
+COUNT(*)>0
+1
+ALTER TABLE t4 ADD COLUMN c INT;
+CREATE TABLE t5 (i INT, KEY(i)) ENGINE=InnoDB;
+INSERT INTO t5 VALUES (-42);
+ALTER TABLE t5 ADD UNIQUE ui(i);
+ALTER TABLE t5 ADD COLUMN i2 INT, DROP INDEX i;
+CREATE TABLE t6 (i INT NOT NULL) ENGINE=InnoDB;
+INSERT INTO t6 VALUES (0);
+ALTER TABLE t6 ADD COLUMN j INT;
+TRUNCATE TABLE t6;
+INSERT INTO t6 VALUES (1,2);
+CREATE TABLE t7 (i INT) ENGINE=InnoDB;
+INSERT INTO t7 VALUES (1),(2),(3),(4),(5);
+ALTER TABLE t7 ADD t TEXT DEFAULT '';
+CREATE TABLE t8 (i INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t8 VALUES (NULL);
+ALTER TABLE t8 ADD c CHAR(3);
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml';
+ALTER TABLE t8 FORCE;
+connect dml,localhost,root,,;
+SET DEBUG_SYNC='now WAIT_FOR rebuilt';
+BEGIN;
+INSERT INTO t8 SET i=1;
+UPDATE t8 SET i=ISNULL(i);
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL dml';
+connection default;
+SET DEBUG_SYNC='RESET';
+CREATE TABLE t9 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c1 BIGINT UNSIGNED,
+c2 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
+c3 BIGINT,
+c4 VARCHAR(257) CHARACTER SET utf8,
+c5 TINYINT UNSIGNED,
+c6 TINYINT,
+c7 VARCHAR(257) CHARACTER SET latin1,
+c8 VARCHAR(257) CHARACTER SET binary
+) ENGINE=InnoDB;
+INSERT INTO t9 () VALUES ();
+ALTER TABLE t9 ADD COLUMN IF NOT EXISTS t TIMESTAMP NULL KEY;
+Warnings:
+Note 1061 Multiple primary key defined
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml';
+OPTIMIZE TABLE t9;
+connection dml;
+SET DEBUG_SYNC='now WAIT_FOR rebuilt';
+BEGIN;
+INSERT INTO t9 () VALUES (),();
+UPDATE t9 SET t=current_timestamp();
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL dml';
+disconnect dml;
+connection default;
+Table Op Msg_type Msg_text
+test.t9 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t9 optimize status OK
+SET DEBUG_SYNC='RESET';
+CREATE TABLE t10 (pk INT DEFAULT 0 KEY) ENGINE=InnoDB;
+INSERT INTO t10 (pk) VALUES (1);
+ALTER TABLE t10 ADD c INT;
+TRUNCATE TABLE t10;
+INSERT INTO t10 VALUES (1,1),(2,2);
+ALTER TABLE t10 FORCE;
+CREATE TABLE t11 (
+c01 enum('a','b'),
+c02 bit,
+c03 blob,
+c04 enum('c','d'),
+c05 blob,
+c06 decimal,
+c07 char(1),
+c08 int,
+c09 char(1),
+c10 set('e','f'),
+c11 char(1),
+c12 float,
+c13 bit,
+c14 char(1),
+c15 int,
+c16 float,
+c17 decimal,
+c18 char(1) CHARACTER SET utf8 not null default '',
+c19 float,
+c20 set('g','h'),
+c21 char(1),
+c22 int,
+c23 int,
+c24 int,
+c25 set('i','j'),
+c26 decimal,
+c27 float,
+c28 char(1),
+c29 int,
+c30 enum('k','l'),
+c31 decimal,
+c32 char(1),
+c33 decimal,
+c34 bit,
+c35 enum('m','n'),
+c36 set('o','p'),
+c37 enum('q','r'),
+c38 blob,
+c39 decimal,
+c40 blob not null default '',
+c41 char(1),
+c42 int,
+c43 float,
+c44 float,
+c45 enum('s','t'),
+c46 decimal,
+c47 set('u','v'),
+c48 enum('w','x'),
+c49 set('y','z'),
+c50 float
+) ENGINE=InnoDB;
+INSERT INTO t11 () VALUES ();
+ALTER TABLE t11 ADD COLUMN f INT;
+INSERT INTO t11 () VALUES ();
+UPDATE t11 SET c22 = 1;
+InnoDB 0 transactions not purged
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
+#
+# MDEV-15060 Assertion in row_log_table_apply_op after instant ADD
+# when the table is emptied during subsequent ALTER TABLE
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL);
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL;
+connect stop_purge,localhost,root;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connect ddl,localhost,root,,test;
+DELETE FROM t1;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+ALTER TABLE t1 FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR copied';
+BEGIN;
+INSERT INTO t1 SET b=1;
+ROLLBACK;
+connection stop_purge;
+COMMIT;
+connection default;
+InnoDB 2 transactions not purged
+SET DEBUG_SYNC='now SIGNAL logged';
+connection ddl;
+connection default;
+DROP TABLE t1;
+SET DEBUG_SYNC='RESET';
+#
+# MDEV-16131 Assertion failed in dict_index_t::instant_field_value()
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 SET a=0;
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 2, ADD COLUMN c INT;
+connection stop_purge;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+DELETE FROM t1;
+connection ddl;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+ALTER TABLE t1 FORCE;
+disconnect stop_purge;
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR copied';
+InnoDB 1 transactions not purged
+INSERT INTO t1 SET a=1;
+INSERT INTO t1 SET a=2,b=3,c=4;
+SET DEBUG_SYNC = 'now SIGNAL logged';
+connection ddl;
+connection default;
+SET DEBUG_SYNC = RESET;
+SELECT * FROM t1;
+a b c
+1 2 NULL
+2 3 4
+#
+# MDEV-15872 Crash in online ALTER TABLE...ADD PRIMARY KEY
+# after instant ADD COLUMN ... NULL
+#
+ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=INSTANT;
+UPDATE t1 SET d=1;
+connection ddl;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d);
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR copied';
+BEGIN;
+INSERT INTO t1 SET a=3;
+ROLLBACK;
+SET DEBUG_SYNC = 'now SIGNAL logged';
+connection ddl;
+ERROR 22004: Invalid use of NULL value
+disconnect ddl;
+connection default;
+SET DEBUG_SYNC = RESET;
+SELECT * FROM t1;
+a b c d
+1 2 NULL 1
+2 3 4 1
+DROP TABLE t1;
+#
+# MDEV-19916 Corruption after instant ADD/DROP and shrinking the tree
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET @old_limit = @@innodb_limit_optimistic_insert_debug;
+SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
+INSERT INTO t1 VALUES (1),(5),(4),(3),(2);
+SET GLOBAL innodb_limit_optimistic_insert_debug = @old_limit;
+ALTER TABLE t1 ADD COLUMN b INT, ALGORITHM=INSTANT;
+SET @old_defragment = @@innodb_defragment;
+SET GLOBAL innodb_defragment = 1;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SET GLOBAL innodb_defragment = @old_defragment;
+ALTER TABLE t1 ADD vb INT AS (b) VIRTUAL;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1;
+a b vb
+1 NULL NULL
+2 NULL NULL
+3 NULL NULL
+4 NULL NULL
+5 NULL NULL
+DROP TABLE t1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency;
+#
+# MDEV-21045 AddressSanitizer: use-after-poison in mem_heap_dup / row_log_table_get_pk_col
+#
+CREATE TABLE t1 (a TEXT) ENGINE = InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 (a) VALUES ('foo');
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 0,algorithm=instant;
+connect con2,localhost,root,,test;
+SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL onlinealter WAIT_FOR update';
+ALTER TABLE t1 ADD PRIMARY KEY (b);
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR onlinealter';
+UPDATE t1 SET b = 1;
+SET DEBUG_SYNC='now SIGNAL update';
+connection con2;
+connection default;
+SET DEBUG_SYNC='RESET';
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/instant_alter_import.result b/mysql-test/suite/innodb/r/instant_alter_import.result
new file mode 100644
index 00000000000..ab14d44bdff
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_import.result
@@ -0,0 +1,46 @@
+set default_storage_engine=innodb;
+#
+# MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
+#
+create table t2 (x int, z int default 41);
+alter table t2 discard tablespace;
+create table t1 (x int);
+insert into t1 values (1);
+alter table t1 add z int default 42, algorithm instant;
+select * from t1;
+x z
+1 42
+flush tables t1 for export;
+unlock tables;
+# The metadata has to be updated to instant ADD COLUMN.
+alter table t2 import tablespace;
+select * from t2;
+x z
+1 42
+insert into t2 set x=2;
+select * from t2;
+x z
+1 42
+2 41
+alter table t1 discard tablespace;
+flush tables t2 for export;
+unlock tables;
+# Both the metadata and the data file used instant ADD COLUMN.
+alter table t1 import tablespace;
+select * from t1;
+x z
+1 42
+2 41
+drop table t2;
+create table t2 select * from t1;
+alter table t1 discard tablespace;
+flush tables t2 for export;
+unlock tables;
+# The instant ADD COLUMN has to be removed from the metadata.
+alter table t1 import tablespace;
+select * from t1;
+x z
+1 42
+2 41
+drop table t2;
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/instant_alter_inject.result b/mysql-test/suite/innodb/r/instant_alter_inject.result
new file mode 100644
index 00000000000..fe175f5bed0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_inject.result
@@ -0,0 +1,66 @@
+CREATE TABLE t1(a INT PRIMARY KEY, b INT, KEY(b)) ENGINE=InnoDB
+ROW_FORMAT=REDUNDANT PARTITION BY KEY() PARTITIONS 3;
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5);
+SET @saved_dbug= @@SESSION.debug_dbug;
+SET DEBUG_DBUG='+d,ib_commit_inplace_fail_2';
+ALTER TABLE t1 ADD COLUMN c CHAR(3) DEFAULT 'lie';
+ERROR HY000: Internal error: Injected error!
+SET DEBUG_DBUG= @saved_dbug;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+BEGIN;
+UPDATE t1 SET b=a+1;
+INSERT INTO t1 VALUES (0,1);
+ROLLBACK;
+SELECT * FROM t1;
+a b
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+ALTER TABLE t1 ADD COLUMN c CHAR(3) DEFAULT 'lie';
+SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
+ALTER TABLE t1 ADD COLUMN d INT NOT NULL DEFAULT -42;
+ERROR HY000: Internal error: Injected error!
+SET DEBUG_DBUG= @saved_dbug;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1,2,'foo');
+ROLLBACK;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` char(3) DEFAULT 'lie',
+ PRIMARY KEY (`a`),
+ KEY `b` (`b`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+ PARTITION BY KEY ()
+PARTITIONS 3
+DROP TABLE t1;
+CREATE TABLE t2(a INT, KEY(a)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
+ALTER TABLE t2 ADD COLUMN b INT;
+ERROR HY000: Internal error: Injected error!
+SET DEBUG_DBUG= @saved_dbug;
+CHECK TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+BEGIN;
+DELETE FROM t2;
+INSERT INTO t2 VALUES (1);
+ROLLBACK;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/r/instant_alter_rollback.result b/mysql-test/suite/innodb/r/instant_alter_rollback.result
new file mode 100644
index 00000000000..2c2083adc46
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_rollback.result
@@ -0,0 +1,40 @@
+FLUSH TABLES;
+#
+# MDEV-11369: Instant ADD COLUMN for InnoDB
+#
+connect to_be_killed, localhost, root;
+CREATE TABLE empty (id INT PRIMARY KEY, c2 INT UNIQUE) ENGINE=InnoDB;
+CREATE TABLE once LIKE empty;
+CREATE TABLE twice LIKE empty;
+INSERT INTO once SET id=1,c2=1;
+INSERT INTO twice SET id=1,c2=1;
+ALTER TABLE empty ADD COLUMN (d1 INT DEFAULT 15);
+ALTER TABLE once ADD COLUMN (d1 INT DEFAULT 20);
+ALTER TABLE twice ADD COLUMN (d1 INT DEFAULT 20);
+ALTER TABLE twice ADD COLUMN
+(d2 INT NOT NULL DEFAULT 10,
+d3 VARCHAR(15) NOT NULL DEFAULT 'var och en char');
+BEGIN;
+INSERT INTO empty set id=0,c2=42;
+UPDATE once set c2=c2+1;
+UPDATE twice set c2=c2+1;
+INSERT INTO twice SET id=2,c2=0,d3='';
+connection default;
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+CREATE TABLE foo(a INT PRIMARY KEY) ENGINE=InnoDB;
+# Kill the server
+disconnect to_be_killed;
+SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+DROP TABLE foo;
+InnoDB 0 transactions not purged
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@saved_frequency;
+SELECT * FROM empty;
+id c2 d1
+SELECT * FROM once;
+id c2 d1
+1 1 20
+SELECT * FROM twice;
+id c2 d1 d2 d3
+1 1 20 10 var och en char
+DROP TABLE empty, once, twice;
diff --git a/mysql-test/suite/innodb/r/log_corruption.result b/mysql-test/suite/innodb/r/log_corruption.result
index 49f6e6b85d2..b174546c111 100644
--- a/mysql-test/suite/innodb/r/log_corruption.result
+++ b/mysql-test/suite/innodb/r/log_corruption.result
@@ -49,6 +49,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
+# same, but with current-version header
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
+FOUND 2 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log)
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@@ -104,15 +111,21 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
-FOUND 1 /Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1/ in mysqld.1.err
+FOUND 2 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
# Empty 10.3 redo log
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
-FOUND 1 /InnoDB: Downgrading redo log:/ in mysqld.1.err
+FOUND 1 /InnoDB: .* started; log sequence number 121397[09]/ in mysqld.1.err
+# Empty 10.2 redo log
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+COUNT(*)
+1
+FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
diff --git a/mysql-test/suite/innodb/r/log_file_name.result b/mysql-test/suite/innodb/r/log_file_name.result
index 220f5ab6699..78b97f7f0bb 100644
--- a/mysql-test/suite/innodb/r/log_file_name.result
+++ b/mysql-test/suite/innodb/r/log_file_name.result
@@ -15,30 +15,30 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID.*/ in mysqld.1.err
+FOUND 1 /InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID/ in mysqld.1.err
# Fault 2: Wrong space_id in a dirty file, and a missing file.
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Ignoring data file '.*t1.ibd' with space ID.*/ in mysqld.1.err
-FOUND 1 /InnoDB: Tablespace \d+ was not found at.*t3.ibd.*/ in mysqld.1.err
+FOUND 1 /InnoDB: Ignoring data file '.*t1.ibd' with space ID/ in mysqld.1.err
+FOUND 1 /InnoDB: Tablespace \d+ was not found at.*t3.ibd/ in mysqld.1.err
# Fault 3: Wrong space_id in a dirty file, and no missing file.
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Ignoring data file '.*t[23].ibd' with space ID.*/ in mysqld.1.err
-FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t1.ibd.*/ in mysqld.1.err
-FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t3.ibd.*/ in mysqld.1.err
-FOUND 1 /InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*/ in mysqld.1.err
+FOUND 1 /InnoDB: Ignoring data file '.*t[23].ibd' with space ID/ in mysqld.1.err
+FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t1.ibd/ in mysqld.1.err
+FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t3.ibd/ in mysqld.1.err
+FOUND 2 /InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace/ in mysqld.1.err
# Fault 4: Missing data file
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
-.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*/ in mysqld.1.err
+.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace/ in mysqld.1.err
# Fault 5: Wrong type of data file
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@@ -48,8 +48,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-NOT FOUND /\[Note\] InnoDB: Cannot read first page of .*t2.ibd.*/ in mysqld.1.err
-FOUND 1 /\[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages.*/ in mysqld.1.err
+NOT FOUND /\[Note\] InnoDB: Cannot read first page of .*t2.ibd/ in mysqld.1.err
+FOUND 1 /\[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages/ in mysqld.1.err
SELECT * FROM t2;
a
9
@@ -82,20 +82,20 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*/ in mysqld.1.err
-FOUND 1 /\[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages.*/ in mysqld.1.err
-NOT FOUND /\[Note\] InnoDB: Cannot read first page of .*u2.ibd.*/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
+FOUND 1 /\[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages/ in mysqld.1.err
+NOT FOUND /\[Note\] InnoDB: Cannot read first page of .*u2.ibd/ in mysqld.1.err
# Fault 7: Missing or wrong data file and innodb_force_recovery
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*/ in mysqld.1.err
-FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*/ in mysqld.1.err
-FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' for space ID \d+ because the target file exists.*/ in mysqld.1.err
-FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*/ in mysqld.1.err
-FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*/ in mysqld.1.err
-FOUND 1 /\[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!.*/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
+FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace/ in mysqld.1.err
+FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' because the target file exists/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
+FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace/ in mysqld.1.err
+FOUND 1 /\[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!/ in mysqld.1.err
DROP TABLE u1,u2,u3,u6;
# List of files:
db.opt
diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result
index 2700479e7f7..a40bfdac0d0 100644
--- a/mysql-test/suite/innodb/r/monitor.result
+++ b/mysql-test/suite/innodb/r/monitor.result
@@ -662,7 +662,21 @@ SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 1
+DROP TABLE t1;
+CREATE TABLE t1(id INT PRIMARY KEY, a INT, b CHAR(1), UNIQUE KEY u(a,b))
+ENGINE=InnoDB;
+SET @start = (SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+= 'lock_rec_lock_created');
+BEGIN;
+INSERT INTO t1 VALUES(1,1,'a'),(2,9999,'b'),(3,10000,'c'),(4,4,'d');
+DELETE FROM t1 WHERE a = 9999 AND b='b';
+COMMIT;
+SET @end = (SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+= 'lock_rec_lock_created');
+SELECT @end - @start;
+@end - @start
+0
+DROP TABLE t1;
SET GLOBAL innodb_monitor_enable=default;
SET GLOBAL innodb_monitor_disable=default;
SET GLOBAL innodb_monitor_reset_all=default;
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/mvcc.result b/mysql-test/suite/innodb/r/mvcc.result
index b0b834c91a4..215b2165b8c 100644
--- a/mysql-test/suite/innodb/r/mvcc.result
+++ b/mysql-test/suite/innodb/r/mvcc.result
@@ -23,6 +23,7 @@ connection default;
# FIXME: Block this with ER_TABLE_DEF_CHANGED
SELECT * FROM t1;
a
+0
COMMIT;
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/innodb/r/read_only_recover_committed.result b/mysql-test/suite/innodb/r/read_only_recover_committed.result
index 4c1235761e6..278905a976b 100644
--- a/mysql-test/suite/innodb/r/read_only_recover_committed.result
+++ b/mysql-test/suite/innodb/r/read_only_recover_committed.result
@@ -3,7 +3,7 @@ CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t VALUES(1);
BEGIN;
INSERT INTO t VALUES(2);
-DELETE FROM t WHERE a=2;
+UPDATE t SET a=20 WHERE a=2;
connect con2, localhost, root;
# Normal MariaDB shutdown would roll back the above transaction.
# We want the transaction to remain open, so we will kill the server
@@ -15,7 +15,7 @@ SET DEBUG_SYNC='after_trx_committed_in_memory SIGNAL committed WAIT_FOR ever';
COMMIT;
connection default;
SET DEBUG_SYNC='now WAIT_FOR committed';
-# Ensure that the above incomplete transactions become durable.
+# Ensure that the above transactions become durable.
SET GLOBAL innodb_flush_log_at_trx_commit=1;
BEGIN;
INSERT INTO t VALUES(-10000);
@@ -29,18 +29,40 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
a
1
+20
UPDATE t SET a=3 WHERE a=1;
SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output;
# Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
# In earlier versions, this would return the last committed version
-# (empty table)!
+# (only a=3; no record for a=20)!
SELECT * FROM t;
a
3
+20
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
a
3
+20
+#
+# MDEV-15418 innodb_force_recovery=5 displays bogus warnings
+# about too new transaction identifier
+#
+# With the fix, innodb_force_recovery=5 implies READ UNCOMMITTED.
+SELECT * FROM t;
+a
+3
+20
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT * FROM t;
+a
+3
+20
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SELECT * FROM t;
+a
+3
+20
SELECT * FROM t;
a
3
diff --git a/mysql-test/suite/innodb/r/row_format_redundant.result b/mysql-test/suite/innodb/r/row_format_redundant.result
index 1a291a0e59f..8852bfd8e6a 100644
--- a/mysql-test/suite/innodb/r/row_format_redundant.result
+++ b/mysql-test/suite/innodb/r/row_format_redundant.result
@@ -72,7 +72,7 @@ DROP TABLE t1;
Warnings:
Warning 1932 Table 'test.t1' doesn't exist in engine
DROP TABLE t2,t3;
-FOUND 50 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=255\b/ in mysqld.1.err
+FOUND 50 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b/ in mysqld.1.err
ib_buffer_pool
ib_logfile0
ib_logfile1
diff --git a/mysql-test/suite/innodb/r/strict_mode.result b/mysql-test/suite/innodb/r/strict_mode.result
index 3565fc57e4d..7be5f961ccc 100644
--- a/mysql-test/suite/innodb/r/strict_mode.result
+++ b/mysql-test/suite/innodb/r/strict_mode.result
@@ -2,7 +2,7 @@
# Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
# INNODB_STRICT_MODE = 1
#
-call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+call mtr.add_suppression("InnoDB: Cannot add field .* in table");
set innodb_strict_mode = 0;
create table t1 (id int auto_increment primary key,
v varchar(32),
diff --git a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
index 4527a2ebaf2..7e851cf5634 100644
--- a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
@@ -15,8 +15,8 @@
-header=0x00002815008d (NAME='SYS_DATAFILES',
+header=0x0100000301bf (NAME=0x696e66696d756d00)
+header=0x0000301500de (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
- DB_ROLL_PTR=0x81000001320194,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000e,
+ ID=0x000000000000000f,
N_COLS=0x00000002,
@@ -27,10 +27,9 @@
SPACE=0x00000000)
-header=0x0000101500d5 (NAME='SYS_FOREIGN',
+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000b,
-+ DB_ROLL_PTR=0x800000012c016f,
+ ID=0x000000000000000c,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -40,10 +39,9 @@
SPACE=0x00000000)
-header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000c,
-+ DB_ROLL_PTR=0x800000012c0260,
+ ID=0x000000000000000d,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -53,8 +51,8 @@
SPACE=0x00000000)
-header=0x0400201501b8 (NAME='SYS_TABLESPACES',
+header=0x040028150209 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
- DB_ROLL_PTR=0x81000001320110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000d,
+ ID=0x000000000000000e,
N_COLS=0x00000003,
@@ -65,8 +63,8 @@
SPACE=0x00000000)
-header=0x000030150244 (NAME='SYS_VIRTUAL',
+header=0x000038150251 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
- DB_ROLL_PTR=0x82000001350110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000f,
+ ID=0x0000000000000010,
N_COLS=0x00000003,
@@ -77,8 +75,8 @@
SPACE=0x00000000)
-header=0x000040150288 (NAME='test/tc',
+header=0x000040150295 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
- DB_ROLL_PTR=0x84000001380110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000011,
+ ID=0x0000000000000012,
N_COLS=0x80000001,
@@ -89,8 +87,8 @@
SPACE=0x00000002)
-header=0x000048150310 (NAME='test/td',
+header=0x00004815031d (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
- DB_ROLL_PTR=0x85000001390110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000012,
+ ID=0x0000000000000013,
N_COLS=0x80000001,
@@ -101,8 +99,8 @@
SPACE=0x00000003)
-header=0x000058150200 (NAME='test/tp',
+header=0x00005815008d (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
- DB_ROLL_PTR=0x870000013b0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000014,
+ ID=0x0000000000000015,
N_COLS=0x80000001,
@@ -113,8 +111,8 @@
SPACE=0x00000005)
-header=0x0000381502cc (NAME='test/tr',
+header=0x0000101502d9 (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
- DB_ROLL_PTR=0x83000001370110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000010,
+ ID=0x0000000000000011,
N_COLS=0x00000001,
@@ -122,8 +120,8 @@
MIX_ID=0x0000000000000000,
@@ -104,9 +106,9 @@
header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
- DB_ROLL_PTR=0x860000013a0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000013,
+ ID=0x0000000000000014,
N_COLS=0x80000001,
diff --git a/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff b/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff
index ea2d7048bb7..ce1ff623d50 100644
--- a/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff
@@ -9,93 +9,8 @@
SET innodb_strict_mode=ON;
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-@@ -13,7 +15,7 @@
- header=0x01000003016e (NAME=0x696e66696d756d00)
- header=0x00002815008d (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
-+ DB_ROLL_PTR=0x81000001310194,
- ID=0x000000000000000e,
- N_COLS=0x00000002,
- TYPE=0x00000001,
-@@ -23,7 +25,7 @@
- SPACE=0x00000000)
- header=0x0000101500d5 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
-+ DB_ROLL_PTR=0x800000012c0110,
- ID=0x000000000000000b,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -33,7 +35,7 @@
- SPACE=0x00000000)
- header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
-+ DB_ROLL_PTR=0x800000012c0201,
- ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -43,7 +45,7 @@
- SPACE=0x00000000)
- header=0x0400201501b8 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
-+ DB_ROLL_PTR=0x81000001310110,
- ID=0x000000000000000d,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -53,7 +55,7 @@
- SPACE=0x00000000)
- header=0x000030150244 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
-+ DB_ROLL_PTR=0x82000001340110,
- ID=0x000000000000000f,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -63,7 +65,7 @@
- SPACE=0x00000000)
- header=0x000040150288 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
-+ DB_ROLL_PTR=0x84000001370110,
- ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000001,
-@@ -73,7 +75,7 @@
- SPACE=0x00000002)
- header=0x000048150310 (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
-+ DB_ROLL_PTR=0x85000001380110,
- ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000021,
-@@ -83,7 +85,7 @@
- SPACE=0x00000003)
- header=0x000058150200 (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
-+ DB_ROLL_PTR=0x870000013a0110,
- ID=0x0000000000000014,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
-@@ -93,7 +95,7 @@
- SPACE=0x00000005)
- header=0x0000381502cc (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
-+ DB_ROLL_PTR=0x83000001360110,
- ID=0x0000000000000010,
- N_COLS=0x00000001,
- TYPE=0x00000001,
-@@ -103,10 +105,10 @@
- SPACE=0x00000001)
- header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
-+ DB_ROLL_PTR=0x86000001390110,
+@@ -103,7 +105,7 @@
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000013,
N_COLS=0x80000001,
- TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags,4k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,4k,debug.rdiff
deleted file mode 100644
index b7d24f1b2be..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,4k,debug.rdiff
+++ /dev/null
@@ -1,133 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,4k,debug.reject
-@@ -10,91 +10,91 @@
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
- SYS_TABLES clustered index root page (8):
- N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
--header=0x01000003016e (NAME=0x696e66696d756d00)
--header=0x00002815008d (NAME='SYS_DATAFILES',
-+header=0x0100000301bf (NAME=0x696e66696d756d00)
-+header=0x0000301500de (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
-- ID=0x000000000000000e,
-+ DB_ROLL_PTR=0x81000003270194,
-+ ID=0x000000000000000f,
- N_COLS=0x00000002,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0000101500d5 (NAME='SYS_FOREIGN',
-+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
-- ID=0x000000000000000b,
-+ DB_ROLL_PTR=0x8000000320016f,
-+ ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
-+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
-- ID=0x000000000000000c,
-+ DB_ROLL_PTR=0x80000003200260,
-+ ID=0x000000000000000d,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0400201501b8 (NAME='SYS_TABLESPACES',
-+header=0x040028150209 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
-- ID=0x000000000000000d,
-+ DB_ROLL_PTR=0x81000003270110,
-+ ID=0x000000000000000e,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000030150244 (NAME='SYS_VIRTUAL',
-+header=0x000038150251 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
-- ID=0x000000000000000f,
-+ DB_ROLL_PTR=0x820000032b0110,
-+ ID=0x0000000000000010,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000040150288 (NAME='test/tc',
-+header=0x000040150295 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
-- ID=0x0000000000000011,
-+ DB_ROLL_PTR=0x840000032f0110,
-+ ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000002)
--header=0x000048150310 (NAME='test/td',
-+header=0x00004815031d (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
-- ID=0x0000000000000012,
-+ DB_ROLL_PTR=0x85000003300110,
-+ ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000003)
--header=0x000058150200 (NAME='test/tp',
-+header=0x00005815008d (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
-- ID=0x0000000000000014,
-+ DB_ROLL_PTR=0x87000003320110,
-+ ID=0x0000000000000015,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000005)
--header=0x0000381502cc (NAME='test/tr',
-+header=0x0000101502d9 (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
-- ID=0x0000000000000010,
-+ DB_ROLL_PTR=0x830000032d0110,
-+ ID=0x0000000000000011,
- N_COLS=0x00000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
-@@ -103,8 +103,8 @@
- SPACE=0x00000001)
- header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
-- ID=0x0000000000000013,
-+ DB_ROLL_PTR=0x86000003310110,
-+ ID=0x0000000000000014,
- N_COLS=0x80000001,
- TYPE=0x00000023,
- MIX_ID=0x0000000000000000,
diff --git a/mysql-test/suite/innodb/r/table_flags,4k,release.rdiff b/mysql-test/suite/innodb/r/table_flags,4k,release.rdiff
deleted file mode 100644
index 0e469ee631b..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,4k,release.rdiff
+++ /dev/null
@@ -1,92 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,4k.reject
-@@ -13,7 +13,7 @@
- header=0x01000003016e (NAME=0x696e66696d756d00)
- header=0x00002815008d (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
-+ DB_ROLL_PTR=0x81000003260194,
- ID=0x000000000000000e,
- N_COLS=0x00000002,
- TYPE=0x00000001,
-@@ -23,7 +23,7 @@
- SPACE=0x00000000)
- header=0x0000101500d5 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
-+ DB_ROLL_PTR=0x80000003200110,
- ID=0x000000000000000b,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -33,7 +33,7 @@
- SPACE=0x00000000)
- header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
-+ DB_ROLL_PTR=0x80000003200201,
- ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -43,7 +43,7 @@
- SPACE=0x00000000)
- header=0x0400201501b8 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
-+ DB_ROLL_PTR=0x81000003260110,
- ID=0x000000000000000d,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -53,7 +53,7 @@
- SPACE=0x00000000)
- header=0x000030150244 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
-+ DB_ROLL_PTR=0x820000032a0110,
- ID=0x000000000000000f,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -63,7 +63,7 @@
- SPACE=0x00000000)
- header=0x000040150288 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
-+ DB_ROLL_PTR=0x840000032d0110,
- ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000001,
-@@ -73,7 +73,7 @@
- SPACE=0x00000002)
- header=0x000048150310 (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
-+ DB_ROLL_PTR=0x850000032f0110,
- ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000021,
-@@ -83,7 +83,7 @@
- SPACE=0x00000003)
- header=0x000058150200 (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
-+ DB_ROLL_PTR=0x87000003310110,
- ID=0x0000000000000014,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
-@@ -93,7 +93,7 @@
- SPACE=0x00000005)
- header=0x0000381502cc (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
-+ DB_ROLL_PTR=0x830000032c0110,
- ID=0x0000000000000010,
- N_COLS=0x00000001,
- TYPE=0x00000001,
-@@ -103,7 +103,7 @@
- SPACE=0x00000001)
- header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
-+ DB_ROLL_PTR=0x86000003300110,
- ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
index 54f3fd451be..da52f17fa68 100644
--- a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
@@ -15,8 +15,8 @@
-header=0x00002815008d (NAME='SYS_DATAFILES',
+header=0x0100000301bf (NAME=0x696e66696d756d00)
+header=0x0000301500de (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
- DB_ROLL_PTR=0x81000001320194,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000e,
+ ID=0x000000000000000f,
N_COLS=0x00000002,
@@ -27,10 +27,9 @@
SPACE=0x00000000)
-header=0x0000101500d5 (NAME='SYS_FOREIGN',
+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000b,
-+ DB_ROLL_PTR=0x800000012c016f,
+ ID=0x000000000000000c,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -40,10 +39,9 @@
SPACE=0x00000000)
-header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000c,
-+ DB_ROLL_PTR=0x800000012c0260,
+ ID=0x000000000000000d,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -53,8 +51,8 @@
SPACE=0x00000000)
-header=0x0400201501b8 (NAME='SYS_TABLESPACES',
+header=0x040028150209 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
- DB_ROLL_PTR=0x81000001320110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000d,
+ ID=0x000000000000000e,
N_COLS=0x00000003,
@@ -65,8 +63,8 @@
SPACE=0x00000000)
-header=0x000030150244 (NAME='SYS_VIRTUAL',
+header=0x000038150251 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
- DB_ROLL_PTR=0x82000001350110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000f,
+ ID=0x0000000000000010,
N_COLS=0x00000003,
@@ -77,8 +75,8 @@
SPACE=0x00000000)
-header=0x000040150288 (NAME='test/tc',
+header=0x000040150295 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
- DB_ROLL_PTR=0x84000001380110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000011,
+ ID=0x0000000000000012,
N_COLS=0x80000001,
@@ -89,8 +87,8 @@
SPACE=0x00000002)
-header=0x000048150310 (NAME='test/td',
+header=0x00004815031d (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
- DB_ROLL_PTR=0x85000001390110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000012,
+ ID=0x0000000000000013,
N_COLS=0x80000001,
@@ -101,8 +99,8 @@
SPACE=0x00000003)
-header=0x000058150200 (NAME='test/tp',
+header=0x00005815008d (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
- DB_ROLL_PTR=0x870000013b0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000014,
+ ID=0x0000000000000015,
N_COLS=0x80000001,
@@ -113,8 +111,8 @@
SPACE=0x00000005)
-header=0x0000381502cc (NAME='test/tr',
+header=0x0000101502d9 (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
- DB_ROLL_PTR=0x83000001370110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000010,
+ ID=0x0000000000000011,
N_COLS=0x00000001,
@@ -122,8 +120,8 @@
MIX_ID=0x0000000000000000,
@@ -104,9 +106,9 @@
header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
- DB_ROLL_PTR=0x860000013a0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000013,
+ ID=0x0000000000000014,
N_COLS=0x80000001,
diff --git a/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff b/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff
index ce2d7faa925..f2ba1280be3 100644
--- a/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff
@@ -9,93 +9,8 @@
SET innodb_strict_mode=ON;
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-@@ -13,7 +15,7 @@
- header=0x01000003016e (NAME=0x696e66696d756d00)
- header=0x00002815008d (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
-+ DB_ROLL_PTR=0x81000001310194,
- ID=0x000000000000000e,
- N_COLS=0x00000002,
- TYPE=0x00000001,
-@@ -23,7 +25,7 @@
- SPACE=0x00000000)
- header=0x0000101500d5 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
-+ DB_ROLL_PTR=0x800000012c0110,
- ID=0x000000000000000b,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -33,7 +35,7 @@
- SPACE=0x00000000)
- header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
-+ DB_ROLL_PTR=0x800000012c0201,
- ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -43,7 +45,7 @@
- SPACE=0x00000000)
- header=0x0400201501b8 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
-+ DB_ROLL_PTR=0x81000001310110,
- ID=0x000000000000000d,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -53,7 +55,7 @@
- SPACE=0x00000000)
- header=0x000030150244 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
-+ DB_ROLL_PTR=0x82000001340110,
- ID=0x000000000000000f,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -63,7 +65,7 @@
- SPACE=0x00000000)
- header=0x000040150288 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
-+ DB_ROLL_PTR=0x84000001370110,
- ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000001,
-@@ -73,7 +75,7 @@
- SPACE=0x00000002)
- header=0x000048150310 (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
-+ DB_ROLL_PTR=0x85000001380110,
- ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000021,
-@@ -83,7 +85,7 @@
- SPACE=0x00000003)
- header=0x000058150200 (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
-+ DB_ROLL_PTR=0x870000013a0110,
- ID=0x0000000000000014,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
-@@ -93,7 +95,7 @@
- SPACE=0x00000005)
- header=0x0000381502cc (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
-+ DB_ROLL_PTR=0x83000001360110,
- ID=0x0000000000000010,
- N_COLS=0x00000001,
- TYPE=0x00000001,
-@@ -103,10 +105,10 @@
- SPACE=0x00000001)
- header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
-+ DB_ROLL_PTR=0x86000001390110,
+@@ -103,7 +105,7 @@
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000013,
N_COLS=0x80000001,
- TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags,8k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,8k,debug.rdiff
deleted file mode 100644
index 3e45c3cfe84..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,8k,debug.rdiff
+++ /dev/null
@@ -1,133 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,8k,debug.reject
-@@ -10,91 +10,91 @@
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
- SYS_TABLES clustered index root page (8):
- N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
--header=0x01000003016e (NAME=0x696e66696d756d00)
--header=0x00002815008d (NAME='SYS_DATAFILES',
-+header=0x0100000301bf (NAME=0x696e66696d756d00)
-+header=0x0000301500de (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
-- ID=0x000000000000000e,
-+ DB_ROLL_PTR=0x81000001d80194,
-+ ID=0x000000000000000f,
- N_COLS=0x00000002,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0000101500d5 (NAME='SYS_FOREIGN',
-+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
-- ID=0x000000000000000b,
-+ DB_ROLL_PTR=0x80000001d1016f,
-+ ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
-+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
-- ID=0x000000000000000c,
-+ DB_ROLL_PTR=0x80000001d10260,
-+ ID=0x000000000000000d,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0400201501b8 (NAME='SYS_TABLESPACES',
-+header=0x040028150209 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
-- ID=0x000000000000000d,
-+ DB_ROLL_PTR=0x81000001d80110,
-+ ID=0x000000000000000e,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000030150244 (NAME='SYS_VIRTUAL',
-+header=0x000038150251 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
-- ID=0x000000000000000f,
-+ DB_ROLL_PTR=0x82000001db0110,
-+ ID=0x0000000000000010,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000040150288 (NAME='test/tc',
-+header=0x000040150295 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
-- ID=0x0000000000000011,
-+ DB_ROLL_PTR=0x84000001de0110,
-+ ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000002)
--header=0x000048150310 (NAME='test/td',
-+header=0x00004815031d (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
-- ID=0x0000000000000012,
-+ DB_ROLL_PTR=0x85000001df0110,
-+ ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000003)
--header=0x000058150200 (NAME='test/tp',
-+header=0x00005815008d (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
-- ID=0x0000000000000014,
-+ DB_ROLL_PTR=0x87000001e10110,
-+ ID=0x0000000000000015,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000005)
--header=0x0000381502cc (NAME='test/tr',
-+header=0x0000101502d9 (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
-- ID=0x0000000000000010,
-+ DB_ROLL_PTR=0x83000001dd0110,
-+ ID=0x0000000000000011,
- N_COLS=0x00000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
-@@ -103,8 +103,8 @@
- SPACE=0x00000001)
- header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
-- ID=0x0000000000000013,
-+ DB_ROLL_PTR=0x86000001e00110,
-+ ID=0x0000000000000014,
- N_COLS=0x80000001,
- TYPE=0x00000023,
- MIX_ID=0x0000000000000000,
diff --git a/mysql-test/suite/innodb/r/table_flags,8k,release.rdiff b/mysql-test/suite/innodb/r/table_flags,8k,release.rdiff
deleted file mode 100644
index d5b5731b305..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,8k,release.rdiff
+++ /dev/null
@@ -1,92 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,8k.reject
-@@ -13,7 +13,7 @@
- header=0x01000003016e (NAME=0x696e66696d756d00)
- header=0x00002815008d (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
-+ DB_ROLL_PTR=0x81000001d70194,
- ID=0x000000000000000e,
- N_COLS=0x00000002,
- TYPE=0x00000001,
-@@ -23,7 +23,7 @@
- SPACE=0x00000000)
- header=0x0000101500d5 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
-+ DB_ROLL_PTR=0x80000001d10110,
- ID=0x000000000000000b,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -33,7 +33,7 @@
- SPACE=0x00000000)
- header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
-+ DB_ROLL_PTR=0x80000001d10201,
- ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
-@@ -43,7 +43,7 @@
- SPACE=0x00000000)
- header=0x0400201501b8 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
-+ DB_ROLL_PTR=0x81000001d70110,
- ID=0x000000000000000d,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -53,7 +53,7 @@
- SPACE=0x00000000)
- header=0x000030150244 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
-+ DB_ROLL_PTR=0x82000001da0110,
- ID=0x000000000000000f,
- N_COLS=0x00000003,
- TYPE=0x00000001,
-@@ -63,7 +63,7 @@
- SPACE=0x00000000)
- header=0x000040150288 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
-+ DB_ROLL_PTR=0x84000001dd0110,
- ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000001,
-@@ -73,7 +73,7 @@
- SPACE=0x00000002)
- header=0x000048150310 (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
-+ DB_ROLL_PTR=0x85000001de0110,
- ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000021,
-@@ -83,7 +83,7 @@
- SPACE=0x00000003)
- header=0x000058150200 (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
-+ DB_ROLL_PTR=0x87000001e00110,
- ID=0x0000000000000014,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
-@@ -93,7 +93,7 @@
- SPACE=0x00000005)
- header=0x0000381502cc (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
-+ DB_ROLL_PTR=0x83000001dc0110,
- ID=0x0000000000000010,
- N_COLS=0x00000001,
- TYPE=0x00000001,
-@@ -103,7 +103,7 @@
- SPACE=0x00000001)
- header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
-+ DB_ROLL_PTR=0x86000001df0110,
- ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,debug.rdiff
index fef75cb3193..16f748468dd 100644
--- a/mysql-test/suite/innodb/r/table_flags,debug.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,debug.rdiff
@@ -8,10 +8,9 @@
-header=0x00002815008d (NAME='SYS_DATAFILES',
+header=0x0100000301bf (NAME=0x696e66696d756d00)
+header=0x0000301500de (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320194,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000e,
-+ DB_ROLL_PTR=0x81000001330194,
+ ID=0x000000000000000f,
N_COLS=0x00000002,
TYPE=0x00000001,
@@ -21,10 +20,9 @@
SPACE=0x00000000)
-header=0x0000101500d5 (NAME='SYS_FOREIGN',
+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000b,
-+ DB_ROLL_PTR=0x800000012d016f,
+ ID=0x000000000000000c,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -34,10 +32,9 @@
SPACE=0x00000000)
-header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
-- DB_ROLL_PTR=0x800000012d0201,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000c,
-+ DB_ROLL_PTR=0x800000012d0260,
+ ID=0x000000000000000d,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -47,10 +44,9 @@
SPACE=0x00000000)
-header=0x0400201501b8 (NAME='SYS_TABLESPACES',
+header=0x040028150209 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
-- DB_ROLL_PTR=0x81000001320110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000d,
-+ DB_ROLL_PTR=0x81000001330110,
+ ID=0x000000000000000e,
N_COLS=0x00000003,
TYPE=0x00000001,
@@ -60,10 +56,9 @@
SPACE=0x00000000)
-header=0x000030150244 (NAME='SYS_VIRTUAL',
+header=0x000038150251 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
-- DB_ROLL_PTR=0x82000001350110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x000000000000000f,
-+ DB_ROLL_PTR=0x82000001360110,
+ ID=0x0000000000000010,
N_COLS=0x00000003,
TYPE=0x00000001,
@@ -73,10 +68,9 @@
SPACE=0x00000000)
-header=0x000040150288 (NAME='test/tc',
+header=0x000040150295 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
-- DB_ROLL_PTR=0x84000001380110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000011,
-+ DB_ROLL_PTR=0x84000001390110,
+ ID=0x0000000000000012,
N_COLS=0x80000001,
TYPE=0x00000001,
@@ -86,10 +80,9 @@
SPACE=0x00000002)
-header=0x000048150310 (NAME='test/td',
+header=0x00004815031d (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
-- DB_ROLL_PTR=0x85000001390110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000012,
-+ DB_ROLL_PTR=0x850000013a0110,
+ ID=0x0000000000000013,
N_COLS=0x80000001,
TYPE=0x00000021,
@@ -99,10 +92,9 @@
SPACE=0x00000003)
-header=0x000058150200 (NAME='test/tp',
+header=0x00005815008d (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
-- DB_ROLL_PTR=0x870000013b0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000014,
-+ DB_ROLL_PTR=0x870000013c0110,
+ ID=0x0000000000000015,
N_COLS=0x80000001,
TYPE=0x000009a1,
@@ -112,21 +104,18 @@
SPACE=0x00000005)
-header=0x0000381502cc (NAME='test/tr',
+header=0x0000101502d9 (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
-- DB_ROLL_PTR=0x83000001370110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000010,
-+ DB_ROLL_PTR=0x83000001380110,
+ ID=0x0000000000000011,
N_COLS=0x00000001,
TYPE=0x00000001,
MIX_ID=0x0000000000000000,
-@@ -103,8 +103,8 @@
- SPACE=0x00000001)
+@@ -104,7 +104,7 @@
header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
-- DB_ROLL_PTR=0x860000013a0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000013,
-+ DB_ROLL_PTR=0x860000013b0110,
+ ID=0x0000000000000014,
N_COLS=0x80000001,
TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result
index ab665d46cac..8c4280738e1 100644
--- a/mysql-test/suite/innodb/r/table_flags.result
+++ b/mysql-test/suite/innodb/r/table_flags.result
@@ -12,8 +12,8 @@ SYS_TABLES clustered index root page (8):
N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
header=0x01000003016e (NAME=0x696e66696d756d00)
header=0x00002815008d (NAME='SYS_DATAFILES',
- DB_TRX_ID=0x000000000302,
- DB_ROLL_PTR=0x81000001320194,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x000000000000000e,
N_COLS=0x00000002,
TYPE=0x00000001,
@@ -22,8 +22,8 @@ header=0x00002815008d (NAME='SYS_DATAFILES',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000000)
header=0x0000101500d5 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000300,
- DB_ROLL_PTR=0x800000012d0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x000000000000000b,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -32,8 +32,8 @@ header=0x0000101500d5 (NAME='SYS_FOREIGN',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000000)
header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000300,
- DB_ROLL_PTR=0x800000012d0201,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x000000000000000c,
N_COLS=0x00000004,
TYPE=0x00000001,
@@ -42,8 +42,8 @@ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000000)
header=0x0400201501b8 (NAME='SYS_TABLESPACES',
- DB_TRX_ID=0x000000000302,
- DB_ROLL_PTR=0x81000001320110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x000000000000000d,
N_COLS=0x00000003,
TYPE=0x00000001,
@@ -52,8 +52,8 @@ header=0x0400201501b8 (NAME='SYS_TABLESPACES',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000000)
header=0x000030150244 (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000304,
- DB_ROLL_PTR=0x82000001350110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x000000000000000f,
N_COLS=0x00000003,
TYPE=0x00000001,
@@ -62,8 +62,8 @@ header=0x000030150244 (NAME='SYS_VIRTUAL',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000000)
header=0x000040150288 (NAME='test/tc',
- DB_TRX_ID=0x000000000308,
- DB_ROLL_PTR=0x84000001380110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000011,
N_COLS=0x80000001,
TYPE=0x00000001,
@@ -72,8 +72,8 @@ header=0x000040150288 (NAME='test/tc',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000002)
header=0x000048150310 (NAME='test/td',
- DB_TRX_ID=0x00000000030a,
- DB_ROLL_PTR=0x85000001390110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000012,
N_COLS=0x80000001,
TYPE=0x00000021,
@@ -82,8 +82,8 @@ header=0x000048150310 (NAME='test/td',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000003)
header=0x000058150200 (NAME='test/tp',
- DB_TRX_ID=0x00000000030e,
- DB_ROLL_PTR=0x870000013b0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000014,
N_COLS=0x80000001,
TYPE=0x000009a1,
@@ -92,8 +92,8 @@ header=0x000058150200 (NAME='test/tp',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000005)
header=0x0000381502cc (NAME='test/tr',
- DB_TRX_ID=0x000000000306,
- DB_ROLL_PTR=0x83000001370110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000010,
N_COLS=0x00000001,
TYPE=0x00000001,
@@ -102,8 +102,8 @@ header=0x0000381502cc (NAME='test/tr',
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000001)
header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x00000000030c,
- DB_ROLL_PTR=0x860000013a0110,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
ID=0x0000000000000013,
N_COLS=0x80000001,
TYPE=0x00000023,
@@ -127,10 +127,20 @@ td CREATE TABLE `td` (
SELECT * FROM td;
a
SHOW CREATE TABLE tz;
-ERROR 42S02: Table 'test.tz' doesn't exist in engine
+Table Create Table
+tz CREATE TABLE `tz` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1
+BEGIN;
+INSERT INTO tz VALUES(42);
+ROLLBACK;
+SELECT * FROM tz;
+a
+42
SHOW CREATE TABLE tp;
ERROR 42S02: Table 'test.tp' doesn't exist in engine
-FOUND 7 /InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649/ in mysqld.1.err
+FOUND 5 /InnoDB: Table `test`.`t[cp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649/ in mysqld.1.err
FOUND 2 /InnoDB: Table `test`\.`tr` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=65 SYS_TABLES\.MIX_LEN=4294967295\b/ in mysqld.1.err
Restoring SYS_TABLES clustered index root page (8)
SHOW CREATE TABLE tr;
@@ -167,7 +177,6 @@ BEGIN;
INSERT INTO tr VALUES(1);
INSERT INTO tc VALUES(1);
INSERT INTO td VALUES(1);
-INSERT INTO tz VALUES(1);
INSERT INTO tp VALUES(1);
ROLLBACK;
SELECT * FROM tr;
@@ -176,8 +185,6 @@ SELECT * FROM tc;
a
SELECT * FROM td;
a
-SELECT * FROM tz;
-a
SELECT * FROM tp;
a
DROP TABLE tr,tc,td,tz,tp;
diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result
index 628bb648ead..94c2cfc63b1 100644
--- a/mysql-test/suite/innodb/r/temporary_table.result
+++ b/mysql-test/suite/innodb/r/temporary_table.result
@@ -663,3 +663,11 @@ DROP TABLE t1;
END//
call t1_proc;
drop procedure t1_proc;
+#
+# MDEV-15874 CREATE TABLE creates extra transaction
+#
+call mtr.add_suppression("Warning 150 Create table `mysqld.1`.`t1` with foreign key constraint failed. Temporary tables can't have foreign key constraints.*");
+SET FOREIGN_KEY_CHECKS = 0;
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+FOREIGN KEY(f1) REFERENCES t0(f1))ENGINE=InnoDB;
+ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
diff --git a/mysql-test/suite/innodb/r/truncate.result b/mysql-test/suite/innodb/r/truncate.result
index 5e9fd60d4fe..0e5ffeea34f 100644
--- a/mysql-test/suite/innodb/r/truncate.result
+++ b/mysql-test/suite/innodb/r/truncate.result
@@ -12,8 +12,8 @@ DROP TABLE t;
CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB KEY_BLOCK_SIZE=4;
TRUNCATE TABLE t1;
SHOW TABLE STATUS;
-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 InnoDB # Compressed # # # # # # 1 # # NULL latin1_swedish_ci NULL key_block_size=4
+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 Max_index_length Temporary
+t1 InnoDB # Compressed # # # # # # 1 # # NULL latin1_swedish_ci NULL key_block_size=4 0 N
DROP TABLE t1;
#
# MDEV-17859 Operating system errors in file operations
diff --git a/mysql-test/suite/innodb/r/truncate_debug.result b/mysql-test/suite/innodb/r/truncate_debug.result
deleted file mode 100644
index c04b83dbbe8..00000000000
--- a/mysql-test/suite/innodb/r/truncate_debug.result
+++ /dev/null
@@ -1,88 +0,0 @@
-#
-# Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS
-#
-SET @ahi= @@global.innodb_adaptive_hash_index;
-SET GLOBAL innodb_adaptive_hash_index=OFF;
-SET GLOBAL innodb_adaptive_hash_index=ON;
-Test_1 :- Check if DDL operations are possible on
-table being truncated. Also check if
-DDL operations on other tables succeed.
-create table t1 (f1 int,f2 int,key(f2),f3 int) engine=innodb;
-create index idx1 on t1(f3);
-create table t2 (f1 int,f2 int,key(f2),f3 int) engine=innodb;
-create table t3 (f1 int,f2 int,key(f2)) engine=innodb;
-insert into t1 values (10,20,30),(30,40,50),(50,60,70);
-insert into t1 select * from t1;
-insert into t1 select * from t1;
-insert into t1 select * from t1;
-insert into t2 values (10,20,30),(30,40,50),(50,60,70);
-insert into t2 select * from t2;
-insert into t2 select * from t2;
-insert into t2 select * from t2;
-insert into t3 values (10,20),(30,40),(50,50);
-insert into t3 select * from t3;
-insert into t3 select * from t3;
-SET session lock_wait_timeout = 1;
-connect con1,localhost,root,,;
-SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan';
-truncate table t1;
-connection default;
-SET DEBUG_SYNC= 'now WAIT_FOR started';
-Check Analyze table. Gives lock time out error.
-analyze table t1;
-Table Op Msg_type Msg_text
-test.t1 analyze Error Lock wait timeout exceeded; try restarting transaction
-test.t1 analyze status Operation failed
-Check if we can turn off auto recalculation.
-alter table t1 STATS_AUTO_RECALC=0;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-Check if we can turn off persistent stats on the table
-alter table t1 STATS_PERSISTENT=0;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-Check if DML is possible on table being truncated
-insert into t1 values (10,89,99);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-Check if DDL is possible on table being truncated
-alter table t1 add column f4 int;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-check if table can be created with the same name
-create table t1 (bd int) engine=innodb;
-Got one of the listed errors
-check if index can be created on table being truncated
-create index idx1 on t1(f1);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-Check if DROP of table is possible during truncate
-drop table t1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-Check if select is possible during truncate
-select * from t1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-select * from t2 where t2.f1=t1.f1;
-ERROR 42S22: Unknown column 't1.f1' in 'where clause'
-Check concurrent truncate operation on table;
-truncate table t1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-Check concurrent selects and inserts on the other table
-insert into t3 values (10,20),(30,40),(50,50);
-select * from t3 where f1=40;
-f1 f2
-Concurrent truncate on other tables
-truncate table t2;
-Concurrent alters on the other tables
-alter table t2 add column f4 int;
-check if index can be created on the other table
-create index idx1 on t2(f3);
-Check if we can turn off persistent stats off entire instance
-SET GLOBAL innodb_stats_persistent=off;
-connect con2,localhost,root,,;
-set global innodb_adaptive_hash_index=off;
-connection default;
-SET DEBUG_SYNC= 'now SIGNAL finish_scan';
-connection con1;
-disconnect con1;
-connection con2;
-disconnect con2;
-connection default;
-SET DEBUG_SYNC= 'RESET';
-SET GLOBAL innodb_adaptive_hash_index=@ahi;
-drop table t1,t2,t3;
diff --git a/mysql-test/suite/innodb/r/truncate_inject.result b/mysql-test/suite/innodb/r/truncate_inject.result
deleted file mode 100644
index f69013172cd..00000000000
--- a/mysql-test/suite/innodb/r/truncate_inject.result
+++ /dev/null
@@ -1,114 +0,0 @@
-SET @save_dbug = @@SESSION.debug_dbug;
-call mtr.add_suppression("InnoDB: Flagged corruption of .* in table `test`\\.`t` in TRUNCATE TABLE");
-# 1. Error in assigning undo logs for truncate action
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c))
-ENGINE = InnoDB;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_assigning_undo_log';
-truncate table t;
-ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-# 2. Error while preparing for truncate
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_preparing_for_truncate';
-truncate table t;
-ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-# 3. Error while dropping/creating indexes
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_drop_index';
-truncate table t;
-ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check Warning InnoDB: Index PRIMARY is marked as corrupted
-test.t check error Corrupt
-select * from t;
-Got one of the listed errors
-drop table t;
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c))
-ENGINE = InnoDB;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_create_index';
-truncate table t;
-ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check Warning InnoDB: Index PRIMARY is marked as corrupted
-test.t check error Corrupt
-select * from t;
-Got one of the listed errors
-drop table t;
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c))
-ENGINE = InnoDB;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_temp_recreate_index';
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-drop table t;
-# 4. Error while completing truncate of table involving FTS
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100),
-FULLTEXT INDEX(c)) ENGINE = InnoDB;
-insert into t values (1, 1.1, 'mysql is now oracle company'),
-(2, 2.2, 'innodb is part of mysql'),
-(3, 3.3, 'innodb is default storage engine of mysql');
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_temp_recreate_index';
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-drop table t;
-# 5. Error while updating sys-tables
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100),
-FULLTEXT INDEX(c)) ENGINE = InnoDB;
-insert into t values (1, 1.1, 'mysql is now oracle company'),
-(2, 2.2, 'innodb is part of mysql'),
-(3, 3.3, 'innodb is default storage engine of mysql');
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_temp_recreate_index';
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t order by i;
-i f c
-drop table t;
diff --git a/mysql-test/suite/innodb/r/truncate_purge_debug.result b/mysql-test/suite/innodb/r/truncate_purge_debug.result
deleted file mode 100644
index 164987083d5..00000000000
--- a/mysql-test/suite/innodb/r/truncate_purge_debug.result
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS
-#
-create table t1 (f1 int ,f2 int,key(f2)) engine=innodb;
-begin;
-insert into t1 values (10,45),(20,78),(30,88),(40,23),(50,78),(60,11),(70,56),(80,90);
-delete from t1;
-connect con2,localhost,root,,;
-START TRANSACTION WITH CONSISTENT SNAPSHOT;
-connection default;
-SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
-SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
-commit;
-connect con1,localhost,root,,;
-SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan';
-truncate table t1;
-connection con2;
-SET DEBUG_SYNC= 'now WAIT_FOR started';
-COMMIT;
-disconnect con2;
-connection default;
-InnoDB 0 transactions not purged
-SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
-SET DEBUG_SYNC = 'now SIGNAL finish_scan';
-connection con1;
-disconnect con1;
-connection default;
-SET DEBUG_SYNC = 'RESET';
-drop table t1;
diff --git a/mysql-test/suite/innodb/r/truncate_restart.result b/mysql-test/suite/innodb/r/truncate_restart.result
deleted file mode 100644
index b6d14124371..00000000000
--- a/mysql-test/suite/innodb/r/truncate_restart.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SET GLOBAL innodb_stats_persistent= ON;
-CREATE TABLE t1 (t TEXT) ENGINE=InnoDB STATS_PERSISTENT=1;
-connect con1,localhost,root,,test;
-SET DEBUG_SYNC='ib_trunc_table_trunc_completing SIGNAL committed WAIT_FOR ever';
-TRUNCATE TABLE t1;
-connection default;
-SET DEBUG_SYNC='now WAIT_FOR committed';
-disconnect con1;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-0
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/trx_id_future.result b/mysql-test/suite/innodb/r/trx_id_future.result
index 887d11ddcc2..1ddc0e64f8b 100644
--- a/mysql-test/suite/innodb/r/trx_id_future.result
+++ b/mysql-test/suite/innodb/r/trx_id_future.result
@@ -2,12 +2,17 @@
# Bug #20445525 ADD A CONSISTENCY CHECK AGAINST DB_TRX_ID BEING
# IN THE FUTURE
#
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE t1(a INT) row_format=redundant engine=innoDB;
INSERT INTO t1 VALUES(1);
+InnoDB 0 transactions not purged
NOT FOUND /\[Warning\] InnoDB: A transaction id in a record of table `test`\.`t1` is newer than the system-wide maximum/ in mysqld.1.err
call mtr.add_suppression("\\[Warning\\] InnoDB: A transaction id in a record of table `test`\\.`t1` is newer than the system-wide maximum");
+SET @save_count = @@max_error_count;
+SET max_error_count = 1;
SELECT * FROM t1;
a
Warnings:
Warning 1642 InnoDB: Transaction id in a record of table `test`.`t1` is newer than system-wide maximum.
+SET max_error_count = @save_count;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/undo_truncate.result b/mysql-test/suite/innodb/r/undo_truncate.result
index 89171d36d0f..dce91a7461e 100644
--- a/mysql-test/suite/innodb/r/undo_truncate.result
+++ b/mysql-test/suite/innodb/r/undo_truncate.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("InnoDB: The transaction log size is too large");
SET @save_undo_logs = @@GLOBAL.innodb_undo_logs;
SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET @save_truncate = @@GLOBAL.innodb_undo_log_truncate;
diff --git a/mysql-test/suite/innodb/r/undo_truncate_recover.result b/mysql-test/suite/innodb/r/undo_truncate_recover.result
index 03393f38aed..fad69682b84 100644
--- a/mysql-test/suite/innodb/r/undo_truncate_recover.result
+++ b/mysql-test/suite/innodb/r/undo_truncate_recover.result
@@ -11,6 +11,6 @@ set global debug_dbug = '+d,ib_undo_trunc';
commit;
drop table t1;
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
-call mtr.add_suppression("InnoDB: The transaction log size is too large");
+call mtr.add_suppression("InnoDB: The redo log transaction size ");
SET GLOBAL innodb_fast_shutdown=0;
FOUND 1 /ib_undo_trunc/ in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/update_time_wl6658.result b/mysql-test/suite/innodb/r/update_time_wl6658.result
index 9c069478ace..fcd7a53351a 100644
--- a/mysql-test/suite/innodb/r/update_time_wl6658.result
+++ b/mysql-test/suite/innodb/r/update_time_wl6658.result
@@ -176,8 +176,9 @@ FROM information_schema.tables WHERE table_name='tab1i';
update_time
NULL
BEGIN WORK;
-INSERT INTO tab2 VALUES(1,'Oracle','NUTT',10);
+DELETE FROM tab1i;
SAVEPOINT A;
+INSERT INTO tab2 VALUES(1,'Oracle','NUTT',10);
INSERT INTO tab2 VALUES(2,'HUAWEI','BOLT',40);
SAVEPOINT B;
INSERT INTO tab2 VALUES(3,'IBM','NAIL',70);
@@ -185,17 +186,16 @@ SAVEPOINT C;
ROLLBACK to A;
SELECT * FROM tab2;
id store_name parts store_id
-1 Oracle NUTT 10
SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
update_time
NULL
#execute DDL instead of commit
create table tab6(c1 int);
-SELECT COUNT(update_time)
+SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
-COUNT(update_time)
-1
+update_time
+NULL
START TRANSACTION;
DELETE FROM tab7;
ROLLBACK;
diff --git a/mysql-test/suite/innodb/t/101_compatibility.test b/mysql-test/suite/innodb/t/101_compatibility.test
index eb3d3b0c014..eb1ec3b26ac 100644
--- a/mysql-test/suite/innodb/t/101_compatibility.test
+++ b/mysql-test/suite/innodb/t/101_compatibility.test
@@ -10,7 +10,7 @@
# buggy 10.1 files (by manually converting the flags in the files).
--disable_query_log
-call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of tablespace");
+call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file ");
FLUSH TABLES;
--enable_query_log
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
@@ -42,6 +42,7 @@ perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "ti");
ib_restore_tablespaces("test", "ti");
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
do "$ENV{MTR_SUITE_DIR}/include/ibd_convert.pl";
my $ps = $ENV{INNODB_PAGE_SIZE};
my $dd = $ENV{MYSQLD_DATADIR};
@@ -62,6 +63,7 @@ INSERT INTO ti VALUES(1);
--source include/kill_mysqld.inc
perl;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
do "$ENV{MTR_SUITE_DIR}/include/ibd_convert.pl";
my $ps = $ENV{INNODB_PAGE_SIZE};
my $dd = $ENV{MYSQLD_DATADIR};
@@ -81,6 +83,7 @@ CHECK TABLE tr,tc,td,tz,tdd,tp,ti;
--source include/shutdown_mysqld.inc
perl;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
do "$ENV{MTR_SUITE_DIR}/include/ibd_convert.pl";
my $ps = $ENV{INNODB_PAGE_SIZE};
my $dd = $ENV{MYSQLD_DATADIR};
diff --git a/mysql-test/suite/innodb/t/alter_algorithm.combinations b/mysql-test/suite/innodb/t/alter_algorithm.combinations
new file mode 100644
index 00000000000..197748d168e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_algorithm.combinations
@@ -0,0 +1,11 @@
+[COPY]
+--alter_algorithm=copy
+
+[INPLACE]
+--alter_algorithm=inplace
+
+[NOCOPY]
+--alter_algorithm=nocopy
+
+[INSTANT]
+--alter_algorithm=instant
diff --git a/mysql-test/suite/innodb/t/alter_algorithm.inc b/mysql-test/suite/innodb/t/alter_algorithm.inc
new file mode 100644
index 00000000000..1aa3caf7d66
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_algorithm.inc
@@ -0,0 +1,2 @@
+# See also alter_algorithm.combinations
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/innodb/t/alter_algorithm.test b/mysql-test/suite/innodb/t/alter_algorithm.test
new file mode 100644
index 00000000000..08c23b505f3
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_algorithm.test
@@ -0,0 +1,145 @@
+--source include/have_innodb.inc
+let $algorithm = `SELECT @@ALTER_ALGORITHM`;
+let $error_code = 0;
+
+if ($algorithm == "NOCOPY") {
+ let $error_code = ER_ALTER_OPERATION_NOT_SUPPORTED, ER_ALTER_OPERATION_NOT_SUPPORTED_REASON;
+}
+
+if ($algorithm == "INSTANT") {
+ let $error_code = ER_ALTER_OPERATION_NOT_SUPPORTED, ER_ALTER_OPERATION_NOT_SUPPORTED_REASON;
+}
+
+CREATE TABLE t1(f1 INT NOT NULL,
+ f2 INT NOT NULL,
+ f3 INT NULL,
+ f4 INT as (f2) STORED,
+ f5 INT as (f3) STORED,
+ PRIMARY KEY(f1))ROW_FORMAT=COMPRESSED, ENGINE=INNODB;
+INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
+
+SELECT @@alter_algorithm;
+
+--enable_info
+--echo # All the following cases needs table rebuild
+
+--echo # Add and Drop primary key
+--error $error_code
+ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1);
+
+--echo # Make existing column NULLABLE
+--error $error_code
+ALTER TABLE t1 MODIFY f2 INT;
+
+--echo # Drop Stored Column
+--error $error_code
+ALTER TABLE t1 DROP COLUMN f5;
+
+--echo # Add base non-generated column as a last column in the compressed table
+--error $error_code
+ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+
+--echo # Add base non-generated column but not in the last position
+--error $error_code
+ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3;
+
+--echo # Force the table to rebuild
+--error $error_code
+ALTER TABLE t1 FORCE;
+
+--echo # Row format changes
+--error $error_code
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+
+--echo # Engine table
+--error $error_code
+ALTER TABLE t1 ENGINE=INNODB;
+
+# Irrespective of alter_algorithm value, the following command
+# should succeed because of explicitly mentioning ALGORTHM=DEFAULT
+ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
+
+DROP TABLE t1;
+--disable_info
+
+if ($algorithm == "NOCOPY") {
+ let $error_code = 0;
+}
+
+if ($algorithm == "INSTANT") {
+ let $error_code = ER_ALTER_OPERATION_NOT_SUPPORTED_REASON;
+}
+
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+ f3 INT AS (f2 * f2) VIRTUAL,
+ f4 INT NOT NULL UNIQUE,
+ f5 INT NOT NULL,
+ INDEX idx(f2))ENGINE=INNODB;
+
+CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
+ INDEX(f1),
+ FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
+
+INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
+
+--enable_info
+--error $error_code
+ALTER TABLE t1 ADD INDEX idx1(f4), page_compressed=1;
+
+--error $error_code
+ALTER TABLE t1 DROP INDEX idx, page_compression_level=5;
+
+--error $error_code
+ALTER TABLE t1 ADD UNIQUE INDEX u1(f2);
+
+--error $error_code
+ALTER TABLE t1 DROP INDEX f4, page_compression_level=9;
+
+SET foreign_key_checks = 0;
+--error $error_code
+ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1);
+
+DROP TABLE t2, t1;
+--disable_info
+
+CREATE TABLE t1(f1 INT NOT NULL,
+ f2 INT NOT NULL,
+ f3 INT AS (f2 * f2) VIRTUAL,
+ INDEX idx (f2))engine=innodb;
+
+CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
+ f3 VARCHAR(10),
+ INDEX(f1))ENGINE=INNODB;
+
+INSERT INTO t1(f1, f2) VALUES(1, 1);
+
+--enable_info
+--echo # Add column at the end of the table
+ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL';
+
+--echo # Change virtual column expression
+ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL;
+
+--echo # Add virtual column
+ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL;
+
+--echo # Rename Column
+ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL;
+
+--echo # Rename table
+ALTER TABLE t1 RENAME t3;
+
+--echo # Drop Virtual Column
+ALTER TABLE t3 DROP COLUMN vcol;
+
+--echo # Column length varies
+ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20);
+
+SET foreign_key_checks = 0;
+ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1);
+
+SET foreign_key_checks = 1;
+ALTER TABLE t3 DROP FOREIGN KEY fidx;
+
+DROP TABLE t3, t2;
+--disable_info
diff --git a/mysql-test/suite/innodb/t/alter_algorithm2.test b/mysql-test/suite/innodb/t/alter_algorithm2.test
new file mode 100644
index 00000000000..cf538e30196
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_algorithm2.test
@@ -0,0 +1,59 @@
+--source include/have_innodb.inc
+CREATE TABLE t1 (a INT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+# alter_algorithm variable doesn't affect when ALTER stmt
+# during PREPARE PHASE or CREATE PROCEDURE
+# Only when execution/call happens, alter uses the alter_algorithm
+# variable when user does not mention algorithm explicitly.
+
+--enable_info
+SET alter_algorithm='INPLACE';
+PREPARE stmt FROM 'ALTER TABLE t1 ADD KEY idx(a)';
+PREPARE stmt1 FROM 'ALTER TABLE t1 DROP KEY idx';
+DELIMITER |;
+CREATE OR REPLACE PROCEDURE p1()
+BEGIN
+ ALTER TABLE t1 ADD KEY idx2(a);
+END|
+
+CREATE OR REPLACE PROCEDURE p2()
+BEGIN
+ ALTER TABLE t1 DROP KEY idx2;
+END|
+DELIMITER ;|
+
+SET alter_algorithm='COPY';
+EXECUTE stmt;
+EXECUTE stmt1;
+call p1();
+call p2();
+
+SET alter_algorithm='NOCOPY';
+EXECUTE stmt;
+EXECUTE stmt1;
+call p1();
+call p2();
+
+SET alter_algorithm='INSTANT';
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+EXECUTE stmt;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+call p1();
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+CREATE TABLE t1(id INT PRIMARY KEY,
+ col1 INT UNSIGNED NOT NULL UNIQUE)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1),(2,2),(3,3);
+SET ALTER_ALGORITHM=INSTANT;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 DROP COLUMN col1;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 DROP COLUMN col1, ALGORITHM=NOCOPY;
+ALTER TABLE t1 DROP COLUMN col1, ALGORITHM=DEFAULT;
+ALTER TABLE t1 DROP PRIMARY KEY, ALGORITHM=DEFAULT;
+DROP TABLE t1;
+--disable_info
diff --git a/mysql-test/suite/innodb/t/alter_copy.opt b/mysql-test/suite/innodb/t/alter_copy.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/alter_copy.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/alter_crash.opt b/mysql-test/suite/innodb/t/alter_crash.opt
index 0e92a05802e..39b93371503 100644
--- a/mysql-test/suite/innodb/t/alter_crash.opt
+++ b/mysql-test/suite/innodb/t/alter_crash.opt
@@ -1,2 +1 @@
--loose-innodb-sys-tables
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/alter_crash.test b/mysql-test/suite/innodb/t/alter_crash.test
index c7cd1bcfe66..72116b0ca9d 100644
--- a/mysql-test/suite/innodb/t/alter_crash.test
+++ b/mysql-test/suite/innodb/t/alter_crash.test
@@ -196,3 +196,30 @@ SHOW CREATE TABLE t1;
UPDATE t1 SET d=NULL;
SELECT * FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-22637 Rollback of insert fails when column reorder happens
+--echo #
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_TRANS_TABLES', '');
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_ALL_TABLES', '');
+CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
+ f3 CHAR(100), f4 CHAR(100))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "This is column2", "This is column3",
+ "This is column4");
+set DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
+--send ALTER TABLE t1 ADD COLUMN f6 int after f3, add primary key(f6, f4(3), f3(3))
+connect(con1,localhost,root,,);
+SET DEBUG_SYNC = 'now WAIT_FOR scanned';
+BEGIN;
+INSERT INTO t1(f1, f2) VALUES(2, "This is column2 value");
+ROLLBACK;
+set DEBUG_SYNC = 'now SIGNAL insert_done';
+
+connection default;
+reap;
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) FROM t1;
+disconnect con1;
+DROP TABLE t1;
+SET DEBUG_SYNC = 'RESET';
+SET SQL_MODE=DEFAULT;
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index aec1c5f92b2..daaac4bc0ee 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -26,12 +26,14 @@ call mtr.add_suppression("InnoDB: Table `test`\\.`bug16720368` is corrupted");
-- echo #
SET GLOBAL innodb_file_per_table=1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB;
connect (con1,localhost,root);
CREATE TABLE bug16720368 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO bug16720368 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+--source include/wait_all_purged.inc
connection default;
diff --git a/mysql-test/suite/innodb/t/alter_missing_tablespace.test b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
index 1051b79bddb..c1cfc0fa092 100644
--- a/mysql-test/suite/innodb/t/alter_missing_tablespace.test
+++ b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
@@ -17,6 +17,7 @@ call mtr.add_suppression("Could not find a valid tablespace file for");
call mtr.add_suppression("InnoDB: Failed to find tablespace for table `test`\.`\(t\|x\.\.d\)` in the cache");
call mtr.add_suppression("InnoDB: Cannot delete tablespace [0-9]+.*not found");
call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist");
+call mtr.add_suppression("InnoDB: ALTER TABLE `test`.`t` DISCARD TABLESPACE failed to find tablespace");
--enable_query_log
let $MYSQLD_DATADIR=`select @@datadir`;
diff --git a/mysql-test/suite/innodb/t/alter_non_null.inc b/mysql-test/suite/innodb/t/alter_non_null.inc
new file mode 100644
index 00000000000..3d26aab5ab1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_non_null.inc
@@ -0,0 +1,2 @@
+# See also alter_non_null.combinations
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/innodb/t/alter_not_null.combinations b/mysql-test/suite/innodb/t/alter_not_null.combinations
new file mode 100644
index 00000000000..815223ce1cb
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_not_null.combinations
@@ -0,0 +1,5 @@
+[COPY]
+--alter_algorithm=copy
+
+[INPLACE]
+--alter_algorithm=inplace
diff --git a/mysql-test/suite/innodb/t/alter_not_null.test b/mysql-test/suite/innodb/t/alter_not_null.test
new file mode 100644
index 00000000000..646838593e2
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_not_null.test
@@ -0,0 +1,102 @@
+--source include/have_innodb.inc
+--source alter_sql_mode.inc
+
+let $sql_mode = `SELECT @@SQL_MODE`;
+let $error_code = 0;
+
+if ($sql_mode == "STRICT_TRANS_TABLES") {
+ let $error_code = WARN_DATA_TRUNCATED;
+}
+
+CREATE TABLE t1(f1 INT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+--enable_info
+--error $error_code
+ALTER TABLE t1 CHANGE f1 f1 INT NOT NULL;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 CHAR(10))ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+--enable_info
+--error $error_code
+ALTER TABLE t1 CHANGE f1 f1 CHAR(10) NOT NULL;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 VARCHAR(10))ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+--enable_info
+--error $error_code
+ALTER TABLE t1 CHANGE f1 f1 VARCHAR(20) NOT NULL;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 TEXT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+--enable_info
+--error $error_code
+ALTER TABLE t1 CHANGE f1 f1 TEXT NOT NULL DEFAULT 'abc';
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, f3 INT)ENGINE=INNODB;
+INSERT INTO t1 VALUES(2, 2, NULL);
+SELECT * FROM t1;
+--enable_info
+--error $error_code
+ALTER TABLE t1 CHANGE f3 f3 INT NOT NULL DEFAULT (f1 + f2);
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL DEFAULT 0, b TINYINT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(10, NULL);
+SELECT * FROM t1;
+--enable_info
+--error $error_code
+ALTER TABLE t1 CHANGE b b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(a INT, v INT AS (a), c INT, d INT NOT NULL, e INT) ENGINE=InnoDB;
+--enable_info
+ALTER TABLE t1 DROP COLUMN c, CHANGE COLUMN e e INT NOT NULL;
+--disable_info
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, v INT AS (a), d INT NOT NULL, e INT) ENGINE=InnoDB;
+--enable_info
+ALTER TABLE t1 FORCE;
+--disable_info
+DROP TABLE t1;
+
+# Alter ignore should work irrespective of sql mode
+
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, NULL);
+--enable_info
+ALTER IGNORE TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-16126 Crash or ASAN heap-buffer-overflow in
+--echo # mach_read_from_n_little_endian upon ALTER TABLE with blob
+--echo #
+
+CREATE TABLE t1(a INT, v INT AS (a), b INT, c BLOB) ENGINE=InnoDB;
+--enable_info
+ALTER TABLE t1 ADD PRIMARY KEY(b);
+--disable_info
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/alter_not_null_debug.test b/mysql-test/suite/innodb/t/alter_not_null_debug.test
new file mode 100644
index 00000000000..058f0fc02a5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_not_null_debug.test
@@ -0,0 +1,72 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source alter_sql_mode.inc
+
+let $sql_mode = `SELECT @@SQL_MODE`;
+let $error_code = 0;
+
+if ($sql_mode == "STRICT_TRANS_TABLES") {
+ let $error_code = WARN_DATA_TRUNCATED;
+}
+
+
+# Alter table should fail for strict sql mode
+
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 1);
+--enable_info
+SET DEBUG_SYNC= 'row_merge_after_scan
+SIGNAL opened WAIT_FOR flushed';
+send ALTER TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+connect (con1,localhost,root);
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+INSERT INTO t1 VALUES(2, NULL);
+UPDATE t1 SET c1 = 3 WHERE c2 = 1;
+SET DEBUG_SYNC= 'now SIGNAL flushed';
+connection default;
+--error $error_code
+reap;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Alter table should successfully apply the log for the alter operation
+
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 1);
+--enable_info
+SET DEBUG_SYNC= 'row_merge_after_scan
+SIGNAL opened WAIT_FOR flushed';
+send ALTER TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+connection con1;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+INSERT INTO t1 VALUES(2, 3);
+UPDATE t1 SET c1 = 3 WHERE c2 = 1;
+SET DEBUG_SYNC= 'now SIGNAL flushed';
+connection default;
+reap;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Alter ignore should not give error
+
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT, c3 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 2, 3);
+--enable_info
+SET DEBUG_SYNC= 'row_merge_after_scan
+SIGNAL opened WAIT_FOR flushed';
+send ALTER IGNORE TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+connection con1;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+UPDATE t1 SET c2= 2 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2, NULL, 4);
+SET DEBUG_SYNC= 'now SIGNAL flushed';
+connection default;
+reap;
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+disconnect con1;
+SET DEBUG_SYNC='RESET';
diff --git a/mysql-test/suite/innodb/t/alter_partitioned.test b/mysql-test/suite/innodb/t/alter_partitioned.test
new file mode 100644
index 00000000000..9bf6c8f047a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_partitioned.test
@@ -0,0 +1,15 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+
+CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (3),
+PARTITION pb VALUES LESS THAN (5));
+
+--error ER_FOREIGN_KEY_ON_PARTITIONED
+CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (2),
+PARTITION pb VALUES LESS THAN (4));
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/alter_primary_key.test b/mysql-test/suite/innodb/t/alter_primary_key.test
new file mode 100644
index 00000000000..4edc0cc023e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_primary_key.test
@@ -0,0 +1,34 @@
+--source innodb_default_row_format.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--echo #
+--echo # MDEV-23244 ALTER TABLE…ADD PRIMARY KEY fails to flag
+--echo # duplicate key error from concurrent DML
+--echo #
+
+CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (c CHAR(2) NOT NULL) ENGINE=InnoDB;
+
+connect (con1,localhost,root,,);
+BEGIN;
+INSERT INTO t0 VALUES(1);
+
+connection default;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
+send ALTER TABLE t1 ADD PRIMARY KEY(c(1));
+
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR dml';
+INSERT INTO t1 VALUES ('ab'),('ac');
+COMMIT;
+SET DEBUG_SYNC='now SIGNAL dml_done';
+disconnect con1;
+
+connection default;
+--error ER_DUP_ENTRY
+reap;
+SET DEBUG_SYNC='RESET';
+
+SELECT * FROM t1;
+DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/t/alter_rename_existing.test b/mysql-test/suite/innodb/t/alter_rename_existing.test
index 0c8bf481969..0202f2b6ad3 100644
--- a/mysql-test/suite/innodb/t/alter_rename_existing.test
+++ b/mysql-test/suite/innodb/t/alter_rename_existing.test
@@ -61,10 +61,10 @@ ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=COPY;
SET GLOBAL innodb_file_per_table=ON;
--replace_regex /$MYSQLD_DATADIR/MYSQLD_DATADIR/
--error ER_TABLESPACE_EXISTS
-ALTER TABLE t1 ADD COLUMN e1 INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
--replace_regex /Error on rename of '.*' to '.*'/Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME'/
--error ER_ERROR_ON_RENAME
-ALTER TABLE t1 ADD COLUMN e2 INT, ALGORITHM=COPY;
+ALTER TABLE t1 FORCE, ALGORITHM=COPY;
--echo #
--echo # Delete the blocking file called MYSQLD_DATADIR/test/t1.ibd
@@ -72,7 +72,7 @@ ALTER TABLE t1 ADD COLUMN e2 INT, ALGORITHM=COPY;
--echo # Move t1 to file-per-table using ALGORITHM=INPLACE with no blocking t1.ibd.
--echo #
-ALTER TABLE t1 ADD COLUMN e INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1;
SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
@@ -88,6 +88,6 @@ SELECT * from t1;
DROP TABLE t1;
--disable_query_log
-call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot rename '.*' to '.*' for space ID .* because the target file exists. Remove the target file and try again");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot rename '.*' to '.*' because the target file exists. Remove the target file and try again");
SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/alter_sql_mode.combinations b/mysql-test/suite/innodb/t/alter_sql_mode.combinations
new file mode 100644
index 00000000000..2749bd1077c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_sql_mode.combinations
@@ -0,0 +1,5 @@
+[STRICT]
+--sql_mode=STRICT_TRANS_TABLES
+
+[NON-STRICT]
+--sql_mode=
diff --git a/mysql-test/suite/innodb/t/alter_sql_mode.inc b/mysql-test/suite/innodb/t/alter_sql_mode.inc
new file mode 100644
index 00000000000..d51208502a7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_sql_mode.inc
@@ -0,0 +1,2 @@
+# See also alter_sql_mode.combinations
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/innodb/t/alter_varchar_change.test b/mysql-test/suite/innodb/t/alter_varchar_change.test
index 6a5719a1ef0..23928badb24 100644
--- a/mysql-test/suite/innodb/t/alter_varchar_change.test
+++ b/mysql-test/suite/innodb/t/alter_varchar_change.test
@@ -26,7 +26,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@@ -39,7 +39,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@@ -51,7 +51,7 @@ CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100), f3 VARCHAR(100),
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), MODIFY f3 VARCHAR(150);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), MODIFY f3 VARCHAR(150), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
@@ -65,7 +65,7 @@ CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100),
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
@@ -80,7 +80,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200);
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
@@ -98,7 +98,7 @@ INSERT INTO t1(f1, f2) VALUES(1, repeat('a', 40));
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(100);
+ALTER TABLE t1 MODIFY f2 VARCHAR(100), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
@@ -129,7 +129,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(10));
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(10)), ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
@@ -192,7 +192,7 @@ CREATE TABLE t1(f1 INT NOT NULL,
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT, ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@@ -202,7 +202,7 @@ DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
-ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
+ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT, ALGORITHM=INSTANT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
diff --git a/mysql-test/suite/innodb/t/ddl_purge.test b/mysql-test/suite/innodb/t/ddl_purge.test
new file mode 100644
index 00000000000..60d17acead8
--- /dev/null
+++ b/mysql-test/suite/innodb/t/ddl_purge.test
@@ -0,0 +1,36 @@
+--source innodb_default_row_format.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+
+--connect (con1,localhost,root,,test)
+BEGIN;
+INSERT INTO t0 SET pk=1;
+
+--connect (con2,localhost,root,,test)
+BEGIN;
+INSERT INTO t0 SET pk=2;
+
+--connection default
+SET DEBUG_SYNC='alter_table_inplace_after_lock_downgrade SIGNAL prepared WAIT_FOR logged';
+send ALTER TABLE t1 FORCE;
+
+--connection con1
+SET DEBUG_SYNC='now WAIT_FOR prepared';
+INSERT INTO t1 SET pk=1;
+COMMIT;
+--disconnect con1
+
+--connection con2
+UPDATE t1 SET b=1;
+DELETE FROM t1;
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL logged';
+--disconnect con2
+
+--connection default
+reap;
+SET DEBUG_SYNC='RESET';
+DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/t/default_row_format_compatibility.test b/mysql-test/suite/innodb/t/default_row_format_compatibility.test
index 0f433b1fcfe..3dea78b2ff0 100644
--- a/mysql-test/suite/innodb/t/default_row_format_compatibility.test
+++ b/mysql-test/suite/innodb/t/default_row_format_compatibility.test
@@ -1,9 +1,6 @@
--source include/have_innodb.inc
SET @row_format = @@GLOBAL.innodb_default_row_format;
-SET @large_prefix = @@GLOBAL.innodb_large_prefix;
-SET @file_format = @@GLOBAL.innodb_file_format;
-SET GLOBAL innodb_file_format = barracuda;
# set the variables
let $MYSQLD_DATADIR = `SELECT @@datadir`;
@@ -63,10 +60,6 @@ ALTER TABLE tab IMPORT TABLESPACE;
# Cleanup
DROP TABLE tab;
-# Remove orphan files
---remove_file $MYSQLD_DATADIR/test/tab.cfg
---remove_file $MYSQLD_DATADIR/test/tab.ibd
-
# Set the default_row_format=Compact
SET GLOBAL innodb_default_row_format=Compact;
@@ -107,7 +100,6 @@ DROP TABLE tab;
# Set the default_row_format=Dynamic
SET GLOBAL innodb_default_row_format=Dynamic;
-SET GLOBAL innodb_large_prefix=ON;
SELECT @@innodb_default_row_format;
@@ -170,5 +162,3 @@ SHOW TABLE STATUS LIKE 'tab';
DROP TABLE tab;
SET GLOBAL innodb_default_row_format = @row_format;
-SET GLOBAL innodb_large_prefix = @large_prefix;
-SET GLOBAL innodb_file_format = @file_format;
diff --git a/mysql-test/suite/innodb/t/dml_purge.test b/mysql-test/suite/innodb/t/dml_purge.test
new file mode 100644
index 00000000000..37178982c8d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/dml_purge.test
@@ -0,0 +1,77 @@
+--source include/innodb_page_size.inc
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+
+--echo #
+--echo # MDEV-12288 Reset DB_TRX_ID when the history is removed,
+--echo # to speed up MVCC
+--echo #
+
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+
+CREATE TABLE t1(a INT PRIMARY KEY, b INT NOT NULL)
+ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
+
+--connect (prevent_purge,localhost,root)
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+--connection default
+INSERT INTO t1 VALUES(1,2),(3,4);
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET b=-3 WHERE a=3;
+
+--connect (con1,localhost,root)
+BEGIN;
+# For purgeable records, we must record DB_TRX_ID=0 in the undo log!
+UPDATE t1 SET b=4 WHERE a=3;
+--disconnect prevent_purge
+
+--connection default
+# Initiate a full purge, which should reset the DB_TRX_ID except for a=3.
+--source include/wait_all_purged.inc
+# Initiate a ROLLBACK of the update, which should reset the DB_TRX_ID for a=3.
+--disconnect con1
+
+FLUSH TABLE t1 FOR EXPORT;
+# The following is based on innodb.table_flags:
+--perl
+use strict;
+my $ps= $ENV{INNODB_PAGE_SIZE};
+my $file= "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
+open(FILE, "<", $file) || die "Unable to open $file\n";
+my $page;
+print "Clustered index root page contents:\n";
+sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file";
+die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+print "N_RECS=", unpack("n", substr($page,38+16,2));
+print "; LEVEL=", unpack("n", substr($page,38+26,2)), "\n";
+my @fields=qw(a DB_TRX_ID DB_ROLL_PTR b c);
+for (my $offset= 0x65; $offset;
+ $offset= unpack("n", substr($page,$offset-2,2)))
+{
+ print "header=0x", unpack("H*",substr($page,$offset-6,6)), " (";
+ my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff;
+ my $start= 0;
+ my $name;
+ for (my $i= 0; $i < $n_fields; $i++) {
+ my $end= unpack("C", substr($page, $offset-7-$i, 1));
+ print ",\n " if $i;
+ print "$fields[$i]=";
+ if ($end & 0x80) {
+ print "NULL(", ($end & 0x7f) - $start, " bytes)"
+ } else {
+ print "0x", unpack("H*", substr($page,$offset+$start,$end-$start))
+ }
+ $start= $end & 0x7f;
+ }
+ print ")\n";
+}
+close(FILE) || die "Unable to close $file\n";
+EOF
+UNLOCK TABLES;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/t/doublewrite.test b/mysql-test/suite/innodb/t/doublewrite.test
index 059a7f37ccf..7c8c1180adb 100644
--- a/mysql-test/suite/innodb/t/doublewrite.test
+++ b/mysql-test/suite/innodb/t/doublewrite.test
@@ -73,6 +73,9 @@ set global innodb_buf_flush_list_now = 1;
perl;
use IO::Handle;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
+my $polynomial = 0x82f63b78; # CRC-32C
+
my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
my $page_size = $ENV{INNODB_PAGE_SIZE};
my $page;
@@ -102,9 +105,12 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
$badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE
substr ($_, 54, 4) = pack("N", $badflags);
- # Replace the innodb_checksum_algorithm=none checksum
- substr ($_, 0, 4) = pack("N", 0xdeadbeef);
- substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
+ # Replace the innodb_checksum_algorithm=crc32 checksum
+ my $ck= pack("N",
+ mycrc32(substr($_, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($_, 38, $page_size - 38 - 8), 0, $polynomial));
+ substr ($_, 0, 4) = $ck;
+ substr ($_, $page_size - 8, 4) = $ck;
syswrite(FILE, $_, $page_size)==$page_size||die;
close(FILE);
exit 0;
diff --git a/mysql-test/suite/innodb/t/drop_table_background.opt b/mysql-test/suite/innodb/t/drop_table_background.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/drop_table_background.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/fake_changes-7000.test b/mysql-test/suite/innodb/t/fake_changes-7000.test
deleted file mode 100644
index 2be6be2d476..00000000000
--- a/mysql-test/suite/innodb/t/fake_changes-7000.test
+++ /dev/null
@@ -1,9 +0,0 @@
---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/file_format_defaults-master.opt b/mysql-test/suite/innodb/t/file_format_defaults-master.opt
deleted file mode 100644
index 202ecee6d48..00000000000
--- a/mysql-test/suite/innodb/t/file_format_defaults-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb_large_prefix=OFF --innodb_file_format=barracuda --innodb-file-format-check=off --innodb-file-format-max=antelope
diff --git a/mysql-test/suite/innodb/t/file_format_defaults.test b/mysql-test/suite/innodb/t/file_format_defaults.test
index d276ad6e834..5c7c617cb52 100644
--- a/mysql-test/suite/innodb/t/file_format_defaults.test
+++ b/mysql-test/suite/innodb/t/file_format_defaults.test
@@ -1,10 +1,6 @@
#***********************************************************
# WL#7703:
-# Check the max key length 3072 when innodb_large_prefix=ON
# Check boundary value of max key length 3073
-# When innodb_file_format=Antelope, compress DDLs fails
-# Check file_format_max becomes Barracuda on DDL operation
-# on compression table.
#***********************************************************
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
@@ -16,9 +12,6 @@ SELECT @@innodb_strict_mode;
SELECT @@innodb_file_per_table;
-SET @file_format = @@GLOBAL.innodb_file_format;
-
-SET GLOBAL innodb_large_prefix=ON;
SET SQL_MODE=strict_all_tables;
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
@@ -28,18 +21,9 @@ DROP TABLE tab0;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB KEY_BLOCK_SIZE=2;
-SET GLOBAL innodb_file_format=Antelope;
-
---error ER_CANT_CREATE_TABLE
-CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
-
-SET GLOBAL innodb_file_format=Default;
-
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
DROP TABLE tab0;
-SELECT @@innodb_file_format;
-
SET GLOBAL innodb_strict_mode=OFF;
# Check with default value
@@ -47,30 +31,5 @@ SET GLOBAL innodb_strict_mode=Default;
SELECT @@innodb_strict_mode;
-SET GLOBAL innodb_large_prefix=OFF;
-
-SELECT @@innodb_large_prefix;
-
-SET GLOBAL innodb_large_prefix=Default;
-
-# Check with default value
-SELECT @@innodb_large_prefix;
-
-SET GLOBAL innodb_file_format_max=Default;
-
-# Check with default value
-SELECT @@innodb_file_format_max;
-
CREATE TABLE tab1(c1 int ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
-
-# Check file format changed to Barracuda, on DDL operation
-SELECT @@innodb_file_format_max;
-
-SET GLOBAL innodb_file_format_max=Default;
-
-# Restore to the value that we explicitly used at startup.
-SET GLOBAL innodb_large_prefix=off;
-
-SET GLOBAL innodb_file_format = @file_format;
-
DROP TABLE tab1;
diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test
index 58a71d11a6a..cda3966e7f9 100644
--- a/mysql-test/suite/innodb/t/foreign-keys.test
+++ b/mysql-test/suite/innodb/t/foreign-keys.test
@@ -140,7 +140,7 @@ send ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE;
connect con1, localhost, root;
SET debug_sync='now WAIT_FOR ready';
-SET lock_wait_timeout=1; # change to 0 in 10.3
+SET lock_wait_timeout=0;
--error ER_LOCK_WAIT_TIMEOUT
UPDATE t2 SET pk=10 WHERE pk=1;
PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1';
diff --git a/mysql-test/suite/innodb/t/group_commit_crash.test b/mysql-test/suite/innodb/t/group_commit_crash.test
index 7ad0d9d1e74..12f7ba202e3 100644
--- a/mysql-test/suite/innodb/t/group_commit_crash.test
+++ b/mysql-test/suite/innodb/t/group_commit_crash.test
@@ -9,7 +9,6 @@
--source include/have_debug.inc
--source include/have_log_bin.inc
-let $file_format_max=`SELECT @@innodb_file_format_max`;
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),
@@ -77,6 +76,3 @@ while ($numtests)
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE setcrash;
---disable_query_log
-eval SET GLOBAL innodb_file_format_max=$file_format_max;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
index 9dc2557e687..6115e3f0050 100644
--- a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
+++ b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
@@ -9,7 +9,6 @@
--source include/have_debug.inc
--source include/have_log_bin.inc
-let $file_format_max=`SELECT @@innodb_file_format_max`;
CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),
@@ -77,6 +76,3 @@ while ($numtests)
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE setcrash;
---disable_query_log
-eval SET GLOBAL innodb_file_format_max=$file_format_max;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/ibuf_not_empty.test b/mysql-test/suite/innodb/t/ibuf_not_empty.test
index a5093892b35..43f09bf6828 100644
--- a/mysql-test/suite/innodb/t/ibuf_not_empty.test
+++ b/mysql-test/suite/innodb/t/ibuf_not_empty.test
@@ -6,9 +6,12 @@
# The test is not big enough to use change buffering with larger page size.
--source include/have_innodb_max_16k.inc
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
--disable_query_log
call mtr.add_suppression("InnoDB: Failed to find tablespace for table `test`\\.`t1` in the cache\\. Attempting to load the tablespace with space id");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for test.t1, old maximum was");
+call mtr.add_suppression("InnoDB: Failed to find tablespace for table `mysql`\\.`transaction_registry` in the cache\\. Attempting to load the tablespace with space id");
+call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for mysql.transaction_registry, old maximum was");
--enable_query_log
CREATE TABLE t1(
@@ -27,6 +30,7 @@ SET GLOBAL innodb_change_buffering_debug = 1;
# Create enough rows for the table, so that the change buffer will be
# used for modifying the secondary index page. There must be multiple
# index pages, because changes to the root page are never buffered.
+BEGIN;
INSERT INTO t1 VALUES(0,'x',1);
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
@@ -40,9 +44,13 @@ 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;
+COMMIT;
let MYSQLD_DATADIR=`select @@datadir`;
let PAGE_SIZE=`select @@innodb_page_size`;
+# Ensure that purge will not access the truncated .ibd file
+--source include/wait_all_purged.inc
+
--source include/shutdown_mysqld.inc
# Corrupt the change buffer bitmap, to claim that pages are clean
diff --git a/mysql-test/suite/innodb/t/innodb-16k.test b/mysql-test/suite/innodb/t/innodb-16k.test
index 8bde997ed04..89819ba7b6d 100644
--- a/mysql-test/suite/innodb/t/innodb-16k.test
+++ b/mysql-test/suite/innodb/t/innodb-16k.test
@@ -3,15 +3,9 @@
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
-call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+call mtr.add_suppression("InnoDB: Cannot add field .* in table");
---disable_query_log
let $MYSQLD_DATADIR= `select @@datadir`;
-# These values can change during the test
-let $innodb_large_prefix_orig = `SELECT @@innodb_large_prefix`;
---enable_query_log
-
-SET GLOBAL innodb_large_prefix = OFF;
--echo # Test 1) Show the page size from Information Schema
SELECT variable_value FROM information_schema.global_status
@@ -466,11 +460,3 @@ DROP TABLE t1;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE tlong;
DROP TABLE tlong2;
-
-#
-# restore environment to the state it was before this test execution
-#
-
---disable_query_log
-EVAL SET GLOBAL innodb_large_prefix = $innodb_large_prefix_orig;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-alter-debug.test b/mysql-test/suite/innodb/t/innodb-alter-debug.test
index 3c457294884..00300bfdccc 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-debug.test
@@ -40,7 +40,7 @@ engine = innodb;
insert into t1 select 1, 1;
insert into t1 select 2, 2;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
---send alter table t1 add b int, ALGORITHM=inplace
+--send alter table t1 force, add b int, ALGORITHM=inplace
--echo /* connection con1 */
connect (con1,localhost,root,,);
@@ -51,12 +51,12 @@ SET DEBUG_SYNC = 'now SIGNAL s2';
--echo /* connection default */
connection default;
---echo /* reap */ alter table t1 add b int, ALGORITHM=inplace;
+--echo /* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
--error ER_DUP_ENTRY
--reap
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
---send alter table t1 add b int, ALGORITHM=inplace;
+--send alter table t1 force, add b int, ALGORITHM=inplace;
--echo /* connection con1 */
connection con1;
@@ -67,7 +67,7 @@ SET DEBUG_SYNC = 'now SIGNAL s2';
--echo /* connection default */
connection default;
---echo /* reap */ alter table t1 add b int, ALGORITHM=inplace;
+--echo /* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
--error ER_DUP_ENTRY
--reap
SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/suite/innodb/t/innodb-alter-nullable.test b/mysql-test/suite/innodb/t/innodb-alter-nullable.test
index 8a16d15066d..af13a12ab41 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-nullable.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-nullable.test
@@ -136,9 +136,9 @@ INSERT INTO t1 SET c=NULL;
INSERT INTO t2 SET c=NULL;
INSERT INTO t3 SET c=NULL;
--enable_info
---error ER_INVALID_USE_OF_NULL
+--error WARN_DATA_TRUNCATED
ALTER TABLE t1 MODIFY c INT NOT NULL;
---error ER_INVALID_USE_OF_NULL
+--error WARN_DATA_TRUNCATED
ALTER TABLE t2 MODIFY c INT NOT NULL;
--error WARN_DATA_TRUNCATED
ALTER TABLE t3 MODIFY c INT NOT NULL;
@@ -149,7 +149,6 @@ UPDATE t3 SET c=0;
--enable_info
ALTER TABLE t1 MODIFY c INT NOT NULL;
ALTER TABLE t2 MODIFY c INT NOT NULL;
---echo # MDEV-18819 FIXME: This should not require ALGORITHM=COPY.
ALTER TABLE t3 MODIFY c INT NOT NULL;
--disable_info
SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
index de27c7ebf62..f7635e96d50 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -31,7 +31,6 @@ SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
--error 2013
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
---echo # Startup the server after the crash
remove_files_wildcard $datadir/test #sql-*.frm;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-timestamp.test b/mysql-test/suite/innodb/t/innodb-alter-timestamp.test
index d8acc02cbdb..28b09b18e10 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-timestamp.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-timestamp.test
@@ -1,9 +1,10 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
CREATE TABLE t1 (i1 INT UNSIGNED NULL DEFAULT 42) ENGINE=innodb;
INSERT INTO t1 VALUES(NULL);
--enable_info
---error ER_INVALID_USE_OF_NULL
+--error WARN_DATA_TRUNCATED
ALTER TABLE t1 CHANGE i1 i1 INT UNSIGNED NOT NULL DEFAULT rand(),
ALGORITHM=INPLACE;
--error WARN_DATA_TRUNCATED
@@ -12,10 +13,20 @@ ALGORITHM=COPY;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY(id), ALGORITHM=INPLACE;
---error ER_INVALID_USE_OF_NULL
+
+# ALTER IGNORE cannot create unique or primary key with ALGORITHM=INPLACE.
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER IGNORE TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
+# Try the same with ALTER TABLE, using non-strict sql_mode.
+--disable_info
+SET @old_sql_mode = @@sql_mode;
+SET sql_mode = '';
+--enable_info
ALTER TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
-ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
-ADD PRIMARY KEY(id);
+--disable_info
+SET sql_mode = @old_sql_mode;
+--enable_info
+ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT;
--disable_info
SELECT * FROM t1;
SHOW CREATE TABLE t1;
@@ -72,3 +83,23 @@ ALTER TABLE t1 ADD COLUMN d4 TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
SELECT COUNT(DISTINCT d4),COUNT(d4),COUNT(*) FROM t1;
SELECT DISTINCT (CURRENT_TIMESTAMP()-d4) <= 60 FROM t1;
DROP TABLE t1;
+
+# MDEV-19611 INPLACE ALTER does not fail on bad implicit default value
+
+# Empty-table
+CREATE TABLE t1(f1 int) ENGINE=InnoDB;
+INSERT INTO t1 SELECT * FROM seq_1_to_4096;
+connect(purge_control,localhost,root,,);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+connection default;
+DELETE FROM t1;
+SET sql_mode='STRICT_ALL_TABLES,STRICT_TRANS_TABLES,NO_ZERO_DATE';
+ALTER TABLE t1 ADD f2 DATE NOT NULL, ALGORITHM=INPLACE;
+
+# Non-empty table
+INSERT INTO t1 VALUES (1, now());
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 ADD f3 DATE NOT NULL, ALGORITHM=INPLACE;
+DROP TABLE t1;
+disconnect purge_control;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index aae3f3960a2..df2cd1707dc 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -194,6 +194,33 @@ ALGORITHM=INPLACE, LOCK=SHARED;
-- source suite/innodb/include/innodb_dict.inc
SHOW CREATE TABLE tt;
+# Non-instant ADD COLUMN would require the table to be rebuilt.
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+# This is still non-instant ADD COLUMN, because FTS_DOC_ID is hidden.
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+
+CREATE TABLE tu (
+ pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
+ FULLTEXT INDEX(t)
+) ENGINE=InnoDB;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+# Instant ADD COLUMN (adding after the visible FTS_DOC_ID)
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+DROP TABLE tu;
+
+CREATE TABLE tv (
+ pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
+ UNIQUE INDEX FTS_DOC_ID_INDEX(FTS_DOC_ID),
+ FULLTEXT INDEX(t)
+) ENGINE=InnoDB;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+# Instant ADD COLUMN (adding after the visible FTS_DOC_ID)
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+DROP TABLE tv;
# DB_ROW_ID, DB_TRX_ID, DB_ROLL_PTR are reserved InnoDB system column names.
--error ER_WRONG_COLUMN_NAME
@@ -246,13 +273,8 @@ ALTER TABLE t1o ADD FULLTEXT INDEX(cu),
ADD COLUMN FTS_DOC_ID BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
# Replace the hidden FTS_DOC_ID column with a user-visible one.
-# This used to work if there is at most one fulltext index.
-# Currently, we disallow native ALTER TABLE if the table
-# contains any FULLTEXT indexes.
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1o ADD COLUMN FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
-ALTER TABLE t1o ADD COLUMN FTS_DOC_ID BIGINT UNSIGNED NOT NULL;
# Replace the user-visible FTS_DOC_ID column with a hidden one.
# We do not support this in-place.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
diff --git a/mysql-test/suite/innodb/t/innodb-changed-pages-master.opt b/mysql-test/suite/innodb/t/innodb-changed-pages-master.opt
deleted file mode 100644
index bdee9614faa..00000000000
--- a/mysql-test/suite/innodb/t/innodb-changed-pages-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-track-changed-pages=0 --innodb-changed-pages=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb-changed-pages.test b/mysql-test/suite/innodb/t/innodb-changed-pages.test
deleted file mode 100644
index 14668af25cb..00000000000
--- a/mysql-test/suite/innodb/t/innodb-changed-pages.test
+++ /dev/null
@@ -1,63 +0,0 @@
--- source include/have_xtradb.inc
-
-#
-# This test requires innodb-changed-pages=1 so that necessary information schema table exists
-# and innodb-track-changed-pages=0 to disable actual changed pages tracking, because
-# page number are not consistent from run to run
-#
-
-#
-# MDEV-4791: ssertion range_end >= range_start fails in log0online.c
-# on select from I_S.INNODB_CHANGED_PAGES
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 10 AND end_lsn > 20 ;
-
-SELECT * FROM INFORMATION_SCHEMA . `INNODB_CHANGED_PAGES` AS table1 WHERE ( ( (NOT ( ( ( ( (NOT ( table1 . `page_id` <> table1 . `start_lsn` AND table1 . `space_id` <> 8) AND table1 . `page_id` >= table1 . `end_lsn`) OR table1 . `end_lsn` = table1 . `space_id`) AND table1 . `end_lsn` <> table1 . `page_id`) OR table1 . `end_lsn` < 8) AND table1 . `space_id` >= '2000-06-10 11:33:07.046821') AND table1 . `end_lsn` >= 5) AND table1 . `start_lsn` < 'mm') OR table1 . `end_lsn` != table1 . `end_lsn`) HAVING ( table1 . `start_lsn` < '2005-09-09 01:34:19.012946' OR table1 . `page_id` < 6) ORDER BY table1 . `start_lsn`
-LIMIT 3;
-
-#
-# Basic tests
-#
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn > 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn >= 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn > 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn >= 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 and end_lsn < 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 and end_lsn < 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 and end_lsn <= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 and end_lsn <= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn = 2000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE end_lsn = 2000000;
-
-#
-# OR
-#
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn < 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn < 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn <= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn <= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn < 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn < 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn <= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn <= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn > 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn > 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn < 2000000 or end_lsn >= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn <= 2000000 or end_lsn >= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn > 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn > 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 2000000 or end_lsn >= 3000000;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn >= 2000000 or end_lsn >= 3000000;
-
-#
-# Range
-#
-SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE (start_lsn > 2000000 and end_lsn < 3000000) or (start_lsn > 4000000 and end_lsn < 5000000);
-
diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
index a81235a9dd4..a064f08d677 100644
--- a/mysql-test/suite/innodb/t/innodb-corrupted-table.test
+++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
@@ -2,11 +2,11 @@
--source include/not_embedded.inc
#
-# MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD
+# MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD
#
-call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB.*");
-call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MariaDB.*");
+call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB");
+call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB");
create table t1 (pk int, i int, key(i)) engine=InnoDB;
insert into t1 values (1,1),(2,2);
diff --git a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
index 7cc886cb9e5..2f9bf78f82e 100644
--- a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
+++ b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
@@ -1,5 +1,4 @@
--innodb-file-per-table
---innodb-file-format='Barracuda'
--innodb-buffer-pool-size=32M
--innodb-page-size=64k
--innodb-strict-mode=OFF
diff --git a/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt b/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt
deleted file mode 100644
index afa6311a74b..00000000000
--- a/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---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
deleted file mode 100644
index 662bbbaacaf..00000000000
--- a/mysql-test/suite/innodb/t/innodb-flush-changed-page-bitmaps.test
+++ /dev/null
@@ -1,5 +0,0 @@
--- source include/have_xtradb.inc
--- source include/not_embedded.inc
-
-FLUSH NO_WRITE_TO_BINLOG changed_page_bitmaps;
-select * from information_schema.changed_page_bitmaps;
diff --git a/mysql-test/suite/innodb/t/innodb-index-debug.test b/mysql-test/suite/innodb/t/innodb-index-debug.test
index 64ca47ded13..2988a89c651 100644
--- a/mysql-test/suite/innodb/t/innodb-index-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-index-debug.test
@@ -98,7 +98,7 @@ create table t1(k1 int auto_increment primary key,
k2 char(200),k3 char(200))engine=innodb;
SET DEBUG_SYNC= 'row_merge_after_scan
SIGNAL opened WAIT_FOR flushed';
-send ALTER TABLE t1 ADD COLUMN k4 int;
+send ALTER TABLE t1 FORCE, ADD COLUMN k4 int;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET debug = '+d,row_log_tmpfile_fail';
diff --git a/mysql-test/suite/innodb/t/innodb-index-online.test b/mysql-test/suite/innodb/t/innodb-index-online.test
index 5d92b010e60..4cdbdb7c584 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online.test
@@ -53,6 +53,10 @@ SET DEBUG_DBUG = '+d,innodb_OOM_inplace_alter';
--error ER_OUT_OF_RESOURCES
CREATE UNIQUE INDEX c2 ON t1(c2);
SET DEBUG_DBUG = @saved_debug_dbug;
+SET DEBUG_DBUG = '+d,innodb_OOM_prepare_add_index';
+--error ER_OUT_OF_RESOURCES
+ALTER TABLE t1 ADD KEY(c2), ADD KEY c3_10(c3(10)), ADD KEY c3_c2(c3(4),c2);
+SET DEBUG_DBUG = @saved_debug_dbug;
CREATE UNIQUE INDEX c2 ON t1(c2);
DROP INDEX c2 ON t1;
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7513.test b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
index b929ea14781..b824cbcfa60 100644
--- a/mysql-test/suite/innodb/t/innodb-mdev-7513.test
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
@@ -3,7 +3,6 @@
# MDEV-7513: ib_warn_row_too_big dereferences null thd
-call mtr.add_suppression("Row size too large (> 8126)*");
--disable_warnings
CREATE TABLE t1 ( text1 TEXT,
diff --git a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
index e70659f6d17..1c99c6eeb9d 100644
--- a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
+++ b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
@@ -2,10 +2,10 @@
create table t1(a int not null primary key, b geometry not null) engine=innodb;
--error 1846
-ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b);
+ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), ALGORITHM=INSTANT;
show warnings;
show errors;
-ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), LOCK=SHARED;
+ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), LOCK=SHARED, ALGORITHM=NOCOPY;
show warnings;
show errors;
drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-page-cleaners.test b/mysql-test/suite/innodb/t/innodb-page-cleaners.test
new file mode 100644
index 00000000000..6f8accec30f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page-cleaners.test
@@ -0,0 +1,100 @@
+--source include/have_innodb.inc
+# This test is slow on buildbot.
+--source include/big_test.inc
+
+SET @saved_page_cleaners = @@GLOBAL.innodb_page_cleaners;
+
+create table t1 (a int not null primary key auto_increment,
+b bigint,
+c varchar(200),
+d int,
+key b (b),
+key d (d)) engine=INNODB;
+
+let $rows = 15000;
+--disable_query_log
+begin;
+while ($rows)
+{
+ eval insert into t1 values(NULL, $rows, 'testing...', $rows+1000);
+ dec $rows;
+}
+commit;
+--enable_query_log
+
+#
+# We want 4 connections: (1) - (3) to create dirty pages
+# and default to modify the number of page cleaner threads
+#
+
+set GLOBAL innodb_page_cleaners = 4;
+
+connect (con1,localhost,root,,);
+connection con1;
+send update t1 set b = b + 5, d = d + 1 where a between 1 and 2000;
+
+connect (con2,localhost,root,,);
+connection con2;
+send update t1 set b = b + 5, d = d + 1 where a between 3000 and 5000;
+
+
+connect (con3,localhost,root,,);
+connection con3;
+send update t1 set b = b + 5, d = d + 1 where a between 8000 and 12000;
+
+#
+# Page cleaners are increased
+#
+
+connection default;
+set GLOBAL innodb_page_cleaners = 2;
+set GLOBAL innodb_page_cleaners = 4;
+set GLOBAL innodb_page_cleaners = 6;
+
+connection con1;
+reap;
+
+connection con2;
+reap;
+
+connection con3;
+reap;
+
+connection default;
+set GLOBAL innodb_page_cleaners = 4;
+
+#
+# Page cleaners are decreased
+#
+
+connection con1;
+send update t1 set b = b + 5, d = d + 1 where a between 1 and 2000;
+
+connection con2;
+send update t1 set b = b + 5, d = d + 1 where a between 3000 and 5000;
+
+connection con3;
+send update t1 set b = b + 5, d = d + 1 where a between 8000 and 12000;
+
+connection default;
+set GLOBAL innodb_page_cleaners = 3;
+set GLOBAL innodb_page_cleaners = 2;
+set GLOBAL innodb_page_cleaners = 1;
+
+connection con1;
+reap;
+
+connection con2;
+reap;
+
+connection con3;
+reap;
+
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+
+DROP TABLE t1;
+
+SET GLOBAL innodb_page_cleaners=@saved_page_cleaners;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
index 69a632d6010..2b4a9ea22a9 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
@@ -2,8 +2,6 @@
-- source include/have_innodb_bzip2.inc
-- source include/not_embedded.inc
-let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`;
-
# bzip2
set global innodb_compression_algorithm = 5;
@@ -79,9 +77,14 @@ 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;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
show create table innodb_normal;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
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;
@@ -95,6 +98,7 @@ 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;
@@ -236,8 +240,3 @@ 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;
---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
index 1b1df674e3c..49255d3a1ac 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
@@ -2,8 +2,6 @@
-- source include/have_innodb_lz4.inc
-- source include/not_embedded.inc
-let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
-
# lz4
set global innodb_compression_algorithm = 2;
@@ -79,9 +77,14 @@ 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;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
show create table innodb_normal;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
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;
@@ -237,8 +240,3 @@ 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;
---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
index 9cec3e7a947..e05c08f7515 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
@@ -2,8 +2,6 @@
-- source include/have_innodb_lzma.inc
-- source include/not_embedded.inc
-let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
-
# lzma
set global innodb_compression_algorithm = 4;
@@ -79,9 +77,14 @@ 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;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
show create table innodb_normal;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
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;
@@ -95,6 +98,7 @@ 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;
@@ -236,8 +240,3 @@ 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;
---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
index 65c7e5dd3d9..af831bd2467 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
@@ -2,8 +2,6 @@
-- source include/have_innodb_lzo.inc
-- source include/not_embedded.inc
-let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`;
-
# lzo
set global innodb_compression_algorithm = 3;
@@ -79,9 +77,14 @@ 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;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
show create table innodb_normal;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
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;
@@ -95,6 +98,7 @@ 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;
@@ -189,8 +193,3 @@ 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;
---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
index a5244de9e29..75504a53c55 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_tables.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_tables.test
@@ -66,8 +66,12 @@ select count(*) from innodb_dynamic where c1 < 1500000;
# 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;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compact page_compressed=DEFAULT, algorithm=instant;
+alter table innodb_compact page_compressed=DEFAULT;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_dynamic page_compressed=DEFAULT, algorithm=instant;
+alter table innodb_dynamic page_compressed=DEFAULT;
show create table innodb_compact;
show create table innodb_dynamic;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
index 89ec6f01db6..ad78767e903 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
@@ -3,8 +3,6 @@
# This test is slow on buildbot.
--source include/big_test.inc
-let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
-
# zlib
set global innodb_compression_algorithm = 1;
@@ -80,9 +78,14 @@ 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;
+alter table innodb_normal page_compressed=1 page_compression_level=8,
+algorithm=instant;
show warnings;
show create table innodb_normal;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
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;
@@ -189,8 +192,3 @@ 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;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-system-table-view.test b/mysql-test/suite/innodb/t/innodb-system-table-view.test
index 087c0a22eca..4f5111eafbc 100644
--- a/mysql-test/suite/innodb/t/innodb-system-table-view.test
+++ b/mysql-test/suite/innodb/t/innodb-system-table-view.test
@@ -4,6 +4,8 @@
--source include/innodb_page_size_small.inc
+SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
LET $MYSQLD_DATADIR = `select @@datadir`;
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
@@ -70,6 +72,8 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
# INNODB_SYS_TABLESTATS
INSERT INTO parent VALUES(1);
+--source include/wait_all_purged.inc
+
--sorted_result
SELECT name, num_rows, ref_count
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
@@ -126,6 +130,8 @@ INSERT INTO parent VALUES(1, 9);
--sorted_result
SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
+--source include/wait_all_purged.inc
+
--sorted_result
SELECT name, num_rows, ref_count
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
@@ -134,3 +140,4 @@ WHERE name LIKE "%parent";
DROP TABLE child;
DROP TABLE parent;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test
index 936dd7306aa..ce014b0aa00 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online.test
+++ b/mysql-test/suite/innodb/t/innodb-table-online.test
@@ -350,22 +350,16 @@ UPDATE t1 SET c3 = NULL WHERE c3 = '';
SET lock_wait_timeout = 1;
--error ER_KEY_COLUMN_DOES_NOT_EXITS
ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5));
-SET @old_sql_mode = @@sql_mode;
-# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
-# And adding a PRIMARY KEY will also add NOT NULL implicitly!
-SET @@sql_mode = 'STRICT_TRANS_TABLES';
---error ER_INVALID_USE_OF_NULL
-ALTER TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
+# NULL -> NOT NULL is only allowed INPLACE without IGNORE.
+# Adding a PRIMARY KEY will add NOT NULL implicitly!
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER IGNORE TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
ALGORITHM = INPLACE;
---error ER_INVALID_USE_OF_NULL
-ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
-SET @@sql_mode = @old_sql_mode;
UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0';
-# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
-SET @@sql_mode = 'STRICT_TRANS_TABLES';
+# NULL -> NOT NULL is allowed INPLACE.
--send
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)),
@@ -382,9 +376,8 @@ SET DEBUG_SYNC = 'now SIGNAL ins_done0';
--echo # session con1
connection con1;
---error ER_INVALID_USE_OF_NULL
+--error WARN_DATA_TRUNCATED
reap;
-SET @@sql_mode = @old_sql_mode;
--echo # session default
connection default;
@@ -393,6 +386,7 @@ ROLLBACK;
--echo # session con1
connection con1;
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
+
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created WAIT_FOR ins_done';
--send
ALTER TABLE t1 DROP PRIMARY KEY, DROP COLUMN c22f,
diff --git a/mysql-test/suite/innodb/t/innodb-timeout.test b/mysql-test/suite/innodb/t/innodb-timeout.test
index 0beeea8f39e..0f8bbbec559 100644
--- a/mysql-test/suite/innodb/t/innodb-timeout.test
+++ b/mysql-test/suite/innodb/t/innodb-timeout.test
@@ -1,3 +1,5 @@
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
--source include/have_innodb.inc
let $initial_timeout=`select @@innodb_lock_wait_timeout`;
@@ -115,3 +117,84 @@ connection default;
drop table t1;
--replace_result $initial_timeout <initial_timeout>
eval set global innodb_lock_wait_timeout=$initial_timeout;
+
+--echo #
+--echo # MDEV-11379 - AliSQL: [Feature] Issue#8: SELECT FOR UPDATE WAIT
+--echo #
+CREATE TABLE t1 (c1 INT, c2 INT) ENGINE=InnoDB;
+INSERT INTO t1 (c1,c2) values (1,1),(2,2),(3,3),(4,4);
+
+# Not supported in view/sp
+--error ER_VIEW_SELECT_CLAUSE
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+--error ER_VIEW_SELECT_CLAUSE
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+--error ER_SP_BADSTATEMENT
+CREATE PROCEDURE p1() SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+--error ER_SP_BADSTATEMENT
+CREATE PROCEDURE p1() SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+
+connect(con1,localhost,root,,);
+LOCK TABLE t1 WRITE;
+
+connect(con2,localhost,root,,);
+# The following statement should hang because con1 is locking the table
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+PREPARE stmt FROM 'SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT';
+--error ER_LOCK_WAIT_TIMEOUT
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM 'SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0';
+--error ER_LOCK_WAIT_TIMEOUT
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+connection con1;
+INSERT INTO t1 VALUES(5,5);
+UNLOCK TABLES;
+set AUTOCOMMIT=0;
+--disable_result_log
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
+--enable_result_log
+
+connection con2;
+set AUTOCOMMIT=0;
+SET INNODB_LOCK_WAIT_TIMEOUT=1;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
+
+connection con1;
+UPDATE t1 SET c2=5 WHERE c1=4;
+COMMIT;
+set AUTOCOMMIT=0;
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
+
+connection con2;
+set AUTOCOMMIT=0;
+SET INNODB_LOCK_WAIT_TIMEOUT=1;
+--send
+--disable_result_log
+SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 10;
+
+connection con1;
+COMMIT;
+
+connection con2;
+--reap
+
+
+disconnect con1;
+disconnect con2;
+
+# clear
+connection default;
+DROP TABLE t1;
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb-trim.opt b/mysql-test/suite/innodb/t/innodb-trim.opt
deleted file mode 100644
index c33d075b002..00000000000
--- a/mysql-test/suite/innodb/t/innodb-trim.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-use-trim=1
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test
index 906246ebf07..2b836bfc985 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522.test
@@ -82,7 +82,6 @@ ALTER TABLE t2 IMPORT TABLESPACE;
--error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t2 IMPORT TABLESPACE;
DROP TABLE t2;
---remove_file $MYSQLD_DATADIR/test/t2.ibd
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 7aa146d7d99..37708a4536d 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -1350,9 +1350,7 @@ source include/varchar.inc;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
-SET GLOBAL innodb_large_prefix=OFF;
create table t1 (v varchar(65530), key(v));
-SET GLOBAL innodb_large_prefix=default;
drop table t1;
create table t1 (v varchar(65536));
show create table t1;
@@ -1520,39 +1518,6 @@ show create table t9;
drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
-SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
-SET GLOBAL innodb_large_prefix=OFF;
-# these should have their index length trimmed
-create table t1 (col1 varchar(768), index(col1))
- character set = latin1 engine = innodb;
-create table t2 (col1 varbinary(768), index(col1))
- character set = latin1 engine = innodb;
-create table t3 (col1 text, index(col1(768)))
- character set = latin1 engine = innodb;
-create table t4 (col1 blob, index(col1(768)))
- character set = latin1 engine = innodb;
-SET GLOBAL innodb_large_prefix=default;
-
-show create table t1;
-
-drop table t1, t2, t3, t4;
-
-# these should be refused
-set global innodb_large_prefix=OFF;
---error ER_TOO_LONG_KEY
-create table t1 (col1 varchar(768) primary key)
- character set = latin1 engine = innodb;
---error ER_TOO_LONG_KEY
-create table t2 (col1 varbinary(768) primary key)
- character set = latin1 engine = innodb;
---error ER_TOO_LONG_KEY
-create table t3 (col1 text, primary key(col1(768)))
- character set = latin1 engine = innodb;
---error ER_TOO_LONG_KEY
-create table t4 (col1 blob, primary key(col1(768)))
- character set = latin1 engine = innodb;
-SET sql_mode = default;
-set global innodb_large_prefix=default;
#
# Test improved foreign key error messages (bug #3443)
#
diff --git a/mysql-test/suite/innodb/t/innodb_bug13510739.test b/mysql-test/suite/innodb/t/innodb_bug13510739.test
index d2193996d68..f10bcd8e272 100644
--- a/mysql-test/suite/innodb/t/innodb_bug13510739.test
+++ b/mysql-test/suite/innodb/t/innodb_bug13510739.test
@@ -2,10 +2,6 @@
# Bug#13510739 63775: SERVER CRASH ON HANDLER READ NEXT AFTER DELETE RECORD.
#
-if (`select plugin_auth_version < "5.6.15" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB before 5.6.15
-}
-- source include/have_innodb.inc
CREATE TABLE bug13510739 (c INTEGER NOT NULL, PRIMARY KEY (c)) ENGINE=INNODB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test
index d8f0cc6d4b6..44b9d16ca78 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -14,6 +14,10 @@ call mtr.add_suppression("InnoDB: We detected index corruption in an InnoDB type
call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
--enable_query_log
+--echo # Ensure that purge will not crash on the table after we corrupt it.
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+SET GLOBAL innodb_fast_shutdown=0;
+
--echo # Create and populate the table to be corrupted
set global innodb_file_per_table=ON;
diff --git a/mysql-test/suite/innodb/t/innodb_bug30113362.test b/mysql-test/suite/innodb/t/innodb_bug30113362.test
index 2291574f9ec..de5d07ffb29 100644
--- a/mysql-test/suite/innodb/t/innodb_bug30113362.test
+++ b/mysql-test/suite/innodb/t/innodb_bug30113362.test
@@ -29,7 +29,7 @@ CREATE TABLE t1 (
a01 CHAR(255) NOT NULL DEFAULT 'a',
a02 CHAR(255) NOT NULL DEFAULT 'a',
b INT NOT NULL DEFAULT 0,
- CONSTRAINT pkey PRIMARY KEY(a00, a01, a02)
+ PRIMARY KEY(a00, a01, a02)
) charset latin1 ENGINE = InnoDB COMMENT='MERGE_THRESHOLD=45';
#
diff --git a/mysql-test/suite/innodb/t/innodb_bug47167.test b/mysql-test/suite/innodb/t/innodb_bug47167.test
deleted file mode 100644
index 88adfc753a9..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug47167.test
+++ /dev/null
@@ -1,51 +0,0 @@
---source include/have_innodb.inc
-# This is the unit test for bug #47167.
-# It tests setting the global variable "innodb_file_format_max" (
-# originally "innodb_file_format_check") with a user-Defined Variable.
-
---source include/not_embedded.inc
---source include/restart_and_reinit.inc
-
-# Save the value (Antelope) in 'innodb_file_format_max' to
-# 'old_innodb_file_format_max'
-set @old_innodb_file_format_max=@@innodb_file_format_max;
-
-# @old_innodb_file_format_max shall have the value of 'Antelope'
-select @old_innodb_file_format_max;
-
-# Reset the value in 'innodb_file_format_max' to 'Barracuda'
-set global innodb_file_format_max = Barracuda;
-
-select @@innodb_file_format_max;
-
-# Set 'innodb_file_format_max' to its default value, which
-# is the latest file format supported in the current release.
-set global innodb_file_format_max = DEFAULT;
-
-select @@innodb_file_format_max;
-
-# Put the saved value back to 'innodb_file_format_max'
-set global innodb_file_format_max = @old_innodb_file_format_max;
-
-# Check whether 'innodb_file_format_max' get its original value.
-select @@innodb_file_format_max;
-
-# Following are negative tests, all should fail.
---disable_warnings
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max = cheetah;
-
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max = Bear;
-
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max = on;
-
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max = off;
---enable_warnings
-
-# Put the saved value back to 'innodb_file_format_max'
---disable_query_log
-set global innodb_file_format_max = @old_innodb_file_format_max;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug84958.test b/mysql-test/suite/innodb/t/innodb_bug84958.test
index 98904680fce..cbcc5d1abc6 100644
--- a/mysql-test/suite/innodb/t/innodb_bug84958.test
+++ b/mysql-test/suite/innodb/t/innodb_bug84958.test
@@ -64,7 +64,7 @@ connection default;
--echo # Connect to default and record how many pages were accessed
--echo # when selecting the record using the secondary key.
--echo #
---let $wait_all_purged=3
+--let $wait_all_purged=4
--source include/wait_all_purged.inc
SET @num_pages_1 = num_pages_get();
SELECT * FROM t1 force index (b);
diff --git a/mysql-test/suite/innodb/t/innodb_bulk_create_index_flush.test b/mysql-test/suite/innodb/t/innodb_bulk_create_index_flush.test
index 0cc52b46c20..cffca0cc773 100644
--- a/mysql-test/suite/innodb/t/innodb_bulk_create_index_flush.test
+++ b/mysql-test/suite/innodb/t/innodb_bulk_create_index_flush.test
@@ -52,7 +52,7 @@ CREATE FULLTEXT INDEX fidx_title ON t1(title);
CHECK TABLE t1;
-- error ER_QUERY_INTERRUPTED
-ALTER TABLE t1 ADD COLUMN content TEXT;
+ALTER TABLE t1 ADD COLUMN content TEXT, FORCE;
CHECK TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_default_row_format.combinations b/mysql-test/suite/innodb/t/innodb_default_row_format.combinations
new file mode 100644
index 00000000000..d6041d72bf8
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_default_row_format.combinations
@@ -0,0 +1,6 @@
+[redundant]
+innodb_default_row_format=redundant
+[dynamic]
+innodb_default_row_format=dynamic
+[compact]
+innodb_default_row_format=compact
diff --git a/mysql-test/suite/innodb/t/innodb_default_row_format.inc b/mysql-test/suite/innodb/t/innodb_default_row_format.inc
new file mode 100644
index 00000000000..15c61dc6342
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_default_row_format.inc
@@ -0,0 +1,2 @@
+# See also innodb_default_row_format.combinations
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test
deleted file mode 100644
index 2c99167ce6e..00000000000
--- a/mysql-test/suite/innodb/t/innodb_file_format.test
+++ /dev/null
@@ -1,44 +0,0 @@
--- source include/restart_and_reinit.inc
--- source include/have_innodb.inc
-
-let $innodb_file_format_orig=`select @@innodb_file_format`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
-
-select @@innodb_file_format;
-select @@innodb_file_format_check;
-select @@innodb_file_format_max;
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=cheetah;
-select @@innodb_file_format;
-set global innodb_file_format=default;
-select @@innodb_file_format;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=on;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=off;
-select @@innodb_file_format;
-set global innodb_file_format_max=antelope;
-set global innodb_file_format_max=barracuda;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max=cheetah;
-select @@innodb_file_format_max;
-set global innodb_file_format_max=default;
-select @@innodb_file_format_max;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=on;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=off;
-select @@innodb_file_format_max;
-set global innodb_file_format_max=antelope;
-
-# innodb_file_format_check is read only variable, can be
-# set as server startup parameter
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_file_format_check=off;
-
---disable_query_log
-eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_force_recovery.test b/mysql-test/suite/innodb/t/innodb_force_recovery.test
index 9d7cf9d80b7..fe070100c08 100644
--- a/mysql-test/suite/innodb/t/innodb_force_recovery.test
+++ b/mysql-test/suite/innodb/t/innodb_force_recovery.test
@@ -7,6 +7,7 @@
--disable_query_log
call mtr.add_suppression("InnoDB: Failed to find tablespace for table .* in the cache. Attempting to load the tablespace with space id");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for test.t[12], old maximum was");
+call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for mysql.transaction_registry, old maximum was");
--enable_query_log
create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb_mysql-master.opt b/mysql-test/suite/innodb/t/innodb_mysql-master.opt
index a1ee2c096cf..17dd95cd2cc 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_mysql-master.opt
@@ -1,3 +1,2 @@
--loose-innodb-lock-wait-timeout=2
--default-storage-engine=MyISAM
---loose-innodb-large-prefix=off
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
index 520ec43bb85..1fb7c6d0f77 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
@@ -13,8 +13,6 @@
# Embedded server tests do not support restarting
--source include/not_embedded.inc
-set global innodb_large_prefix=1;
-
#------------------------------------------------------------------------------
# Stop the server in between when prefix index are created and see if state is
# correct when server is restarted.
@@ -48,6 +46,7 @@ START TRANSACTION;
--connection default
# Restart the server
+SET GLOBAL innodb_fast_shutdown=3;
-- source include/restart_mysqld.inc
SELECT COUNT(*) FROM worklog5743;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
@@ -68,6 +67,7 @@ worklog5743;
--connection default
# Restart the server
+SET GLOBAL innodb_fast_shutdown=3;
-- source include/restart_mysqld.inc
SELECT COUNT(*) FROM worklog5743;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
@@ -86,6 +86,7 @@ worklog5743;
--connection default
# Restart the server
+SET GLOBAL innodb_fast_shutdown=3;
-- source include/restart_mysqld.inc
SELECT COUNT(*) FROM worklog5743;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
diff --git a/mysql-test/suite/innodb/t/innodb_wl6326.test b/mysql-test/suite/innodb/t/innodb_wl6326.test
index 74fa931edf1..71eba94be04 100644
--- a/mysql-test/suite/innodb/t/innodb_wl6326.test
+++ b/mysql-test/suite/innodb/t/innodb_wl6326.test
@@ -34,7 +34,7 @@ CREATE TABLE t1 (
b INT NOT NULL DEFAULT 0
) ENGINE = InnoDB;
-ALTER TABLE t1 ADD CONSTRAINT pkey PRIMARY KEY(
+ALTER TABLE t1 ADD PRIMARY KEY(
a00,
a01,
a02,
diff --git a/mysql-test/suite/innodb/t/innodb_xtradb_compat-master.opt b/mysql-test/suite/innodb/t/innodb_xtradb_compat-master.opt
deleted file mode 100644
index 1ee264ee868..00000000000
--- a/mysql-test/suite/innodb/t/innodb_xtradb_compat-master.opt
+++ /dev/null
@@ -1,38 +0,0 @@
---innodb-adaptive-hash-index-partitions=16
---innodb-buffer-pool-populate=1
---innodb-cleaner-eviction-factor
---innodb-cleaner-flush-chunk-size=16
---innodb-cleaner_free_list_lwm=1
---innodb-cleaner-lru-chunk-size=1
---innodb-cleaner-lsn-age-factor=HIGH_CHECKPOINT
---innodb-cleaner-max-flush-time=1
---innodb-cleaner-max-lru-time=1
---innodb-corrupt-table-action=salvage
---innodb-empty-free-list-algorithm=BACKOFF
---innodb-fake-changes
---innodb-file-io-threads=16
---innodb-foreground-preflush=EXPONENTIAL_BACKOFF
---innodb-kill-idle-transaction=1
---innodb-locking-fake-changes
---innodb-log-arch-expire-sec=1
---innodb-log-arch-dir='ttt'
---innodb-log-archive
---innodb-log-block-size=16
---innodb-log_checksum_algorithm=STRICT_INNODB
---innodb-max-bitmap-file-size=1
---innodb-max-changed-pages=1
---innodb-mirrored-log-groups=8
---innodb-priority-cleaner
---innodb-priority-io
---innodb-priority-master
---innodb-priority-purge
---innodb-sched-priority-cleaner=16
---innodb-sched-priority-io=16
---innodb-sched-priority-master=16
---innodb-sched-priority-purge=16
---innodb-show-locks-held=16
---innodb-show-verbose-locks=1
---innodb-track-changed-pages
---innodb-track-redo-log-now
---innodb-use-global-flush-log-at-trx-commit
---innodb-use-stacktrace
diff --git a/mysql-test/suite/innodb/t/innodb_xtradb_compat.test b/mysql-test/suite/innodb/t/innodb_xtradb_compat.test
deleted file mode 100644
index 359d93717d5..00000000000
--- a/mysql-test/suite/innodb/t/innodb_xtradb_compat.test
+++ /dev/null
@@ -1,160 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/not_embedded.inc
---source include/not_windows.inc
-
-select @@innodb_adaptive_hash_index_partitions, @@innodb_adaptive_hash_index_parts;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_adaptive_hash_index_partitions=1;
-
-select @@innodb_buffer_pool_populate;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_buffer_pool_populate=1;
-
-select @@innodb_cleaner_eviction_factor;
-set global innodb_cleaner_eviction_factor=1;
-select @@innodb_cleaner_eviction_factor;
-
-select @@innodb_cleaner_flush_chunk_size;
-set global innodb_cleaner_flush_chunk_size=8;
-select @@innodb_cleaner_flush_chunk_size;
-
-select @@innodb_cleaner_free_list_lwm;
-set global innodb_cleaner_free_list_lwm=1;
-select @@innodb_cleaner_free_list_lwm;
-
-select @@innodb_cleaner_lru_chunk_size;
-set global innodb_cleaner_lru_chunk_size=8;
-select @@innodb_cleaner_lru_chunk_size;
-
-select @@innodb_cleaner_lsn_age_factor;
-set global innodb_cleaner_lsn_age_factor=HIGH_CHECKPOINT;
-select @@innodb_cleaner_lsn_age_factor;
-
-select @@innodb_cleaner_max_flush_time;
-set global innodb_cleaner_max_flush_time=1;
-select @@innodb_cleaner_max_flush_time;
-
-select @@innodb_cleaner_max_lru_time;
-set global innodb_cleaner_max_lru_time=1;
-select @@innodb_cleaner_max_lru_time;
-
-select @@innodb_corrupt_table_action;
-set global innodb_corrupt_table_action=salvage;
-select @@innodb_corrupt_table_action;
-
-select @@innodb_empty_free_list_algorithm;
-set global innodb_empty_free_list_algorithm=BACKOFF;
-select @@innodb_empty_free_list_algorithm;
-
-select @@innodb_fake_changes;
-set global innodb_fake_changes=1;
-select @@innodb_fake_changes;
-
---echo # @@innodb_file_io_threads is absent
-
-select @@innodb_foreground_preflush;
-set global innodb_foreground_preflush=EXPONENTIAL_BACKOFF;
-select @@innodb_foreground_preflush;
-
-select @@innodb_kill_idle_transaction;
-set global innodb_kill_idle_transaction=1;
-select @@innodb_kill_idle_transaction;
-
-select @@innodb_locking_fake_changes;
-set global innodb_locking_fake_changes=1;
-select @@innodb_locking_fake_changes;
-
-select @@innodb_log_arch_expire_sec;
-set global innodb_log_arch_expire_sec=1;
-select @@innodb_log_arch_expire_sec;
-
-select @@innodb_log_block_size;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_log_block_size= 8;
-
-select @@innodb_log_checksum_algorithm, @@innodb_log_checksums;
-set global innodb_log_checksum_algorithm=NONE;
-select @@innodb_log_checksum_algorithm, @@innodb_log_checksums;
-set global innodb_log_checksum_algorithm=STRICT_INNODB;
-select @@innodb_log_checksum_algorithm, @@innodb_log_checksums;
-
-select @@innodb_max_bitmap_file_size;
-set global innodb_max_bitmap_file_size=1;
-select @@innodb_max_bitmap_file_size;
-
-select @@innodb_max_changed_pages;
-set global innodb_max_changed_pages=1;
-select @@innodb_max_changed_pages;
-
-select @@innodb_mirrored_log_groups;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_mirrored_log_groups= 4;
-
-select @@innodb_priority_cleaner;
-set global innodb_priority_cleaner=1;
-select @@innodb_priority_cleaner;
-
-select @@innodb_priority_io;
-set global innodb_priority_io=1;
-select @@innodb_priority_io;
-
-select @@innodb_priority_master;
-set global innodb_priority_master=1;
-select @@innodb_priority_master;
-
-select @@innodb_priority_purge;
-set global innodb_priority_purge=1;
-select @@innodb_priority_purge;
-
-select @@innodb_sched_priority_cleaner;
-set global innodb_sched_priority_cleaner=8;
-select @@innodb_sched_priority_cleaner;
-
-select @@innodb_sched_priority_io;
-set global innodb_sched_priority_io=8;
-select @@innodb_sched_priority_io;
-
-select @@innodb_sched_priority_master;
-set global innodb_sched_priority_master=8;
-select @@innodb_sched_priority_master;
-
-select @@innodb_sched_priority_purge;
-set global innodb_sched_priority_purge=8;
-select @@innodb_sched_priority_purge;
-
-select @@innodb_show_locks_held;
-set global innodb_show_locks_held=8;
-select @@innodb_show_locks_held;
-
-select @@innodb_show_verbose_locks;
-set global innodb_show_verbose_locks=1;
-select @@innodb_show_verbose_locks;
-
-select @@innodb_track_changed_pages;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_track_changed_pages=1;
-
-select @@innodb_track_redo_log_now;
-set global innodb_track_redo_log_now=1;
-select @@innodb_track_redo_log_now;
-
-select @@innodb_use_global_flush_log_at_trx_commit;
-set global innodb_use_global_flush_log_at_trx_commit=1;
-select @@innodb_use_global_flush_log_at_trx_commit;
-
-select @@innodb_use_stacktrace;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_use_stacktrace=1;
-
-select @@innodb_log_archive;
-set global innodb_log_archive=1;
-select @@innodb_log_archive;
-
-select @@innodb_log_arch_dir;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_log_arch_dir="ttt";
-
---let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
---let SEARCH_PATTERN=Using [A-Za-z\\-]* is deprecated and the parameter may be removed in future releases. Ignoning the parameter.
---source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/instant_alter.opt b/mysql-test/suite/innodb/t/instant_alter.opt
new file mode 100644
index 00000000000..99bf0e5a28b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter.opt
@@ -0,0 +1 @@
+--innodb-sys-tablestats
diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test
new file mode 100644
index 00000000000..6d5c4e96d26
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter.test
@@ -0,0 +1,440 @@
+--source include/innodb_page_size.inc
+
+--echo #
+--echo # MDEV-11369: Instant ADD COLUMN for InnoDB
+--echo #
+
+SET @saved_allowance = @@GLOBAL.innodb_instant_alter_column_allowed;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+
+call mtr.add_suppression("Cannot add field `.*` in table `test`.`.*` because after adding it, the row size is");
+
+let $format= `SELECT CASE WHEN @@GLOBAL.innodb_page_size>16384
+THEN 'DYNAMIC' ELSE 'COMPRESSED' END`;
+CREATE TABLE t(a INT UNIQUE)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+eval ALTER TABLE t ADD e INT, ROW_FORMAT=$format;
+INSERT INTO t SET a=1;
+SET @old_instant=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column');
+--enable_info
+ALTER TABLE t ADD b INT NOT NULL, ALGORITHM=COPY;
+ALTER TABLE t ADD c INT NOT NULL, FORCE;
+--disable_info
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+--enable_info
+ALTER TABLE t ADD d INT NOT NULL;
+--disable_info
+SELECT * FROM t;
+SHOW CREATE TABLE t;
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+DROP TABLE t;
+
+connect analyze, localhost, root;
+connection default;
+SET timestamp = 42;
+SET time_zone='+03:00';
+SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+
+SET @old_instant=
+(SELECT variable_value FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column');
+
+let $format= 3;
+let $redundant_4k= `SELECT @@GLOBAL.innodb_page_size=4096`;
+while ($format) {
+let $engine= `SELECT CONCAT('ENGINE=InnoDB ROW_FORMAT=',CASE $format
+WHEN 1 THEN 'DYNAMIC'
+WHEN 2 THEN 'COMPACT'
+ELSE 'REDUNDANT' END)`;
+
+eval CREATE TABLE t1
+(id INT PRIMARY KEY, c2 INT UNIQUE,
+ c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
+ SPATIAL INDEX(c3)) $engine;
+
+INSERT INTO t1 (id, c2) values(1,1);
+SELECT id,c2,ST_AsText(c3) c3 FROM t1;
+
+--enable_info
+ALTER TABLE t1 ADD COLUMN (
+ d1 INT, d2 INT UNSIGNED DEFAULT 10, d3 VARCHAR(20) NOT NULL DEFAULT 'abcde',
+ d4 TIMESTAMP NOT NULL DEFAULT current_timestamp());
+ALTER TABLE t1 ADD INDEX(d3);
+--disable_info
+
+BEGIN;
+UPDATE t1 SET d3='';
+ROLLBACK;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, d4 FROM t1;
+INSERT INTO t1 (id) VALUES(2),(3),(4),(5),(6);
+
+--enable_info
+ALTER TABLE t1 CHANGE d1 d1 INT DEFAULT 5, CHANGE d2 d2 INT DEFAULT 15,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'fghij',
+CHANGE d4 dfour TIMESTAMP NOT NULL DEFAULT now();
+--disable_info
+
+UPDATE t1 SET d3='foo' WHERE id = 2;
+UPDATE t1 SET d3=DEFAULT WHERE id = 4;
+INSERT INTO t1 SET id = 7;
+SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, dfour FROM t1;
+CHECK TABLE t1;
+
+# add virtual columns
+--enable_info
+ALTER TABLE t1 ADD COLUMN e1 INT AS (id * 3);
+ALTER TABLE t1 ADD COLUMN e2 VARCHAR(30) AS (d3);
+ALTER TABLE t1 ADD COLUMN e3 INT AS (id * 2);
+
+# instant alter
+ALTER TABLE t1 CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'foobar',
+ADD COLUMN (d5 CHAR(20) DEFAULT 'hijkl', d6 INT DEFAULT -12345, d7 INT),
+DROP INDEX d3;
+--disable_info
+
+INSERT INTO t1 SET id = 8;
+
+# Updating a column by extending an existing record
+UPDATE t1 SET d3 = 'yyyyy' WHERE id = 1;
+
+# Updating an already materialized column
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 2;
+
+# transaction rollback
+BEGIN;
+UPDATE t1 SET d3 = 'xxxxx' WHERE id = 3;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
+
+# NULL to NULL, no change
+BEGIN;
+UPDATE t1 SET d7 = NULL WHERE ID = 5;
+ROLLBACK;
+BEGIN;
+UPDATE t1 SET d7 = NULL, d6 = 10 WHERE id = 5;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+ROLLBACK;
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
+
+# add virtual stored columns; not instant
+--enable_info
+ALTER TABLE t1 ADD COLUMN (f1 VARCHAR(20) AS (concat('x', e2)) STORED);
+
+# instant add
+ALTER TABLE t1 ADD COLUMN (d8 VARCHAR(20) DEFAULT 'omnopq');
+--disable_info
+
+SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7, f1, d8 FROM t1;
+SHOW CREATE TABLE t1;
+
+--enable_info
+ALTER TABLE t1
+CHANGE c2 c2 INT DEFAULT 42,
+CHANGE d1 d1 INT DEFAULT 1,
+CHANGE d2 d2 INT DEFAULT 20,
+CHANGE d3 d3 VARCHAR(20) NOT NULL DEFAULT 'boofar';
+--disable_info
+INSERT INTO t1 SET id=9;
+--enable_info
+ALTER TABLE t1 DROP c3;
+--disable_info
+
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+eval CREATE TABLE t2
+(id INT primary key, c1 VARCHAR(4000),
+ p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+ SPATIAL INDEX(p))
+$engine;
+
+BEGIN;
+INSERT INTO t2 SET id=1, c1=REPEAT('a', 4000);
+INSERT INTO t2 SET id=2, c1=REPEAT('a', 4000), p=ST_GeomFromText('POINT(1 1)');
+COMMIT;
+
+--enable_info
+ALTER TABLE t2 ADD COLUMN d1 VARCHAR(2000) DEFAULT REPEAT('asdf',500);
+--disable_info
+SELECT id, c1, ST_AsText(p) p, d1 FROM t2;
+
+# inplace update, rollback
+BEGIN;
+UPDATE t2 SET c1 = repeat(id, 4000);
+
+connection analyze;
+ANALYZE TABLE t2;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+connection default;
+
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+connection default;
+
+# non-inplace update. Rollback MUST NOT materialize off-page columns.
+BEGIN;
+UPDATE t2 SET d1 = repeat(id, 200);
+connection analyze;
+ANALYZE TABLE t2;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+connection default;
+ROLLBACK;
+connection analyze;
+ANALYZE TABLE t2;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/t2';
+connection default;
+
+--enable_info
+ALTER TABLE t2 DROP p;
+--disable_info
+SELECT * FROM t2;
+
+# datetime
+eval CREATE TABLE t3
+(id INT PRIMARY KEY, c2 INT UNSIGNED NOT NULL UNIQUE,
+ c3 POLYGON NOT NULL DEFAULT ST_PolyFromText('POLYGON((1 1,2 2,3 3,1 1))'),
+ SPATIAL INDEX(c3))
+$engine;
+INSERT INTO t3(id,c2) VALUES(1,1),(2,2),(3,3);
+SELECT id, c2, ST_AsText(c3) c3 FROM t3;
+--enable_info
+ALTER TABLE t3 ADD COLUMN
+(c4 DATETIME DEFAULT current_timestamp(),
+ c5 TIMESTAMP NOT NULL DEFAULT current_timestamp(),
+ c6 POINT);
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6 FROM t3;
+ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
+ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
+--disable_info
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
+
+--enable_info
+ALTER TABLE t3 ADD COLUMN t TEXT CHARSET utf8
+DEFAULT 'The quick brown fox jumps over the lazy dog';
+
+if ($redundant_4k)
+{
+--error ER_TOO_BIG_ROWSIZE
+ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
+SET innodb_strict_mode = OFF;
+}
+ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
+--error ER_NO_DEFAULT_FOR_FIELD
+INSERT INTO t3 SET id=4;
+INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
+
+SET innodb_strict_mode = OFF;
+ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
+CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
+--disable_info
+INSERT INTO t3 SET id=5, c2=9;
+SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8, phrase, b FROM t3;
+--enable_info
+ALTER TABLE t3 DROP c3, DROP c7;
+--disable_info
+SELECT * FROM t3;
+
+eval CREATE TABLE t4
+(id INT, foo INT DEFAULT 0, c1 VARCHAR(4000),
+ p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'),
+ PRIMARY KEY(id,foo))
+$engine;
+
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000)), (2, REPEAT('a', 4000));
+ALTER TABLE t4 ADD COLUMN d1 INT;
+
+BEGIN;
+UPDATE t4 SET c1 = repeat('1', 4000), foo=1 WHERE id=1;
+INSERT INTO t4 (id,c1) VALUES (1, REPEAT('a', 4000));
+UPDATE t4 SET c1 = repeat('2', 4000), foo=1 WHERE id=2;
+ROLLBACK;
+
+BEGIN;
+UPDATE t4 SET d1 = 1,foo=2 WHERE id=1;
+INSERT INTO t4 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000));
+COMMIT;
+
+eval CREATE TABLE big
+(id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
+ p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
+$engine;
+BEGIN;
+INSERT INTO big
+SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
+SET @i:=1;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+INSERT INTO big SELECT @i:=@i+1, c1, c2, c3, p FROM big;
+COMMIT;
+connection analyze;
+ANALYZE TABLE big;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+connection default;
+--enable_info
+ALTER TABLE big ADD COLUMN
+(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
+ d3 TIMESTAMP NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp);
+--disable_info
+CHECKSUM TABLE big;
+BEGIN;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+INSERT INTO big(id, c1, c2, c3) SELECT @i:=@i+1, c1, c2, c3 FROM big;
+CHECKSUM TABLE big;
+connection analyze;
+ANALYZE TABLE big;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+connection default;
+ROLLBACK;
+CHECKSUM TABLE big;
+connection analyze;
+ANALYZE TABLE big;
+SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE name = 'test/big';
+connection default;
+
+--source include/wait_all_purged.inc
+DROP TABLE t1,t2,t3,t4,big;
+
+# MDEV-14837 Duplicate primary keys are allowed after ADD COLUMN / UPDATE
+eval CREATE TABLE t1 (a VARCHAR(1) PRIMARY KEY) $engine;
+INSERT INTO t1 SET a='a';
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 0;
+UPDATE t1 SET b = 1;
+--error ER_DUP_ENTRY
+INSERT INTO t1 SET a='a';
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# MDEV-16065 Assertion failed in btr_pcur_restore_position_func on UPDATE
+eval CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) $engine;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
+
+# MDEV-16830 Crash in ALTER TABLE DROP FOREIGN KEY
+eval CREATE TABLE t1 (a INT PRIMARY KEY) $engine;
+eval CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY(b) REFERENCES t1(a))
+$engine;
+INSERT INTO t1 SET a=1;
+INSERT INTO t2 SET b=1;
+ALTER TABLE t2 ADD COLUMN a INT, DROP FOREIGN KEY t2_ibfk_1;
+ALTER TABLE t2 ADD INDEX(a);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+SET foreign_key_checks=0;
+ALTER TABLE t1 ADD COLUMN b INT, ADD FOREIGN KEY(a) REFERENCES t2(a),
+ALGORITHM=INSTANT;
+ALTER TABLE t2 ADD CONSTRAINT fk FOREIGN KEY(b) REFERENCES t1(a),
+ALGORITHM=INSTANT;
+SET foreign_key_checks=1;
+ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
+ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+DROP TABLE t2, t1;
+
+#
+# MDEV-17483 Insert on delete-marked record can wrongly inherit old values
+# for instantly added column
+#
+
+eval CREATE TABLE t1 (a INT PRIMARY KEY) $engine;
+INSERT INTO t1 SET a = 1;
+ALTER TABLE t1 ADD COLUMN b TEXT;
+BEGIN;
+UPDATE t1 SET b = REPEAT('1', 32768);
+UPDATE t1 SET a = 2;
+INSERT INTO t1 SET a = 1;
+SELECT a,LENGTH(b) FROM t1;
+DELETE FROM t1;
+COMMIT;
+--source include/wait_all_purged.inc
+DROP TABLE t1;
+
+#
+# MDEV-20066 Wrong value on instantly added column after DELETE and UPDATE
+#
+
+eval CREATE TABLE t1(a INT PRIMARY KEY) $engine;
+INSERT INTO t1 VALUES (7);
+
+ALTER TABLE t1 ADD COLUMN c INT NOT NULL DEFAULT 0;
+ALTER TABLE t1 ADD INDEX (c);
+
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4,0),(7,77);
+COMMIT;
+BEGIN;
+DELETE FROM t1 WHERE a=7;
+UPDATE t1 SET a=7;
+COMMIT;
+SELECT * FROM t1 FORCE INDEX(PRIMARY);
+SELECT * FROM t1 FORCE INDEX(c);
+DELETE FROM t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+# MDEV-21172 Memory leak during ADD PRIMARY KEY
+
+SET innodb_strict_mode = ON;
+eval CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) $engine;
+ALTER TABLE t1 ADD d TEXT;
+--error 0,ER_TOO_BIG_ROWSIZE
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+# Exploit MDEV-17468 to force the table definition to be reloaded
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
+
+# MDEV-20950 innodb_instant_alter_column_allowed
+eval CREATE TABLE t1 (a INT PRIMARY KEY) $engine;
+INSERT INTO t1 SET a=42;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+ALTER TABLE t1 ADD b TEXT, ALGORITHM=INSTANT;
+SET GLOBAL innodb_instant_alter_column_allowed = never;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
+--enable_info
+ALTER TABLE t1 MODIFY a INT DEFAULT 0;
+--disable_info
+ALTER TABLE t1 MODIFY a INT DEFAULT NULL, ALGORITHM=INSTANT;
+DROP TABLE t1;
+SET GLOBAL innodb_instant_alter_column_allowed = add_last;
+
+dec $format;
+let $redundant_4k= 0;
+}
+disconnect analyze;
+SELECT variable_value-@old_instant instants
+FROM information_schema.global_status
+WHERE variable_name = 'innodb_instant_alter_column';
+SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
+SET GLOBAL innodb_instant_alter_column_allowed = @saved_allowance;
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
new file mode 100644
index 00000000000..a7ccefb19af
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -0,0 +1,207 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-17821 Assertion `!page_rec_is_supremum(rec)' failed
+--echo # in btr_pcur_store_position
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2);
+ALTER TABLE t1 ADD COLUMN f VARCHAR(255);
+ALTER TABLE t1 DROP COLUMN f;
+DELETE FROM t1;
+HANDLER t1 OPEN;
+HANDLER t1 READ `PRIMARY` <= (3);
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ pk INT AUTO_INCREMENT,
+ f1 CHAR(32),
+ f2 CHAR(32),
+ f3 CHAR(32),
+ f4 INT,
+ f5 CHAR(32),
+ f6 INT,
+ f7 INT,
+ f8 INT,
+ PRIMARY KEY (pk),
+ UNIQUE (f6)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES
+ ('reality', 'llt', 'within', -1996816384, 'j', 160, 7, -1822687232),
+ ('h', 'j', 'j', 251, 'civilian', NULL, 211, NULL),
+ ('ltq', 'b', 'mud', 111, 'v', 90, 0, NULL),
+ ('toxic', 'breakfast', 'series', 2, 'x', NULL, 118, 2),
+ ('h', 'n', 'vision', 84, 'n', NULL, 197, 103),
+ ('h', 'tq', 'q', 6, 'bet', -1927151616, -446038016, 3),
+ ('pocket', 'qjt', 'jtl', 0, 'blink', NULL, 12, 0),
+ ('k', 'uv', 'exist', 37, 'g', 149, -1610219520, NULL),
+ ('parent', 'motion', 'u', 70, 'promote', NULL, 178, NULL),
+ ('get', 'convict', 'liquid', -780337152, 'd', NULL, 4, NULL),
+ ('vp', 'px', 'xi', -631111680, 'support', NULL, 8, NULL),
+ ('ck', 'z', 'minority', 8, 'k', NULL, 864878592, NULL),
+ ('kxx', 'g', 'container', 1, 'cholesterol', NULL, 4, 1404436480),
+ ('xxv', 'rail', 'j', 219, 'serious', NULL, -816119808, 62),
+ ('x', 'v', 'vr', 146, 'm', 16, 170, -1765867520),
+ ('age', 'm', 'q', -1251278848, 'rte', 6, 224, NULL),
+ ('discrimination', 't', 'q', 31, 'exl', 0, 2, 244),
+ ('water', 'x', 'ldb', 98, 'r', 235, 4, 63),
+ ('d', 'db', 'p', 248, 'so-called', 102, -255524864, 198),
+ ('last', 'bz', 'us', 0, 'experienced', 137, 240, 134),
+ ('q', 'z', 'attract', 67, 'code', 67, 75, 1758920704),
+ ('yellow', 'c', 'u', 6, 'v', 1731985408, 528154624, 2),
+ ('cognitive', 'he', 'protective', 590020608, 'sentence', NULL, 4, 102),
+ ('eih', 'l', 'ih', 1266024448, 'traditionally', NULL, 190, NULL),
+ ('pine', 'i', 'y', 6, 'glimpse', 214, 7, -1486880768),
+ ('jo', 'everyone', 'ol', 0, 'lj', NULL, 1, 0),
+ ('blood', 'f', 'scientist', 54, 'j', 1341128704, 168, NULL),
+ ('z', 'brief', 'ambassador', 115, 'ygp', 82, 129, NULL),
+ ('gp', 'severe', 'consist', 7, 'p', -1829961728, 602669056, 154),
+ ('admit', 'poetry', 'x', 116, 'enemy', 174, -2128543744, -407764992),
+ ('s', 'norm', 'decide', 2055667712, 'rtz', NULL, 99, -1233715200),
+ ('tzg', 'f', 'beg', 2016280576, 'w', NULL, -643825664, 137),
+ ('zgg', 'x', 'f', 148, 'y', -987496448, -708116480, 8),
+ ('attorney', 'perfectly', 's', 49, 'z', -1865285632, 56, -1518534656),
+ ('concentrate', 's', 'k', -1028849664, 'tir', 83, -1592459264, 1820065792),
+ ('t', 'sacrifice', 'ir', -2143879168, 'recipe', 156, 217, NULL),
+ ('wdf', 'd', 'f', 137, 'empty', NULL, 188, NULL),
+ ('o', 'customer', 'qd', -2135293952, 'z', 1527840768, 227, -1174929408),
+ ('d', 'qow', 'o', 1472266240, 'whe', NULL, 7, 197),
+ ('deny', 'reputation', 'dutch', 59, 'v', 124, 2, 191),
+ ('m', 'liver', 'fv', 0, 'policy', 781582336, 198574080, 177),
+ ('vk', 'kx', 'immigrant', -1452736512, 'x', 163, 76, 6) ,
+ ('j', 'ru', 'r', 67, 'joke', NULL, 3, NULL),
+ ('o', 'u', 'a', -569442304, 'uz', NULL, 933298176, NULL),
+ ('g', 'zb', 'c', -1694760960, 'fish', 18, -390463488, 1),
+ ('bb', 'o', 'b', 6, 'z', 9, 12, NULL),
+ ('compelling', 'xe', 'debut', 89, 'e', -734724096, 119, 175),
+ ('md', 'r', 'object', 1046478848, 'frequently', 915537920, 0, 1506410496),
+ ('dwn', 'wnz', 'x', 1767571456, 'nz', 241, -882180096, 9),
+ ('zvf', 'vfo', 'g', -844824576, 'w', NULL, 1, 9),
+ ('w', 'pose', 'r', 1029308416, 'a', -48627712, 1756168192, NULL),
+ ('o', 'jwp', 'patient', 172, 'i', 297140224, 45809664, 3),
+ ('w', 'p', 'american', 450297856, 'z', 20, 4, 186),
+ ('ridiculous', 'helpful', 'vy', -2022899712, 'conspiracy', NULL, 162, -264634368),
+ ('t', 'g', 'spite', 289931264, 'y', 4, 13, NULL),
+ ('performer', 'i', 'tomato', -1519386624, 'mz', 8, 87, 106),
+ ('m', 'z', 'hang', 3, 'crowded', -537919488, 1, 2),
+ ('fu', 'uot', 'j', 1, 'o', 179, 220, -2084569088),
+ ('ts', 'n', 'su', 1, 'o', 198, 9, 68),
+ ('ball', 'halfway', 'uf', 40, 'l', 145948672, 9, 149),
+ ('hunting', 'n', 'teenager', 0, 'neat', 209, 2044461056, 68),
+ ('independent', 'along', 'fpn', 5, 'pn', 3, 1353252864, 217),
+ ('p', 'presumably', 'n', -1977548800, 'balanced', 1909260288, 197, NULL),
+ ('pink', 'h', 'tear', 8, 'n', 254, 8, 1006305280),
+ ('tyy', 'n', 'yyr', 1107820544, 'yr', NULL, 0, 219),
+ ('u', 'retirement', 'thread', -2083192832, 'rx', -678232064, 209, 1048969216),
+ ('xk', 'kb', 'z', 9, 'ba', 218, 7, 8),
+ ('a', 'plenty', 'forget', 36, 'c', 215, 2027094016, NULL),
+ ('i', 'compromise', 'n', -1090256896, 'o', 10, 66, 1872887808),
+ ('x', 'disappointment', 'cognitive', 753860608, 'ua', 77, 123, 10),
+ ('e', 'added', 'aub', 2, 'u', NULL, 9, 92),
+ ('bc', 'h', 'n', 146, 'master', NULL, 1003945984, NULL),
+ ('execution', 'f', 'cgp', 574423040, 'gp', 2, -518782976, -1189085184),
+ ('pv', 'bad', 'v', 132, 'r', 195, 6, 5),
+ ('modify', 'participation', 'vol', 237, 'j', -842924032, 88, -747765760),
+ ('substantially', 'i', 'congressional', 2, 'edit', NULL, 1003159552, NULL),
+ ('tell', 'forty', 'v', -910098432, 'd', 43, 3, NULL),
+ ('crawl', 'ad', 'respect', -1851195392, 'p', 72, -1709047808, 1343225856),
+ ('w', 'reception', 'fiber', 56, 's', NULL, 2, -993787904),
+ ('successful', 'instruct', 'dug', 2, 'u', 7, -411500544, NULL),
+ ('appointment', 'pregnant', 'weird', 2, 'r', NULL, -897384448, 76),
+ ('g', 'j', 'thin', 663617536, 'oan', 1, 7, NULL),
+ ('secretary', 'a', 'o', 103, 'nj', 1977745408, -1291124736, -1314521088),
+ ('g', 'jq', 'q', 1875116032, 'blame', NULL, 1, 4),
+ ('oj', 'j', 'breast', 150, 'c', NULL, 3, NULL),
+ ('rd', 'm', 'comprehensive', 1723334656, 't', NULL, 155, -312344576) ,
+ ('a', 'd', 'criminal', -1155137536, 'airplane', 242, -662896640, 1),
+ ('fast', 'i', 'k', -386662400, 'zxe', NULL, 7, 119),
+ ('xe', 'mouse', 'c', -205717504, 'ew', NULL, -729612288, 86),
+ ('hang', 'j', 'o', 3, 'hungry', NULL, 200, 49),
+ ('expense', 'z', 'sum', 2, 'gob', -472055808, -538181632, NULL),
+ ('nest', 'o', 'k', 116, 'weak', NULL, 223, NULL);
+--error ER_DUP_ENTRY
+INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES ('impact', 'b', 'h', 185, 'fj', 7, 7, 3);
+
+ALTER TABLE t1 ADD COLUMN filler VARCHAR(255) DEFAULT '';
+SELECT * FROM t1 INTO OUTFILE 'load.data';
+UPDATE IGNORE t1 SET pk = 0;
+LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1;
+HANDLER t1 OPEN AS h;
+HANDLER h READ `PRIMARY` PREV WHERE 0;
+
+# Cleanup
+HANDLER h CLOSE;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-19630 ALTER TABLE ... ADD COLUMN damages foreign keys
+--echo # which are pointed to the table being altered
+--echo #
+CREATE TABLE t1(f1 int not null, primary key(f1))engine=innodb;
+CREATE TABLE t2(f1 INT AUTO_INCREMENT NOT NULL, f2 INT NOT NULL,
+ status ENUM ('a', 'b', 'c'), INDEX idx1(f2),
+ PRIMARY KEY(f1),
+ FOREIGN KEY (f2) REFERENCES t1(f1))ENGINE=InnoDB;
+
+ALTER TABLE t1 CHANGE f1 f1_id INT NOT NULL, ADD f3 VARCHAR(255) DEFAULT NULL;
+ALTER TABLE t1 CHANGE f1_id f1 INT NOT NULL;
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+ALTER TABLE t2 CHANGE status status VARCHAR(20) DEFAULT NULL;
+DROP TABLE t2, t1;
+
+--let $datadir= `select @@datadir`
+--remove_file $datadir/test/load.data
+
+--echo #
+--echo # MDEV-20938 Double free of dict_foreign_t during instant ALTER TABLE
+--echo #
+
+CREATE TABLE t1 (id INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT UNSIGNED PRIMARY KEY, b INT UNSIGNED UNIQUE,
+ FOREIGN KEY fk1 (b) REFERENCES t1 (id)) ENGINE=InnoDB;
+ALTER TABLE t2
+ DROP FOREIGN KEY fk1,
+ CHANGE b d INT UNSIGNED,
+ ADD c INT;
+DROP TABLE t2, t1;
+
+--echo #
+--echo # MDEV-22446 InnoDB aborts while adding instant column
+--echo # for discarded tablespace
+--echo #
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+CREATE TABLE t1(c1 INT NOT NULL, c2 INT NOT NULL DEFAULT 0)ENGINE=InnoDB;
+INSERT INTO t1(c1) VALUES(1);
+
+ALTER TABLE t1 ADD COLUMN c3 INT DEFAULT 10;
+--replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/
+FLUSH TABLES t1 FOR EXPORT;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+UNLOCK TABLES;
+DROP TABLE t1;
+
+# Restore of instant table
+CREATE TABLE t1(c1 INT NOT NULL)Engine=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1 ADD COLUMN c2 INT NOT NULL;
+ALTER TABLE t1 ADD COLUMN c3 INT DEFAULT 10;
+# Restore files
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_restore_tablespaces("test", "t1");
+EOF
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+--echo # End of 10.3 tests
diff --git a/mysql-test/suite/innodb/t/instant_alter_crash.test b/mysql-test/suite/innodb/t/instant_alter_crash.test
new file mode 100644
index 00000000000..c037d77bef3
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_crash.test
@@ -0,0 +1,133 @@
+--source include/have_innodb.inc
+# The embedded server tests do not support restarting.
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+FLUSH TABLES;
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+
+--echo #
+--echo # MDEV-11369: Instant ADD COLUMN for InnoDB
+--echo #
+
+CREATE TABLE t1(id INT PRIMARY KEY, c2 INT UNIQUE)
+ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES(0,2);
+INSERT INTO t2 VALUES(2,1);
+ALTER TABLE t2 ADD COLUMN (c3 TEXT NOT NULL DEFAULT 'De finibus bonorum');
+BEGIN;
+INSERT INTO t2 VALUES(3,4,'accusantium doloremque laudantium');
+
+connect ddl, localhost, root;
+SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
+--send
+ALTER TABLE t1 ADD COLUMN (c3 TEXT NOT NULL DEFAULT ' et malorum');
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR ddl';
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+COMMIT;
+
+--source include/kill_mysqld.inc
+disconnect ddl;
+--source include/start_mysqld.inc
+
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+SELECT * FROM t1;
+SELECT * FROM t2;
+BEGIN;
+DELETE FROM t1;
+ROLLBACK;
+--source include/wait_all_purged.inc
+
+INSERT INTO t2 VALUES (64,42,'De finibus bonorum'), (347,33101,' et malorum');
+
+connect ddl, localhost, root;
+SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
+--send
+ALTER TABLE t2 ADD COLUMN (c4 TEXT NOT NULL DEFAULT ' et malorum');
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR ddl';
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+DELETE FROM t1;
+
+--source include/kill_mysqld.inc
+disconnect ddl;
+--source include/start_mysqld.inc
+
+SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN= \[Note\] InnoDB: Rolled back recovered transaction ;
+-- source include/search_pattern_in_file.inc
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+BEGIN;
+INSERT INTO t1 SET id=1;
+DELETE FROM t2;
+ROLLBACK;
+--source include/wait_all_purged.inc
+
+FLUSH TABLE t1,t2 FOR EXPORT;
+
+# At this point, t1 is empty and t2 contains a 'default row'.
+
+# The following is based on innodb.table_flags and innodb.dml_purge:
+--perl
+use strict;
+my $ps= $ENV{INNODB_PAGE_SIZE};
+foreach my $table ('t1','t2') {
+my $file= "$ENV{MYSQLD_DATADIR}/test/$table.ibd";
+open(FILE, "<", $file) || die "Unable to open $file\n";
+my $page;
+sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file";
+die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+print "$table clustered index root page";
+print "(type ", unpack("n", substr($page,24,2)), "):\n";
+print "N_RECS=", unpack("n", substr($page,38+16,2));
+print "; LEVEL=", unpack("n", substr($page,38+26,2)), "\n";
+my @fields=("id","DB_TRX_ID","DB_ROLL_PTR", "c2","c3","c4");
+for (my $offset= 0x65; $offset;
+ $offset= unpack("n", substr($page,$offset-2,2)))
+{
+ print "header=0x", unpack("H*",substr($page,$offset-6,6)), " (";
+ my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff;
+ my $start= 0;
+ my $name;
+ for (my $i= 0; $i < $n_fields; $i++) {
+ my $end= unpack("C", substr($page, $offset-7-$i, 1));
+ print ",\n " if $i;
+ print "$fields[$i]=";
+ if ($end & 0x80) {
+ print "NULL(", ($end & 0x7f) - $start, " bytes)"
+ } else {
+ print "0x", unpack("H*", substr($page,$offset+$start,$end-$start))
+ }
+ $start= $end & 0x7f;
+ }
+ print ")\n";
+}
+close(FILE) || die "Unable to close $file\n";
+}
+EOF
+
+UNLOCK TABLES;
+
+DELETE FROM t2;
+--source include/wait_all_purged.inc
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1,t2;
+
+--remove_files_wildcard $MYSQLD_DATADIR/test #sql*.frm
+--list_files $MYSQLD_DATADIR/test
+
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@saved_frequency;
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
new file mode 100644
index 00000000000..cec7a05725b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -0,0 +1,321 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+
+CREATE TABLE t1 (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ c1 INT,
+ c2 VARCHAR(255),
+ c3 VARCHAR(255),
+ c4 INT,
+ c5 INT,
+ c6 INT,
+ c7 VARCHAR(255),
+ c8 TIMESTAMP NULL
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL,1,NULL,'foo',NULL,1,NULL,NULL,'2011-11-11 00:00:00');
+ALTER TABLE t1 ADD COLUMN f INT;
+REPLACE INTO t1 (c7) VALUES ('bar');
+
+CREATE TABLE t2 (i INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (-1),(1);
+ALTER TABLE t2 ADD COLUMN j INT;
+BEGIN;
+DELETE FROM t2;
+ROLLBACK;
+TRUNCATE TABLE t2;
+INSERT INTO t2 VALUES (1,2);
+
+CREATE TABLE t3 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t3 () VALUES ();
+ALTER TABLE t3 ADD COLUMN f INT;
+UPDATE t3 SET pk = DEFAULT;
+SELECT * FROM t3;
+
+CREATE TABLE t4 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (0);
+ALTER TABLE t4 ADD COLUMN b INT;
+SELECT COUNT(*)>0 FROM INFORMATION_SCHEMA.COLUMNS
+LEFT JOIN t4 ON (NUMERIC_SCALE = pk);
+ALTER TABLE t4 ADD COLUMN c INT;
+
+CREATE TABLE t5 (i INT, KEY(i)) ENGINE=InnoDB;
+INSERT INTO t5 VALUES (-42);
+ALTER TABLE t5 ADD UNIQUE ui(i);
+ALTER TABLE t5 ADD COLUMN i2 INT, DROP INDEX i;
+
+CREATE TABLE t6 (i INT NOT NULL) ENGINE=InnoDB;
+INSERT INTO t6 VALUES (0);
+ALTER TABLE t6 ADD COLUMN j INT;
+TRUNCATE TABLE t6;
+INSERT INTO t6 VALUES (1,2);
+
+CREATE TABLE t7 (i INT) ENGINE=InnoDB;
+INSERT INTO t7 VALUES (1),(2),(3),(4),(5);
+ALTER TABLE t7 ADD t TEXT DEFAULT '';
+
+CREATE TABLE t8 (i INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t8 VALUES (NULL);
+ALTER TABLE t8 ADD c CHAR(3);
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml';
+--send
+ALTER TABLE t8 FORCE;
+connect (dml,localhost,root,,);
+SET DEBUG_SYNC='now WAIT_FOR rebuilt';
+BEGIN;
+INSERT INTO t8 SET i=1;
+UPDATE t8 SET i=ISNULL(i);
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL dml';
+connection default;
+reap;
+SET DEBUG_SYNC='RESET';
+
+CREATE TABLE t9 (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ c1 BIGINT UNSIGNED,
+ c2 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
+ c3 BIGINT,
+ c4 VARCHAR(257) CHARACTER SET utf8,
+ c5 TINYINT UNSIGNED,
+ c6 TINYINT,
+ c7 VARCHAR(257) CHARACTER SET latin1,
+ c8 VARCHAR(257) CHARACTER SET binary
+) ENGINE=InnoDB;
+INSERT INTO t9 () VALUES ();
+ALTER TABLE t9 ADD COLUMN IF NOT EXISTS t TIMESTAMP NULL KEY;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml';
+--send
+OPTIMIZE TABLE t9;
+connection dml;
+SET DEBUG_SYNC='now WAIT_FOR rebuilt';
+BEGIN;
+INSERT INTO t9 () VALUES (),();
+UPDATE t9 SET t=current_timestamp();
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL dml';
+disconnect dml;
+connection default;
+reap;
+SET DEBUG_SYNC='RESET';
+
+CREATE TABLE t10 (pk INT DEFAULT 0 KEY) ENGINE=InnoDB;
+INSERT INTO t10 (pk) VALUES (1);
+ALTER TABLE t10 ADD c INT;
+TRUNCATE TABLE t10;
+INSERT INTO t10 VALUES (1,1),(2,2);
+ALTER TABLE t10 FORCE;
+
+CREATE TABLE t11 (
+ c01 enum('a','b'),
+ c02 bit,
+ c03 blob,
+ c04 enum('c','d'),
+ c05 blob,
+ c06 decimal,
+ c07 char(1),
+ c08 int,
+ c09 char(1),
+ c10 set('e','f'),
+ c11 char(1),
+ c12 float,
+ c13 bit,
+ c14 char(1),
+ c15 int,
+ c16 float,
+ c17 decimal,
+ c18 char(1) CHARACTER SET utf8 not null default '',
+ c19 float,
+ c20 set('g','h'),
+ c21 char(1),
+ c22 int,
+ c23 int,
+ c24 int,
+ c25 set('i','j'),
+ c26 decimal,
+ c27 float,
+ c28 char(1),
+ c29 int,
+ c30 enum('k','l'),
+ c31 decimal,
+ c32 char(1),
+ c33 decimal,
+ c34 bit,
+ c35 enum('m','n'),
+ c36 set('o','p'),
+ c37 enum('q','r'),
+ c38 blob,
+ c39 decimal,
+ c40 blob not null default '',
+ c41 char(1),
+ c42 int,
+ c43 float,
+ c44 float,
+ c45 enum('s','t'),
+ c46 decimal,
+ c47 set('u','v'),
+ c48 enum('w','x'),
+ c49 set('y','z'),
+ c50 float
+) ENGINE=InnoDB;
+INSERT INTO t11 () VALUES ();
+ALTER TABLE t11 ADD COLUMN f INT;
+INSERT INTO t11 () VALUES ();
+UPDATE t11 SET c22 = 1;
+
+--source include/wait_all_purged.inc
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
+
+--echo #
+--echo # MDEV-15060 Assertion in row_log_table_apply_op after instant ADD
+--echo # when the table is emptied during subsequent ALTER TABLE
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL);
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL;
+connect stop_purge,localhost,root;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connect ddl,localhost,root,,test;
+DELETE FROM t1;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+send ALTER TABLE t1 FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR copied';
+
+BEGIN;
+INSERT INTO t1 SET b=1;
+ROLLBACK;
+connection stop_purge;
+COMMIT;
+connection default;
+
+# Wait for purge to empty the table.
+let $wait_all_purged=2;
+--source include/wait_all_purged.inc
+let $wait_all_purged=0;
+
+SET DEBUG_SYNC='now SIGNAL logged';
+connection ddl;
+reap;
+connection default;
+DROP TABLE t1;
+SET DEBUG_SYNC='RESET';
+
+--echo #
+--echo # MDEV-16131 Assertion failed in dict_index_t::instant_field_value()
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 SET a=0;
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 2, ADD COLUMN c INT;
+
+connection stop_purge;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+connection default;
+DELETE FROM t1;
+
+connection ddl;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+send ALTER TABLE t1 FORCE;
+
+disconnect stop_purge;
+
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR copied';
+let $wait_all_purged = 1;
+--source include/wait_all_purged.inc
+INSERT INTO t1 SET a=1;
+INSERT INTO t1 SET a=2,b=3,c=4;
+SET DEBUG_SYNC = 'now SIGNAL logged';
+
+connection ddl;
+reap;
+
+connection default;
+SET DEBUG_SYNC = RESET;
+SELECT * FROM t1;
+
+--echo #
+--echo # MDEV-15872 Crash in online ALTER TABLE...ADD PRIMARY KEY
+--echo # after instant ADD COLUMN ... NULL
+--echo #
+ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=INSTANT;
+UPDATE t1 SET d=1;
+
+connection ddl;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+send ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d);
+
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR copied';
+BEGIN;
+INSERT INTO t1 SET a=3;
+ROLLBACK;
+SET DEBUG_SYNC = 'now SIGNAL logged';
+
+connection ddl;
+--error ER_INVALID_USE_OF_NULL
+reap;
+disconnect ddl;
+
+connection default;
+SET DEBUG_SYNC = RESET;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-19916 Corruption after instant ADD/DROP and shrinking the tree
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+
+# Create an index tree with 2 levels of node pointer pages.
+
+SET @old_limit = @@innodb_limit_optimistic_insert_debug;
+SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
+INSERT INTO t1 VALUES (1),(5),(4),(3),(2);
+SET GLOBAL innodb_limit_optimistic_insert_debug = @old_limit;
+
+ALTER TABLE t1 ADD COLUMN b INT, ALGORITHM=INSTANT;
+
+SET @old_defragment = @@innodb_defragment;
+SET GLOBAL innodb_defragment = 1;
+OPTIMIZE TABLE t1;
+SET GLOBAL innodb_defragment = @old_defragment;
+
+# Exploit MDEV-17468 to force the table definition to be reloaded
+ALTER TABLE t1 ADD vb INT AS (b) VIRTUAL;
+CHECK TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency;
+
+--echo #
+--echo # MDEV-21045 AddressSanitizer: use-after-poison in mem_heap_dup / row_log_table_get_pk_col
+--echo #
+CREATE TABLE t1 (a TEXT) ENGINE = InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 (a) VALUES ('foo');
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 0,algorithm=instant;
+
+--connect (con2,localhost,root,,test)
+SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL onlinealter WAIT_FOR update';
+--send
+ALTER TABLE t1 ADD PRIMARY KEY (b);
+
+--connection default
+SET DEBUG_SYNC='now WAIT_FOR onlinealter';
+UPDATE t1 SET b = 1;
+SET DEBUG_SYNC='now SIGNAL update';
+
+--connection con2
+--reap
+
+--connection default
+SET DEBUG_SYNC='RESET';
+--disconnect con2
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test
new file mode 100644
index 00000000000..5bd10a7994e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_import.test
@@ -0,0 +1,52 @@
+--source include/have_innodb.inc
+set default_storage_engine=innodb;
+
+--echo #
+--echo # MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
+--echo #
+
+create table t2 (x int, z int default 41);
+alter table t2 discard tablespace;
+
+create table t1 (x int);
+insert into t1 values (1);
+alter table t1 add z int default 42, algorithm instant;
+select * from t1;
+flush tables t1 for export;
+--let $MYSQLD_DATADIR= `select @@datadir`
+--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+unlock tables;
+
+--echo # The metadata has to be updated to instant ADD COLUMN.
+alter table t2 import tablespace;
+
+select * from t2;
+insert into t2 set x=2;
+select * from t2;
+
+alter table t1 discard tablespace;
+flush tables t2 for export;
+--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
+unlock tables;
+
+--echo # Both the metadata and the data file used instant ADD COLUMN.
+alter table t1 import tablespace;
+select * from t1;
+
+drop table t2;
+create table t2 select * from t1;
+
+alter table t1 discard tablespace;
+flush tables t2 for export;
+--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
+unlock tables;
+
+--echo # The instant ADD COLUMN has to be removed from the metadata.
+alter table t1 import tablespace;
+select * from t1;
+
+drop table t2;
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_inject.test b/mysql-test/suite/innodb/t/instant_alter_inject.test
new file mode 100644
index 00000000000..2a74998f65e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_inject.test
@@ -0,0 +1,46 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_partition.inc
+
+CREATE TABLE t1(a INT PRIMARY KEY, b INT, KEY(b)) ENGINE=InnoDB
+ROW_FORMAT=REDUNDANT PARTITION BY KEY() PARTITIONS 3;
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5);
+SET @saved_dbug= @@SESSION.debug_dbug;
+SET DEBUG_DBUG='+d,ib_commit_inplace_fail_2';
+--error ER_INTERNAL_ERROR
+ALTER TABLE t1 ADD COLUMN c CHAR(3) DEFAULT 'lie';
+SET DEBUG_DBUG= @saved_dbug;
+CHECK TABLE t1;
+BEGIN;
+UPDATE t1 SET b=a+1;
+INSERT INTO t1 VALUES (0,1);
+ROLLBACK;
+SELECT * FROM t1;
+ALTER TABLE t1 ADD COLUMN c CHAR(3) DEFAULT 'lie';
+SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
+--error ER_INTERNAL_ERROR
+ALTER TABLE t1 ADD COLUMN d INT NOT NULL DEFAULT -42;
+SET DEBUG_DBUG= @saved_dbug;
+CHECK TABLE t1;
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1,2,'foo');
+ROLLBACK;
+
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t2(a INT, KEY(a)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
+--error ER_INTERNAL_ERROR
+ALTER TABLE t2 ADD COLUMN b INT;
+SET DEBUG_DBUG= @saved_dbug;
+CHECK TABLE t2;
+BEGIN;
+DELETE FROM t2;
+INSERT INTO t2 VALUES (1);
+ROLLBACK;
+
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/t/instant_alter_rollback.test b/mysql-test/suite/innodb/t/instant_alter_rollback.test
new file mode 100644
index 00000000000..b68a6ad3880
--- /dev/null
+++ b/mysql-test/suite/innodb/t/instant_alter_rollback.test
@@ -0,0 +1,51 @@
+--source include/have_innodb.inc
+--source innodb_default_row_format.inc
+# The embedded server tests do not support restarting.
+--source include/not_embedded.inc
+
+# Flush any open myisam tables from previous tests
+FLUSH TABLES;
+
+--echo #
+--echo # MDEV-11369: Instant ADD COLUMN for InnoDB
+--echo #
+
+connect to_be_killed, localhost, root;
+
+CREATE TABLE empty (id INT PRIMARY KEY, c2 INT UNIQUE) ENGINE=InnoDB;
+CREATE TABLE once LIKE empty;
+CREATE TABLE twice LIKE empty;
+INSERT INTO once SET id=1,c2=1;
+INSERT INTO twice SET id=1,c2=1;
+ALTER TABLE empty ADD COLUMN (d1 INT DEFAULT 15);
+ALTER TABLE once ADD COLUMN (d1 INT DEFAULT 20);
+ALTER TABLE twice ADD COLUMN (d1 INT DEFAULT 20);
+ALTER TABLE twice ADD COLUMN
+(d2 INT NOT NULL DEFAULT 10,
+ d3 VARCHAR(15) NOT NULL DEFAULT 'var och en char');
+
+BEGIN;
+
+INSERT INTO empty set id=0,c2=42;
+UPDATE once set c2=c2+1;
+UPDATE twice set c2=c2+1;
+INSERT INTO twice SET id=2,c2=0,d3='';
+
+connection default;
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+CREATE TABLE foo(a INT PRIMARY KEY) ENGINE=InnoDB;
+
+--source include/kill_mysqld.inc
+disconnect to_be_killed;
+--source include/start_mysqld.inc
+
+SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
+DROP TABLE foo;
+--source include/wait_all_purged.inc
+SET GLOBAL innodb_purge_rseg_truncate_frequency=@saved_frequency;
+
+SELECT * FROM empty;
+SELECT * FROM once;
+SELECT * FROM twice;
+DROP TABLE empty, once, twice;
diff --git a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
index 2d8e7f2ff5e..faed87630b2 100644
--- a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
+++ b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
@@ -9,7 +9,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Plugin initialization aborted at s
call mtr.add_suppression("\\[ERROR\\] Plugin 'InnoDB' (init function|registration)");
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption");
call mtr.add_suppression("\\[ERROR\\] mysqld.*: Index for table 't1' is corrupt; try to repair it");
-call mtr.add_suppression("InnoDB: Error code: [0-9][0-9][0-9]* btr_pcur_open_low level: 0 called from file: ");
+call mtr.add_suppression("InnoDB: btr_pcur_open_low level: 0 called from file: ");
--enable_query_log
CREATE TABLE t1 (pk INT PRIMARY KEY, c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test
index 3db15bd43cc..3d68724f7a9 100644
--- a/mysql-test/suite/innodb/t/log_corruption.test
+++ b/mysql-test/suite/innodb/t/log_corruption.test
@@ -2,7 +2,7 @@
--source include/have_innodb_16k.inc
--disable_query_log
-call mtr.add_suppression("InnoDB: (Up|Down)grade after a crash is not supported");
+call mtr.add_suppression("InnoDB: Upgrade after a crash is not supported");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
@@ -33,55 +33,60 @@ EOF
--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
perl;
+do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
# Create a dummy system tablespace file using the default innodb_page_size=16k
die unless open OUT, ">", "$ENV{bugdir}/ibdata1";
binmode OUT;
+# We calculate innodb_checksum_algorithm=crc32 for the pages.
+# The following bytes are excluded:
+# bytes 0..3 (the checksum is stored there)
+# bytes 26..37 (encryption key version, post-encryption checksum, tablespace id)
+# bytes $page_size-8..$page_size-1 (checksum, LSB of FIL_PAGE_LSN)
+my $polynomial = 0x82f63b78; # CRC-32C
+
# Tablespace header page with valid FSP_SIZE=768 pages.
# Also, write a dummy FSEG_MAGIC_N at offset 60 to keep fseg_inode_try_get()
# happy when fseg_n_reserved_pages() is following an invalid pointer
# from the all-zero change buffer header page (page 3).
-print OUT pack("Nx[42]Nx[10]Nx[16312]Nx[4]",
- 0xdeadbeef, # checksum
- 768, # FSP_PAGE_SIZE
- 97937874, # FSEG_MAGIC_N
- 0xdeadbeef); # checksum
+## FIL_PAGE_OFFSET
+my $head = pack("Nx[18]", 0);
+## FSP_PAGE_SIZE, # FSEG_MAGIC_N
+my $body = pack("x[8]Nx[10]Nx[16312]", 768, 97937874);
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
# Dummy pages 1..6.
print OUT chr(0) x (6 * 16384);
-# Dictionary header page.
-print OUT pack("NNx[62]Nx[8]Nx[16290]Nx[4]",
- 0xdeadbeef, # checksum
- 7, # FIL_PAGE_OFFSET
- 8, # DICT_HDR_TABLES
- 9, # DICT_HDR_INDEXES
- 0xdeadbeef); # checksum
+# Dictionary header page (page 7).
+## FIL_PAGE_OFFSET
+$head = pack("Nx[18]", 7);
+## DICT_HDR_TABLES,DICT_HDR_INDEXES
+$body = pack("x[32]Nx[8]Nx[16290]", 8, 9);
+$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
# Empty SYS_TABLES page (page 8).
-print OUT pack("NNNNx[8]nx[12]nnx[31]Cx[20]",
- 0xdeadbeef, # checksum
- 8, # FIL_PAGE_OFFSET
- ~0, ~0, # FIL_PAGE_PREV, FIL_PAGE_NEXT
- 17855, # FIL_PAGE_TYPE == FIL_PAGE_INDEX
- 2, # PAGE_N_DIR_SLOTS
- 124, # PAGE_HEAP_TOP
- 1); # PAGE_INDEX_ID == DICT_TABLES_ID
-print OUT pack("nxnn", 0x801, 3, 116), "infimum";
-print OUT pack("xnxnxx", 0x901, 0x803), "supremum";
-print OUT pack("x[16248]nnNx[4]", 116, 101, 0xdeadbeef);
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
+$head = pack("NNNx[8]n", 8, ~0, ~0, 17855);
+## PAGE_N_DIR_SLOTS, PAGE_HEAP_TOP, PAGE_INDEX_ID == DICT_TABLES_ID
+$body = pack("nnx[31]Cx[20]", 2, 124, 1);
+$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
+$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
+$body .= pack("x[16248]nn", 116, 101);
+$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
# Empty SYS_INDEXES page (page 9).
-print OUT pack("NNNNx[8]nx[12]nnx[31]Cx[20]",
- 0xdeadbeef, # checksum
- 9, # FIL_PAGE_OFFSET
- ~0, ~0, # FIL_PAGE_PREV, FIL_PAGE_NEXT
- 17855, # FIL_PAGE_TYPE == FIL_PAGE_INDEX
- 2, # PAGE_N_DIR_SLOTS
- 124, # PAGE_HEAP_TOP
- 3); # PAGE_INDEX_ID == DICT_INDEXES_ID
-
-print OUT pack("nxnn", 0x801, 3, 116), "infimum";
-print OUT pack("xnxnxx", 0x901, 0x803), "supremum";
-print OUT pack("x[16248]nnNx[4]", 116, 101, 0xdeadbeef);
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
+$head = pack("NNNx[8]n", 9, ~0, ~0, 17855);
+## PAGE_N_DIR_SLOTS, PAGE_HEAP_TOP, PAGE_INDEX_ID == DICT_INDEXES_ID
+$body = pack("nnx[31]Cx[20]", 2, 124, 3);
+$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
+$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
+$body .= pack("x[16248]nn", 116, 101);
+$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
print OUT chr(0) x (759 * 16384);
close OUT or die;
@@ -227,6 +232,23 @@ let SEARCH_PATTERN=InnoDB: Invalid log block checksum. block: 2372 checkpoint no
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\.;
--source include/search_pattern_in_file.inc
+
+--echo # same, but with current-version header
+perl;
+die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
+binmode OUT;
+print OUT pack("Nx[5]nx[5]", 103, 0x1286), "MariaDB 10.3.1";
+print OUT pack("x[478]N", 0x85021a0f);
+close OUT or die;
+EOF
+--source include/start_mysqld.inc
+eval $check_no_innodb;
+--source include/shutdown_mysqld.inc
+
+let SEARCH_PATTERN=InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122;
+--source include/search_pattern_in_file.inc
+let SEARCH_PATTERN=InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\.;
+--source include/search_pattern_in_file.inc
--echo # --innodb-force-recovery=6 (skip the entire redo log)
--let $restart_parameters= $dirs --innodb-force-recovery=6
--source include/start_mysqld.inc
@@ -240,9 +262,8 @@ perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
# header block
-print OUT pack("Nx[5]nx[5]", 1, 0x1286);
-print OUT "malicious intentions, or perhaps not";
-print OUT pack("x[456]N", 0xd42d53a2);
+print OUT pack("Nx[5]nx[5]", 103, 0x1286), "MariaDB 10.3.1";
+print OUT pack("x[478]N", 0x85021a0f);
# checkpoint page 1 and all-zero checkpoint 2
print OUT pack("x[13]nCNNx[264]", 0x1286, 12, 0, 0x80c);
print OUT pack("H*x[212]Nx[1024]", "590DBAACFE922582", 0xc72d49c4);
@@ -300,9 +321,8 @@ perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
# header block
-print OUT pack("Nx[5]nx[5]", 1, 0x1286);
-print OUT "ibbackup was here!!!1!";
-print OUT pack("x[470]N", 0x52b54540);
+print OUT pack("Nx[5]nx[5]", 103, 0x1286), "MariaDB 10.3.1";
+print OUT pack("x[478]N", 0x85021a0f);
# invalid (all-zero) checkpoint page 1 and an empty log page
print OUT chr(0) x 1024;
# valid checkpoint block 2
@@ -385,8 +405,6 @@ eval $check_no_innodb;
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42
--source include/search_pattern_in_file.inc
---let SEARCH_PATTERN= Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1
---source include/search_pattern_in_file.inc
--echo # Empty 10.3 redo log
perl;
@@ -403,7 +421,41 @@ SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN= InnoDB: Downgrading redo log:
+# In encryption.innodb_encrypt_log_corruption, we would convert the
+# log to encrypted format. Writing an extra log checkpoint before the
+# redo log conversion would advance the LSN by the size of a
+# MLOG_CHECKPOINT record (9 bytes).
+--let SEARCH_PATTERN= InnoDB: .* started; log sequence number 121397[09]
+--source include/search_pattern_in_file.inc
+
+--echo # Empty 10.2 redo log
+perl;
+die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
+binmode OUT;
+# header block
+print OUT pack("Nx[5]nx[5]", 1, 0x1286);
+print OUT "ibbackup was here!!!1!";
+print OUT pack("x[470]N", 0x52b54540);
+# In encryption.innodb_log_corruption the previous step would
+# replace the block with an encrypted one and update the checkpoint.
+# Restore them.
+# invalid (all-zero) checkpoint page 1 and an empty log page
+print OUT chr(0) x 1024;
+# valid checkpoint block 2
+print OUT pack("x[12]NNNx[264]", 0x12860c, 0, 0x80c);
+# pointer to the MLOG_CHECKPOINT record, and checkpoint page checksum
+print OUT pack("H*x[204]NNN", "590DBAACFE922582", 0x128612, 0, 0x101741b);
+# log page
+print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 1, 0x46c8a2a2);
+close OUT or die;
+EOF
+
+--source include/start_mysqld.inc
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+--source include/shutdown_mysqld.inc
+--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc
--echo # Minimal MariaDB 10.1.21 encrypted redo log
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index df9f8664a64..9df1c6eed5a 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -39,7 +39,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# checkpoint after the INSERT. That is what we checked above.
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID.*;
+let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@@ -54,10 +54,10 @@ let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Ano
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t1.ibd' with space ID.*;
+let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t1.ibd' with space ID;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd.*;
+let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@@ -73,14 +73,14 @@ let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd.*;
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t[23].ibd' with space ID.*;
+let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t[23].ibd' with space ID;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t1.ibd.*;
+let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t1.ibd;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t3.ibd.*;
+let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t3.ibd;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*;
+let SEARCH_PATTERN= InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@@ -96,7 +96,7 @@ eval $check_no_innodb;
--source include/shutdown_mysqld.inc
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
-.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*;
+.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace;
--source include/search_pattern_in_file.inc
--echo # Fault 5: Wrong type of data file
@@ -120,9 +120,9 @@ EOF
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*t2.ibd.*;
+let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*t2.ibd;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages.*;
+let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages;
--source include/search_pattern_in_file.inc
# Restore t2.ibd
@@ -214,17 +214,17 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*;
+let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages.*;
+let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages;
--source include/search_pattern_in_file.inc
# TODO: These errors should state the file name (u2.ibd) and be ignored
# in innodb-force-recovery mode once
# Bug#18131883 IMPROVE INNODB ERROR MESSAGES REGARDING FILES
# has been fixed:
-let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*u2.ibd.*;
+let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*u2.ibd;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@@ -239,26 +239,26 @@ let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*u2.ibd.*;
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*;
+let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*;
+let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' for space ID \d+ because the target file exists.*;
+let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' because the target file exists;
--source include/search_pattern_in_file.inc
--remove_file $MYSQLD_DATADIR/test/u6.ibd
--source include/restart_mysqld.inc
-let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*;
+let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*;
+let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= \[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!.*;
+let SEARCH_PATTERN= \[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!;
--source include/search_pattern_in_file.inc
--let $restart_parameters=
diff --git a/mysql-test/suite/innodb/t/monitor.test b/mysql-test/suite/innodb/t/monitor.test
index dfae93694bf..3535c9c85ad 100644
--- a/mysql-test/suite/innodb/t/monitor.test
+++ b/mysql-test/suite/innodb/t/monitor.test
@@ -422,10 +422,27 @@ UNLOCK TABLES;
SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
+DROP TABLE t1;
+
+CREATE TABLE t1(id INT PRIMARY KEY, a INT, b CHAR(1), UNIQUE KEY u(a,b))
+ENGINE=InnoDB;
+
+SET @start = (SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+= 'lock_rec_lock_created');
+
+BEGIN;
+INSERT INTO t1 VALUES(1,1,'a'),(2,9999,'b'),(3,10000,'c'),(4,4,'d');
+DELETE FROM t1 WHERE a = 9999 AND b='b';
+COMMIT;
+
+SET @end = (SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+= 'lock_rec_lock_created');
+SELECT @end - @start;
+
+DROP TABLE t1;
+
--disable_warnings
SET GLOBAL innodb_monitor_enable=default;
SET GLOBAL innodb_monitor_disable=default;
SET GLOBAL innodb_monitor_reset_all=default;
--enable_warnings
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test
index 5fd11f01356..9ad09bb9b3a 100644
--- a/mysql-test/suite/innodb/t/read_only_recover_committed.test
+++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test
@@ -4,6 +4,13 @@
# need to restart server
--source include/not_embedded.inc
+--disable_query_log
+# Ignore messages from the innodb_force_recovery=5 startup.
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to find tablespace for table `test`\\.`t` in the cache");
+call mtr.add_suppression("\\[Warning\\] InnoDB: Allocated tablespace ID.* for test/t, old maximum was 0");
+FLUSH TABLES;
+--enable_query_log
+
--connect(con1, localhost, root)
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t VALUES(1);
@@ -11,7 +18,7 @@ BEGIN;
# Generate insert_undo log.
INSERT INTO t VALUES(2);
# Generate update_undo log.
-DELETE FROM t WHERE a=2;
+UPDATE t SET a=20 WHERE a=2;
--connect(con2, localhost, root)
--echo # Normal MariaDB shutdown would roll back the above transaction.
--echo # We want the transaction to remain open, so we will kill the server
@@ -34,7 +41,7 @@ send COMMIT;
connection default;
SET DEBUG_SYNC='now WAIT_FOR committed';
---echo # Ensure that the above incomplete transactions become durable.
+--echo # Ensure that the above transactions become durable.
SET GLOBAL innodb_flush_log_at_trx_commit=1;
BEGIN;
INSERT INTO t VALUES(-10000);
@@ -55,10 +62,22 @@ UPDATE t SET a=3 WHERE a=1;
SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output;
--echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
--echo # In earlier versions, this would return the last committed version
---echo # (empty table)!
+--echo # (only a=3; no record for a=20)!
SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
+--let $restart_parameters= --innodb-force-recovery=5
+--source include/restart_mysqld.inc
+--echo #
+--echo # MDEV-15418 innodb_force_recovery=5 displays bogus warnings
+--echo # about too new transaction identifier
+--echo #
+--echo # With the fix, innodb_force_recovery=5 implies READ UNCOMMITTED.
+SELECT * FROM t;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT * FROM t;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SELECT * FROM t;
--let $restart_parameters=
--source include/restart_mysqld.inc
SELECT * FROM t;
diff --git a/mysql-test/suite/innodb/t/rename_table_debug.opt b/mysql-test/suite/innodb/t/rename_table_debug.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/rename_table_debug.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test
index af3fe3b52cf..fc72e5c2664 100644
--- a/mysql-test/suite/innodb/t/row_format_redundant.test
+++ b/mysql-test/suite/innodb/t/row_format_redundant.test
@@ -4,7 +4,7 @@
--disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");
-call mtr.add_suppression("InnoDB: Table `test`.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES\\.TYPE=1 SYS_TABLES\\.MIX_LEN=255\\r?$");
+call mtr.add_suppression("InnoDB: Table `test`.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES\\.TYPE=1 SYS_TABLES\\.MIX_LEN=511\\r?$");
call mtr.add_suppression("InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found");
call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary");
call mtr.add_suppression("InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (rename|drop)");
@@ -92,6 +92,7 @@ TRUNCATE TABLE t3;
--source include/shutdown_mysqld.inc
--perl
use strict;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
my $ps= $ENV{INNODB_PAGE_SIZE};
my $file= "$ENV{bugdir}/ibdata1";
open(FILE, "+<", $file) || die "Unable to open $file\n";
@@ -115,13 +116,16 @@ for (my $offset= 0x65; $offset;
if ($i == 7 && $name =~ '^test/t[123]')
{
print "corrupted SYS_TABLES.MIX_LEN for $name\n";
- substr($page,$offset+$start,$end-$start)= pack("N", 255);
+ substr($page,$offset+$start,$end-$start)= pack("N", 511);
}
$start= $end & 0x7f;
}
}
-substr($page,0,4)=pack("N",0xdeadbeef);
-substr($page,$ps-8,4)=pack("N",0xdeadbeef);
+my $polynomial = 0x82f63b78; # CRC-32C
+my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
+substr($page,0,4)=$ck;
+substr($page,$ps-8,4)=$ck;
sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file\n";
@@ -141,7 +145,7 @@ RENAME TABLE t1 TO tee_one;
DROP TABLE t1;
DROP TABLE t2,t3;
---let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=255\b
+--let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b
--source include/search_pattern_in_file.inc
--let $restart_parameters=
diff --git a/mysql-test/suite/innodb/t/strict_mode.test b/mysql-test/suite/innodb/t/strict_mode.test
index ebfc05aef02..9154d6b73ae 100644
--- a/mysql-test/suite/innodb/t/strict_mode.test
+++ b/mysql-test/suite/innodb/t/strict_mode.test
@@ -5,7 +5,7 @@
--echo # INNODB_STRICT_MODE = 1
--echo #
-call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+call mtr.add_suppression("InnoDB: Cannot add field .* in table");
set innodb_strict_mode = 0;
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index 69f5d00693b..13e1fc01dc0 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -6,7 +6,7 @@
--disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");
call mtr.add_suppression("InnoDB: incorrect flags in SYS_TABLES");
-call mtr.add_suppression("InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.TYPE=(129|289|3873|1232[31]) SYS_TABLES\\.N_COLS=2147483649\\r?$");
+call mtr.add_suppression("InnoDB: Table `test`.`t[cp]` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.TYPE=(129|289|3873|1232[31]) SYS_TABLES\\.N_COLS=2147483649\\r?$");
call mtr.add_suppression("InnoDB: Table `test`\\.`tr` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.TYPE=65 SYS_TABLES\\.MIX_LEN=4294967295\\r?$");
call mtr.add_suppression("InnoDB: Refusing to load '\\..test.td\\.ibd' \\(id=3, flags=0x([2e]1)\\); dictionary contains id=3, flags=0x100\\1\\r?$");
call mtr.add_suppression("InnoDB: Refusing to load '\\..test.td\\.ibd' \\(id=3, flags=0x(1[2ae]1)\\); dictionary contains id=3, flags=0x10\\1\\r?$");
@@ -15,7 +15,7 @@ call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`.`td` because it
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation");
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified");
call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself");
-call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of tablespace");
+call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file ");
FLUSH TABLES;
--enable_query_log
@@ -29,10 +29,12 @@ let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags;
--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
--let $d=$d --innodb-data-file-path=ibdata1:1M:autoextend
--let $d=$d --innodb-undo-tablespaces=0
+--let $d=$d --innodb-purge-rseg-truncate-frequency=1
+--let $d=$d --skip-innodb-fast-shutdown
if ($have_debug) {
--let $d=$d --debug=d,create_and_drop_garbage
}
---let $restart_parameters=$d --innodb-stats-persistent=0 --innodb-file-format=1
+--let $restart_parameters=$d --innodb-stats-persistent=0
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_per_table=1;
@@ -50,6 +52,7 @@ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
--source include/shutdown_mysqld.inc
--perl
use strict;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
my $ps= $ENV{INNODB_PAGE_SIZE};
my $file= "$ENV{bugdir}/ibdata1";
open(FILE, "+<", $file) || die "Unable to open $file\n";
@@ -125,8 +128,11 @@ for (my $offset= 0x65; $offset;
}
print ")\n";
}
-substr($page,0,4)=pack("N",0xdeadbeef);
-substr($page,$ps-8,4)=pack("N",0xdeadbeef);
+my $polynomial = 0x82f63b78; # CRC-32C
+my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
+substr($page,0,4)=$ck;
+substr($page,$ps-8,4)=$ck;
sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file\n";
@@ -141,15 +147,19 @@ SHOW CREATE TABLE tc;
SELECT * FROM tc;
SHOW CREATE TABLE td;
SELECT * FROM td;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+# This table was converted to NO_ROLLBACK due to the SYS_TABLES.TYPE change.
SHOW CREATE TABLE tz;
+BEGIN;
+INSERT INTO tz VALUES(42);
+ROLLBACK;
+SELECT * FROM tz;
--error ER_NO_SUCH_TABLE_IN_ENGINE
SHOW CREATE TABLE tp;
--source include/shutdown_mysqld.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
---let SEARCH_PATTERN= InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649
+--let SEARCH_PATTERN= InnoDB: Table `test`.`t[cp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Table `test`\.`tr` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=65 SYS_TABLES\.MIX_LEN=4294967295\b
--source include/search_pattern_in_file.inc
@@ -184,14 +194,17 @@ BEGIN;
INSERT INTO tr VALUES(1);
INSERT INTO tc VALUES(1);
INSERT INTO td VALUES(1);
-INSERT INTO tz VALUES(1);
+# We cannot access tz, because due to our fiddling of the NO_ROLLBACK flag,
+# it now has a record with DB_TRX_ID=0, which is invalid for
+# transactional tables until MDEV-12288 is implemented.
+# INSERT INTO tz VALUES(1);
INSERT INTO tp VALUES(1);
ROLLBACK;
SELECT * FROM tr;
SELECT * FROM tc;
SELECT * FROM td;
-SELECT * FROM tz;
+# SELECT * FROM tz;
SELECT * FROM tp;
DROP TABLE tr,tc,td,tz,tp;
diff --git a/mysql-test/suite/innodb/t/table_index_statistics.inc b/mysql-test/suite/innodb/t/table_index_statistics.inc
new file mode 100644
index 00000000000..ba585320fc9
--- /dev/null
+++ b/mysql-test/suite/innodb/t/table_index_statistics.inc
@@ -0,0 +1,59 @@
+# include file to test index and table statstics for specific storage engine
+# requires includer set the default strorage engine for the session
+
+# Bug 602047 (wrong rows_read value)
+
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+
+SET @userstat_old= @@userstat;
+SET GLOBAL userstat=ON;
+
+CREATE TABLE t1 (id int(10), PRIMARY KEY (id));
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) FROM t1;
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+
+# Test that FLUSH clears one table but not another
+
+FLUSH TABLE_STATISTICS;
+
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+
+# Test that FLUSH clears both tables now
+
+FLUSH INDEX_STATISTICS;
+
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+
+# Test that stats are collected after the FLUSH again
+
+SELECT COUNT(*) FROM t1;
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+
+DROP TABLE t1;
+
+# Bug 1183625 (handler::update_global_table_stats crash).
+
+CREATE TABLE t2 (c1 INT UNSIGNED);
+
+ALTER TABLE t2 MODIFY c1 FLOAT;
+
+SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
+
+DROP TABLE t2;
+
+# Bug 1183625 (handler::update_global_table_stats crash).
+
+CREATE TABLE t2 (c1 INT UNSIGNED);
+
+ALTER TABLE t2 MODIFY c1 FLOAT;
+
+SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
+
+DROP TABLE t2;
+
+SET GLOBAL userstat= @userstat_old;
diff --git a/mysql-test/suite/innodb/t/table_index_statistics.test b/mysql-test/suite/innodb/t/table_index_statistics.test
index af6f1946486..697f4d64328 100644
--- a/mysql-test/suite/innodb/t/table_index_statistics.test
+++ b/mysql-test/suite/innodb/t/table_index_statistics.test
@@ -3,6 +3,6 @@
SET @default_storage_engine_old = @@session.default_storage_engine;
SET SESSION default_storage_engine = INNODB;
---source extra/table_index_statistics.inc
+--source ./table_index_statistics.inc
SET SESSION default_storage_engine = @default_storage_engine_old;
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index 6856ca86323..8e3ddf95634 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -493,3 +493,12 @@ delimiter ;//
call t1_proc;
drop procedure t1_proc;
+
+--echo #
+--echo # MDEV-15874 CREATE TABLE creates extra transaction
+--echo #
+call mtr.add_suppression("Warning 150 Create table `mysqld.1`.`t1` with foreign key constraint failed. Temporary tables can't have foreign key constraints.*");
+SET FOREIGN_KEY_CHECKS = 0;
+--error ER_CANT_CREATE_TABLE
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+ FOREIGN KEY(f1) REFERENCES t0(f1))ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/tmpdir.test b/mysql-test/suite/innodb/t/tmpdir.test
index 98517a97c7a..b43a02363dc 100644
--- a/mysql-test/suite/innodb/t/tmpdir.test
+++ b/mysql-test/suite/innodb/t/tmpdir.test
@@ -1,11 +1,6 @@
--source include/have_innodb.inc
--source include/count_sessions.inc
-if (`select plugin_auth_version <= "5.6.28-MariaDB-76.1" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.6.28-MariaDB-76.1 or earlier
-}
-
--echo #
--echo # Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
--echo # WHERE INNODB WRITES TEMP FILES
diff --git a/mysql-test/suite/innodb/t/truncate.opt b/mysql-test/suite/innodb/t/truncate.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/truncate.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/truncate_crash.opt b/mysql-test/suite/innodb/t/truncate_crash.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/truncate_crash.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/truncate_debug.opt b/mysql-test/suite/innodb/t/truncate_debug.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb/t/truncate_debug.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb/t/truncate_debug.test b/mysql-test/suite/innodb/t/truncate_debug.test
deleted file mode 100644
index 5fee9174d98..00000000000
--- a/mysql-test/suite/innodb/t/truncate_debug.test
+++ /dev/null
@@ -1,127 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
-
---source include/count_sessions.inc
-
---echo #
---echo # Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS
---echo #
-
-SET @ahi= @@global.innodb_adaptive_hash_index;
-# Ensure that there is no adaptive hash index on any system tables,
-# or any other tables than the ones that we are creating below.
-SET GLOBAL innodb_adaptive_hash_index=OFF;
-SET GLOBAL innodb_adaptive_hash_index=ON;
-
---echo Test_1 :- Check if DDL operations are possible on
---echo table being truncated. Also check if
---echo DDL operations on other tables succeed.
-
-create table t1 (f1 int,f2 int,key(f2),f3 int) engine=innodb;
-create index idx1 on t1(f3);
-create table t2 (f1 int,f2 int,key(f2),f3 int) engine=innodb;
-create table t3 (f1 int,f2 int,key(f2)) engine=innodb;
-
-insert into t1 values (10,20,30),(30,40,50),(50,60,70);
-insert into t1 select * from t1;
-insert into t1 select * from t1;
-insert into t1 select * from t1;
-insert into t2 values (10,20,30),(30,40,50),(50,60,70);
-
-insert into t2 select * from t2;
-insert into t2 select * from t2;
-insert into t2 select * from t2;
-
-insert into t3 values (10,20),(30,40),(50,50);
-insert into t3 select * from t3;
-insert into t3 select * from t3;
-
-SET session lock_wait_timeout = 1;
-
-connect (con1,localhost,root,,);
-SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan';
-send truncate table t1;
-
-connection default;
-SET DEBUG_SYNC= 'now WAIT_FOR started';
-
---echo Check Analyze table. Gives lock time out error.
-analyze table t1;
-
---echo Check if we can turn off auto recalculation.
---error ER_LOCK_WAIT_TIMEOUT
-alter table t1 STATS_AUTO_RECALC=0;
-
---echo Check if we can turn off persistent stats on the table
---error ER_LOCK_WAIT_TIMEOUT
-alter table t1 STATS_PERSISTENT=0;
-
---echo Check if DML is possible on table being truncated
---error ER_LOCK_WAIT_TIMEOUT
-insert into t1 values (10,89,99);
-
---echo Check if DDL is possible on table being truncated
---error ER_LOCK_WAIT_TIMEOUT
-alter table t1 add column f4 int;
-
---echo check if table can be created with the same name
---error ER_TABLE_EXISTS_ERROR,ER_LOCK_WAIT_TIMEOUT
-create table t1 (bd int) engine=innodb;
-
---echo check if index can be created on table being truncated
---error ER_LOCK_WAIT_TIMEOUT
-create index idx1 on t1(f1);
-
---echo Check if DROP of table is possible during truncate
---error ER_LOCK_WAIT_TIMEOUT
-drop table t1;
-
---echo Check if select is possible during truncate
---error ER_LOCK_WAIT_TIMEOUT
-select * from t1;
-
---error ER_BAD_FIELD_ERROR
-select * from t2 where t2.f1=t1.f1;
-
---echo Check concurrent truncate operation on table;
---error ER_LOCK_WAIT_TIMEOUT
-truncate table t1;
-
---echo Check concurrent selects and inserts on the other table
-insert into t3 values (10,20),(30,40),(50,50);
-select * from t3 where f1=40;
-
---echo Concurrent truncate on other tables
-truncate table t2;
-
---echo Concurrent alters on the other tables
-alter table t2 add column f4 int;
-
---echo check if index can be created on the other table
-create index idx1 on t2(f3);
-
---echo Check if we can turn off persistent stats off entire instance
-SET GLOBAL innodb_stats_persistent=off;
-
-connect (con2,localhost,root,,);
-send set global innodb_adaptive_hash_index=off;
-
-connection default;
-SET DEBUG_SYNC= 'now SIGNAL finish_scan';
-
-connection con1;
-reap;
-disconnect con1;
-
-connection con2;
-reap;
-disconnect con2;
-
-connection default;
-SET DEBUG_SYNC= 'RESET';
-
-SET GLOBAL innodb_adaptive_hash_index=@ahi;
-
-drop table t1,t2,t3;
---source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/truncate_foreign.opt b/mysql-test/suite/innodb/t/truncate_foreign.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/truncate_foreign.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/truncate_inject.opt b/mysql-test/suite/innodb/t/truncate_inject.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb/t/truncate_inject.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb/t/truncate_inject.test b/mysql-test/suite/innodb/t/truncate_inject.test
deleted file mode 100644
index 25002bd2f7b..00000000000
--- a/mysql-test/suite/innodb/t/truncate_inject.test
+++ /dev/null
@@ -1,97 +0,0 @@
-# This test is based on innodb_zip.wl6501_error_1 in MySQL 5.7.
-
---source include/have_innodb.inc
---source include/innodb_row_format.inc
---source include/have_debug.inc
-
-SET @save_dbug = @@SESSION.debug_dbug;
-
-call mtr.add_suppression("InnoDB: Flagged corruption of .* in table `test`\\.`t` in TRUNCATE TABLE");
-
---echo # 1. Error in assigning undo logs for truncate action
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c))
-ENGINE = InnoDB;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-check table t;
-#
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_assigning_undo_log';
---error ER_GET_ERRNO
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-select * from t;
-
---echo # 2. Error while preparing for truncate
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_preparing_for_truncate';
---error ER_GET_ERRNO
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
-select * from t;
-
---echo # 3. Error while dropping/creating indexes
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_drop_index';
---error ER_GET_ERRNO
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
---error ER_TABLE_CORRUPT,ER_GET_ERRNO
-select * from t;
-drop table t;
-
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c))
-ENGINE = InnoDB;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-check table t;
-
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_create_index';
---error ER_GET_ERRNO
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-check table t;
---error ER_TABLE_CORRUPT,ER_GET_ERRNO
-select * from t;
-drop table t;
-
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c))
-ENGINE = InnoDB;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-check table t;
-
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_temp_recreate_index';
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-
-check table t;
-select * from t;
-drop table t;
-
---echo # 4. Error while completing truncate of table involving FTS
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100),
-FULLTEXT INDEX(c)) ENGINE = InnoDB;
-insert into t values (1, 1.1, 'mysql is now oracle company'),
- (2, 2.2, 'innodb is part of mysql'),
- (3, 3.3, 'innodb is default storage engine of mysql');
-check table t;
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_temp_recreate_index';
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-
-check table t;
-select * from t;
-drop table t;
-
---echo # 5. Error while updating sys-tables
-CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100),
-FULLTEXT INDEX(c)) ENGINE = InnoDB;
-insert into t values (1, 1.1, 'mysql is now oracle company'),
- (2, 2.2, 'innodb is part of mysql'),
- (3, 3.3, 'innodb is default storage engine of mysql');
-check table t;
-SET @@SESSION.debug_dbug = '+d,ib_err_trunc_temp_recreate_index';
-truncate table t;
-SET @@SESSION.debug_dbug = @save_dbug;
-
-check table t;
-select * from t order by i;
-drop table t;
diff --git a/mysql-test/suite/innodb/t/truncate_missing.opt b/mysql-test/suite/innodb/t/truncate_missing.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/innodb/t/truncate_missing.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb/t/truncate_purge_debug.opt b/mysql-test/suite/innodb/t/truncate_purge_debug.opt
deleted file mode 100644
index 4cb238c6e53..00000000000
--- a/mysql-test/suite/innodb/t/truncate_purge_debug.opt
+++ /dev/null
@@ -1,4 +0,0 @@
---innodb-purge-threads=1
---innodb-purge-batch-size=1
---innodb-stats-persistent=OFF
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb/t/truncate_purge_debug.test b/mysql-test/suite/innodb/t/truncate_purge_debug.test
deleted file mode 100644
index e8f5768f557..00000000000
--- a/mysql-test/suite/innodb/t/truncate_purge_debug.test
+++ /dev/null
@@ -1,49 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
---source include/count_sessions.inc
-
---echo #
---echo # Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS
---echo #
-
-create table t1 (f1 int ,f2 int,key(f2)) engine=innodb;
-begin;
-insert into t1 values (10,45),(20,78),(30,88),(40,23),(50,78),(60,11),(70,56),(80,90);
-delete from t1;
-
-connect (con2,localhost,root,,);
-# Stop the purge thread
-START TRANSACTION WITH CONSISTENT SNAPSHOT;
-
-connection default;
-# Ensure that the history list length will actually be decremented by purge.
-SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
-SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
-commit;
-
-connect (con1,localhost,root,,);
-SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan';
-send truncate table t1;
-
-connection con2;
-SET DEBUG_SYNC= 'now WAIT_FOR started';
-# Allow purge to proceed, by discarding our read view.
-COMMIT;
-disconnect con2;
-
-connection default;
---source include/wait_all_purged.inc
-
-SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
-
-SET DEBUG_SYNC = 'now SIGNAL finish_scan';
-
-connection con1;
-reap;
-disconnect con1;
-
-connection default;
-SET DEBUG_SYNC = 'RESET';
-drop table t1;
---source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/truncate_restart.opt b/mysql-test/suite/innodb/t/truncate_restart.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb/t/truncate_restart.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb/t/truncate_restart.test b/mysql-test/suite/innodb/t/truncate_restart.test
deleted file mode 100644
index 60a3d83cd81..00000000000
--- a/mysql-test/suite/innodb/t/truncate_restart.test
+++ /dev/null
@@ -1,16 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
-
-SET GLOBAL innodb_stats_persistent= ON;
-CREATE TABLE t1 (t TEXT) ENGINE=InnoDB STATS_PERSISTENT=1;
---connect (con1,localhost,root,,test)
-SET DEBUG_SYNC='ib_trunc_table_trunc_completing SIGNAL committed WAIT_FOR ever';
---send
-TRUNCATE TABLE t1;
---connection default
-SET DEBUG_SYNC='now WAIT_FOR committed';
---source include/restart_mysqld.inc
---disconnect con1
-SELECT COUNT(*) FROM t1;
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/trx_id_future.test b/mysql-test/suite/innodb/t/trx_id_future.test
index deba753caca..e65dc537fd8 100644
--- a/mysql-test/suite/innodb/t/trx_id_future.test
+++ b/mysql-test/suite/innodb/t/trx_id_future.test
@@ -3,17 +3,17 @@
--echo # IN THE FUTURE
--echo #
---source include/not_debug.inc
--source include/have_innodb.inc
--source include/not_embedded.inc
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
let PAGE_SIZE=`select @@innodb_page_size`;
CREATE TABLE t1(a INT) row_format=redundant engine=innoDB;
INSERT INTO t1 VALUES(1);
let MYSQLD_DATADIR=`select @@datadir`;
-
+--source include/wait_all_purged.inc
--source include/shutdown_mysqld.inc
perl;
@@ -46,6 +46,8 @@ syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file";
EOF
+# Debug assertions would fail due to the injected corruption.
+--let $restart_parameters= --loose-skip-debug-assert
--source include/start_mysqld.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
@@ -54,5 +56,9 @@ let SEARCH_PATTERN= \[Warning\] InnoDB: A transaction id in a record of table `t
call mtr.add_suppression("\\[Warning\\] InnoDB: A transaction id in a record of table `test`\\.`t1` is newer than the system-wide maximum");
+# A debug assertion would cause a duplicated message to be output.
+SET @save_count = @@max_error_count;
+SET max_error_count = 1;
SELECT * FROM t1;
+SET max_error_count = @save_count;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/undo_truncate.opt b/mysql-test/suite/innodb/t/undo_truncate.opt
new file mode 100644
index 00000000000..1c897ab6cfc
--- /dev/null
+++ b/mysql-test/suite/innodb/t/undo_truncate.opt
@@ -0,0 +1 @@
+--innodb-log-buffer-size=2m
diff --git a/mysql-test/suite/innodb/t/undo_truncate.test b/mysql-test/suite/innodb/t/undo_truncate.test
index 4f350e380ee..9b91c78e35a 100644
--- a/mysql-test/suite/innodb/t/undo_truncate.test
+++ b/mysql-test/suite/innodb/t/undo_truncate.test
@@ -6,8 +6,6 @@
--source include/innodb_page_size_small.inc
--source include/have_undo_tablespaces.inc
-call mtr.add_suppression("InnoDB: The transaction log size is too large");
-
SET @save_undo_logs = @@GLOBAL.innodb_undo_logs;
SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET @save_truncate = @@GLOBAL.innodb_undo_log_truncate;
diff --git a/mysql-test/suite/innodb/t/undo_truncate_recover.test b/mysql-test/suite/innodb/t/undo_truncate_recover.test
index 94e09ed0e64..f3034c16988 100644
--- a/mysql-test/suite/innodb/t/undo_truncate_recover.test
+++ b/mysql-test/suite/innodb/t/undo_truncate_recover.test
@@ -37,7 +37,7 @@ commit;
drop table t1;
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
# FIXME: remove this work-around, and generate less log!
-call mtr.add_suppression("InnoDB: The transaction log size is too large");
+call mtr.add_suppression("InnoDB: The redo log transaction size ");
SET GLOBAL innodb_fast_shutdown=0;
--source include/shutdown_mysqld.inc
--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/update_time_wl6658.test b/mysql-test/suite/innodb/t/update_time_wl6658.test
index 0b2b94ae2a9..0adc6a867fe 100644
--- a/mysql-test/suite/innodb/t/update_time_wl6658.test
+++ b/mysql-test/suite/innodb/t/update_time_wl6658.test
@@ -187,8 +187,9 @@ SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
BEGIN WORK;
-INSERT INTO tab2 VALUES(1,'Oracle','NUTT',10);
+DELETE FROM tab1i;
SAVEPOINT A;
+INSERT INTO tab2 VALUES(1,'Oracle','NUTT',10);
INSERT INTO tab2 VALUES(2,'HUAWEI','BOLT',40);
SAVEPOINT B;
INSERT INTO tab2 VALUES(3,'IBM','NAIL',70);
@@ -203,7 +204,7 @@ FROM information_schema.tables WHERE table_name='tab2';
--echo #execute DDL instead of commit
create table tab6(c1 int);
-SELECT COUNT(update_time)
+SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
START TRANSACTION;
diff --git a/mysql-test/suite/innodb_fts/r/create.result b/mysql-test/suite/innodb_fts/r/create.result
index c3a14fa0281..55c5c45f643 100644
--- a/mysql-test/suite/innodb_fts/r/create.result
+++ b/mysql-test/suite/innodb_fts/r/create.result
@@ -9,8 +9,6 @@ INSERT INTO t SET t=REPEAT(_utf8 0xefbc90,84);
INSERT INTO t SET t=REPEAT('befor',17);
INSERT INTO t SET t='BeforeTheIndexCreation';
CREATE FULLTEXT INDEX ft ON t(t);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t SET t='this was inserted after creating the index';
INSERT INTO t SET t=REPEAT(_utf8 0xefbc91,84);
INSERT INTO t SET t=REPEAT('after',17);
@@ -90,8 +88,6 @@ INSERT INTO t SET t=REPEAT(_utf8 0xefbc90,84);
INSERT INTO t SET t=REPEAT('befor',17);
INSERT INTO t SET t='BeforeTheIndexCreation';
CREATE FULLTEXT INDEX ft ON t(t);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t SET t='this was inserted after creating the index';
INSERT INTO t SET t=REPEAT(_utf8 0xefbc91,84);
INSERT INTO t SET t=REPEAT('after',17);
diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result
index 42e294b3293..0e30dd0be05 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext.result
@@ -56,7 +56,7 @@ Only MyISAM tables support collections
MySQL has now support for full-text search
Full-text search in MySQL implements vector space model
select * from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION);
-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 EXPANSION)' at line 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 'WITH QUERY EXPANSION)' at line 1
explain select * from t1 where MATCH(a,b) AGAINST ("collections");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
@@ -277,8 +277,6 @@ PRIMARY KEY (id),
KEY ind5 (title)
) ENGINE = InnoDB;
CREATE FULLTEXT INDEX ft1 ON t1(title);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
insert into t1 (title) values ('this is a test');
select * from t1 where match title against ('test' in boolean mode);
id title
diff --git a/mysql-test/suite/innodb_fts/r/fulltext2.result b/mysql-test/suite/innodb_fts/r/fulltext2.result
index 0ce3dfa43a9..8f8135b35cd 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext2.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext2.result
@@ -1,4 +1,3 @@
-DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
i int(10) unsigned not null auto_increment primary key,
a varchar(255) not null,
diff --git a/mysql-test/suite/innodb_fts/r/fulltext_misc.result b/mysql-test/suite/innodb_fts/r/fulltext_misc.result
index 6a24d9aea58..f3e1ef519fd 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext_misc.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext_misc.result
@@ -148,7 +148,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
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 `a` + 12
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` union /* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `a` + 12
# Should not crash
SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY a + 12;
a
@@ -163,7 +163,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
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))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` union /* select#2 */ 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);
@@ -181,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 <expr_cache><`a`>((select `a` from `test`.`t2` where `test`.`t2`.`b` = 12))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` union /* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <expr_cache><`a`>((/* select#3 */ 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_var.result b/mysql-test/suite/innodb_fts/r/fulltext_var.result
index 9fe586210c8..ee4ba98d6eb 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext_var.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext_var.result
@@ -1,4 +1,3 @@
-drop table if exists t1;
show variables like "ft\_%";
Variable_name Value
ft_boolean_syntax + -><()~*:""&|
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
index f23813aed48..7d98aba7fc3 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
@@ -10,9 +10,9 @@ INSERT INTO fts_test (title,body) VALUES
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
-CREATE FULLTEXT INDEX idx on fts_test (title, body);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=INPLACE;
SELECT * FROM fts_test WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
id title body
@@ -26,7 +26,7 @@ INSERT INTO fts_test (title,body) VALUES
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
-CREATE FULLTEXT INDEX idx on fts_test (title, body);
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
SELECT * FROM fts_test WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
id title body
@@ -68,7 +68,6 @@ FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT
) ENGINE=InnoDB;
-create unique index FTS_DOC_ID_INDEX on fts_test(FTS_DOC_ID);
INSERT INTO fts_test (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...') ,
('How To Use MySQL Well','After you went through a ...'),
@@ -78,9 +77,9 @@ INSERT INTO fts_test (title,body) VALUES
('MySQL Security','When configured properly, MySQL ...');
CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
-CREATE FULLTEXT INDEX idx on fts_test (title, body);
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try LOCK=SHARED
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT;
SELECT * FROM fts_test WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
@@ -95,7 +94,6 @@ FTS_DOC_ID title body
1 MySQL Tutorial DBMS stands for DataBase ...
3 Optimizing MySQL In this tutorial we will show ...
drop index idx on fts_test;
-drop index FTS_DOC_ID_INDEX on fts_test;
CREATE FULLTEXT INDEX idx on fts_test (title, body);
SELECT * FROM fts_test WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
@@ -162,11 +160,15 @@ INSERT INTO articles (FTS_DOC_ID, title, body) VALUES
(14,'1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
(19, 'MySQL vs. YourSQL','In the following database comparison ...'),
(20, 'MySQL Security','When configured properly, MySQL ...');
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title),
-ADD FULLTEXT INDEX idx5 (title);
-ERROR HY000: InnoDB presently supports one FULLTEXT index creation at a time
-CREATE FULLTEXT INDEX idx on articles (title);
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title);
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ADD FULLTEXT INDEX idx3 (title), ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ADD FULLTEXT INDEX idx3 (title);
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release
ALTER TABLE articles ADD INDEX t20 (title(20)), LOCK=NONE;
ALTER TABLE articles DROP INDEX t20;
INSERT INTO articles (FTS_DOC_ID, title, body) VALUES
@@ -198,7 +200,7 @@ FTS_DOC_ID title body
DROP TABLE articles;
create table articles(`FTS_DOC_ID` serial,
`col32` timestamp not null,`col115` text) engine=innodb;
-create fulltext index `idx5` on articles(`col115`) ;
+create fulltext index `idx5` on articles(`col115`) ;
alter ignore table articles add primary key (`col32`) ;
drop table articles;
CREATE TABLE articles (
@@ -214,13 +216,9 @@ INSERT INTO articles VALUES
(5, 'MySQL vs. YourSQL','In the following database comparison ...'),
(6, 'MySQL Security','When configured properly, MySQL ...');
CREATE FULLTEXT INDEX idx on articles (title, body);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
DROP INDEX idx ON articles;
CREATE UNIQUE INDEX idx2 ON articles(id);
CREATE FULLTEXT INDEX idx on articles (title, body);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM articles WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
id title body
@@ -234,3 +232,15 @@ CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY,
f1 VARCHAR(200),FULLTEXT fidx(f1))engine=innodb;
ALTER TABLE t1 DROP index fidx, ADD FULLTEXT INDEX(f1);
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);
+DROP TABLE t1;
+#
+# MDEV-18152 Assertion 'num_fts_index <= 1' failed
+# in prepare_inplace_alter_table_dict
+#
+CREATE TABLE t1
+(a VARCHAR(128), b VARCHAR(128), FULLTEXT INDEX(a), FULLTEXT INDEX(b))
+ENGINE=InnoDB;
+ALTER TABLE t1 ADD c SERIAL;
+DROP TABLE t1;
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 731abad9198..36d3826be59 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
@@ -13,8 +13,6 @@ INSERT INTO articles (title,body) VALUES
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
CREATE FULLTEXT INDEX idx on articles (title, body);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM articles WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
id title body
@@ -105,8 +103,6 @@ INSERT INTO articles (title,body) VALUES
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
CREATE FULLTEXT INDEX idx on articles (title);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
CREATE FULLTEXT INDEX idx2 on articles (body);
SELECT * FROM articles WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result
index 8074260952a..94513831afd 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result
@@ -8,8 +8,6 @@ INSERT INTO t1 (a,b) VALUES
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -160,8 +158,6 @@ a VARCHAR(200),
b TEXT
) ENGINE = InnoDB;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...') ,
('How To Use MySQL Well','After you went through a ...'),
@@ -339,8 +335,6 @@ a VARCHAR(200),
b TEXT
) ENGINE = InnoDB;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...');
INSERT INTO t1 (a,b) VALUES
@@ -418,8 +412,6 @@ set names utf8;
"----------Test1---------"
create table t50 (s1 varchar(60) character set utf8 collate utf8_bin) engine = innodb;
create fulltext index i on t50 (s1);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
insert into t50 values ('ABCDE'),('FGHIJ'),('KLMNO'),('VÃÆ·WÄ°');
select * from t50 where match(s1) against ('VÃÆ·WÄ°');
s1
@@ -429,8 +421,6 @@ drop table t50;
create table t50 (s1 int unsigned primary key auto_increment, s2
varchar(60) character set utf8) engine = innodb;
create fulltext index i on t50 (s2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
insert into t50 (s2) values ('FGHIJ'),('KLMNO'),('VÃÆ·WÄ°'),('ABCDE');
select * from t50 order by s2;
s1 s2
@@ -443,8 +433,6 @@ drop table t50;
create table t50 (id int unsigned primary key auto_increment, s2
varchar(60) character set utf8) engine = innodb;
create fulltext index i on t50 (s2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
insert into t50 (s2) values ('FGHIJ'),('KLMNO'),('VÃÆ·WÄ°'),('ABCDE');
set @@autocommit=0;
update t50 set s2 = lower(s2);
@@ -468,8 +456,6 @@ set @@autocommit=1;
create table t50 (id int unsigned primary key auto_increment, s2
varchar(60) character set utf8) engine = innodb;
create fulltext index i on t50 (s2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
insert into t50 (s2) values ('FGHIJ'),('KLMNO'),('VÃÆ·WÄ°'),('ABCD*');
select * from t50 where match(s2) against ('abcd*' in natural language
mode);
@@ -505,8 +491,6 @@ INSERT INTO t1 (a,b) VALUES
('aab MySQL vs. YourSQL','In the following database comparison ...'),
('aaa MySQL Security','When configured properly, MySQL ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM t1 ORDER BY MATCH(a,b) AGAINST ('aac') DESC;
id a b
3 aac Optimizing MySQL In this tutorial we will show ...
@@ -554,8 +538,6 @@ INSERT INTO t1 (a,b) VALUES
('How To Use MySQL Well','After you went through a q ...abdd'),
('Optimizing MySQL','In this tutorial we will show ...abed');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -635,8 +617,6 @@ DROP TABLE t2,t1;
set names utf8;
CREATE TABLE t1 (s1 INT, s2 VARCHAR(200) CHARACTER SET UTF8 COLLATE UTF8_SPANISH_CI) ENGINE = InnoDB;
CREATE FULLTEXT INDEX i ON t1 (s2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 VALUES (1,'aaCen'),(2,'aaCha'),(3,'aaCio'),(4,'aaçen'),(5,'aaçha'),(6,'aaçio');
SELECT * FROM t1 WHERE MATCH(s2) AGAINST ('aach*' IN BOOLEAN MODE);
s1 s2
@@ -654,8 +634,6 @@ DROP TABLE t1;
"----------Test14---------"
CREATE TABLE t1(s1 INT , s2 VARCHAR(100) CHARACTER SET sjis) ENGINE = InnoDB;
CREATE FULLTEXT INDEX i ON t1 (s2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 VALUES (1,'ペペペ'),(2,'テテテ'),(3,'ルルル'),(4,'グググ');
DROP TABLE t1;
"----------Test15---------"
@@ -670,8 +648,6 @@ LLLL
ÅÅÅÅ ÅÅÅÅ
CREATE TABLE t2 (s1 VARCHAR(60) CHARACTER SET UTF8 COLLATE UTF8_POLISH_CI) ENGINE = InnoDB;
CREATE FULLTEXT INDEX i ON t2 ( s1);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t2 VALUES
('a'),('b'),('c'),('d'),('ÅÅÅÅ'),('LLLL'),(NULL),('ÅÅÅÅ ÅÅÅÅ'),('LLLLLLLL');
SELECT * FROM t2 WHERE MATCH(s1) AGAINST ('LLLL' COLLATE UTF8_UNICODE_520_CI);
@@ -681,8 +657,6 @@ DROP TABLE t1,t2;
"----------Test16---------"
CREATE TABLE t1 (s1 INT, s2 VARCHAR(50) CHARACTER SET UTF8) ENGINE = InnoDB;
CREATE FULLTEXT INDEX i ON t1(s2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 VALUES (2, 'ğė Daśi p ');
SELECT * FROM t1 WHERE MATCH(s2) AGAINST ('+p +"ğė Daśi*"' IN BOOLEAN MODE);
s1 s2
@@ -691,8 +665,6 @@ DROP TABLE t1;
CREATE TABLE t1 ( id INT , char_column VARCHAR(60) CHARACTER SET UTF8) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,'İóëɠ');
CREATE FULLTEXT INDEX i ON t1 (char_column);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM t1 WHERE MATCH(char_column) AGAINST ('"İóëɠ"' IN BOOLEAN MODE);
id char_column
1 İóëɠ
@@ -702,8 +674,6 @@ CREATE TABLE t1 ( id INT , char_column VARCHAR(60) CHARACTER SET UTF32, char_col
INSERT INTO t1 (char_column) VALUES ('abcde'),('fghij'),('klmno'),('qrstu');
UPDATE t1 SET char_column2 = char_column;
CREATE FULLTEXT INDEX i ON t1 (char_column2);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM t1 WHERE MATCH(char_column) AGAINST ('abc*' IN BOOLEAN MODE);
ERROR HY000: Can't find FULLTEXT index matching the column list
DROP TABLE t1;
@@ -711,18 +681,14 @@ DROP TABLE t1;
CREATE TABLE t1 ( id INT , char_column VARCHAR(60) CHARACTER SET UTF8) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,'aaa'),(2,'bbb'),(3,'ccc');
CREATE FULLTEXT INDEX i ON t1 (char_column);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
HANDLER t1 OPEN;
HANDLER t1 READ i = ('aaa');
-id char_column
+ERROR HY000: FULLTEXT index `i` does not support this operation
DROP TABLE t1;
"----------Test25---------"
CREATE TABLE t1 ( id INT , char_column VARCHAR(60) CHARACTER SET UTF8 COLLATE UTF8_CROATIAN_CI) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,'LJin'),(2,'ljin'),(3,'lmin'),(4,'LJLJLJLJLJ');
CREATE FULLTEXT INDEX i ON t1 (char_column);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT count(*) FROM t1 WHERE MATCH (char_column) AGAINST ('lj*' IN BOOLEAN MODE);
count(*)
3
@@ -966,8 +932,6 @@ INSERT INTO t1 (a,b) VALUES
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -1041,8 +1005,6 @@ INSERT INTO t1 VALUES
(2, 'How To Use MySQL Well','After you went through a ...'),
(3, 'Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
ALTER TABLE t1 ADD UNIQUE INDEX (`id`);
SELECT id FROM t1 WHERE MATCH (a,b)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
@@ -1073,8 +1035,6 @@ INSERT INTO t1 VALUES
(2, 'How To Use MySQL Well','After you went through a ...'),
(3, 'Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD UNIQUE INDEX (`id`), ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT id FROM t1 WHERE MATCH (a,b)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
id
@@ -1168,8 +1128,6 @@ INSERT INTO t1 (a,b) VALUES
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
COMMIT WORK AND CHAIN;
INSERT INTO t1 (a,b) VALUES
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
@@ -1430,3 +1388,8 @@ SELECT * FROM t1 WHERE MATCH (a) AGAINST ('+"good database"' IN BOOLEAN MODE);
id a
1 know mysql good database
DROP TABLE t1;
+CREATE TABLE t1(f1 TEXT, FULLTEXT KEY(f1))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(repeat("this is the test case", 500));
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
index b76784d4ffd..aec3d7f777d 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
@@ -473,8 +473,6 @@ INSERT INTO t1 (a,b) VALUES
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -666,8 +664,6 @@ INSERT INTO t1 (a,b) VALUES
('Trial version','query performace @1255 minute on 2.1Hz Memory 2GB...') ,
('when To Use MySQL Well','for free faq mail@xyz.com ...');
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM t1 WHERE MATCH(a,b) AGAINST ("вредит χωÏὶς") ORDER BY id;
id a b
1 Я могу еÑÑ‚ÑŒ Ñтекло оно мне не вредит
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result b/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result
index b0f7d7727d6..a6dfc2d4b4a 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result
@@ -9,8 +9,6 @@ INSERT INTO t1 (a,b) VALUES
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...');
ALTER TABLE t1 ADD FULLTEXT INDEX idx_1 (a);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
ALTER TABLE t1 ADD FULLTEXT INDEX idx_2 (b);
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result
index b7688e9ef0f..dc71156b7a1 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result
@@ -67,8 +67,6 @@ INSERT INTO articles (title, body) VALUES
('1001 MySQL Tricks','How to use full-text search engine'),
('Go MySQL Tricks','How to use full text search engine');
ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
id title body
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result b/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result
index ca9a57dc3e7..d67981e0851 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result
@@ -5,8 +5,6 @@ a VARCHAR(200),
b TEXT
) ENGINE= InnoDB;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
@@ -111,8 +109,6 @@ INSERT INTO t1 (a,b) VALUES
('when To Use MySQL Well','After that you went through a ...'),
('where will Optimizing MySQL','what In this tutorial we will show ...');
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL Tutorial','request docteam@oraclehelp.com ...') ,
('Trial version','query performace @1255 minute on 2.1Hz Memory 2GB...'),
@@ -148,8 +144,6 @@ INSERT INTO t1 (a,b,c) VALUES (repeat("b", 19000), 'XYZ, long text', 'very lon
INSERT INTO t1 (a,b,c) VALUES (repeat("b", 19000), 'XYZ, very little long blob very much blob', 'very long blob');
INSERT INTO t1 (a,b,c) VALUES (repeat("b", 19000),"very 租车 ä¾› blob","new 供需分æžinformation");
CREATE FULLTEXT INDEX idx on t1 (a,b,c);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b,c) VALUES (repeat("x", 19000), 'new, long text', 'very new blob');
INSERT INTO t1 (a,b,c) VALUES ('interesting, long text', repeat("x", 19000), 'very very good new blob');
SELECT count(*) FROM t1
@@ -191,8 +185,6 @@ b TEXT
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for + DataBase ...');
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('"stands database"@3' IN BOOLEAN MODE);
@@ -208,8 +200,6 @@ c TEXT
INSERT INTO t1 (a,b,c) VALUES (repeat("b", 19000), 'XYZ, long text', 'very long blob');
INSERT INTO t1 (a,b,c) VALUES ('XYZ, 租车 very little long blob very much blob', repeat("b", 19000), 'very long but smaller blob');
CREATE FULLTEXT INDEX idx on t1 (a,b,c);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
DELETE FROM t1;
INSERT INTO t1 (a,b,c) VALUES (repeat("b", 19000), 'XYZ, long text', 'very long blob');
INSERT INTO t1 (a,b,c) VALUES ('XYZ, 租车 very little long blob is a very much longer blob', repeat("b", 19000), 'this is very long but smaller blob');
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result b/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result
index 40a38e62a1e..61eb5294463 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result
@@ -4,8 +4,6 @@ a VARCHAR(200),
b TEXT
) ENGINE= InnoDB;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result b/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
index 6f5409f63cd..fc6a1d1afe7 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
@@ -5,8 +5,6 @@ a VARCHAR(200),
b TEXT
) ENGINE = InnoDB STATS_PERSISTENT=0;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
@@ -128,8 +126,6 @@ a VARCHAR(200),
b TEXT
) ENGINE = InnoDB;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
@@ -241,8 +237,6 @@ a VARCHAR(200),
b TEXT
) ENGINE = InnoDB;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
@@ -328,8 +322,6 @@ INSERT INTO t1 (a,b) VALUES
connect con2,localhost,root,,;
SET NAMES UTF8;
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
connection con1;
SELECT * FROM t1
WHERE MATCH (a,b)
@@ -546,8 +538,6 @@ select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
@@ -663,8 +653,6 @@ select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
@@ -810,8 +798,6 @@ select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
@@ -932,8 +918,6 @@ select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result
index 8ef2ac425fc..f1110797f33 100644
--- a/mysql-test/suite/innodb_fts/r/misc_debug.result
+++ b/mysql-test/suite/innodb_fts/r/misc_debug.result
@@ -7,7 +7,7 @@ FULLTEXT (title,body)
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail";
CREATE FULLTEXT INDEX idx ON articles(body);
-ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
+ERROR HY000: Out of memory.
SET SESSION debug_dbug=@saved_debug_dbug;
ALTER TABLE articles STATS_PERSISTENT=DEFAULT;
DROP TABLE articles;
diff --git a/mysql-test/suite/innodb_fts/r/sync_ddl.result b/mysql-test/suite/innodb_fts/r/sync_ddl.result
index 1e98594b28e..441954dc77b 100644
--- a/mysql-test/suite/innodb_fts/r/sync_ddl.result
+++ b/mysql-test/suite/innodb_fts/r/sync_ddl.result
@@ -3,8 +3,6 @@ id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
value VARCHAR(1024)
) ENGINE=InnoDB;
CREATE FULLTEXT INDEX idx1 ON t1(value);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SET @save_debug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_sync_before_syncing,ib_trunc_sleep_before_fts_cache_clear';
INSERT INTO t1 (value) VALUES
@@ -18,8 +16,6 @@ id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
value VARCHAR(1024)
) ENGINE=InnoDB;
CREATE FULLTEXT INDEX idx1 ON t1(value);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_write_words_before_select_index,ib_trunc_sleep_before_fts_cache_clear';
INSERT INTO t1 (value) VALUES
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
@@ -39,8 +35,6 @@ CREATE TABLE t1 (
value VARCHAR(1024)
) ENGINE=InnoDB;
CREATE FULLTEXT INDEX idx1 ON t1(value);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
INSERT INTO t1 (value) VALUES
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
@@ -60,8 +54,6 @@ CREATE TABLE t1 (
value VARCHAR(1024)
) ENGINE=InnoDB;
CREATE FULLTEXT INDEX idx1 ON t1(value);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
INSERT INTO t1 (value) VALUES
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
@@ -83,8 +75,6 @@ CREATE TABLE t1 (
value VARCHAR(1024)
) ENGINE=InnoDB;
CREATE FULLTEXT INDEX idx1 ON t1(value);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
INSERT INTO t1 (value) VALUES
('example, a column that uses the latin1 character'),
@@ -100,8 +90,6 @@ id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
value VARCHAR(1024)
) ENGINE=InnoDB;
CREATE FULLTEXT INDEX idx1 ON t1(value);
-Warnings:
-Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
INSERT INTO t1 (value) VALUES
('example, a column that uses the latin1 character'),
diff --git a/mysql-test/suite/innodb_fts/t/fulltext2.test b/mysql-test/suite/innodb_fts/t/fulltext2.test
index 6529630b01e..4dd2c78827f 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext2.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext2.test
@@ -7,9 +7,6 @@
#
--source include/have_innodb.inc
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
CREATE TABLE t1 (
i int(10) unsigned not null auto_increment primary key,
diff --git a/mysql-test/suite/innodb_fts/t/fulltext_var.test b/mysql-test/suite/innodb_fts/t/fulltext_var.test
index 03eab7e8557..2b94aa58424 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext_var.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext_var.test
@@ -3,15 +3,6 @@
#
--source include/have_innodb.inc
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB 5.6.10 or earlier
-}
-
# Save ft_boolean_syntax variable
let $saved_ft_boolean_syntax=`select @@global.ft_boolean_syntax`;
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
index cd292803fb3..cca110f3550 100644
--- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
@@ -18,14 +18,17 @@ INSERT INTO fts_test (title,body) VALUES
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
+# Table does rebuild when fts index builds for the first time
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
+
# Create the FTS index
-CREATE FULLTEXT INDEX idx on fts_test (title, body);
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=INPLACE;
# Select word "tutorial" in the table
SELECT * FROM fts_test WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
-
# Drop the FTS idx
DROP INDEX idx ON fts_test;
@@ -38,9 +41,8 @@ INSERT INTO fts_test (title,body) VALUES
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
-
-# Recreate the FTS index
-CREATE FULLTEXT INDEX idx on fts_test (title, body);
+# FTS_DOC_ID hidden column and FTS_DOC_ID index exist
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
# Select word "tutorial" in the table
SELECT * FROM fts_test WHERE MATCH (title, body)
@@ -81,8 +83,6 @@ CREATE TABLE fts_test (
body TEXT
) ENGINE=InnoDB;
-create unique index FTS_DOC_ID_INDEX on fts_test(FTS_DOC_ID);
-
# Insert six rows
INSERT INTO fts_test (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...') ,
@@ -97,7 +97,7 @@ INSERT INTO fts_test (title,body) VALUES
# column already exists. This has not been implemented yet.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE;
-CREATE FULLTEXT INDEX idx on fts_test (title, body);
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE;
@@ -117,8 +117,6 @@ SELECT * FROM fts_test WHERE MATCH (title, body)
# Drop the FTS_DOC_ID_INDEX and try again
drop index idx on fts_test;
-drop index FTS_DOC_ID_INDEX on fts_test;
-
CREATE FULLTEXT INDEX idx on fts_test (title, body);
SELECT * FROM fts_test WHERE MATCH (title, body)
@@ -195,12 +193,13 @@ INSERT INTO articles (FTS_DOC_ID, title, body) VALUES
(19, 'MySQL vs. YourSQL','In the following database comparison ...'),
(20, 'MySQL Security','When configured properly, MySQL ...');
---error ER_INNODB_FT_LIMIT
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title),
- ADD FULLTEXT INDEX idx5 (title);
-
-CREATE FULLTEXT INDEX idx on articles (title);
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ ADD FULLTEXT INDEX idx3 (title), ALGORITHM=INPLACE;
+--enable_info
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ ADD FULLTEXT INDEX idx3 (title);
+--disable_info
ALTER TABLE articles ADD INDEX t20 (title(20)), LOCK=NONE;
ALTER TABLE articles DROP INDEX t20;
@@ -231,7 +230,7 @@ DROP TABLE articles;
create table articles(`FTS_DOC_ID` serial,
`col32` timestamp not null,`col115` text) engine=innodb;
-create fulltext index `idx5` on articles(`col115`) ;
+create fulltext index `idx5` on articles(`col115`) ;
alter ignore table articles add primary key (`col32`) ;
@@ -278,3 +277,20 @@ CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY,
f1 VARCHAR(200),FULLTEXT fidx(f1))engine=innodb;
ALTER TABLE t1 DROP index fidx, ADD FULLTEXT INDEX(f1);
DROP TABLE t1;
+
+# Add more than one FTS index
+CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);
+
+# Cleanup
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-18152 Assertion 'num_fts_index <= 1' failed
+--echo # in prepare_inplace_alter_table_dict
+--echo #
+CREATE TABLE t1
+(a VARCHAR(128), b VARCHAR(128), FULLTEXT INDEX(a), FULLTEXT INDEX(b))
+ENGINE=InnoDB;
+ALTER TABLE t1 ADD c SERIAL;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
index d1c6063d524..d17ebecb0b6 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
@@ -641,6 +641,7 @@ CREATE TABLE t1 ( id INT , char_column VARCHAR(60) CHARACTER SET UTF8) ENGINE =
INSERT INTO t1 VALUES (1,'aaa'),(2,'bbb'),(3,'ccc');
CREATE FULLTEXT INDEX i ON t1 (char_column);
HANDLER t1 OPEN;
+--error ER_KEY_DOESNT_SUPPORT
HANDLER t1 READ i = ('aaa');
DROP TABLE t1;
#23. Duplicate key error when there are no unique indexes (procedure test)
@@ -1333,3 +1334,11 @@ INSERT INTO t1 (a) VALUES
SELECT * FROM t1 WHERE MATCH (a) AGAINST ('+"good database"' IN BOOLEAN MODE);
DROP TABLE t1;
+
+# MDEV-19974 InnoDB: Cannot load compressed BLOB
+CREATE TABLE t1(f1 TEXT, FULLTEXT KEY(f1))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(repeat("this is the test case", 500));
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_multiple_index.test b/mysql-test/suite/innodb_fts/t/innodb_fts_multiple_index.test
index 012881173e0..c8293655d1b 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_multiple_index.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_multiple_index.test
@@ -25,7 +25,7 @@ ALTER TABLE t1 ADD FULLTEXT INDEX idx_1 (a);
ALTER TABLE t1 ADD FULLTEXT INDEX idx_2 (b);
EVAL SHOW CREATE TABLE t1;
-# check mutiple index with transaction
+# check multiple index with transaction
START TRANSACTION;
# Insert rows
INSERT INTO t1 (a,b) VALUES
diff --git a/mysql-test/suite/innodb_gis/r/0.result b/mysql-test/suite/innodb_gis/r/0.result
index eeeb5fe423b..ffe423005d2 100644
--- a/mysql-test/suite/innodb_gis/r/0.result
+++ b/mysql-test/suite/innodb_gis/r/0.result
@@ -507,8 +507,8 @@ down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersects
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
diff --git a/mysql-test/suite/innodb_gis/r/1.result b/mysql-test/suite/innodb_gis/r/1.result
index 67ce2de26b2..bc1d9a4f4d7 100644
--- a/mysql-test/suite/innodb_gis/r/1.result
+++ b/mysql-test/suite/innodb_gis/r/1.result
@@ -681,7 +681,7 @@ def test t1 t1 g g 255 4294967295 0 Y 144 0 63
g
select ST_asbinary(g) from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def ST_asbinary(g) 252 4294967295 0 Y 128 0 63
+def ST_asbinary(g) 251 4294967295 0 Y 128 0 63
ST_asbinary(g)
drop table t1;
create table t1 (a TEXT, b GEOMETRY NOT NULL, INDEX(b(5)));
@@ -796,11 +796,15 @@ POINT(1 1)
drop function fn3;
create table t1(pt POINT);
alter table t1 add primary key pti(pt);
+Warnings:
+Warning 1280 Name 'pti' ignored for PRIMARY key.
drop table t1;
create table t1(pt GEOMETRY);
alter table t1 add primary key pti(pt);
ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length
alter table t1 add primary key pti(pt(20));
+Warnings:
+Warning 1280 Name 'pti' ignored for PRIMARY key.
drop table t1;
create table t1 select ST_GeomFromText('point(1 1)');
desc t1;
@@ -868,8 +872,8 @@ down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRequals FROM t1 a1 JOIN t1 a2 ON MBREquals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
MBRequals
center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersects
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRoverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
MBRoverlaps
@@ -996,9 +1000,7 @@ ST_GEOMFROMTEXT(
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'));
# must not crash
SELECT 1 FROM t1 WHERE a <> (SELECT ST_GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
-1
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x06\x00\x00\x00\x01\x00\x00\x00\x01\x03\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\...'
+ERROR HY000: Illegal parameter data types int and geometry for operation '<>'
DROP TABLE t1;
#
# Bug #49250 : spatial btree index corruption and crash
@@ -1026,9 +1028,9 @@ f5 datetime YES NULL
drop view v1;
drop table t1;
SELECT MultiPoint(12345,'');
-ERROR 22007: Illegal non geometric '12345' value found during parsing
+ERROR HY000: Illegal parameter data type int for operation 'geometrycollection'
SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
-ERROR 22007: Illegal non geometric ''00000'' value found during parsing
+ERROR HY000: Illegal parameter data type varchar for operation 'geometrycollection'
#
# BUG#51875: crash when loading data into geometry function ST_polyfromwkb
#
@@ -1092,7 +1094,7 @@ ST_ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)))
# GEOMETRY FUNCTION ARGUMENTS
#
SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
-ERROR 22007: Illegal non geometric '' value found during parsing
+ERROR HY000: Illegal parameter data type bigint for operation 'geometrycollection'
End of 5.1 tests
#
# Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
@@ -1105,11 +1107,7 @@ FLUSH TABLES;
SELECT 1 FROM g1
FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
;
-1
-Warnings:
-Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?'
-Warning 1441 Datetime function: datetime field overflow
-Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\x00@'
+ERROR HY000: Illegal parameter data types geometry and datetime for operation '='
DROP TABLE g1;
#
# Bug#13013970 MORE CRASHES IN FIELD_BLOB::GET_KEY_IMAGE
@@ -1495,5 +1493,4 @@ DROP DATABASE gis_ogs;
# Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE
#
SELECT ST_Union('', ''), md5(1);
-ST_Union('', '') md5(1)
-NULL c4ca4238a0b923820dcc509a6f75849b
+ERROR HY000: Illegal parameter data type varchar for operation 'st_union'
diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
index bef144e6072..9bf4ae6cd06 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -287,6 +287,9 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab where c1 = c2;
+ERROR HY000: Illegal parameter data types int and geometry for operation '='
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
+CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab;
INSERT INTO temp_tab SELECT * FROM tab;
CREATE SPATIAL INDEX idx2 ON temp_tab(c2);
CREATE SPATIAL INDEX idx3 ON temp_tab(c3);
@@ -480,16 +483,55 @@ info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tab MODIFY COLUMN c2 GEOMETRY NOT NULL;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE tab MODIFY COLUMN c3 POLYGON NOT NULL;
+affected rows: 10
+info: Records: 10 Duplicates: 0 Warnings: 0
+ALTER TABLE tab add COLUMN c7 POINT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tab add COLUMN c8 POINT NOT NULL, ALGORITHM = INPLACE, LOCK=NONE;
+SELECT HEX(c8) FROM tab;
+HEX(c8)
+
+
+
+
+
+
+
+
+
+
+BEGIN;
+INSERT INTO tab SELECT 0,c2,c3,c4,c5,
+ST_GeomFromText('POINT(67 89)'),ST_GeomFromText('POINT(67 89)')
+FROM tab LIMIT 1;
+SELECT HEX(c8) FROM tab;
+HEX(c8)
+0000000001010000000000000000C050400000000000405640
+
+
+
+
+
+
+
+
+
+
+ROLLBACK;
+ALTER TABLE tab add COLUMN c9 POINT NOT NULL AFTER c5, ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
SHOW CREATE TABLE tab;
Table Create Table
tab CREATE TABLE `tab` (
`c1` int(11) NOT NULL,
`c2` geometry NOT NULL,
- `c3` linestring NOT NULL,
+ `c3` polygon NOT NULL,
`c4` polygon NOT NULL,
`c5` geometry NOT NULL,
+ `c7` point NOT NULL,
+ `c8` point NOT NULL,
PRIMARY KEY (`c1`),
SPATIAL KEY `idx2` (`c2`),
SPATIAL KEY `idx3` (`c3`),
@@ -522,9 +564,11 @@ Table Create Table
tab CREATE TABLE `tab` (
`c1` int(11) NOT NULL,
`c2` geometry NOT NULL,
- `c3` linestring NOT NULL,
+ `c3` polygon NOT NULL,
`c4` geometry NOT NULL,
`c5` geometry NOT NULL,
+ `c7` point NOT NULL,
+ `c8` point NOT NULL,
PRIMARY KEY (`c1`),
SPATIAL KEY `idx2` (`c2`),
SPATIAL KEY `idx3` (`c3`),
@@ -568,8 +612,8 @@ ALTER TABLE tab MODIFY COLUMN c2 POINT NOT NULL;
affected rows: 8
info: Records: 8 Duplicates: 0 Warnings: 0
ALTER TABLE tab MODIFY COLUMN c3 LINESTRING NOT NULL;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
ALTER TABLE tab MODIFY COLUMN c4 POLYGON NOT NULL;
affected rows: 8
info: Records: 8 Duplicates: 0 Warnings: 0
@@ -581,6 +625,8 @@ tab CREATE TABLE `tab` (
`c3` linestring NOT NULL,
`c4` polygon NOT NULL,
`c5` geometry NOT NULL,
+ `c7` point NOT NULL,
+ `c8` point NOT NULL,
PRIMARY KEY (`c1`),
SPATIAL KEY `idx2` (`c2`),
SPATIAL KEY `idx3` (`c3`),
@@ -740,16 +786,16 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p);
ALTER TABLE t1 FORCE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
DROP TABLE t1;
-create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
insert into t1 values(default);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION(POINT(0 0),POINT(1 1))' for column `test`.`t1`.`p` at row 1
drop table t1;
SET timestamp=default;
-create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
alter table t1 add column i int;
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION(POINT(0 0),POINT(1 1))' for column `test`.`t1`.`p` at row 1
drop table t1;
SET timestamp=default;
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb_gis/r/create_spatial_index.result b/mysql-test/suite/innodb_gis/r/create_spatial_index.result
index 80632affb67..1af03c251bf 100644
--- a/mysql-test/suite/innodb_gis/r/create_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/create_spatial_index.result
@@ -1241,13 +1241,15 @@ Table Op Msg_type Msg_text
test.tab check status OK
DROP TABLE tab;
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(c1 > 0) ) ENGINE=InnoDB;
+ERROR HY000: Illegal parameter data types geometry and int for operation '>'
+CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(CAST(c1 AS BINARY) > 0) ) ENGINE=InnoDB;
CREATE SPATIAL INDEX idx1 ON tab(c1) ;
SHOW CREATE TABLE tab;
Table Create Table
tab CREATE TABLE `tab` (
`c1` point NOT NULL,
SPATIAL KEY `idx1` (`c1`),
- CONSTRAINT `tab_const` CHECK (`c1` > 0)
+ CONSTRAINT `tab_const` CHECK (cast(`c1` as char charset binary) > 0)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW INDEX FROM tab;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
diff --git a/mysql-test/suite/innodb_gis/r/geometry.result b/mysql-test/suite/innodb_gis/r/geometry.result
index a54d41dc30a..70e0f04cdf1 100644
--- a/mysql-test/suite/innodb_gis/r/geometry.result
+++ b/mysql-test/suite/innodb_gis/r/geometry.result
@@ -362,6 +362,8 @@ c7 geometrycollection YES NULL
c8 geometry YES UNI NULL
#add primary key
ALTER TABLE tab ADD PRIMARY KEY pk2(c8(5));
+Warnings:
+Warning 1280 Name 'pk2' ignored for PRIMARY key.
#check columns
SHOW FIELDS FROM tab;
Field Type Null Key Default Extra
@@ -533,13 +535,9 @@ ST_AsText(a.c2) ST_AsText(b.c2)
LINESTRING(10 10,20 20,30 30) LINESTRING(10 10,20 20,30 30)
#check DELETE stmt with Where clause and a constant predicate
DELETE FROM tab
-Where c8=c8=ST_GeometryFromWKB(ST_AsWKB(ST_GeomCollFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))')));
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x07\x00\x00\x00\x02\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00...'
-#check the data, should 0
-SELECT COUNT(*) FROM tab;
-COUNT(*)
-1
+WHERE c8=ST_GeometryFromWKB(ST_AsWKB(ST_GeomCollFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))')));
+SELECT * FROM tab;
+c0 c2 c3 c4 c5 c6 c7 c8
#check UPDATE stmt with Where clause and a constant predicate
SET @c8=ST_GeomCollFromText('GeometryCollection(Point(10 10),LineString(20 20, 30 30))');
UPDATE tab2 SET c8=@c8
@@ -1097,6 +1095,8 @@ ERROR 42000: The storage engine for the table doesn't support GEOMETRY
#check start transaction commit & Rollback
START TRANSACTION;
DELETE FROM tab3;
+SELECT * FROM tab3;
+c1 c2 c3 C4 c5 c6 c7 c8
ROLLBACK;
SELECT COUNT(*) FROM tab3;
COUNT(*)
@@ -1104,9 +1104,8 @@ COUNT(*)
START TRANSACTION;
DELETE FROM tab3;
COMMIT;
-SELECT COUNT(*) FROM tab3;
-COUNT(*)
-0
+SELECT * FROM tab3;
+c1 c2 c3 C4 c5 c6 c7 c8
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point;
DROP TABLE gis_multi_line, gis_multi_polygon;
DROP TABLE gis_geometrycollection, gis_geometry;
diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result
index 33e0c1c0410..2725b7cc8ed 100644
--- a/mysql-test/suite/innodb_gis/r/gis.result
+++ b/mysql-test/suite/innodb_gis/r/gis.result
@@ -681,7 +681,7 @@ def test t1 t1 g g 255 4294967295 0 Y 144 0 63
g
select ST_asbinary(g) from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def ST_asbinary(g) 252 4294967295 0 Y 128 0 63
+def ST_asbinary(g) 251 4294967295 0 Y 128 0 63
ST_asbinary(g)
drop table t1;
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
@@ -792,11 +792,15 @@ POINT(1 1)
drop function fn3;
create table t1(pt POINT);
alter table t1 add primary key pti(pt);
+Warnings:
+Warning 1280 Name 'pti' ignored for PRIMARY key.
drop table t1;
create table t1(pt GEOMETRY);
alter table t1 add primary key pti(pt);
ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length
alter table t1 add primary key pti(pt(20));
+Warnings:
+Warning 1280 Name 'pti' ignored for PRIMARY key.
drop table t1;
create table t1 select ST_GeomFromText('point(1 1)');
desc t1;
@@ -864,8 +868,8 @@ down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRequals FROM t1 a1 JOIN t1 a2 ON MBREquals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
MBRequals
center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersects
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRoverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
MBRoverlaps
@@ -992,9 +996,7 @@ ST_GEOMFROMTEXT(
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'));
# must not crash
SELECT 1 FROM t1 WHERE a <> (SELECT ST_GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
-1
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x06\x00\x00\x00\x01\x00\x00\x00\x01\x03\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\...'
+ERROR HY000: Illegal parameter data types int and geometry for operation '<>'
DROP TABLE t1;
#
# Bug #49250 : spatial btree index corruption and crash
@@ -1022,9 +1024,9 @@ f5 datetime YES NULL
drop view v1;
drop table t1;
SELECT MultiPoint(12345,'');
-ERROR 22007: Illegal non geometric '12345' value found during parsing
+ERROR HY000: Illegal parameter data type int for operation 'geometrycollection'
SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
-ERROR 22007: Illegal non geometric ''00000'' value found during parsing
+ERROR HY000: Illegal parameter data type varchar for operation 'geometrycollection'
#
# BUG#51875: crash when loading data into geometry function ST_polyfromwkb
#
@@ -1093,7 +1095,7 @@ ST_ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)))
# GEOMETRY FUNCTION ARGUMENTS
#
SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
-ERROR 22007: Illegal non geometric '' value found during parsing
+ERROR HY000: Illegal parameter data type bigint for operation 'geometrycollection'
End of 5.1 tests
#
# Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
@@ -1106,11 +1108,7 @@ FLUSH TABLES;
SELECT 1 FROM g1
FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
;
-1
-Warnings:
-Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?'
-Warning 1441 Datetime function: datetime field overflow
-Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\x00@'
+ERROR HY000: Illegal parameter data types geometry and datetime for operation '='
DROP TABLE g1;
#
# Bug#13013970 MORE CRASHES IN FIELD_BLOB::GET_KEY_IMAGE
@@ -1487,5 +1485,4 @@ DROP DATABASE gis_ogs;
# Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE
#
SELECT ST_Union('', ''), md5(1);
-ST_Union('', '') md5(1)
-NULL c4ca4238a0b923820dcc509a6f75849b
+ERROR HY000: Illegal parameter data type varchar for operation 'st_union'
diff --git a/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result b/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result
index 82e7cb84275..97dc96e1b03 100644
--- a/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result
+++ b/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result
@@ -308,403 +308,403 @@ fid AsText(g)
56 LINESTRING(41 41,50 50)
45 LINESTRING(51 51,60 60)
55 LINESTRING(41 51,50 60)
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 10 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 9 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 8 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 7 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 6 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 5 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 4 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 3 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 2 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 1 * 10 - 9), 0)));
SELECT count(*) FROM t2;
count(*)
100
@@ -1613,23 +1613,17 @@ DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a));
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
+ERROR HY000: Illegal parameter data type int for operation 'st_contains'
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
+ERROR HY000: Illegal parameter data type decimal for operation 'st_contains'
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
+ERROR HY000: Illegal parameter data type double for operation 'st_contains'
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
+ERROR HY000: Illegal parameter data type time for operation 'st_contains'
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
+ERROR HY000: Illegal parameter data type date for operation 'st_contains'
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
+ERROR HY000: Illegal parameter data type datetime for operation 'st_contains'
DROP TABLE t1;
#
# End of 10.1 tests
diff --git a/mysql-test/suite/innodb_gis/r/point_basic.result b/mysql-test/suite/innodb_gis/r/point_basic.result
index ac9deef2cfd..8322539475a 100644
--- a/mysql-test/suite/innodb_gis/r/point_basic.result
+++ b/mysql-test/suite/innodb_gis/r/point_basic.result
@@ -1503,7 +1503,7 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`child` with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near 'FOREIGN KEY(p) REFERENCES parent(p)'.
Error 1005 Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `child`
ALTER TABLE parent DROP INDEX idx1;
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
Got one of the listed errors
@@ -1511,7 +1511,7 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`child` with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near 'FOREIGN KEY(p) REFERENCES parent(p)'.
Error 1005 Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `child`
ALTER TABLE child DROP INDEX idx2;
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
Got one of the listed errors
@@ -1519,7 +1519,7 @@ show warnings;
Level Code Message
Warning 150 Alter table `test`.`child` with foreign key constraint failed. There is only prefix index in the referenced table where the referenced columns appear as the first columns near 'FOREIGN KEY(p) REFERENCES parent(p)'.
Error 1005 Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
-Warning 1215 Cannot add foreign key constraint
+Warning 1215 Cannot add foreign key constraint for `child`
DROP TABLE child, parent;
#
# Bug#28763: Selecting geometry fields in UNION caused server crash.
diff --git a/mysql-test/suite/innodb_gis/r/precise.result b/mysql-test/suite/innodb_gis/r/precise.result
index 9d6538bc3ed..3c05b814602 100644
--- a/mysql-test/suite/innodb_gis/r/precise.result
+++ b/mysql-test/suite/innodb_gis/r/precise.result
@@ -216,8 +216,7 @@ st_u
MULTIPOLYGON(((525400 18370,525000.9677614468 183300,525400 183300,525400 18370)),((525000 183300,525000 183700,525000.9677614468 183300,525000 183300)),((525265.58 183481.95,525263.95 183484.75,525260.7 183491.55,525276.79 183500,525278.39 183500.84,525278.63 183500.97,525280.98 183502.26,525283.17 183503.47,525289.11 183506.62,525296.42 183510.31,525296.57 183510.39,525298.67 183511.53,525302.81 183513.8,525304.5 183510.83,525307.85 183504.95,525304.45 183504.25,525301.75 183509.35,525283.55 183500,525282.2 183499.3,525282.3 183499.1,525280.35 183498.2,525275.5 183495.7,525276.5 183493.45,525278.97 183488.73,525265.58 183481.95),(525266.99 183484.33,525263.26 183491.55,525266.15 183493.04,525269.88 183485.82,525266.99 183484.33),(525272.06 183488.37,525268.94 183494.51,525271.94 183496.03,525275.06 183489.89,525272.06 183488.37)))
SET @a=0x0000000001030000000200000005000000000000000000000000000000000000000000000000002440000000000000000000000000000024400000000000002440000000000000000000000000000024400000000000000000000000000000000000000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F;
SELECT ST_ASTEXT(ST_TOUCHES(@a, ST_GEOMFROMTEXT('point(0 0)'))) t;
-t
-NULL
+ERROR HY000: Illegal parameter data type int for operation 'st_astext'
DROP TABLE IF EXISTS p1;
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
BEGIN
diff --git a/mysql-test/suite/innodb_gis/r/rollback.result b/mysql-test/suite/innodb_gis/r/rollback.result
index 36a39902ca9..8688690b66a 100644
--- a/mysql-test/suite/innodb_gis/r/rollback.result
+++ b/mysql-test/suite/innodb_gis/r/rollback.result
@@ -378,7 +378,6 @@ INSERT INTO t4 (c2, c1, c3, spatial_point) VALUES
rollback;
DROP TABLE t4;
SET GLOBAL innodb_file_per_table='on';
-SET GLOBAL innodb_file_format='Barracuda';
create table t1(i int primary key,
a geometry not null, spatial index(a)) row_format=dynamic engine=innodb;
insert into t1 values(1, st_geomfromtext(concat('multilinestring(','(-4286 -5983,52762 -5983,52762 79876,-4286 79876,-4286 -5983)',',','(-4286 -5983,52762 -5983,52762 79876,-4286 79876,-4286 -5983)',',','(-768 -136,-771 2864,-772 2860,-777 2862,-775 2858,-775 2863,-770 2866,-765 2871,-761 2874,-759 2878,-759 2883,-759 2886,-758 2886,-758 2886,-755 2890,-752 2890,-751 2890,1249 2890,1250 2892,1251 2892,1251 2892,1256 2897,1259 2894,1256 2899,1253 2904,1256 2904,1257 2906,1252 2910,1253 2910,1256 2912,1255 2913,1260 2911,1256 2913,1255 2918,1257 2921,1259 2925,1262 2922,1263 2923,1266 2926,1268 2929,1269 2932,1273 2937,1277 2942,1282 2942,1284 2939,1287 2935,1290 2935,1293 2938,1296 2940,1299 2942,1302 2947,1307 2952,1311 2956,1312 2958,1307 2956,1311 2955,1307 2956,1307 2960,1307 2962,1311 2965,1315 2967,1314 2968,1319 2969,1322 2973,1324 2978,1323 2977,1327 2982,1330 7982,1332 7985,1332 7986,1332 7988,1328 7991,1328 7991,1328 7991,1253 2910,1249 2908,1251 2908,1253 2913,1253 2909,1256 2914,1255 2916,1259 2919,1261 2923,1262 2923,1266 2925,1270 2930,1270 2932,1267 2929,1269 2929,1269 2931,1269 2926,1265 1926,1270 1926,1274 1926,1274 1929,1269 1929,1270 1931,1272 1935,1269 1935,1273 1938,1278 1938,1278 1938,1280 1943,1275 1948,1276 1951,1279 1948,1280 1952,1281 1952,1286 1954,1290 1958,1290 1963,1294 1964,1298 1962,1298 1958,1302 1963,1302 1967,1307 -2033,1311 -2030,1307 -2030,1310 -2025,1314 -2020,1317 -1020,1321 -1016,1321 -1018,1321 -1015,1326 -1016,1324 -1016,1327 -1011,1326 -1007,1326 -1002,1326 -1004,1321 -1004,1321 -1003,1324 -1008,1328 -1007,1328 -1003,1333 -999,1336 -998,1339 -997,1337 -996,1340 -2996,1335 -3000,1339 -2996,1343 -2995,1346 -2990,1341 -2990,1345 -2991,1345 -2995,1269 2931,1269 2936,1271 2941,1275 2941,6275 2943,6274 2943,6279 2939,6274 2942,6274 2946,6275 2947,6276 2948,6280 2947,6282 2951,6287 2952,6287 2956,6289 2959,6294 4959,6298 4964,6302 4965,6300 6965,6305 6965,11305 6967,11305 6967,11310 6966,11310 6966,11314 6964,11318 6969,11318 6972,11323 6974,11328 6977,11329 6979,11333 6982,11337 6982,11334 6982,11337 6983,11341 6988,11345 6991,11349 6992,11353 6993,11353 6996,11353 7000,11356 7000,11353 6000,11350 6002,11353 6004,11354 6007,11356 6009,11358 6009,11359 6011,11363 6016,11365 6013,11369 6015,11372 6017,11377 6022,11381 6025,11382 9025,11385 9029,11390 9024,11389 9020,11391 9020,11389 9016,11394 12016,11397 12021,11400 12021,11405 12024,11405 8024,11403 8029,11403 8032,11401 8033,11406 8032,11402 8027,11406 8027,11410 8029,11408 8030,11408 8035,11413 8035,11418 8038,11423 8038,11428 8036,11428 8037,11433 8033,11435 8032,6435 8035,6439 8036,6440 8034,6441 8039,6442 8043,6446 8045,6451 12045,6454 12050,6454 12049,6455 12054,6457 12057,6458 12060,6461 13060,6466 13060,6467 13065,6467 13070,6465 13073,6465 13073,6466 13077,6463 16077,6465 16081,6468 16077,6471 16077,6475 16078,6475 16080,6470 16082,6465 16084,6465 16088,6470 16091,6471 16091,6469 16089,6473 16091,6477 16091,6477 16093,6480 16098,6476 16099,6478 16099,6481 16100,6486 16105,6486 16110,6488 16105,6485 16107,6487 16108,6484 16104,6485 16101,6488 16101,6489 16103,6493 16105,6493 16108,6490 16110,6487 16113,6492 16116,6495 16118,6499 16123,6497 16124,6496 16127,6498 16132,6497 16134,6499 16138,6503 16143,6502 16138,6500 16140,6502 16144,6502 16146,6503 16150,6498 16151,6500 16154,6495 16154,6494 16154,6499 16156,7499 16158,7504 16161,7507 16166,7503 16163,7505 16163,7508 16163,7511 16165,7514 16162,7517 16165,7519 16166,7524 16165,7527 16168,7529 16172,7534 16172,7534 16177,7539 16179,7537 16179,7538 16184,7538 16185,7538 16189,7540 16191,7540 16193,7541 16193,7545 16197,7550 16199,7554 16204,7558 16208,7559 16211,7560 16214,7564 16216,7563 16215,7558 16219,7558 16216,7555 16221,7559 16223,7559 16224,7559 16226,7561 16231,7558 16235,7553 16240,7552 16236,7557 16234,7552 16236,7554 16238,7557 16239,7552 16243,7553 16243,7555 16243,7555 14243,7558 14248,7559 14243,7559 14239,7561 14241,7561 14243,7561 14248,7562 14250,7566 14254,7570 14254,7575 14256,7575 14259,7576 14259,7579 14259,7583 14257,7583 14257,7583 14253,7584 14249,7579 14247,7576 14245,7579 14250,7577 14253,7582 14256,7582 14257,7578 14253,7575 14252,7577 14255,7578 14255,7578 14256,7581 14257,7584 14252,7588 14252,7592 14249,7592 18249,7588 18253,7590 18255,7592 18259,7596 18254,7601 18255,7601 17255,7605 17256,7610 17258,7613 17261,7617 17262,7619 17266,7617 17267,7621 17268,7623 17272,7626 17272,7626 17277,7625 17282,7620 17281,7617 17284,7618 17287,7617 17283,7616 17281,7621 17279,7624 17281,7624 17282,7624 17279,7628 17279,7628 17280,7633 17284,7637 17280,7638 17280,7638 17281,7641 17282,7641 17282,7638 17283,7638 17284,7643 17280,7647 17281,7652 17285,7656 17285,7658 17288,7660 17290,7661 17292,7664 17297,7666 17302,7663 17304,7664 17300,7659 17303,7661 17303,7657 17307,7659 17307,8659 17310,8661 17313,8664 17314,8665 17313,8665 17309,8669 17313,8671 17316,8670 17320,8668 17320,3668 17323,3665 17324,3661 17329,3661 17331,1661 17332,1661 17333,1663 17338,1668 17333,1663 17333,1667 17331,1668 17331,1664 17334,1666 17337,1665 17337,6499 16138,6503 18138,10503 18142,10503 18142,10505 21142,10502 21144,10502 21142,10504 21141,10504 21139,10508 21140,10512 21141,10512 21143,10515 21144,10517 21147,10517 21143,10519 21143,10519 21146,10519 21142,10519 21142,10522 21141,10523 21141,10523 21145,10523 21149,10527 21153,10531 21154,10534 21158,10531 21158,10527 21160,10532 21165,10534 21165,10531 21165,10533 21162,10529 21163,10532 21160,10534 21163,10535 21161,10540 25161,10538 25164,10538 25166,10540 25171,10543 25171,10547 25175,10547 25175,10550 25178,10552 25182,10556 25177,10558 25181,10558 25183,10563 25187,10564 25183,10560 25188,10565 25188,10569 25191,10573 25195,10575 25199,7581 14257,7585 14257,7586 14257,7588 14254,7590 14255,7593 14256,7590 14260,7595 14263,7595 14259,7597 14256,7598 14261,7598 14258,7599 14261,7600 14261,7602 14258,7602 14258,7598 14259,7598 14264,7600 14267,7601 17267,7597 17268,7602 17273,7605 17276,7605 17276,7603 17279,7604 17279,7608 17278,7613 17282,7615 17285,7617 17288,2617 17288,2617 17289,2620 17289,2620 17285,-1380 17288,-1382 17287,-1384 17292,-1384 17294,-1380 17295,-1380 17297,-1380 17299,-1375 17303,-1372 17303,-1373 17298,-1368 13298,-1365 13301,-1366 13297,-1371 13295,-1371 13298,-1371 13298,-1375 13301,-1378 13302,-1378 13302,-1377 13302,-1374 13301,-1373 13306,-1370 13311,-1371 13307,-1366 13307,-1365 13309,11349 6992,11352 6992,11354 6997,11356 7002,11356 7007,11359 7010,11354 7005,9354 7009,9356 7011,9359 7016,9360 7014,9360 7015,9363 8015,9367 11015,9370 11012,9367 11012,9368 11016,9363 11017,9360 11018,9364 11021,9359 11016,11402 8027,11399 8029,11400 8033,11401 8034,11405 8029,11407 8027,11410 8029,12410 8033,12414 8035,12412 8040,12415 8040,12416 8045,12421 8042,12426 8037,12424 8042,12427 8042,12430 8044,12434 8046,12430 8048,12434 8045,9434 8045,9439 8043,9442 8043,9442 8045,9442 8040,9442 8035,9438 8038,9440 8039,9445 8036,9446 8039,9441 8043,12441 8047,12440 8048,12444 8052,12445 8057,12450 8053,12452 8053,12448 8054,12443 8058,12441 8063,12444 8067,12449 8067,12448 8071,12451 8076,12454 8073,17454 8073,17457 8074,17459 8079,17463 8079,17461 8080,17464 4080,17467 4085,17463 4085,17463 4088,17462 4090,17464 4095,17468 4094,17464 4097,17464 4093,17466 4088,17469 4092,17470 4094,17472 4089,17470 4090,17473 4089,17478 4094,17474 4091,17477 4095,17482 4100,17487 4103,17492 4101,17492 4104,17493 4101,17495 4106,17497 4106,17502 4111,17505 4111,17504 4113,17505 4115,17509 4119,17504 4123,17505 4127,17503 4131,17503 4126,17504 4126,17506 4129,17501 4132,17502 4133,17499 4133,17503 5133,17503 5135,17498 5134,21498 5134,21498 5131,21498 5133,21497 5138,21501 5140,21502 5138,21502 5141,21505 5136,21501 5139,21501 5141,21505 5146,21510 5151,21510 5155,21512 5156,21508 5159,21508 5163,21512 5167,21517 5169,21521 5173,21519 5172,21517 5172,21515 5172,21515 5173,21516 5172,21515 5169,21516 5170,21516 5170,21516 5168,21520 5172,21523 5172,21525 5174,21522 5176,21523 5180,21527 5176,21527 5177,21527 5178,21531 5183,21533 5181,21538 5176,21539 5179,21544 9179,21544 9184,21547 9186,21548 9184,21553 9188,21553 9193,21554 9195,21556 9200,21556 9201,21555 9201,21556 9205,21561 9205,21556 9202,21561 9203,22561 9204,22566 9204,22561 9208,22559 9210,22564 9207,22560 9205,22560 9208,22564 9210,22567 9214,22569 9218,22572 9222,22576 9218,23576 9222,24576 9220,24574 9224,24569 9228,24569 9228,6481 16100,6483 16101,6486 16104,6485 16108,8485 16110,8486 16115,8482 16110,8483 16115,8485 16110,8486 16106,8487 16103,8490 16106,8486 16107,8487 16104,8487 16104,8492 16108,8493 17108,8488 17108,8490 17110,8494 17114,8495 17113,8495 17117,8498 17117,8503 17122,8498 17124,8498 17128,8494 17129,8496 17134,8496 17134,8497 17135,8498 17135,8501 17135,8502 17132,8506 17132,8501 17130,8505 17131,21515 5169,21518 5164,21523 5160,21528 5162,21530 8162,21532 8164,21536 8165,21536 8168,21540 8169,21543 8165,25543 8169,25545 8173,25549 8169,29549 8174,29546 8177,29547 8172,29552 8177,29552 8180,29557 8180,29558 8175,34558 8180,34558 8176,34555 8179,34556 8181,7584 14249,7586 14250,7588 14252,7591 14256,7587 14257,7590 14257,7592 17257,7597 17261,7601 17265,7605 17268,7606 17273,7610 17268,7612 17270,7612 17271,7615 17266,7617 17266,7622 17270,7627 17272,7627 19272,7631 19277,7636 19279,7636 19280,7636 19285,7637 19287,7639 19290,7644 19295,7647 19291,7649 19296,7653 19296,7653 19291,7656 19292,7657 19292,7653 19292,7653 19297,7652 19297,7648 19299,7647 19303,7647 19304,7649 19307,7654 19309,7651 21309,7653 21309,7657 21313,7659 21309,7662 21310,7666 21314,7663 21314,7663 21317,7658 21317,7661 21321,7666 21323,7667 21328,7662 21333,7663 21328,7667 21332,7669 21334,7671 21330,7674 21326,7675 21331,7679 21336,7681 21338,7681 21342,7681 21342,7677 21345,7682 21346,3682 21348,3680 21350,3681 21351,3680 21349,3681 21349,3686 21350,8686 21355,8682 21354,8685 21350,8681 21345,8684 21350,8683 21353,8681 21356,8681 21358,8684 21361,8684 21364,8684 21367,8685 21363,8685 21365,8685 21362,8688 21358,8690 21359,8687 21364,8687 21364,8689 21361,8691 21356,8696 21353,8696 21352,8699 21352,8699 21357,8703 21358,8706 21353,8708 21358,17503 4126,17505 4129,20505 4133,20510 4133,20515 4128,21515 4129,21516 9129,21519 9131,21524 9134,21522 9135,21522 9138,21518 9137,21516 9138,21516 9138,21515 12138,21516 12142,21518 12146,21513 12144,21517 12149,21521 12144,21521 12148,21523 12151,21527 12148,21527 12143,21528 12148,21528 12145,21533 12149,21534 12152,21537 12155,21532 7155,21536 7153,21540 7157,21536 7154,21540 7154,21539 7157,21539 7160,21542 7160,21547 7164,21551 7168,21554 9168,21556 9168,21556 9169,21559 9166,21561 9169,21565 9171,21568 9176,21565 9181,21567 9180,23567 9178,23570 9181,23575 9181,23571 9181,20571 9176,20574 9179,20569 9182,20569 9184,20570 9189,20565 9191,20562 9195,20559 9196,20559 9201,20563 9197,20564 9193,20565 9197,20565 9200,20565 9200,20563 9201,20559 9205,20564 13205,20560 13207,20560 13212,20555 13213,20558 13217,20554 13217,20558 13219,20559 13222,20561 13223,20561 13226,20561 13231,20562 13232,20567 13235,20564 13239,20560 13239,20560 13236,20560 13236,20560 13237,20564 13241,24564 13241,28564 13242,28564 13240,28561 13237,28561 13240,28562 13243,28563 13243,28560 13248,28559 13248,28559 9248,28562 9245,28564 9241,28567 9245,28568 9240,28568 9245,28571 9247,28571 9248,28574 9253,28572 9256,28576 9257,28577 9257,28574 9257,10564 25183,10566 25188,10567 25190,10568 25186,10569 25187,10570 25188,10573 25185,10568 25185,10570 25187,10573 25191,10573 25193,10578 25193,10578 25198,10581 25202,10582 25206,10578 25206,10579 25211,10580 25206,10582 25208,12426 8037,12427 8042,12432 8047,12437 8047,12435 8051,12435 9051,12432 9054,12433 9056,12435 9061,12438 9062,12435 9062,12438 9067,12434 9071,12431 9075,12436 11075,12436 11075,12441 11080,12445 11085,12449 11089,12445 11091,12442 11091,12442 11093,12442 11093,12443 11098,12439 11098,12440 11099,7440 11104,7442 11107,7446 11110,7446 11114,7451 6114,7452 6110,11452 6105,11452 6104,11454 6103,11459 6106,11462 6107,13462 6107,13458 6104,12458 9104,17458 9109,17458 9110,17460 9113,17465 12113,17468 12112,17468 12114,17466 12111,17470 12116,17469 12119,17472 12123,17470 12118,17474 12118,17476 12120,13476 12121,13480 17121,13480 17125,13484 17123,13489 17122,13489 17125,13487 17127,13487 17132,13486 17131,13491 17136,13491 17139,13495 17144,13496 17147,13496 21147,13498 21149,13498 21154,16498 21159,16503 21162,16504 26162,16509 26160,16509 26163,16509 26162,16514 26159,16518 26163,16522 26158,16518 30158,16516 30161,16516 30164,16517 30169,16520 30167,16525 30168,16528 30170,17528 30170,17532 30175,17533 30177,17533 30182,17536 30186,17537 30189,17540 30193,20540 30193,20541 30196,20541 30197,20542 30196,20544 30195,20548 30200,20553 30199,20557 30201,20561 30206,20565 30210,20566 30209,20568 30214,20568 30217,20563 30217,20563 30218,20565 30222,20567 30222,20572 30225,20567 29225,20570 29225,20570 29230,20573 29231,20571 29230,20569 29232,20570 29236,17504 4123,17505 4127,17508 5127,17505 5131,17505 5135,17509 5140,17508 5142,17510 5139,17515 5141,17517 5144,17522 5144,17524 5146,17529 5147,17529 5152,17533 8152,17533 8150,17537 8153,17532 8158,17533 11158,17536 11163,17540 16163,17540 16165,17542 16168,17542 16171,17542 16171,17547 16167,17548 16170,17550 16170,17545 16175,17549 16178,17549 16179,17549 16179,20549 16181,20551 16186,20549 15186,20550 15186,20547 15188,20550 15184,20546 15186,20545 15191,20548 15190,20552 15193,20557 15195,20552 15196,20557 15193,20562 15196,20562 15199,20567 15202,20563 15207,20564 15207,20564 15209,20568 15209,20571 13209,20573 13209,20576 13211,20577 13216,20574 14216,20570 14215,20568 17215,20568 17216,20570 17218,20575 17218,20580 16218,20583 16215,20586 16217,20581 16220,20582 16224,20585 16224,20588 16229,20590 16231,20592 16235,20595 16232,20595 16234,20598 16238,20603 16240,20607 16236,20608 16236,20608 16239,20611 21239,20613 21244,20614 21246,20612 21244,20612 21242,20615 21239,20616 21241,20621 21242,17621 21244,17626 21245,17629 21244,15629 21239,15632 21240,15636 21245,15637 21247,15639 21244,15637 21245,15642 21245,15647 21244,15646 21248,15650 21252,15653 21247,15651 21250,15649 21250,15645 21250,19645 21253,19648 21256,19647 21253,19643 21249,19646 21249,19648 21245,19650 21242,19647 21240,19652 21240,14652 21240,14657 21243,14659 21244,14664 21241,14659 21239,14654 21240,14651 21244,14647 21246,14647 21249,14650 21247,14651 21252,14651 21255,14649 21258,14652 21262,14655 21262,14652 21260,14653 21255,14653 21255,14653 21257,14656 21258,14651 21258,14653 21261,14654 21263,14654 21264,14659 21267,14660 21263,14664 21264,14666 26264,14661 26266,14661 26263,14661 26264,14666 26265,14667 26265,14665 26263,14669 26263,14667 26263,14669 26261,14667 26263,14671 26261,14671 26263,12671 26264,12672 26266,12677 26269,17677 26269,17673 26271,17676 26271,17676 26273,17681 26278,17685 26278,21536 8168,21539 8171,21543 8169,21538 8170,21541 8170,21544 8171,21548 8166,21548 8168,21552 8171,21555 8173,21558 8168,21557 8168,21562 8163,21559 8168,21559 8172,21564 8177,21569 8175,21568 8175,21573 8178,21575 8180,21570 8183,21570 8186,21566 8184,21569 8185,21569 8187,25569 8190,25571 8193,25575 8193,25576 8194,25576 13194,25580 13194,25584 13196,25589 13197,25592 13200,25595 13205,25592 17205,25593 17209,25594 17213,27594 17209,27592 17213,27590 17212,27592 17217,27592 17220,27596 17224,27599 17227,27603 17232,27603 17227,27605 17229,28605 17230,28607 17234,28609 17230,28610 17231,28610 17236,28611 17238,28613 17241,28614 17241,28615 17243,28616 18243,28618 18246,28618 18246,28622 18246,28627 18246,28632 18245,27632 18245,27634 18245,27633 18244,27638 18245,-1366 13297,-1365 13299,-1362 13303,-1362 13300,-1361 13304,-1366 13308,-1368 13304,-1368 13306,-1367 13309,-1363 13313,-1358 13313,-1353 13318,-1351 13319,-1347 13323,-1343 13318,-1343 13322,-1340 13317,-1337 13318,-1337 13322,-1337 13324,-1335 13327,-1339 13328,-339 13328,-334 13333,-331 13336,-327 13338,-326 13340,-326 13342,-321 13340,-318 13343,-317 11343,-312 11345,-307 11349,-311 11353,-314 11350,-311 11353,-313 11349,-308 11352,-313 11347,-308 11351,-306 9351,-306 9351,-306 9351,-301 9355,-301 9356,-299 9359,-297 9355,-297 9354,-296 9359,-294 9364,-290 9360,-294 9355,-289 9357,-291 9353,-286 9355,-4286 9351,-4283 9347,-4281 9344,-4281 9344,-4280 9342,-4280 9342,-4280 9339,-4277 9335,-4274 9333,-4274 9335,-4269 9336,-4265 9339,-4260 9340,-4256 9339,-4251 9336,-4251 9339,-4249 9344,-4254 9344,-4255 9348,-4253 7348,-4251 7352,-4247 7354,-4243 7357,-4242 7357,-4240 7362,-4240 7367,-4235 7371,-3235 7371,-3230 7376,-3225 7375,-3221 7372,-3223 7369,-3223 7371,-3223 7369,-3225 7364,-3220 7364,-3218 11364,-3218 11368,-3215 11369,-3210 11372,-3210 11369,-3208 11373,-3207 11377,-3207 11381,-3209 11384,-3209 11383,-1209 11379,-1211 11383,-1209 11383,-1205 11379,-1200 11384,-1197 11379,-1195 11375,-1197 11376,-1192 11377,-1192 11379,-1192 11384,-1188 11382,-1186 11382,-1181 11384,-1180 11388,-1176 11389,-1171 11388,-1171 11393,-1169 11393,-1164 11398,-1162 11393,-1158 11392,-1155 11395,-1155 11397,-155 16397,-156 16401,-156 16406,-158 16409,-158 16412,-158 16414,-160 16415,-158 20415,2842 20411,2847 20413,2848 20417,2848 20417,2848 20412,2850 20407,2850 20403,2846 20408,2847 20406,2849 20406,2854 20402,2858 20403,2863 23403,2858 23402,2855 23405,2858 23400,2857 23400,2852 26400,2849 26404,2850 26406,2855 26410,2859 26415,2863 26411,2866 26411,2866 26411,2866 26412,2868 26415,2868 26419,2868 26423,2873 26424,2876 26425,14656 21258,14661 21260,14664 21262,14664 22262,14662 22267,14662 22268,14662 22268,14658 22273,14660 22278,14658 22277,14659 22278,14660 22283,14661 22281,14661 22285,14661 22288,14664 22290,14659 22295,14662 22298,14663 22301,14667 22301,14668 22301,14673 22303,14678 22306,14681 22302,14686 22299,14686 22301,14683 22304,14686 22305,14687 22301,14689 25301,14684 25301,14684 25299,14685 25300,14685 25301,14685 24301,14688 24301,14693 24303,14693 24298,14693 24298,14688 24299,14689 24297,14690 24299,14690 24302,14690 24302,14686 24303,14686 24306,14688 24302,8492 16108,8494 16113,8498 16116,8495 16116,8496 16116,8499 16116,8504 20116,8508 20119,8508 20119,8507 20119,8509 20123,8509 20127,8512 20128,8514 20130,8519 20135,8522 20136,8522 20136,8524 20138,8524 20141,8528 20142,8526 20145,8530 20141,8530 20145,8532 20149,8531 20151,8536 20155,8535 20154,8539 20154,8539 20149,8539 20149,8543 20146,8540 25146,8538 23146,8540 23149,8540 23149,8545 23151,8546 23152,8551 23152,8555 23152,8559 23153,8561 23153,10561 18153,10561 18153,12561 18158,12564 18159,12566 18163,12567 18165,12564 18165,12568 20165,12570 20170,12575 20173,12579 20177,12576 20177,12579 20176,12584 20176,12583 20181,12585 20182,12583 20186,12582 20187,12585 20192,12582 20194,12584 20198,12586 20198,12581 20201,12582 20204,12581 20206,13581 20209,13586 20211,13586 20216,13589 20217,13589 20213,13586 20215,13588 20213,13592 20215,13596 20216,13596 20221,13600 20221,13598 20224,13595 20221,13598 20226,13602 20229,15602 20232,15606 20232,15611 20232,15610 20232,15613 20235,15617 20239,15612 20234,15612 20233,15615 20237,15617 20233,15619 20234,15619 20229,15623 25229,15624 25229,20624 25228,20628 25229,20631 25234,20630 25239,20634 25241,20632 25244,20636 25240,20634 25237,20639 25236,20634 25241,7590 14257,7592 14260,7592 14262,7592 14265,7595 14266,7600 14263,7600 14268,7604 14270,7609 14274,7611 14275,7615 14275,7620 14277,7620 14276,7625 14277,7625 14277,7628 14281,7628 14286,7630 14284,7630 14284,8543 20146,8542 20148,8546 20150,8550 20152,8550 20153,8550 20158,8545 20156,8545 20157,8550 20157,8550 20155,8550 20157,8553 20161,8557 20161,8557 20165,8560 20161,8563 20159,8568 20154,8570 20158,8573 20161,8573 20166,8577 20168,8580 20171,8584 20173,8585 20175,8580 20180,8582 20183,8582 20188,8582 20188,8585 20193,8588 20198,8589 20199,8591 20197,8594 20198,8596 20196,8592 23196,8597 25196,8601 25199,8601 25203,8604 25202,8604 25202,8599 25205,8601 25210,8601 25206,8603 25206,8606 25206,8605 25211,8609 25211,8613 25208,8614 25205,8619 25208,8619 25210,8621 25214,8619 29214,8615 29218,8616 29219,8617 29217,8622 29222,11622 29225,11624 29229,11623 29230,9623 29225,9621 29224,9625 29227,9628 29227,9624 29232,9626 29237,9631 29241,9634 29245,9635 29248,9638 29253,9643 29258,9646 29258,9647 29255,9648 29253,9650 29258,9648 29262,9647 29262,9642 29267,9646 29267,14646 29269,14650 29274,14655 29279,14654 29277,14655 29275,14653 29276,14655 29273,14656 29269,14653 29272,14656 29272,14656 29274,14660 29276,14663 29276,14660 29278,14659 29281,14659 29276,14661 29272,14656 29273,14657 29274,14652 29270,14654 29274,14657 29270,14659 29272,14655 29275,14657 29270,14659 32270,14660 32270,14662 32273,14665 32277,12665 32279,12670 32279,12670 32277,12670 32274,12672 32277,12677 32282,12682 32285,12678 32289,12674 32291,12677 32287,12679 32287,12683 32292,12685 32292,12680 32289,12682 32294,12683 32299,12687 32298,12692 32300,12695 32305,12699 32310,12703 32311,12704 32312,21515 5172,21516 5175,21518 5175,21513 5177,21516 5182,21520 5186,21525 5185,21529 5185,21528 5186,21530 5181,21533 5178,21537 5183,21537 5183,26537 5183,26534 5183,26539 5183,26542 5178,26542 5176,26544 5176,26546 5177,26548 5175,26549 5178,26548 5181,26548 5184,26553 10184,26557 10179,26559 10175,26563 10171,26563 10173,26564 10170,26568 10169,26572 10171,26577 10171,26581 10169,26577 10173,26573 10169,26575 10171,26578 12171,26576 12175,26576 12180,26581 12183,26577 12183,26580 12184,26582 12181,26582 12182,26583 12182,26588 12186,26590 12191,26593 12193,26593 12198,26598 12198,26602 12193,26602 12193,26604 12195,26607 12195,26611 12196,26615 12196,26615 12200,21534 12152,21534 12152,21537 12147,21540 12147,21545 12150,21545 12145,21548 12150,21549 12152,21544 12152,21544 12150,21547 12153,21552 12152,21553 12157,20553 12161,20553 12156,20556 12152,15556 12157,15559 12160,15557 12163,15561 12163,15564 12166,15565 12165,15561 12161,15559 12163,15559 12168,-4274 9335,-4274 9339,-4276 9341,-4276 9344,-4273 9341,-4271 9341,-4266 9342,-4266 9339,-4269 9335,-4265 9339,-4263 9342,-4259 9345,-4254 9345,-4250 9340,-4250 9335,-4245 9338,-4242 9341,-4240 9341,-3240 9346,-3242 9349,-3241 9351,-3239 9352,-3238 9355,-3237 9358,-3233 9356,-3232 9358,-3233 9358,-3228 9363,-3228 9364,-3223 9369,-3226 9369,-3224 9373,-3222 9378,-3217 9379,-3215 9384,-3215 9384,-3215 9389,-3215 9394,-3215 9390,-3210 9385,-210 9386,-207 9389,-208 9389,1328 -1007,1328 -1010,1329 -1013,1334 -1018,1339 -1013,1344 -1013,1346 -1013,1350 -1015,1351 -2015,1353 -2016,1353 -2011,1350 -2016,1350 -2013,1354 -2010,1356 -2005,1359 -2007,1364 -2005,1363 -2005,1365 -2000,1362 -1999,1365 -1998,1366 -1998,1362 -1994,1364 -1989,1365 -1988,3668 17323,3665 17327,3663 17332,3666 17337,3667 17341,11433 8033,11434 8035,11434 8031,11437 8031,11437 8032,11441 8033,11439 8033,11442 8036,11445 8037,11448 8038,11452 8043,11454 8047,11456 8047,11459 8044,11454 8049,11457 8051,11460 8052,11463 8055,11458 8057,1346 -2990,1346 -2986,1350 -2982,1347 -2986,1352 -2983,1352 -5983,1355 -5979,1358 -5974,1354 -5970,1356 -5965,1360 -5964,1362 -5960,1364 -5960,1364 -5960,1369 -5960,1364 -5963,1369 -5960,1374 -5957,1378 -5952,1380 -5951,1384 -5951,1380 -5948,1380 -5944,1384 -5942,1387 -5945,5387 -5949,5391 -5950,5395 -5950,5395 -5951,5395 -5949,5400 -5954,5404 -5953,5402 -5958,7402 -5958,7403 -5963,7404 -5960,7404 -5959,11363 6016,11359 6018,11364 6023,11365 6024,11365 6023,11369 6025,11373 6020,11378 6020,11377 6024,11379 6029,11383 6033,11384 6034,11388 6037,11389 6041,11394 6043,11396 6048,11401 6048,11402 6050,11406 6052,11404 6054,11409 6058,11413 6059,11415 6060,11411 6065,11416 6068,11420 6073,11415 6076,11416 6078,11419 6083,11423 6085,11428 6086,11430 6086,11432 11086,11437 11091,11432 11088,11429 11086,11432 11086,11427 11090,11427 11095,11429 11092,11427 11092,11431 11087,11433 11088,11436 11090,11436 11091,11436 11096,11439 11099,11440 11099,11440 11095,11445 11097,15445 11102,15445 11102,15441 11099,15445 11100,15445 11102,15443 11106,15445 11110,15450 11107,15453 11110,15457 11110,15457 11115,15459 11119,15460 11117,15465 11117,15465 11120,15464 11123,15463 11124,15460 11124,15460 16124,15458 16127,15462 16122,15466 16126,15462 16131,15465 16133,15463 16135,15462 16136,15462 16140,15466 16142,15468 16147,15468 16147,15471 16149,15471 16147,15475 12147,15477 12150,15480 12147,15484 12144,15487 12145,15490 12147,15492 12149,15494 12150,15496 12153,15497 12155,15499 12150,15499 12147,15500 12143,15504 12146,15499 12150,15500 12150,15500 12152,15505 12153,15506 12157,15506 12157,15508 12158,15512 12159,19512 12162,19513 12159,19511 12163,19512 12162,19517 12167,19520 12167,19522 12168,19525 12171,19525 12172,19525 12175,19526 12172,19526 12172,19526 17172,19527 17175,19528 17176,19529 17179,19529 17178,19533 17181,19532 17183,19532 17179,19537 17174,19539 19174,19538 19171,19542 19172,19547 15172,7641 17282,7646 17284,7649 17284,7652 17284,7654 17285,7650 17289,7647 17291,7645 17296,7649 17297,7650 17294,7653 17294,7653 17298,7656 17303,7658 17308,7662 17313,7666 17308,7664 17313,7669 17313,7669 17313,7669 17316,7667 17313,7667 18313,7663 18314,7661 18316,7662 18317,7657 18318,7662 18315,7658 18316,7661 18318,7661 18322,7664 18317,7667 18315,7671 18315,7675 18315,7674 18315,7670 18316,11670 18316,16670 18321,16673 18321,16678 18322,16682 18327,16683 18332,16686 18334,16690 18334,16688 18336,16685 23336,16688 23337,14688 23338,14692 23337,14694 23338,14697 23339,14697 23342,14698 23342,14698 23343,14698 23348,14693 23350,14694 23347,14695 23347,14696 26347,14692 23347,14692 23347,14693 23350,14693 23351,14698 23355,18698 23352,18698 23356,18702 23360,18701 23362,18699 23363,18701 23363,18702 23366,18699 23366,18694 23370,18699 23370,18702 23374,18707 23378,18706 23380,18706 23381,22706 23384,22706 23385,22705 23389,22706 23384,22706 23384,22706 23384,22710 23380,22713 23381,22718 23386,22716 23390,22712 23390,22708 23390,22705 23392,22704 23397,25704 23402,25704 23402,25706 23404,25710 23404,22710 18404,22707 18402,22704 18403,22704 18406,22704 18411,22704 18411,22704 18410,22709 18410,22709 18407,22704 18405,22703 18405,22707 18405,20707 18409,20709 18412,20710 18411,20712 18414,20712 18414,20712 18412,20712 18416,20714 18412,20717 18417,20720 18419,20715 18421,20718 18422,20723 18425,20723 18430,20723 18434,20725 18435,20724 18437,20724 18433,20726 18433,20731 18437,20732 18437,20730 18438,20735 18440,20739 18438,20734 18438,20739 18437,20739 18437,20744 18439,20749 18438,20750 18434,20753 18436,20754 18431,20754 18432,20758 18433,20762 18438,20764 18443,20766 18447,20766 18450,20767 18451,20768 18451,20769 18448,20770 18452,20774 18456,20777 18458,20781 18462,20782 18463,20785 18468,17785 21468,17784 21473,17782 21477,17787 21481,17783 21482,17785 26482,17788 26482,17788 26482,17791 26479,17794 26483,17790 26483,22790 26483,22790 26479,20583 16215,20585 16220,20589 16225,20590 20225,20592 20222,23592 20227,22592 20229,22597 20233,22600 20233,22603 20237,22604 20240,22599 20241,22595 18241,22595 18242,22598 18243,22602 18247,22605 18252,22601 18256,22598 18255,22600 18257,22604 18258,22609 18261,22608 18261,22606 18264,22608 18261,22605 18265,24605 18262,24608 18263,24611 18267,24608 18267,24613 18271,24615 18272,24610 18273,24614 18272,24619 18276,24621 18281,24625 18276,24622 18280,24622 18282,24621 18279,24622 18277,24627 18279,24631 18284,24634 18289,24634 18292,24634 18294,24636 18299,24639 18294,24644 18295,24647 18298,24647 18301,24643 18303,24643 18306,24639 18311,24636 18315,24641 18317,24645 18317,24648 18319,24649 18323,24649 18328,24652 18330,24652 18329,24652 18327,24655 18322,24656 18319,24658 18319,24661 18320,24664 18316,24660 18320,24657 18318,24657 18320,24659 18325,24660 18327,24661 18323,24656 18327,24652 18323,24654 23323,24658 28323,24660 28318,24665 28319,24666 28323,24668 28325,24668 28328,24672 28325,24667 28328,24668 28325,24670 28326,24665 28330,24668 28334,24672 28336,24672 28336,24668 28339,24672 28340,24672 28338,24674 28341,24675 28346,24675 28351,24677 28356,24679 28357,24681 28356,24677 28360,24680 28355,24684 28354,24688 28356,24688 28351,24690 28356,24686 28361,24691 28364,24692 28364,24692 28365,24692 31365,24693 31370,21693 31370,21692 35370,21688 35372,21692 35377,21695 35377,21697 35377,21698 35379,21698 35374,21701 35375,21701 35379,21703 35380,21708 35383,21706 36383,21709 36383,16709 36383,16710 36386,16715 36382,16711 36386,16706 36388,16706 39388,16706 39383,16706 39379,16711 39379,16711 39376,16714 39381,16716 39386,16717 39389,16717 39391,16720 39391,16723 39387,17723 39392,17726 43392,17722 43396,19722 43399,19724 43394,19727 43391,19725 43395,19723 43398,19726 46398,19730 46400,19730 46403,19730 46405,19734 46407,19734 46410,19733 46407,19728 46412,19726 46416,19726 50416,19723 50417,19723 50416,19718 50420,19719 50424,19718 50429,19713 50433,19715 50437,19718 50442,19719 50442,19718 50444,19719 50439,19721 50443,18721 50444,18721 50446,18721 50450,18726 50451,18727 50453,18722 50451,18727 50456,18729 50455,18731 50458,18726 50458,18728 50458,18730 50463,18730 50460,18729 50456,18727 50460,18730 50462,18734 50457,18739 50455,18744 50457,18744 50461,18748 50461,18748 50466,18745 50468,18749 50463,18750 50468,18754 50472,18754 50472,18759 50472,18760 50468,18763 50473,18760 50477,18762 50477,18766 50481,18769 50483,18769 50481,18772 50482,18776 50482,18779 50486,18779 50489,18781 50489,18783 50494,18786 50496,18786 50495,18786 50498,18784 50499,18784 50499,21784 50504,21788 50502,21785 49502,21790 49501,21790 49498,21795 49494,21800 49494,21801 49495,21801 49500,21797 49505,21799 46505,21802 46508,21798 46513,21799 46516,21802 46516,21805 46519,21800 46524,21805 46527,21804 46528,21801 47528,21801 47531,21804 47533,21804 47529,21804 47534,21809 47538,21808 47538,21812 47540,21812 47535,21813 47532,21810 52532,21812 52535,21817 52536,21820 52536,21824 52541,21828 52545,19828 52545,19829 52547,19829 52551,19833 52555,19831 52552,19826 52557,17826 52562,17827 52567,17830 52568,17830 52572,17830 52575,17830 52575,17830 52574,17831 52578,17827 52582,17827 55582,17829 55583,17834 55583,17839 56583,17843 56579,17846 56580,17850 56584,17848 56588,17853 56592,17851 56596,17856 56596,17856 56600,17851 56601,17856 56601,17856 56604,20856 56604,20861 56601,20865 56596,20865 56597,20866 56597,20869 56602,20871 56603,20874 56607,20871 56605,20872 56610,20874 56613,20874 56612,20876 56617,20876 56622,20876 56626,20876 56621,20879 56623,20880 56627,20883 56624,20880 56629,20880 56629,20881 56630,20884 56630,20884 56635,20881 56636,20879 56637,20876 56632,20879 56629,20881 56633,20878 56634,20879 56634,20879 56637,20879 56642,20884 56638,20879 56639,20884 56634,20885 56631,20886 56633,20889 56632,20894 56627,20894 56631,20894 56631,20898 56632,20903 56632,20908 56630,20907 56633,20907 56636,20903 56641,20904 56641,20904 56637,20900 56639,20905 56642,20910 56643,20905 56648,20910 56653,20915 56654,20910 56659,20910 56663,20910 56664,20912 56664,20912 56666,20917 56670,20922 56670,20918 56673,20920 56675,20920 56677,20920 56677,20921 56681,20926 56677,20931 56677,20934 56680,20934 56684,20936 56689,20938 56689,20938 56690,20940 56695,20935 56696,20939 56697,20939 56699,20940 56696,20941 56694,20940 56698,20945 56700,20947 56702,20947 56707,20950 56712,20954 56713,20950 56710,20952 56706,20955 56704,20957 56708,20953 56709,20951 56714,20953 56716,20957 56720,20957 56722,20959 56725,20958 56727,20959 56728,20962 56731,20963 56736,20965 56741,20965 56740,20967 56742,20969 56737,20969 56742,20974 56744,20979 56744,20978 56745,20974 56748,20970 57748,20972 57749,20974 57751,20971 57754,20972 57752,20977 57755,20981 57758,20981 57763,20981 57765,20984 57765,20982 57767,20982 57763,20987 55763,20989 55767,20991 55770,20987 55771,20988 55774,20988 55777,20991 55775,21991 55778,21996 55778,22000 55783,22001 55783,22005 55783,22010 55785,17010 55781,17011 55783,20011 55778,20015 55783,20018 55786,20015 55791,20015 55795,20019 55792,20019 55792,20021 55792,20022 55788,20023 55783,20028 55786,25028 55790,26028 55795,26029 55790,26030 57790,26033 57794,26032 57798,26036 57802,26039 57805,26042 57805,26046 57810,26050 57811,26054 57815,26054 57819,26050 57819,26055 57820,26060 57822,26063 57823,26066 57826,26068 57824,26073 57826,26077 57831,26082 57831,26078 57836,26082 57839,26084 57839,26086 57834,26082 57834,26083 57835,26082 57840,26083 57844,26086 57843,26083 57846,22083 57849,22084 57847,22089 57847,22094 57848,22094 57853,22094 57850,22095 59850,22095 59855,22098 59858,22099 63858,22099 63861,21099 63861,21104 63862,19104 63862,19108 63864,19109 63864,19112 63868,19113 63873,19117 63876,19121 63875,19116 63877,19115 63882,19117 63878,19122 63883,19125 63884,19129 63879,19133 63879,19135 63874,19139 63871,19136 63871,19136 63873,19140 63868,19140 63873,19144 63877,20144 63879,20144 63876,20146 63880,20148 63878,20149 63877,20149 63879,20150 63882,20155 63886,20155 64886,20159 64884,20160 64884,20161 64887,20160 64887,20164 64887,12677 32287,12677 32292,12679 32297,12678 32298,12682 32294,12687 32294,12682 32296,12682 32296,12683 32298,12683 32301,12682 32305,12685 32309,12686 32311,12686 32316,12691 32311,12692 32316,12692 32312,12697 32314,12700 32319,12705 32322,12706 32327,12704 32329,12705 32332,12702 32334,12707 32338,12703 28338,12704 28340,12700 28345,12702 28345,12702 28345,12701 28348,12704 28349,12704 28345,12709 28342,12709 28343,12714 28347,12718 28351,12723 28352,12727 28353,12730 28355,12728 28353,12733 25353,15733 25353,15736 25355,15740 25356,15745 25356,15747 25351,15752 25353,15752 25354,15754 25354,15754 25353,15759 25352,15763 25352,15764 25357,15759 25352,15761 27352,15760 27354,15760 27354,15760 27355,15762 27357,15762 27354,15759 27354,15759 27354,15763 27358,15767 32358,15764 32360,15769 32360,15767 32360,15765 37360,15770 37362,15772 37363,15774 37367,15779 37363,15780 37359,15779 37363,15782 37366,15780 37370,15775 37370,15778 37365,15781 37360,15785 37356,15785 39356,15789 39358,15789 39360,15794 39365,15794 39370,15797 39375,15797 39380,15799 39379,15804 39376,15805 39377,15807 39380,15808 39385,15809 39386,15807 39386,15809 39386,15810 39389,15815 39392,15820 39392,15819 39396,15820 39398,15820 39395,15825 39400,15823 39405,15824 39403,15829 39403,15834 39406,15836 39411,15831 39415,15832 39415,15833 39415,15838 39417,15839 39419,15839 39414,15842 39413,15846 39418,15843 39420,15842 39423,15839 39420,15840 39422,15839 39420,15842 39415,15846 39410,17846 39415,17845 39411,17847 39416,17849 39420,18849 39424,18847 41424,18852 41424,18849 41429,18849 41432,18848 43432,18852 43433,18855 43433,18859 43435,18855 47435,18858 47440,18861 47435,18866 47435,18866 47439,18869 47442,18871 47445,18873 47445,21873 47445,21876 47444,21873 47449,21878 47451,21883 47456,21880 47454,21880 47454,21880 47457,21883 47459,21887 47464,21890 47465,21893 47467,21894 47464,16894 47462,16899 47457,16898 47455,16893 47456,16897 47458,16896 47455,16898 47459,16900 47464,16903 47469,16908 47471,16903 47474,16901 47473,16906 47473,16901 47478,16904 47479,16906 47475,16906 47474,16907 47475,16906 47479,16901 47482,16901 47482,16905 47486,16908 47487,16911 47490,16915 47490,16917 47492,16921 47497,16926 47498,19525 12175,19525 12176,19521 12177,19522 12181,19525 14181,19521 14181,19519 14185,19519 14189,19524 14192,19527 14192,19529 14196,19534 14200,19535 14205,19538 14208,19540 14204,19545 14207,19545 14207,19547 14210,19550 15210,19554 15210,19555 15210,19555 15213,19560 15213,19562 15212,19564 15213,19569 15210,19570 15214,19573 15214,23573 15217,28573 17217,28574 17220,28574 17219,28574 17224,28576 17229,28577 17233,28577 17236,28579 17236,28580 17238,28584 17243,28588 17248,28587 17252,28587 17252,28582 17255,29582 17259,29577 17260,29578 17262,29583 17257,29585 17257,29586 17260,29586 17265,29590 17267,29593 17267,29594 17267,29599 21267,29603 21271,29603 21272,29605 21274,29607 21276,29612 26276,29613 26279,29616 26280,29621 26277,29621 26277,29623 26282,29626 26285,29631 26289,29628 26289,29632 26290,29637 26294,29642 26290,29646 26292,29648 26291,29649 26288,29653 26293,29655 26292,29655 26293,12702 28345,12703 28348,12698 27348,12699 27349,12698 27354,12700 27354,12700 27355,12703 27360,12703 27361,12700 27362,12704 27367,12701 27371,12706 27376,12710 27372,12710 27373,12710 27368,12715 27370,12713 27374,12716 27378,12716 27380,12714 27379,12719 27374,12718 27373,12722 27376,12724 27376,12729 27371,12733 27372,12733 27377,12735 27373,12735 27374,12737 27378,12739 27379,12742 27381,12739 27381,12739 27376,12743 27378,12743 27379,9743 27375,9744 32375,9745 32377,9746 32374,9746 32372,9750 37372,9752 37375,9754 37375,9751 37377,9755 37379,9759 37379,9763 37383,9766 37385,9767 37382,9768 37383,9765 40383,9770 40378,9770 40382,9775 40384,9777 40386,9782 40391,9778 40395,9773 40395,9778 40397,9779 40399,9781 40402,9781 40398,9781 40393,9780 40396,9782 40399,9785 40398,9786 40395,9789 40390,9793 40387,9798 40390,9803 40394,9805 40397,9800 40400,9795 40402,9800 40403,9802 40407,9807 40410,9806 40407,9807 40403,9812 40400,9814 40403,9819 40403,9819 40400,9822 40405,9824 40405,9822 40408,9827 40410,9831 40413,9831 40413,9826 40412,9827 40417,9832 40418,9832 40416,9833 41416,9833 41421,9834 41416,9838 41416,9838 41421,9840 41422,9844 41424,9839 41424,9843 41427,9845 41430,9849 41430,9849 41425,9852 41423,9855 41426,9858 41429,9860 41434,9862 41436,9866 41441,9868 41436,9869 41434,9871 41434,9875 41437,9877 41437,9881 41438,9883 41438,9879 41438,20903 56641,20898 56644,20903 56647,20901 56649,20903 56645,20905 56650,20909 53650,20905 53650,20910 53652,20907 53655,20912 53652,20916 53656,20917 53656,20912 53661,20912 53660,23912 53663,23912 53663,23909 53663,23912 53665,23913 53669,23911 53669,23915 53669,23912 53671,23916 53670,23917 53675,23922 53680,23927 53683,23930 53688,23935 53689,23935 53691,23935 53691,23931 53692,23931 53694,27931 53693,27933 53695,27937 53695,27942 53699,27947 53701,27949 53703,27949 53704,27949 53708,27952 55708,27953 55710,27949 55710,27953 55710,27958 55713,27959 55718,27960 55722,27962 55725,27965 55730,27965 55732,27968 55730,27969 55733,27972 55733,27975 55734,27975 55734,27979 55737,27981 55733,27982 55732,32982 55732,32979 55734,32978 55737,32978 55738,32974 55742,32977 55746,32981 55750,32985 55746,32983 55747,32987 55750,32992 55751,32995 55751,32998 55751,32998 55753,32998 55753,32993 55753,32995 55757,32999 55758,33002 55760,33002 55761,33005 55766,33005 55767,33000 55764,32997 55767,32997 55771,33001 55773,32998 55777,33001 55777,33005 55776,33004 55776,33009 55781,33014 55786,33014 55790,33015 55790,33016 55790,33015 55786,34015 55787,34019 55790,34019 55791,34021 55793,34017 55793,34019 55796,34016 55797,34020 55793,34020 55796,34023 55792,34023 54792,34025 54797,34028 54800,34029 54799,34029 54795,34034 54796,34036 54797,34041 54792,36041 54797,36045 54801,36048 54803,36051 54804,36053 54806,11439 8033,11441 8038,11441 8039,11441 8040,11445 8035,11441 8035,11442 8039,11438 8035,11438 8035,11443 8039,16443 8038,16444 8038,14444 8040,14448 12040,14451 12036,14455 12038,14455 12041,14456 12046,14459 12049,14457 12051,14458 12046,14458 12047,14459 12042,14464 12042,14465 12047,14470 12050,14471 12055,14471 12058,14468 12060,14473 10060,14477 7060,14477 7062,14474 7062,14474 7067,16474 7063,16471 7065,16474 7067,16471 7072,16471 7068,16476 7066,16481 7069,16482 7072,16487 7072,16487 7077,16488 7077,16493 7076,16493 7079,16497 7079,16500 7079,16502 7079,16502 7079,16505 7075,16504 7080,16501 7077,16497 7079,16501 7081,16497 7080,16496 7084,16500 7086,16495 7087,16498 7084,16501 7087,16496 7087,16496 7083,17496 7083,17500 7083,17505 7088,9860 41434,9864 41435,9864 41435,9865 42435,9860 42435,9862 42436,9863 42434,9863 42430,9862 40430,9863 40427,9863 40428,20608 16239,20605 16242,20610 16237,20614 16237,20615 16242,20611 16242,20612 16245,20609 16244,20604 16242,22604 16237,22608 16239,22607 16240,22610 16244,22610 16241,22615 16246,22616 16246,22614 16251,22616 16251,22617 16249,22619 16254,22623 16252,22618 16255,22618 16259,22620 16262,22615 16262,22618 16263,22622 16263,22626 16265,22629 16266,22628 16269,22633 16267,22636 16268,22636 16267,22641 16269,22646 16269,22645 16271,22646 16273,22650 16271,22655 16274,22655 16277,22658 16279,22660 16280,22658 16280,22661 20280,22663 20282,19663 20285,19658 20288,19658 20292,19661 20295,19666 20298,19670 20301,19671 20301,19675 20301,19677 20306,19675 20311,19674 20315,19678 20318,19677 20314,19680 20315,19682 20310,19684 20314,19683 20316,19687 20315,19688 20316,19688 20319,19693 20319,19698 20322,19702 20323,19698 20323,19702 21323,19707 22323,8508 20119,8509 20119,8510 20116,8515 20113,8518 20115,8519 20116,8516 20120,8520 20119,8520 20118,8525 20123,8527 20125,8527 20125,8528 20123,8530 20126,8533 20123,8535 20127,8532 20132,8534 20136,8538 20138,8542 20141,8537 20143,8537 20145,8542 20145,8547 21145,8548 24145,8552 24145,8557 24150,8560 24147,8562 24151,8566 24156,8569 24160,8574 24156,8579 24159,8584 24164,8587 24164,8585 24167,8588 24170,8591 24171,8589 24172,8590 24176,8595 24177,8593 24174,8596 24178,8600 24179,8603 24175,8602 24178,9602 24182,9605 24177,9609 24178,9610 24182,9608 24178,9603 24183,9606 24188,9608 24193,9609 24195,9614 24196,9616 24197,9618 24201,9618 24205,9613 24209,9612 24214,9608 24211,9603 24216,9607 24221,9611 24221,9615 24217,9617 24217,9618 24221,9623 24225,9623 24225,9626 24225,9630 24225,9630 24222,9626 24223,9626 22223,9627 22223,9626 22226,9629 22228,9632 22228,9636 22225,9638 22226,9639 22227,9634 22230,9634 22231,9639 22235,9639 22240,9641 22242,9642 22246,9647 22249,9652 22250,9655 22255,9651 22256,9652 22253,9652 22256,9652 22261,9655 22262,9657 22257,9659 22261,9659 22261,9657 22264,9657 22261,9656 22264,9661 22267,9662 22270,12662 22270,12665 22265,12669 22270,12669 22270,12673 22269,11356 7007,11361 7010,11361 7010,11357 7014,11356 7015,12356 7020,12357 7015,12361 7017,11361 7018,11364 7017,11359 7018,11355 7017,11354 7020,11357 7020,11361 7023,11364 12023,11368 12028,11368 12029,11371 12030,11372 12034,14372 12034,14372 12039,14372 12042,14376 12045,14381 12047,14379 12047,14381 12049,14384 12054,14385 12051,14388 12056,14384 12056,14384 12061,14381 12058,14386 12062,14386 12059,14391 12059,14396 12060,14397 12060,14398 12056,14403 12051,14408 12052,14410 12057,14409 12057,14414 12053,14414 12051,14415 12051,14420 12049,14423 12048,14427 12044,14427 12044,14425 10044,14421 10049,14424 11049,14426 11054,14427 11059,14429 11064,14433 11064,14434 11064,14437 11065,14441 11068,14444 11072,14445 11076,13445 12076,13445 12077,13445 12081,13444 14081,13446 14081,13446 14078,13449 14083,13447 14084,13450 14085,13452 14090,13453 14087,13456 14084,13457 14083,13461 14081,13463 14082,12463 14082,12463 14087,12463 14087,12464 14087,8464 14087,8465 14083,8465 14080,8467 14085,8472 14085,8473 14085,8476 14090,8474 14094,8475 14094,8480 14094,8481 14099,8476 14103,8476 14107,8480 14111,8483 14116,8488 14120,8488 14118,8488 14120,8483 14115,8481 14118,8485 17118,8485 17114,8488 17110,8488 17115,8484 21115,8484 21118,8486 21120,8487 21120,8482 21115,8487 21118,8490 21122,8494 21127,8497 21132,8497 21133,8500 23133,8503 23135,8507 23135,8508 23132,8511 23129,8512 23125,8517 23126,8522 23125,8527 23129,8522 23131,8527 23132,8530 23132,8531 23128,8533 23132,8533 23134,8533 23139,8533 23144,8536 23143,8537 23146,8533 23146,8533 23149,8537 23152,8533 23157,8530 23158,8532 23162,8536 23162,8536 23165,8536 23165,8540 23170,8544 23171,8548 23169,8547 23173,8551 23176,8552 23173,8548 23169,8553 23173,8553 23170,8548 23173,8549 23173,8546 22173,8547 22174,8551 22177,8550 22179,8552 22183,8553 22183,8553 22184,8557 22185,6557 22185,13598 20226,13601 20227,13604 20229,13608 20233,13610 20234,13605 20237,17605 20237,17610 20242,17605 20242,17602 20241,14602 20241,18602 20236,18606 20239,18606 20244,18608 20241,16608 20245,16611 20240,16615 20239,16610 20234,16611 20232,16613 20235,16608 20235,16608 20239,16613 20242,19734 46410,19734 46410,19738 46414,19737 46414,19735 46415,19737 46418,19741 46421,19744 46423,23912 53671,23908 53673,27908 53675,27913 54675,27917 58675,27921 58677,27925 58678,27930 58678,27926 58683,27930 58686,27931 58691,27931 58695,27934 58700,27936 58699,27936 58699,27941 58695,27942 58695,27947 58699,27952 58699,27954 58703,27957 58704,27962 58708,27958 58706,27959 58703,27962 58703,27967 58706,27967 58701,27965 58701,27962 58702,27966 58703,27971 58704,27976 58706,27980 58709,27980 58712,27975 58711,27971 58716,27971 58713,27968 58712,27968 58712,27971 58711,27968 58713,27968 58710,27969 58708,27972 58706,27976 58711,27978 58716,27979 58716,27983 58718,27978 58718,27981 58719,27981 58723,27986 58725,27986 58728,27986 58731,27991 58734,27996 58738,27993 58736,27995 58732,31995 58736,31990 58735,31993 58738,31990 58734,31995 58729,31996 58729,31999 58731,31994 58726,31996 58731,12463 14087,12465 14090,12465 14093,12463 14090,12463 14095,12461 14092,12464 14093,12459 14091,12459 14091,12459 14091,12459 14096,12461 14100,12458 14103,12457 14101,12452 14101,12452 14106,12453 14103,12453 17103,12455 17104,15455 17104,15460 17108,15463 17104,15458 17108,18458 17108,21458 17105,21461 17105,21464 17110,21467 17115,21464 17120,21464 17120,21468 17123,21470 17126,21465 21126,21461 21126,21464 21128,21464 21132,21468 21137,21471 21142,21475 21146,21471 21146,21476 21147,21473 21151,21475 25151,21475 25152,21477 25153,21481 29153,21479 29158,21484 29162,21488 29162,21490 29165,21487 29170,21488 29167,21489 29162,21493 29164,21493 29169,21498 29169,21499 29164,21495 29167,21498 29167,23498 29170,23498 29169,23503 29172,23505 29171,23510 29167,23514 29164,28514 29168,28514 29172,28514 29174,28512 29172,28513 29176,28518 29179,28518 29182,28521 29177,28521 29179,28519 29179,28517 29179,28515 29177,28519 29177,28519 29179,28524 29184,28527 29183,28527 29185,28523 29187,28523 29184,28525 29189,28522 29189,28518 29186,28523 29189,28519 29189,28521 29189,28526 29193,28529 29193,28529 29196,28534 29200,28538 32200,28537 30200,28539 30202,33539 30207,33539 30209,33534 30205,33535 30208,33536 30208,33538 30213,33538 30214,33542 30218,33545 30221,33548 30222,33551 30225,33552 30227,33554 30231,33555 30233,33560 30228,33563 30225,33564 30229,33565 34229,33565 34234,33570 34231,33572 34235,33572 34239,33573 34243,33578 34239,33579 34243,33574 34247,33573 34247,33576 34243,33573 37243,33573 37246,33568 37241,33568 37244,33573 37239,33578 33239,33574 33241,33574 33239,33578 38239,33583 38242,33587 38242,33590 38242,33594 38243,33596 38247,33599 38248,33599 38252,33595 38252,33598 38257,33603 38258,33604 37258,33609 37255,33604 37257,33607 37262,33607 37265,33609 37266,33614 37271,33614 37276,33616 37278,33616 38278,33616 38282,33621 38284,33621 38288,33621 38285,33618 38289,33616 38291,33616 38294,33611 38296,33608 38301,33610 38305,33610 38300,33612 38303,33617 38308,33621 38309,33625 38305,33630 38307,33634 42307,33636 42310,33638 42314,33634 42312,33631 42315,33631 42315,27931 58691,27936 58693,27937 58695,27940 58700,27943 58703,27943 58708,27946 58709,27950 58711,27950 58714,29950 58718,29951 58723,29947 58728,29947 58732,29950 58727,29950 58727,29955 58730,29960 58734,29964 58732,29961 58734,29963 58735,29968 58739,29968 58741,34968 58739,34971 58739,34972 58739,34973 58740,34968 58741,34970 58743,34974 58745,34977 58749,34979 58744,39979 58745,39979 58742,39978 58744,39982 58748,39983 58744,39983 58744,39979 58747,39979 58752,39983 58757,39982 58759,39985 58759,39986 58759,39983 60759,39986 60762,39990 60767,39994 60770,39994 60770,39997 60770,39997 60770,40000 60775,40002 60775,40003 60779,40007 60784,40008 60787,40011 60788,40015 60788,40016 60790,40016 60792,40021 60788,40025 60788,40030 60788,40026 60786,40027 60786,40030 60787,40032 60792,40037 60795,40032 60800,40032 60799,40035 64799,40035 64801,40036 64806,40041 64803,40037 64805,40038 64801,40040 64804,40036 64804,40040 64805,40045 64810,40048 64811,40051 64813,40051 64817,13491 17139,13486 18139,13489 18139,13494 20139,13492 20138,13494 20141,13499 20145,13499 20145,13499 20148,13503 20149,13500 20149,13505 20151,9367 11012,12367 11015,12369 11011,12364 11012,12364 11015,12359 11011,12354 11011,12354 11014,12359 11017,12356 11015,12361 11015,12361 12015,12365 12016,12369 8016,12374 8021,12373 8025,11373 8021,11368 8021,11373 8024,12700 27362,13700 27363,13705 27364,13710 27368,13705 27369,13707 27367,13707 27371,13709 27375,13712 27377,13714 27373,13712 27376,13714 27379,13713 27382,13718 27384,13713 27380,13713 27385,13711 27386,13715 27386,13719 27386,13719 27389,15719 27394,15724 27398,15729 27400,15734 27401,15734 27401,15729 27396,15732 27396,15735 27397,15734 27399,15733 27400,15729 27400,15734 27400,15729 27405,15734 27405,15739 27408,15739 27408,15741 27412,15743 27416,15743 27416,15740 27416,16740 31416,16743 31421,16738 31425,16742 31430,16742 31435,16743 31439,16743 31444,16741 31449,16746 31450,16747 31455,16742 31459,16738 31463,16742 31466,16742 31471,16742 31471,16742 31471,16744 31475,16749 36475,16749 36473,16753 36478,16757 36474,16761 36477,16759 36478,16761 36481,16760 36484,16761 36485,16760 36486,16765 36491,16766 36494,16771 36498,16769 36501,16771 37501,16774 37504,16769 37507,16769 37507,16772 37503,16772 37508,16774 37511,16774 37510,18774 37515,18777 37515,18772 37512,18775 37514,18777 37517,18778 37519,18779 37517,18776 37517,18778 37520,18780 37520,18785 37522,18785 37526,18787 37523,18786 37520,18790 38520,18789 38520,18792 38522,18797 38527,18802 38529,20802 38534,20804 38535,20803 38540,20802 38539,20806 38543,20811 38546,20814 38543,20812 38541,20808 38546,20811 38544,20815 38539,20816 38535,20818 38531,20815 38531,20814 38528,20814 38533,20817 38536,20816 38539,20821 38540,20818 38542,20820 38540,20816 38540,20821 38540,20823 38541,20828 38541,20831 38546,20836 38547,20836 38548,20835 38553,20835 37553,20835 37558,20837 37558,20842 37560,20846 37561,20846 37564,20849 37569,20854 37564,20854 37565,20850 37566,20852 38566,20856 39566,20861 39566,20863 39562,20867 39566,20872 39567,20868 39566,20873 39568,20876 39573,20876 39573,20880 39575,20884 39579,20885 39580,20889 39580,20891 39584,20888 38584,20889 38587,20890 38592,20891 37592,20892 37597,20894 35597,20895 35600,20897 35603,20899 35605,16678 18322,16681 18323,16682 18323,16686 18328,16690 18326,16693 18331,11693 18335,11692 18332,11695 18332,11698 18335,11703 18335,11703 18336,11702 18339,11698 18344,11702 18349,11705 18353,11704 18357,11707 18360,11707 18359,11711 18358,11716 18358,11713 18358,11712 18360,11710 18360,11710 18362,11710 18362,11710 18367,11710 18366,11707 18366,11706 18365,11710 18369,11715 18371,11714 18374,11712 18376,11711 18377,11711 18379,11712 18384,11715 18385,11711 18385,11714 18387,11717 18389,11718 18386,11721 19386,11723 19391,11722 19395,11722 19396,11723 19398,11726 19398,11729 19403,11733 19408,11736 19407,11733 19411,6733 19407,6735 19402,6738 19402,6743 19406,6746 19406,6742 19411,6742 19414,6742 19414,6746 19419,6746 19423,6746 19418,6749 19418,6747 19418,6748 19420,6748 19424,6748 19424,6751 19427,6751 19429,6752 19429,9752 19426,9754 19428,9759 19430,9756 19431,9751 19435,9753 19440,9757 19445,9755 19443,9757 19448,9757 19448,9759 19451,9763 19451,9766 19454,9766 19456,9770 19459,9770 19462,9770 19466,9766 19467,9771 19468,9772 19468,9769 19469,9768 19470,9770 19470,9774 19473,9778 19470,9781 19470,9786 19471,9789 19471,9789 19473,9792 19478,9795 19475,9800 19478,1256 2899,1260 -1101,1256 -1097,1255 -1093,1255 -1094,1259 -1089,1260 -89,2260 -84,2258 -84,2263 -88,2267 -89,2268 -91,2269 -86,2272 -86,2272 -82,2273 -77,2276 -79,2281 -81,2283 -79,2287 -75,2292 1925,2297 1930,2299 1930,2303 1932,2308 1937,2308 1936,2313 1937,2315 1934,2316 1935,2311 1936,2316 1937,2319 1938,2322 1940,2327 1940,2331 1940,2327 1943,2329 1945,2331 1950,2336 1950,2339 1954,2338 1954,7338 1954,7337 1958,7341 1960,7341 1964,8550 20152,8554 20152,8553 15152,8550 15152,8554 15154,8552 15149,8552 15153,8556 15151,8556 15148,8552 15152,8547 15149,8552 15154,8552 15155,8553 15156,8550 15156,8553 15160,8556 15164,8558 15163,8561 15163,8563 15167,8559 15169,8559 15166,8564 15167,8568 15171,8572 16171,8572 16173,8574 16170,8571 16174,8575 16174,8576 16174,8576 16174,8580 16178,8579 16183,8574 16184,8576 16184,7576 16186,7572 16181,7577 16181,7577 16185,7578 16190,7583 16185,7583 16185,7587 16185,12587 19185,12582 19188,12587 19193,12587 19195,10534 21158,10538 21162,10540 19162,10543 19158,10547 19158,10551 19160,10551 19158,10554 19158,10553 19157,10555 19157,10555 19154,10552 19156,10553 19161,10555 19166,10558 19165,10560 19165,10561 19165,10561 19165,10564 19166,10567 19164,10570 19162,10575 19165,10577 19164,10577 19168,10578 19168,10574 19171,10574 19172,10571 19175,10573 19178,6503 16143,6507 16146,6509 16142,6510 16142,6510 16143,6512 16143,6514 16146,6517 16148,6522 16143,6525 16143,6530 16143,6534 16146,6531 16144,8490 16106,8490 16106,8492 16109,8489 16110,8491 16106,8487 16109,8488 16104,8490 17104,8495 17108,8490 17109,8493 17108,8498 17111,8500 17111,8500 17109,8501 17113,8506 17118,8506 17118,8506 17123,4506 17125,4511 17123,4516 17126,4514 17125,4519 17124,4520 17126,4525 17129,4530 17124,4526 17124,4528 17124,4533 17127,4535 17127,4531 16127,4531 16124,4534 16124,4538 16125,2538 16130,2539 16131,2544 16133,2544 16129,2540 16129,2545 16129,2550 16126,7550 16126,7555 16128,7559 16124,7559 16129,7560 16132,7561 16128,7566 16132,9566 16136,9568 16136,9573 16141,9570 16144,9571 16146,9573 16150,9577 16153,9581 16148,9579 16153,9584 16157,9586 16160,9581 16162,9578 16165,10578 16162,10579 16163,10574 18163,10570 18164,10568 18164,10570 18169,10572 18170,10575 18170,10575 18175,10579 18176,10580 18176,10585 18176,10581 20176,10586 20178,10587 20178,10585 20179,10585 20177,10581 20178,10584 20183,10586 20187,10590 20187,10591 20190,10587 20188,10591 20187,10591 20192,10592 20191,10597 20195,10602 20194,10602 20195,10607 20197,10607 20198,13607 20201,13607 20200,13607 20204,13604 20204,13605 20209,13607 20209,13612 20214,13615 20218,13615 20218,13619 20220,13624 20224,13628 20219,18628 20216,18630 20213,18635 20213,18632 20211,18629 20211,18632 20215,18632 20216,18632 20217,18632 20217,18627 20214,18630 20209,18633 20212,18636 20212,18638 20217,18643 20222,22643 20219,22643 20219,22644 20219,22644 20214,22645 20216,22645 21216,22646 21220,22642 21224,22642 21221,22641 21224,22638 21229,22641 21232,22642 21235,22643 21238,22644 21236,22649 21237,22704 18411,22704 18412,22699 18412,22696 18416,22701 18412,22703 18416,22698 18416,22693 18418,22695 18422,22698 18422,22700 18426,22705 18427,22706 18427,22708 18432,22708 18432,22704 18431,22709 18427,22709 18432,22709 18436,22713 21436,22718 21438,22719 21437,22721 21440,22725 21443,22727 21445,22724 21450,22724 21451,22727 21453,22730 21453,22730 21458,22734 21460,22738 21464,20738 21464,20742 21465,22742 21465,22741 21464,22736 21464,22738 21464,22742 21460,22742 21460,22744 21458,22743 21458,22741 21455,22741 21460,22739 21456,22739 21458,22734 23458,22732 23458,22733 23463,22731 23467,22731 23469,22736 23472,22739 23472,22742 23471,22744 23471,24744 23466,24744 23468,24739 23471,24742 23474,24747 23478,24747 23481,24747 23483,24747 23486,24751 25486,24753 25489,24758 25493,24762 25497,24764 25499,24769 25496,24773 25498,24777 25499,24779 25503,24782 25500,24782 25498,24777 25498,24779 25495,24775 25495,24776 25495,24777 25495,24781 25500,24778 25503,24778 25499,24780 25500,24777 22500,24775 22505,24777 22505,24777 22501,24778 22502,24778 22505,24774 22509,24776 22509,24776 22509,24781 22509,24784 22511,24780 22513,24780 22514,24783 22515,24786 22520,24786 22520,24791 22518,24788 22517,24791 22522,24794 22525,24791 22524,24791 22528,24789 22530,24794 22530,24799 22525,24795 22524,24798 22520,24796 22516,24801 22511,24803 22516,24804 22521,24804 22526,24806 22524,24805 22524,24809 22529,24810 22531,24813 22536,24817 22536,24815 22535,24810 22530,24815 22530,24816 22530,24818 22531,24818 22531,24818 22533,24822 22533,24820 22530,24816 22529,24820 22532,24822 22533,24822 27533,24823 27536,24826 27540,24829 27541,24832 27546,24833 27549,24832 27553,24833 27552,24833 27551,24836 27551,24839 27554,24841 27554,24841 27556,24842 27559,24847 27557,24847 27562,24842 27566,24840 27564,24842 27568,24844 27563,25844 27565,25847 27569,25848 27564,25851 27561,25855 27559,25856 27556,25852 27556,25857 27561,25857 27564,25858 27564,25863 27567,25868 27567,25871 27564,25872 27565,25875 27570,25877 27573,25878 27575,25879 27574,25884 27579,25887 27577,25886 27579,25882 27582,25882 27578,25882 27582,25884 27578,25887 27583,25891 27584,25895 27582,25895 27582,25898 27583,25900 27580,11433 8033,11435 8037,11439 8040,11444 8044,11439 8048,11441 8045,11446 8044,11446 8039,11451 8038,11451 8043,11450 8046,11451 8046,11447 8049,11443 8052,11445 8057,11441 8058,11439 8060,11444 8056,11445 8053,11448 8053,11450 8049,11455 8044,11453 8042,11454 8044,11451 8049,11453 8049,11458 8052,11459 8055,11457 8053,11460 8053,11461 8055,11465 9055,11466 9056,12466 9058,12467 9054,12472 4054,12467 4056,12467 4059,12470 4058,12468 4060,14468 4064,14467 4063,14471 4060,14473 4062,14471 4067,14468 4072,14471 4076,14466 4077,14467 4074,14472 4075,14472 4080,14476 4085,14476 4090,14481 4090,14485 4091,14490 4095,14493 4095,14495 4100,14492 4100,14497 4102,14499 4100,14501 4101,14500 4106,14500 4107,14496 4108,14495 4110,14494 7110,33625 38305,38625 38310,38625 38315,38623 38318,38625 38317,38629 38318,38632 38313,38634 38313,38639 38314,38640 38317,38644 38320,38649 38321,38647 38317,38647 38322,38643 38324,38640 38319,38645 38319,38646 38319,38645 38316,38644 38318,38646 38319,38644 38324,38647 38328,38652 38325,38649 38328,38651 38332,40651 43332,40651 43335,40655 43335,40652 43339,40652 43339,40654 43336,40654 43337,40657 43333,40656 43335,40656 43338,40656 43343,40656 43341,40659 43346,45659 43348,45664 43350,45666 43346,45665 43351,45669 43355,45673 43355,45674 43359,50674 43360,50678 43363,50678 43364,50679 43367,50682 43371,50687 43374,50690 43374,50690 43377,50693 43377,50698 43382,50693 43386,50689 43386,50692 43390,50695 43392,50699 43392,50704 43397,50707 43395,50711 43391,50706 43393,50709 43393,50711 43395,50710 43397,50714 43394,50718 43394,50715 43394,50717 43399,50722 43403,50724 43407,50728 43407,50730 43408,47730 43403,47730 43404,47733 43408,47737 43409,47735 43414,47738 43416,47741 43416,47744 43421,47743 43422,47748 43424,47753 43419,47754 43420,47749 43419,52749 43423,52751 43421,52753 43421,52750 43426,52752 43428,52748 43430,52748 43426,52747 43431,52744 43431,52748 43435,52748 43435,52750 45435,52753 45440,52753 45440,52757 45442,52761 45447,52758 45447,52761 45447,52761 45452,52758 45454,52758 45455,52758 45456,52761 45460,52759 45458,52755 45463,52759 45464,52756 45461,52756 45462,52758 45467,52760 45470,52759 45469,52762 45473,52762 45474,15617 20233,15612 20238,15611 20242,15613 20237,15617 20238,15618 20239,15621 20236,15623 20240,15622 20240,15622 20245,15623 20244,15628 20242,15628 20247,15625 20246,15628 20250,15630 24250,15632 24251,15634 24253,15629 24252,15633 24250,15629 24250,15633 24248,15629 24248,15634 24248,15636 24253,15640 24253,15643 24257,15639 24254,15642 24257,15643 26257,15648 26255,15643 26256,15641 26258,15646 26262,15646 26263,15651 26263,15648 26267,15653 27267,15656 27270,15660 27272,15662 29272,15658 29276,15658 29277,15658 29272,15663 29274,15663 29274,17663 29274,17663 29279,17668 29283,17671 29285,17670 29287,17675 29289,17676 29293,17679 29296,17682 29297,17685 29299,17686 29300,17687 29305,17685 33305,17686 33310,17687 33310,17689 33306,17687 34306,17691 34304,17694 34306,17696 34306,17695 34309,17691 34314,17691 34311,17692 34306,17696 34310,17700 34310,17697 34312,17699 34316,17704 34318,17701 34318,17705 34322,17704 34321,17706 34319,17706 34319,17702 34316,17707 37316,17710 37318,19710 37313,19705 37313,19708 37308,19712 37310,19710 37312,19711 37307,19711 37307,19714 37310,19718 37312,19719 37309,19723 37312,19727 37315,19729 37317,19731 37322,19734 37323,19735 37324,19737 37322,19742 37326,19740 37331,19745 37335,19742 37335,19742 37340,19745 37341,19749 37341,19749 37342,19752 37347,19757 37347,19762 37345,19764 37341,19768 37345,19769 37350,19771 37355,19773 33355,19770 33360,19765 33364,19769 33364,19773 33365,22773 33364,22771 33360,22775 38360,22779 38364,22780 38369,22782 38371,22784 38371,22789 40371,22792 40375,22789 40375,22789 40377,22793 40376,23793 40378,23795 41378,23791 41378,23792 41378,23796 41382,23798 41383,22798 41386,22799 41390,22804 41390,22804 41391,22808 41391,22812 41393,22814 39393,22819 39393,22821 39395,22823 39397,22828 36397,22832 36392,22832 36393,22836 36396,22836 36401,22838 36402,19838 36403,19837 36408,19841 36408,19843 36409,19845 36404,19847 36405,19847 36408,19847 36411,19848 36413,19850 36415,19845 36419,19841 36417,19843 36419,19843 36419,19846 36424,19848 36425,19850 36425,19845 36425,19846 36425,19848 36430,19852 36430,19849 36435,19846 36440,19851 36440,19846 36438,19848 36439,19844 36442,19845 36446,19841 36448,19841 36449,19841 38449,19841 38452,19846 38455,19848 38458,19852 42458,19856 42462,19859 42463,19859 42465,19861 42462,19862 42463,19864 42463,19867 42467,19870 42470,19871 42468,21871 42467,26871 42464,26867 42466,26872 42463,26872 42464,26874 42463,26879 42466,26882 42466,26883 42471,26879 42476,26878 42477,27878 42479,27882 42479,27883 42480,27886 42483,27887 42487,27885 42484,27887 42483,27890 42484,27890 42485,22890 42486,22890 42489,22890 42491,22895 42494,22897 42498,22899 42502,22901 42502,22896 42503,22892 42498,22896 42498,22891 42502,22892 42505,22897 42507,22898 42511,22903 42515,22906 42510,22911 42513,17911 42508,17915 42512,17918 42509,17913 44509,17915 44514,17919 44510,17923 44514,17927 44510,17927 44513,17927 44517,17928 44521,21928 44517,21930 44516,21931 44513,21929 44513,21933 44517,21934 44519,21933 44520,21934 44520,21937 44520,21938 44520,21943 44520,21938 44523,21940 44527,21936 44532,21941 44536,21942 44541,21937 44545,21938 44545,21938 44545,21940 44543,21937 44538,21941 44543,21938 44547,21938 44547,21938 44547,21937 44551,21937 44551,21933 44556,21935 44554,21937 44558,21940 44562,21944 44564,21949 44561,21952 44566,21955 44568,21960 44569,21963 44571,21963 44571,21965 44574,25965 44579,25967 44584,25967 44584,25970 44588,22970 41588,22970 41586,22975 41585,22974 41589,22970 41593,22966 41598,22965 41598,22970 41598,22965 41601,22965 41604,22965 46604,22968 46604,27968 46602,27968 46602,25968 46601,25967 45601,25968 45602,25971 45607,25975 45610,25979 45614,25977 45612,25975 45609,26975 45609,26980 46609,26979 46613,26982 46610,26982 46611,26980 46615,26982 46616,26985 46616,26986 46617,26987 46615,30987 46617,30987 46622,30986 46626,30988 46629,30989 46627,17671 29285,17673 26285,17677 26286,17678 26285,17681 26289,15681 26292,15685 26297,10685 26297,10689 26301,10689 26297,10693 26300,10695 26301,10691 26297,10696 26299,10696 26304,10692 26306,10688 26301,10690 26302,10690 26307,10686 26305,10684 26309,10686 26312,10691 26313,10688 26318,10683 26320,10684 26325,10683 26328,14683 26328,14680 21328,14681 21331,14683 21335,14680 21333,14677 21333,14682 25333,14684 25334,14689 25338,14693 25338,14698 25341,14696 25342,18696 25343,20696 25345,20699 25349,20702 25346,20703 25351,20703 25351,20704 25351,20704 25354,20700 26354,20705 26352,20706 26351,20706 26351,20703 26354,20708 26354,20712 26355,20712 26352,20717 26349,20717 26346,20722 26351,20727 26353,20729 26348,20734 26353,24734 26349,24729 26349,24729 26352,24725 26349,24725 26353,24726 26353,24729 26355,24729 26357,24732 26359,24735 26362,24735 26364,24730 26364,24730 26363,24734 26365,24739 26368,24739 26364,24739 26366,24739 26367,24734 26370,24735 26365,24732 26367,24732 26369,24729 26372,24728 26370,24726 26365,24728 26368,24731 26370,24734 26375,24738 26378,24733 26378,24733 26381,24729 26381,13496 17147,13491 17152,13495 17148,13496 17146,13498 17141,13498 17145,13501 17147,13502 17149,13502 17153,13505 17149,13505 17152,13500 17149,13496 20149,13492 20150,13497 20155,8497 20151,8501 20153,8502 20156,8506 20159,8503 20159,12503 19159,12503 19159,12505 19164,12500 19159,12500 19164,12500 15164,12503 15169,12508 15168,12511 15170,12514 15170,12510 15169,12512 15172,12512 15172,12515 15172,12519 15175,12522 15176,12525 15180,12528 15184,23912 53663,23915 53661,28915 53666,28914 53667,28918 53664,28921 53667,28922 53667,28924 53670,28925 53674,28926 53674,28927 53672,28922 53676,28924 53677,28927 53678,28932 56678,28934 56682,28935 56683,28936 56688,28938 56688,28934 56691,28938 56693,28942 56690,28939 56694,28939 56698,28942 56695,28946 56698,28950 56701,28953 56706,28954 56706,28949 56708,28950 56708,28953 56709,28958 56706,28960 56709,28965 56707,28965 56707,28965 56705,28963 56709,28966 59709,28969 59710,28973 59711,28977 59715,28977 59717,28982 59719,28981 59715,28985 59718,28986 59718,33986 59721,35986 59723,35990 59723,35990 61723,35993 61726,35995 61728,35998 61724,36000 61721,36004 61723,36002 61718,36007 61718,36010 61719,36010 61721,36010 61721,36010 61721,36015 61721,36018 61716,36022 61717,36024 61718,36025 61723,36029 61722,36031 61726,36035 61722,36040 62722,36042 62722,36044 62722,36049 62724,36051 62720,36053 62723,36052 62719,36055 62717,36056 62712,36059 62714,36058 67714,36059 67716,40059 67716,40063 67719,40067 67722,40069 67726,40065 67724,40067 67721,40067 67722,40071 67721,40075 67726,37075 67730,37076 67733,37076 67736,37072 67741,37072 67741,37072 67744,37076 67744,37079 67745,37081 67750,37082 67750,37082 67753,37082 67753,37083 67752,37081 67753,37084 67753,37087 67757,37087 67758,37083 67753,37084 67758,37084 67761,37088 67759,37091 67762,37088 67762,37090 67767,37090 72767,37090 72771,37085 72771,37089 72774,38089 71774,38090 71771,38086 71771,38086 71774,38086 71777,38089 71782,38089 71782,38087 71780,38092 71782,38087 71785,38083 71783,38081 71781,38078 71781,38078 71783,38076 71786,38075 71787,38078 71783,38079 71781,38081 71781,41081 71783,41081 71778,41082 71778,41085 71783,41085 71783,41088 71785,41083 71789,41083 71794,41088 71796,41088 71796,41092 71798,41095 71794,41095 71789,41098 71790,41093 71790,41091 71795,41092 71796,41087 71798,41084 71796,41086 71797,41084 71799,41084 71795,41086 71798,41085 71799,41089 71803,41085 71804,41083 71802,41083 71803,41079 71803,41081 71808,41081 71809,41083 71810,41083 71809,41085 71810,41082 71814,41087 71817,41089 71818,41086 71813,41083 71813,39083 71816,39083 71814,39085 71814,39083 71814,39086 71818,39087 71820,39087 71824,39091 71826,39096 71829,39098 74829,39102 74830,39107 74833,39110 74836,39115 74835,39115 74836,39115 74838,39115 74835,39119 74838,39117 74840,39121 74840,39125 74843,39121 74848,39122 77848,39122 77844,39123 77848,39126 77851,39131 77855,39136 77857,39132 77857,39135 78857,39135 78859,39136 78864,39133 78865,39135 78866,39139 79866,39142 79870,39147 79872,39146 79872,39150 79876,39150 78876,39154 78879,39154 75879,39154 75881,39158 75881,39157 75884,39160 75884,39155 75884,39160 75889,39156 75891,39158 75888,39163 75891,39163 75894,39166 75891,39166 75895,39167 75900,39170 75901,39170 75906,35170 75907,35171 75911,35176 75906,35172 75908,35173 75908,35178 75908,35175 75909,35170 75908,35170 75903,35168 75904,35173 75906,35178 75903,35179 75904,35179 75908,35182 75905,35184 71905,35188 71902,35185 71904,35186 71907,35187 71908,35189 71903,35191 71905,35195 71900,35197 71904,35198 71909,35200 71907,35199 71903,35201 71900,40201 71896,25028 55790,25029 55785,28029 55789,28031 55790,28032 55790,28037 55794,28042 55793,28043 55798,28046 55803,30046 55803,30051 55806,30050 55810,30049 55810,30049 55812,30049 55816,30054 55820,2545 16129,2540 16133,2542 16137,2542 16139,2544 16138,2545 16139,7545 16136,7546 16139,7541 16142,7542 16142,7543 20142,7547 20143,11547 20143,11550 20139,11555 20139,11556 20137,11552 20142,11555 24142,11556 24145,11559 24140,11563 24143,11567 24139,16567 24136,16567 24139,16572 24142,16573 24147,14573 24143,14574 24147,14570 24145,14573 24150,14569 24150,14570 24145,14573 24149,14575 24150,14575 24154,14579 24149,14579 24153,14576 24157,14576 24152,14571 24149,14571 24152,14575 24150,14572 24151,15572 24153,15575 24149,15577 24154,15582 24151,15582 24153,15586 24156,15587 24152,15588 24157,15590 24162,15590 24166,15590 24166,20590 24166,17590 24169,17595 24171,17597 24172,17599 24172,17595 24174,17599 24178,17599 24181,18599 24184,18594 24187,18597 24187,18593 24189,18597 24192,18601 24192,18599 24197,18599 24197,18603 24200,18605 24204,18600 24205,18605 24201,18605 24197,18610 24202,18608 24205,18611 24204,18613 24208,18617 24203,22617 24205,22619 29205,22622 31205,22622 31209,22623 31214,22624 31212,22627 31214,22623 31214,22626 31215,22629 31214,22633 31218,22631 31221,22630 31223,22632 31227,21937 44551,21935 44555,21939 44551,21934 44553,21936 44554,21933 44556,21935 44552,21935 44553,21939 44548,21939 44551,21939 44551,21938 44555,21938 44558,21938 44559,21941 44559,21945 44558,19945 44562,19942 44560,19943 44561,19939 44565,19940 44561,19939 44556,19935 44557,9770 19466,9773 19471,9775 19471,9770 19471,9770 19468,9770 19467,9772 19466,9772 19468,9774 19469,9775 19472,12775 19470,12773 19466,12773 19467,12773 19464,12773 19466,12776 19461,12779 19461,12779 19465,12780 19465,12782 19460,12781 19458,12776 19461,12776 19461,12777 19463,12778 19466,12776 19466,12780 19463,12780 19466,12785 19468,12789 19473,12788 19477,12793 19475,12798 19480,12802 19482,12803 24482,12802 24484,16802 24486,16806 28486,16808 28486,16812 28490,16812 28494,16815 28498,16816 28498,16818 28502,16818 28504,16819 28509,19819 28513,19819 28510,19821 28515,19816 28510,19811 28510,19811 28511,19809 28511,19810 28510,19813 28515,22813 28510,22818 28514,22818 28515,22815 28516,22818 28514,22819 28514)',')')));
@@ -393,7 +392,6 @@ Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
SET GLOBAL innodb_file_per_table=default;
-SET GLOBAL innodb_file_format=default;
create table t1(i int primary key,
a geometry not null, b geometry not null,
c int,
diff --git a/mysql-test/suite/innodb_gis/t/1.test b/mysql-test/suite/innodb_gis/t/1.test
index 256cd1ab0ad..7c9199c59ae 100644
--- a/mysql-test/suite/innodb_gis/t/1.test
+++ b/mysql-test/suite/innodb_gis/t/1.test
@@ -616,7 +616,7 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRequals FROM t1 a1 JOIN t1 a2 ON MBREquals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRoverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS ST_touches FROM t1 a1 JOIN t1 a2 ON ST_Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
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;
@@ -701,6 +701,7 @@ INSERT INTO t1 VALUES
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'));
--echo # must not crash
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT 1 FROM t1 WHERE a <> (SELECT ST_GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
DROP TABLE t1;
@@ -737,7 +738,7 @@ drop table t1;
# Bug#44684: valgrind reports invalid reads in
# Item_func_spatial_collection::val_str
#
---error ER_ILLEGAL_VALUE_FOR_TYPE
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT MultiPoint(12345,'');
#SELECT MultiPoint(123451,'');
#SELECT MultiPoint(1234512,'');
@@ -764,7 +765,7 @@ SELECT MultiPoint(12345,'');
#
# Bug55531 crash with conversions of geometry types / strings
#
---error ER_ILLEGAL_VALUE_FOR_TYPE
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
@@ -867,7 +868,7 @@ SELECT ST_ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
--echo # GEOMETRY FUNCTION ARGUMENTS
--echo #
--replace_regex /non geometric .* value/non geometric '' value/
---error ER_ILLEGAL_VALUE_FOR_TYPE
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
@@ -886,6 +887,7 @@ INSERT INTO g1 VALUES (ST_geomfromtext('point(1 2)'));
FLUSH TABLES;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT 1 FROM g1
FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
;
@@ -1447,5 +1449,5 @@ DROP DATABASE gis_ogs;
--echo # Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE
--echo #
-# --error ER_GIS_INVALID_DATA
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT ST_Union('', ''), md5(1);
diff --git a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
index c4cd100c7e3..653e250017a 100644
--- a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
@@ -312,9 +312,13 @@ ALTER TABLE tab DROP INDEX idx2;
--disable_info
# Check spatial index on temp tables
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab where c1 = c2;
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
+CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab;
+
INSERT INTO temp_tab SELECT * FROM tab;
CREATE SPATIAL INDEX idx2 ON temp_tab(c2);
@@ -472,15 +476,24 @@ ALTER TABLE tab ADD INDEX idx6(c4(10)) USING BTREE;
ALTER TABLE tab MODIFY COLUMN c2 GEOMETRY NOT NULL;
-# --error ER_CANT_CREATE_GEOMETRY_OBJECT
-# ALTER TABLE tab MODIFY COLUMN c3 POLYGON NOT NULL;
+ALTER TABLE tab MODIFY COLUMN c3 POLYGON NOT NULL;
-# --error ER_INVALID_USE_OF_NULL
-# ALTER TABLE tab add COLUMN c7 POINT NOT NULL;
+ALTER TABLE tab add COLUMN c7 POINT NOT NULL;
+--disable_info
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+# instant add, supported
ALTER TABLE tab add COLUMN c8 POINT NOT NULL, ALGORITHM = INPLACE, LOCK=NONE;
---disable_info
+SELECT HEX(c8) FROM tab;
+BEGIN;
+INSERT INTO tab SELECT 0,c2,c3,c4,c5,
+ST_GeomFromText('POINT(67 89)'),ST_GeomFromText('POINT(67 89)')
+FROM tab LIMIT 1;
+SELECT HEX(c8) FROM tab;
+ROLLBACK;
+
+# not instant, not supported
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE tab add COLUMN c9 POINT NOT NULL AFTER c5, ALGORITHM = INPLACE, LOCK=NONE;
SHOW CREATE TABLE tab;
@@ -740,16 +753,16 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p);
ALTER TABLE t1 FORCE, LOCK=NONE;
DROP TABLE t1;
-create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
---error ER_CANT_CREATE_GEOMETRY_OBJECT
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
insert into t1 values(default);
drop table t1;
SET timestamp=default;
-create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
---error ER_CANT_CREATE_GEOMETRY_OBJECT
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
alter table t1 add column i int;
drop table t1;
SET timestamp=default;
diff --git a/mysql-test/suite/innodb_gis/t/create_spatial_index.test b/mysql-test/suite/innodb_gis/t/create_spatial_index.test
index 6a15b0f2d74..7ddece9ad86 100644
--- a/mysql-test/suite/innodb_gis/t/create_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/create_spatial_index.test
@@ -1118,7 +1118,9 @@ DROP TABLE tab;
# End of Testcase compress table with Auto_increment
# Test check constraint on spatial column
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(c1 > 0) ) ENGINE=InnoDB;
+CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(CAST(c1 AS BINARY) > 0) ) ENGINE=InnoDB;
CREATE SPATIAL INDEX idx1 ON tab(c1) ;
diff --git a/mysql-test/suite/innodb_gis/t/geometry.test b/mysql-test/suite/innodb_gis/t/geometry.test
index 8325cc5a27c..3efc664fbd2 100644
--- a/mysql-test/suite/innodb_gis/t/geometry.test
+++ b/mysql-test/suite/innodb_gis/t/geometry.test
@@ -410,10 +410,9 @@ SELECT ST_AsText(a.c2),ST_AsText(b.c2) FROM tab a,tab2 b WHERE a.c2=b.c2;
--echo #check DELETE stmt with Where clause and a constant predicate
DELETE FROM tab
-Where c8=c8=ST_GeometryFromWKB(ST_AsWKB(ST_GeomCollFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))')));
+WHERE c8=ST_GeometryFromWKB(ST_AsWKB(ST_GeomCollFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))')));
---echo #check the data, should 0
-SELECT COUNT(*) FROM tab;
+SELECT * FROM tab;
--echo #check UPDATE stmt with Where clause and a constant predicate
SET @c8=ST_GeomCollFromText('GeometryCollection(Point(10 10),LineString(20 20, 30 30))');
@@ -663,6 +662,7 @@ PARTITION BY LIST(store_id) (
--echo #check start transaction commit & Rollback
START TRANSACTION;
DELETE FROM tab3;
+SELECT * FROM tab3;
ROLLBACK;
SELECT COUNT(*) FROM tab3;
@@ -671,7 +671,7 @@ START TRANSACTION;
DELETE FROM tab3;
COMMIT;
-SELECT COUNT(*) FROM tab3;
+SELECT * FROM tab3;
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point;
DROP TABLE gis_multi_line, gis_multi_polygon;
diff --git a/mysql-test/suite/innodb_gis/t/gis.test b/mysql-test/suite/innodb_gis/t/gis.test
index 489934e957e..44aec76770a 100644
--- a/mysql-test/suite/innodb_gis/t/gis.test
+++ b/mysql-test/suite/innodb_gis/t/gis.test
@@ -610,7 +610,7 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRequals FROM t1 a1 JOIN t1 a2 ON MBREquals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRoverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS ST_touches FROM t1 a1 JOIN t1 a2 ON ST_Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
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;
@@ -695,6 +695,7 @@ INSERT INTO t1 VALUES
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'));
--echo # must not crash
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT 1 FROM t1 WHERE a <> (SELECT ST_GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
DROP TABLE t1;
@@ -731,7 +732,7 @@ drop table t1;
# Bug#44684: valgrind reports invalid reads in
# Item_func_spatial_collection::val_str
#
---error ER_ILLEGAL_VALUE_FOR_TYPE
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT MultiPoint(12345,'');
#SELECT MultiPoint(123451,'');
#SELECT MultiPoint(1234512,'');
@@ -758,7 +759,7 @@ SELECT MultiPoint(12345,'');
#
# Bug55531 crash with conversions of geometry types / strings
#
---error ER_ILLEGAL_VALUE_FOR_TYPE
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
@@ -869,7 +870,7 @@ SELECT ST_ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
--echo # GEOMETRY FUNCTION ARGUMENTS
--echo #
--replace_regex /non geometric .* value/non geometric '' value/
---error ER_ILLEGAL_VALUE_FOR_TYPE
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
@@ -888,6 +889,7 @@ INSERT INTO g1 VALUES (ST_geomfromtext('point(1 2)'));
FLUSH TABLES;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT 1 FROM g1
FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
;
@@ -1441,4 +1443,5 @@ DROP DATABASE gis_ogs;
--echo #
# --error ER_GIS_INVALID_DATA
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT ST_Union('', ''), md5(1);
diff --git a/mysql-test/suite/innodb_gis/t/innodb_gis_rtree.test b/mysql-test/suite/innodb_gis/t/innodb_gis_rtree.test
index 85d6948c8aa..53e12994849 100644
--- a/mysql-test/suite/innodb_gis/t/innodb_gis_rtree.test
+++ b/mysql-test/suite/innodb_gis/t/innodb_gis_rtree.test
@@ -1,3 +1,3 @@
-- source include/innodb_page_size.inc
-- source include/innodb_row_format.inc
--- source ../../../t/gis-rtree.test
+-- source ../../../main/gis-rtree.test
diff --git a/mysql-test/suite/innodb_gis/t/precise.test b/mysql-test/suite/innodb_gis/t/precise.test
index 9174a100003..08b7e348362 100644
--- a/mysql-test/suite/innodb_gis/t/precise.test
+++ b/mysql-test/suite/innodb_gis/t/precise.test
@@ -140,7 +140,7 @@ ST_geomfromtext('POLYGON((525298.67 183511.53,525296.57
183491.55))'))) st_u;
SET @a=0x0000000001030000000200000005000000000000000000000000000000000000000000000000002440000000000000000000000000000024400000000000002440000000000000000000000000000024400000000000000000000000000000000000000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F;
-# --error ER_GIS_INVALID_DATA
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT ST_ASTEXT(ST_TOUCHES(@a, ST_GEOMFROMTEXT('point(0 0)'))) t;
diff --git a/mysql-test/suite/innodb_gis/t/rollback.test b/mysql-test/suite/innodb_gis/t/rollback.test
index 52268cfc962..fcfe71e2f80 100644
--- a/mysql-test/suite/innodb_gis/t/rollback.test
+++ b/mysql-test/suite/innodb_gis/t/rollback.test
@@ -413,11 +413,9 @@ DROP TABLE t4;
# Test externally stored update rollback.
LET $file_per_table='on';
-LET $file_format='Barracuda';
--disable_warnings
eval SET GLOBAL innodb_file_per_table=$file_per_table;
-eval SET GLOBAL innodb_file_format=$file_format;
--enable_warnings
create table t1(i int primary key,
@@ -441,7 +439,6 @@ drop table t1;
--disable_warnings
SET GLOBAL innodb_file_per_table=default;
-SET GLOBAL innodb_file_format=default;
--enable_warnings
# Test partial update rollback.
diff --git a/mysql-test/suite/innodb_zip/include/innodb_wl6501_scale.inc b/mysql-test/suite/innodb_zip/include/innodb_wl6501_scale.inc
deleted file mode 100644
index bef28a9c484..00000000000
--- a/mysql-test/suite/innodb_zip/include/innodb_wl6501_scale.inc
+++ /dev/null
@@ -1,112 +0,0 @@
-#
-# load tables with some significant amount of data and then truncate it.
-#
-
-#-----------------------------------------------------------------------------
-#
-# create test-bed
-#
-let $per_table = `select @@innodb_file_per_table`;
-let $format = `select @@innodb_file_format`;
-
-let $WL6501_TMP_DIR = `select @@tmpdir`;
-let $WL6501_DATA_DIR = `select @@datadir`;
-set innodb_strict_mode=OFF;
-
-#-----------------------------------------------------------------------------
-#
-# create procedure to load data
-#
-delimiter |;
-create procedure populate()
-begin
- declare i int default 1;
- while (i <= 5000) do
- insert into t1 values (i, 'a', 'b');
- insert into t2 values (i, 'a', 'b');
- insert into t3 values (i, 'a', 'b');
- set i = i + 1;
- end while;
-end|
-create procedure populate_small()
-begin
- declare i int default 10001;
- while (i <= 12000) do
- insert into t1 values (i, 'c', 'd');
- insert into t2 values (i, 'a', 'b');
- insert into t3 values (i, 'a', 'b');
- set i = i + 1;
- end while;
-end|
-delimiter ;|
-
-#-----------------------------------------------------------------------------
-#
-# create and load the tables.
-#
-eval set global innodb_file_per_table = $wl6501_file_per_table;
---replace_regex /[0-9]+/NUMBER/
-eval create table t1
- (i int, c1 char(100), c2 char(100),
- index c1_idx(c1))
- engine=innodb row_format=$wl6501_row_fmt
- key_block_size=$wl6501_kbs;
-eval create table t2
- (i int, c1 char(100), c2 char(100),
- index c1_idx(c1))
- engine=innodb row_format=$wl6501_row_fmt
- key_block_size=$wl6501_kbs;
-eval create temporary table t3
- (i int, c1 char(100), c2 char(100),
- index c1_idx(c1))
- engine=innodb row_format=$wl6501_row_fmt
- key_block_size=$wl6501_kbs;
-#
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-begin;
-call populate();
-commit;
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-#
-truncate table t1;
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-#
-call populate_small();
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-#
-truncate table t2;
-truncate table t3;
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-#
-call populate_small();
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-#
-drop table t1;
-drop table t2;
-drop table t3;
-
-#-----------------------------------------------------------------------------
-#
-# drop the procedure
-#
-drop procedure populate;
-drop procedure populate_small;
-
-#-----------------------------------------------------------------------------
-#
-# remove test-bed
-#
-eval set global innodb_file_format = $format;
-eval set global innodb_file_per_table = $per_table;
diff --git a/mysql-test/suite/innodb_zip/r/bug56680.result b/mysql-test/suite/innodb_zip/r/bug56680.result
index 40660f435fb..02ec24c98ae 100644
--- a/mysql-test/suite/innodb_zip/r/bug56680.result
+++ b/mysql-test/suite/innodb_zip/r/bug56680.result
@@ -116,5 +116,8 @@ DF
CHECK TABLE bug56680_2;
Table Op Msg_type Msg_text
test.bug56680_2 check status OK
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
DROP TABLE bug56680_2;
DROP TABLE bug56680;
diff --git a/mysql-test/suite/innodb_zip/r/create_options.result b/mysql-test/suite/innodb_zip/r/create_options.result
index 9165e9ee5ae..b217388b6dc 100644
--- a/mysql-test/suite/innodb_zip/r/create_options.result
+++ b/mysql-test/suite/innodb_zip/r/create_options.result
@@ -1,7 +1,4 @@
SET default_storage_engine=InnoDB;
-SET GLOBAL innodb_file_format=`Barracuda`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET GLOBAL innodb_file_per_table=ON;
SET SESSION innodb_strict_mode = ON;
# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
@@ -260,81 +257,17 @@ Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 1
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
# Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
-# and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope
-# and that they can be set to default values during strict mode.
-SET GLOBAL innodb_file_format=Antelope;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
-Got one of the listed errors
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-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 ( i INT ) ROW_FORMAT=COMPRESSED;
-Got one of the listed errors
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-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 ( i INT ) ROW_FORMAT=DYNAMIC;
-ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
-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 Redundant row_format=REDUNDANT
-DROP TABLE t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
-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 Compact row_format=COMPACT
-DROP TABLE t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
-SHOW WARNINGS;
-Level Code Message
-ALTER TABLE t1 KEY_BLOCK_SIZE=2;
-ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE'
-ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
-ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
-ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
-ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
-SET GLOBAL innodb_file_format=Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-DROP TABLE t1;
+# and a valid non-zero KEY_BLOCK_SIZE
+# can be set to default values during strict mode.
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
-SET GLOBAL innodb_file_format=Antelope;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f1 INT;
-ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW WARNINGS;
Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` int(11) DEFAULT NULL
+ `i` int(11) DEFAULT NULL,
+ `f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
@@ -342,9 +275,6 @@ Level Code Message
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
-SET GLOBAL innodb_file_format=Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 8) StrictMode=ON, Make sure ROW_FORMAT=COMPRESSED
# and a valid non-zero KEY_BLOCK_SIZE are rejected with
# innodb_file_per_table=OFF and that they can be set to default
@@ -742,9 +672,7 @@ Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic key_block_size=15
-# Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
-valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT
-is reverted to Antelope and then used again when ROW_FORMAT=Barracuda.
+# Test 15) StrictMode=OFF.
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
@@ -752,27 +680,12 @@ 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
-SET GLOBAL innodb_file_format=Antelope;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f1 INT;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SHOW WARNINGS;
Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-t1 Dynamic row_format=COMPRESSED key_block_size=1
-SET GLOBAL innodb_file_format=Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+t1 Compressed row_format=COMPRESSED key_block_size=1
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
@@ -786,18 +699,12 @@ 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 Dynamic row_format=DYNAMIC
-SET GLOBAL innodb_file_format=Antelope;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f1 INT;
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 Dynamic row_format=DYNAMIC
-SET GLOBAL innodb_file_format=Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
@@ -851,5 +758,3 @@ TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
# Cleanup
DROP TABLE t1;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix.result b/mysql-test/suite/innodb_zip/r/index_large_prefix.result
index fe03586546a..58d35cf2603 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix.result
@@ -94,18 +94,6 @@ create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16;
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_1(a2(4000));
-Got one of the listed errors
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-Error 1118 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
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_1(a2(4000));
Got one of the listed errors
show warnings;
@@ -128,19 +116,6 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
create index idx6 on worklog5743_1(a1, a2(428));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SET sql_mode= '';
-create index idx1 on worklog5743_2(a2(4000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_2(a2(4000));
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
show warnings;
@@ -163,18 +138,6 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
create index idx6 on worklog5743_2(a1, a2(940));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_4(a2(4000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_4(a2(4000));
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
show warnings;
@@ -197,18 +160,6 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
create index idx6 on worklog5743_4(a1, a2(1964));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_8(a2(1000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_8(a2(3073));
Warnings:
Note 1071 Specified key was too long; max key length is 3072 bytes
@@ -237,18 +188,6 @@ Error 1071 Specified key was too long; max key length is 3072 bytes
create index idx7 on worklog5743_8(a1, a2(2000), a3(1068));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_16(a2(1000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_16(a2(3073));
Warnings:
Note 1071 Specified key was too long; max key length is 3072 bytes
@@ -283,37 +222,21 @@ insert into worklog5743_2 values(9, repeat("a", 10000));
insert into worklog5743_4 values(9, repeat("a", 10000));
insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000));
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-insert into worklog5743_1 values(2, repeat("b", 10000));
-insert into worklog5743_2 values(2, repeat("b", 10000));
-insert into worklog5743_4 values(2, repeat("b", 10000));
-insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
-insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000));
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_2;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_8;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_16;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
begin;
update worklog5743_1 set a1 = 1000;
update worklog5743_2 set a1 = 1000;
@@ -323,23 +246,18 @@ update worklog5743_16 set a1 = 1000;
select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_2;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_8;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_16;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
index c2929bf7937..f1d72fbe281 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
@@ -97,14 +97,11 @@ drop table worklog5743;
create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1;
create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 768 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_1(a2(436));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -122,9 +119,6 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
create index idx6 on worklog5743_1(a1, a2(428));
show warnings;
Level Code Message
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000));
Warnings:
@@ -159,34 +153,31 @@ Error 1071 Specified key was too long; max key length is 768 bytes
create index idx6 on worklog5743_2(a1, a2(764));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_4(a2(4000));
Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 768 bytes
show create table worklog5743_4;
Table Create Table
worklog5743_4 CREATE TABLE `worklog5743_4` (
`a1` int(11) DEFAULT NULL,
`a2` text NOT NULL,
- KEY `idx1` (`a2`(767))
+ KEY `idx1` (`a2`(768))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
create index idx3 on worklog5743_4(a2(769));
Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 768 bytes
create index idx4 on worklog5743_4(a2(768));
Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
+Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release
create index idx5 on worklog5743_4(a1, a2(765));
ERROR 42000: Specified key was too long; max key length is 768 bytes
show warnings;
@@ -199,27 +190,15 @@ SET sql_mode= default;
insert into worklog5743_1 values(9, repeat("a", 10000));
insert into worklog5743_2 values(9, repeat("a", 10000));
insert into worklog5743_4 values(9, repeat("a", 10000));
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-insert into worklog5743_1 values(2, repeat("b", 10000));
-insert into worklog5743_2 values(2, repeat("b", 10000));
-insert into worklog5743_4 values(2, repeat("b", 10000));
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_2;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
begin;
update worklog5743_1 set a1 = 1000;
update worklog5743_2 set a1 = 1000;
@@ -227,15 +206,12 @@ update worklog5743_4 set a1 = 1000;
select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_2;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
index 60dafa2ac46..f064a823b59 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
@@ -98,18 +98,6 @@ create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1;
create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_1(a2(4000));
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
@@ -132,19 +120,6 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
create index idx6 on worklog5743_1(a1, a2(428));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SET sql_mode= '';
-create index idx1 on worklog5743_2(a2(4000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_2(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
@@ -167,18 +142,6 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
create index idx6 on worklog5743_2(a1, a2(940));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_4(a2(4000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx3 on worklog5743_4(a2(1537));
Warnings:
Note 1071 Specified key was too long; max key length is 1536 bytes
@@ -199,18 +162,6 @@ Error 1071 Specified key was too long; max key length is 1536 bytes
create index idx6 on worklog5743_4(a1, a2(1532));
show warnings;
Level Code Message
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create index idx1 on worklog5743_8(a2(1000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 767 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 767 bytes
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_8(a2(3073));
Warnings:
Note 1071 Specified key was too long; max key length is 1536 bytes
@@ -236,32 +187,18 @@ insert into worklog5743_1 values(9, repeat("a", 10000));
insert into worklog5743_2 values(9, repeat("a", 10000));
insert into worklog5743_4 values(9, repeat("a", 10000));
insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-insert into worklog5743_1 values(2, repeat("b", 10000));
-insert into worklog5743_2 values(2, repeat("b", 10000));
-insert into worklog5743_4 values(2, repeat("b", 10000));
-insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
-set global innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_2;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_8;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
-2 bbbbbbbbbbbbbbbbbbbb
begin;
update worklog5743_1 set a1 = 1000;
update worklog5743_2 set a1 = 1000;
@@ -270,19 +207,15 @@ update worklog5743_8 set a1 = 1000;
select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_2;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
select a1, left(a2, 20) from worklog5743_8;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
-1000 bbbbbbbbbbbbbbbbbbbb
connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
diff --git a/mysql-test/suite/innodb_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result
index 419671a6735..0da1d6bbe85 100644
--- a/mysql-test/suite/innodb_zip/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result
@@ -7,9 +7,6 @@ table_name row_format data_length index_length
SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata;
set session innodb_strict_mode=0;
set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET @@global.innodb_stats_on_metadata=ON;
create table t0(a int primary key) engine=innodb row_format=compressed;
Warnings:
@@ -19,7 +16,6 @@ create table t00(a int primary key) engine=innodb
key_block_size=4 row_format=compressed;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
@@ -29,23 +25,17 @@ create table t3(a int primary key) engine=innodb row_format=compact;
create table t4(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
create table t5(a int primary key) engine=innodb
key_block_size=1 row_format=redundant;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
set global innodb_file_per_table=on;
create table t6(a int primary key) engine=innodb
key_block_size=1 row_format=redundant;
Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_format=`1`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
create table t7(a int primary key) engine=innodb
key_block_size=1 row_format=redundant;
Warnings:
@@ -72,7 +62,7 @@ row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t0 Dynamic {valid} 0
mysqltest_innodb_zip t00 Dynamic {valid} 0
@@ -93,15 +83,15 @@ mysqltest_innodb_zip t9 Compact {valid} 0
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t1 Dynamic {valid} 0
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t1 Compact {valid} 0
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t1 Redundant {valid} 0
drop table t1;
@@ -135,7 +125,7 @@ mysqltest_innodb_zip.t1 analyze status OK
analyze table t2;
Table Op Msg_type Msg_text
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';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t1 Compressed 2048 1024
mysqltest_innodb_zip t2 Dynamic {valid} 0
@@ -159,40 +149,7 @@ count(*)
1
update t1 set c3 = repeat('E', 20000) where c1 = 1;
drop table t1;
-set global innodb_file_format=`0`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=`1`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=`2`;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '2'
-set global innodb_file_format=`-1`;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '-1'
-set global innodb_file_format=`Antelope`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format=`Barracuda`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format=`Cheetah`;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Cheetah'
-set global innodb_file_format=`abc`;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'abc'
-set global innodb_file_format=`1a`;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '1a'
-set global innodb_file_format=``;
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of ''
set global innodb_file_per_table = on;
-set global innodb_file_format = `1`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
drop table t1;
@@ -212,7 +169,7 @@ create table t8 (id int primary key) engine = innodb row_format = compressed;
create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t1 Dynamic {valid} 0
mysqltest_innodb_zip t10 Compact {valid} 0
@@ -251,7 +208,7 @@ Error 1005 Can't create table `mysqltest_innodb_zip`.`t4` (errno: 140 "Wrong cre
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t5 (id int primary key) engine = innodb
key_block_size = 4 row_format = default;
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t1 Compressed 4096 0
mysqltest_innodb_zip t5 Compressed 4096 0
@@ -283,7 +240,7 @@ Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 1
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
create table t1 (id int primary key) engine = innodb key_block_size = 1;
@@ -319,90 +276,10 @@ show warnings;
Level Code Message
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
+SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name;
table_schema table_name row_format data_length index_length
mysqltest_innodb_zip t7 Dynamic {valid} 0
mysqltest_innodb_zip t8 Compact {valid} 0
mysqltest_innodb_zip t9 Redundant {valid} 0
drop table t7, t8, t9;
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options")
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Error 1005 Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t7` (errno: 140 "Wrong create options")
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Error 1005 Can't create table `mysqltest_innodb_zip`.`t7` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-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
-mysqltest_innodb_zip t8 Compact {valid} 0
-mysqltest_innodb_zip t9 Redundant {valid} 0
-drop table t8, t9;
-set global innodb_file_per_table=1;
-set global innodb_file_format=Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_format_max=`Antelope`;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-create table normal_table (
-c1 int
-) engine = innodb;
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-create table zip_table (
-c1 int
-) engine = innodb key_block_size = 4;
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-set global innodb_file_format_max=`Antelope`;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Antelope
-show table status;
-select @@innodb_file_format_max;
-@@innodb_file_format_max
-Barracuda
-drop table normal_table, zip_table;
DROP DATABASE mysqltest_innodb_zip;
diff --git a/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff b/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff
index c12527fd8a3..637c33416cd 100644
--- a/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff
+++ b/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff
@@ -9,7 +9,7 @@
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
-@@ -32,13 +32,13 @@
+@@ -36,13 +36,13 @@
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
@@ -25,7 +25,7 @@
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
-@@ -47,141 +47,90 @@
+@@ -51,141 +51,90 @@
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
@@ -213,7 +213,7 @@
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
-@@ -213,15 +162,21 @@
+@@ -217,15 +166,21 @@
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
@@ -235,7 +235,7 @@
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
-@@ -265,6 +220,7 @@
+@@ -269,6 +224,7 @@
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
@@ -243,7 +243,7 @@
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-@@ -272,6 +228,7 @@
+@@ -276,105 +232,11 @@
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
@@ -251,25 +251,7 @@
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-@@ -283,6 +240,7 @@
- ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
- SHOW WARNINGS;
- Level Code Message
-+Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4.
- Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
- Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
- Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-@@ -290,107 +248,13 @@
- ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
- SHOW WARNINGS;
- Level Code Message
-+Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4.
- Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
- Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
- Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
- SET GLOBAL innodb_file_format = `Barracuda`;
- Warnings:
- Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+ SET GLOBAL innodb_file_per_table = ON;
-# Test 7) This series of tests were moved from innodb-index to here
-# because the second alter table t1 assumes a 16k page size.
-# Moving the test allows the rest of innodb-index to be run on all
@@ -368,7 +350,7 @@
# 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,
-@@ -405,10 +269,6 @@
+@@ -389,10 +251,6 @@
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));
@@ -379,7 +361,7 @@
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));
-@@ -423,37 +283,15 @@
+@@ -407,37 +265,15 @@
COMMIT;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
@@ -421,7 +403,7 @@
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
-@@ -479,28 +317,12 @@
+@@ -463,28 +299,12 @@
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
@@ -452,7 +434,7 @@
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
DROP TABLE t1;
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
-@@ -581,27 +403,25 @@
+@@ -565,27 +385,25 @@
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
diff --git a/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff b/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff
index 6ac52b8de2c..a8e69e9b461 100644
--- a/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff
+++ b/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff
@@ -9,7 +9,7 @@
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
-@@ -32,13 +32,13 @@
+@@ -36,13 +36,13 @@
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
@@ -25,7 +25,7 @@
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
-@@ -49,133 +49,97 @@
+@@ -53,133 +53,97 @@
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),
@@ -201,7 +201,7 @@
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
-@@ -213,8 +177,11 @@
+@@ -217,8 +181,11 @@
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
@@ -213,7 +213,7 @@
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
-@@ -272,6 +239,7 @@
+@@ -276,105 +243,11 @@
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
@@ -221,17 +221,7 @@
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-@@ -290,107 +258,13 @@
- ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
- SHOW WARNINGS;
- Level Code Message
-+Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8.
- Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
- Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
- Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
- SET GLOBAL innodb_file_format = `Barracuda`;
- Warnings:
- Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+ SET GLOBAL innodb_file_per_table = ON;
-# Test 7) This series of tests were moved from innodb-index to here
-# because the second alter table t1 assumes a 16k page size.
-# Moving the test allows the rest of innodb-index to be run on all
@@ -330,7 +320,7 @@
# 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,
-@@ -405,10 +279,6 @@
+@@ -389,10 +262,6 @@
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));
@@ -341,7 +331,7 @@
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));
-@@ -423,30 +293,6 @@
+@@ -407,30 +276,6 @@
COMMIT;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
@@ -372,7 +362,7 @@
CREATE INDEX t1t ON t1 (t(767));
BEGIN;
UPDATE t1 SET t=@e;
-@@ -479,24 +325,8 @@
+@@ -463,24 +308,8 @@
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
@@ -397,7 +387,7 @@
KEY `t1t` (`t`(767)),
KEY `t1u` (`u`(767)),
KEY `t1ut` (`u`(767),`t`(767)),
-@@ -584,14 +414,14 @@
+@@ -568,14 +397,14 @@
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
@@ -414,7 +404,7 @@
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
-@@ -601,7 +431,7 @@
+@@ -585,7 +414,7 @@
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result
index 4127ef7c36f..3cf6e7a7a58 100644
--- a/mysql-test/suite/innodb_zip/r/page_size.result
+++ b/mysql-test/suite/innodb_zip/r/page_size.result
@@ -17,6 +17,10 @@ AND t.name LIKE 'mysql%'
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
mysql/innodb_index_stats 11 33 PRIMARY 3 3 4 50
mysql/innodb_table_stats 9 33 PRIMARY 3 3 2 50
+mysql/transaction_registry 8 33 PRIMARY 3 3 1 50
+mysql/transaction_registry 8 33 commit_id 4 2 1 50
+mysql/transaction_registry 8 33 begin_timestamp 5 0 1 50
+mysql/transaction_registry 8 33 commit_timestamp 6 0 2 50
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
@@ -276,26 +280,6 @@ Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
-SET GLOBAL innodb_file_format = `Antelope`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
-ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
-ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
-Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-SET GLOBAL innodb_file_format = `Barracuda`;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 7) This series of tests were moved from innodb-index to here
# because the second alter table t1 assumes a 16k page size.
# Moving the test allows the rest of innodb-index to be run on all
@@ -531,6 +515,8 @@ pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Redundant ENGINE=InnoDB;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
SET @r = repeat('a', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
@@ -562,6 +548,8 @@ pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 ENGINE=InnoDB;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
SET @r = repeat('a', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
diff --git a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result
index 6cb0b09dee0..2c66133404c 100644
--- a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result
@@ -1,5 +1,4 @@
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
-SET @large_prefix_orig = @@GLOBAL.innodb_large_prefix;
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY (col_1_varchar(3072))
@@ -1072,6 +1071,8 @@ CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY `prefix_primary` (col_1_varchar(3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
+Warnings:
+Warning 1280 Name 'prefix_primary' ignored for PRIMARY key.
INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
@@ -1103,6 +1104,8 @@ CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY `prefix_primary` (col_1_varchar(3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
+Warnings:
+Warning 1280 Name 'prefix_primary' ignored for PRIMARY key.
INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
@@ -1390,33 +1393,30 @@ ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000));
ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...' for key 'PRIMARY'
DROP TABLE worklog5743;
set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
+ERROR HY000: Variable 'innodb_large_prefix' is a read only variable
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY (col_1_varchar(3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
+DROP TABLE worklog5743;
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY (col_1_varchar(767))
) engine = innodb;
INSERT INTO worklog5743 VALUES(REPEAT('a',4000),REPEAT('b',4000));
-CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (767));
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
-ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT;
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1000));
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE;
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
+ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=COPY;
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
SHOW CREATE TABLE worklog5743;
Table Create Table
worklog5743 CREATE TABLE `worklog5743` (
`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))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+ KEY `prefix_idx` (`col_1_varchar`(1000))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE worklog5743;
-SET GLOBAL innodb_large_prefix = @large_prefix_orig;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
diff --git a/mysql-test/suite/innodb_zip/r/wl6501_1.result b/mysql-test/suite/innodb_zip/r/wl6501_1.result
deleted file mode 100644
index bf901804be5..00000000000
--- a/mysql-test/suite/innodb_zip/r/wl6501_1.result
+++ /dev/null
@@ -1,1202 +0,0 @@
-set global innodb_file_per_table=on;
-# Verify that 'TRUNCATE TABLE' statement works fine and the size
-# of .ibd file is equal to the initial size after truncation.
-drop table if exists t1,t2,t3,t4,t6;
-Warnings:
-Note 1051 Unknown table 'test.t1'
-Note 1051 Unknown table 'test.t2'
-Note 1051 Unknown table 'test.t3'
-Note 1051 Unknown table 'test.t4'
-Note 1051 Unknown table 'test.t6'
-create table t1(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=redundant;
-create table t2(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compact;
-create table t3(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compressed key_block_size=4;
-create table t4(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=dynamic;
-create temporary table t5(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb;
-create table t6 ( a int ) engine = innodb;
-insert into t6 values (50),(100),(150);
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-count(*)
-3
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_during_drop_index_temp_table";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_during_drop_index_temp_table point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t5;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_drop_of_sec_index point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_drop_of_sec_index point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t2;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_drop_of_sec_index point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t3;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_drop_of_sec_index point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t4;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-drop table t1, t2, t3, t4, t6;
-create table t1(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=redundant;
-create table t2(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compact;
-create table t3(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compressed key_block_size=4;
-create table t4(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=dynamic;
-create temporary table t5(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb;
-create table t6 ( a int ) engine = innodb;
-insert into t6 values (50),(100),(150);
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-count(*)
-3
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_drop_reinit_done_create_to_start---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t5;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_create_of_sec_index---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_create_of_sec_index---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t2;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_create_of_sec_index---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t3;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_on_create_of_sec_index---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t4;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-drop table t1, t2, t3, t4, t6;
-create table t1(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=redundant;
-create table t2(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compact;
-create table t3(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compressed key_block_size=4;
-create table t4(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=dynamic;
-create temporary table t5(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb;
-create table t6 ( a int ) engine = innodb;
-insert into t6 values (50),(100),(150);
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-count(*)
-3
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_before_log_removal point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_before_log_removal point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t2;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_before_log_removal point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t3;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_before_log_removal point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t4;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-drop table t1, t2, t3, t4, t6;
-create table t1(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=redundant;
-create table t2(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compact;
-create table t3(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compressed key_block_size=4;
-create table t4(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=dynamic;
-create temporary table t5(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb;
-create table t6 ( a int ) engine = innodb;
-insert into t6 values (50),(100),(150);
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-count(*)
-3
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t2;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t3;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t4;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-drop table t1, t2, t3, t4, t6;
-create table t1(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=redundant;
-create table t2(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compact;
-create table t3(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compressed key_block_size=4;
-create table t4(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=dynamic;
-create temporary table t5(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb;
-create table t6 ( a int ) engine = innodb;
-insert into t6 values (50),(100),(150);
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-count(*)
-3
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t2;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t3;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_truncate_done point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t4;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-drop table t1, t2, t3, t4, t6;
-create table t1(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=redundant;
-create table t2(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compact;
-create table t3(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=compressed key_block_size=4;
-create table t4(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb row_format=dynamic;
-create temporary table t5(c1 int not null,
-c2 int not null,
-c3 char(255) not null,
-c4 text(500) not null,
-c5 blob(500) not null,
-c6 varchar(500) not null,
-c7 varchar(500) not null,
-c8 datetime,
-c9 decimal(5,3),
-primary key (c1),
-index (c3,c4(50),c5(50)),
-index (c2))
-engine=innodb;
-create table t6 ( a int ) engine = innodb;
-insert into t6 values (50),(100),(150);
-select count(*) from t1;
-count(*)
-3
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-count(*)
-3
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_redo_log_write_complete point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-3
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_redo_log_write_complete point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t2;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-3
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_redo_log_write_complete point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t3;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-3
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-"---debug ib_trunc_crash_after_redo_log_write_complete point---"
-# Write file to make mysql-test-run.pl expect crash and restart
-# Run the crashing query
-truncate table t4;
-ERROR HY000: Lost connection to MySQL server during query
-# Restart the MySQL server
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t5;
-ERROR 42S02: Table 'test.t5' doesn't exist
-select count(*) from t6;
-count(*)
-3
-drop table t1, t2, t3, t4, t6;
diff --git a/mysql-test/suite/innodb_zip/r/wl6501_crash_3.result b/mysql-test/suite/innodb_zip/r/wl6501_crash_3.result
deleted file mode 100644
index 554bb2892f6..00000000000
--- a/mysql-test/suite/innodb_zip/r/wl6501_crash_3.result
+++ /dev/null
@@ -1,462 +0,0 @@
-call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
-call mtr.add_suppression("Cannot create file '.*'");
-call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
-set global innodb_file_per_table = on;
-"1. Hit crash point while writing redo log."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine=innodb row_format=compressed
-key_block_size=16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"2. Hit crash point on completion of redo log write."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"3. Hit crash point while dropping indexes."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"4. Hit crash point on completing drop of all indexes before creation"
-" of index is commenced."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"5. Hit crash point while creating indexes."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"6. Hit crash point after data is updated to system-table and"
-" in-memory dict."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"7. Hit crash point before/after log checkpoint is done."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 16;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-set global innodb_file_per_table = 1;
diff --git a/mysql-test/suite/innodb_zip/r/wl6501_crash_4.result b/mysql-test/suite/innodb_zip/r/wl6501_crash_4.result
deleted file mode 100644
index d766ecceaac..00000000000
--- a/mysql-test/suite/innodb_zip/r/wl6501_crash_4.result
+++ /dev/null
@@ -1,519 +0,0 @@
-call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
-call mtr.add_suppression("Cannot create file '.*'");
-call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
-set global innodb_file_per_table = on;
-"1. Hit crash point while writing redo log."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine=innodb row_format=compressed
-key_block_size=4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"2. Hit crash point on completion of redo log write."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"3. Hit crash point while dropping indexes."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"4. Hit crash point on completing drop of all indexes before creation"
-" of index is commenced."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"5. Hit crash point while creating indexes."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"6. Hit crash point after data is updated to system-table and"
-" in-memory dict."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"7. Hit crash point before/after log checkpoint is done."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-set global innodb_file_per_table = 1;
-call mtr.add_suppression("does not exist in the InnoDB internal");
-set global innodb_file_per_table = on;
-"1. Hit crash point on completing drop of all indexes before creation"
-" of index is commenced."
-set global innodb_file_per_table = 1;
-set innodb_strict_mode=off;
-create temporary table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check Error Table 'test.t' doesn't exist
-test.t check status Operation failed
-"2. Hit crash point after data is updated to system-table and"
-" in-memory dict."
-set global innodb_file_per_table = 1;
-set innodb_strict_mode=off;
-create temporary table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 4;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check Error Table 'test.t' doesn't exist
-test.t check status Operation failed
-set global innodb_file_per_table = 1;
diff --git a/mysql-test/suite/innodb_zip/r/wl6501_crash_5.result b/mysql-test/suite/innodb_zip/r/wl6501_crash_5.result
deleted file mode 100644
index b5fea6382ff..00000000000
--- a/mysql-test/suite/innodb_zip/r/wl6501_crash_5.result
+++ /dev/null
@@ -1,462 +0,0 @@
-call mtr.add_suppression("The file '.*' already exists though the corresponding table did not exist in the InnoDB data dictionary");
-call mtr.add_suppression("Cannot create file '.*'");
-call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'");
-set global innodb_file_per_table = on;
-"1. Hit crash point while writing redo log."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine=innodb row_format=compressed
-key_block_size=8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_while_writing_redo_log";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"2. Hit crash point on completion of redo log write."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_after_redo_log_write_complete";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"3. Hit crash point while dropping indexes."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_clust_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_uniq_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_drop_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"4. Hit crash point on completing drop of all indexes before creation"
-" of index is commenced."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"5. Hit crash point while creating indexes."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_clust_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_uniq_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_create_of_sec_index";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"6. Hit crash point after data is updated to system-table and"
-" in-memory dict."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-"7. Hit crash point before/after log checkpoint is done."
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_before_log_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-use test;
-set global innodb_file_per_table = 1;
-SET innodb_strict_mode=OFF;
-create table t (
-i int, f float, c char,
-primary key pk(i), unique findex(f), index ck(c))
-engine = innodb row_format = compressed
-key_block_size = 8;
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-set session debug = "+d,ib_trunc_crash_after_truncate_done";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-truncate table t;
-ERROR HY000: Lost connection to MySQL server during query
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
-select * from t;
-i f c
-insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
-select * from t;
-i f c
-1 1.1 a
-2 2.2 b
-3 3.3 c
-select * from t where f < 2.5;
-i f c
-1 1.1 a
-2 2.2 b
-drop table t;
-set global innodb_file_per_table = 1;
diff --git a/mysql-test/suite/innodb_zip/r/wl6501_scale_1.result b/mysql-test/suite/innodb_zip/r/wl6501_scale_1.result
deleted file mode 100644
index 3a74b6ebc11..00000000000
--- a/mysql-test/suite/innodb_zip/r/wl6501_scale_1.result
+++ /dev/null
@@ -1,345 +0,0 @@
-set innodb_strict_mode=OFF;
-create procedure populate()
-begin
-declare i int default 1;
-while (i <= 5000) do
-insert into t1 values (i, 'a', 'b');
-insert into t2 values (i, 'a', 'b');
-insert into t3 values (i, 'a', 'b');
-set i = i + 1;
-end while;
-end|
-create procedure populate_small()
-begin
-declare i int default 10001;
-while (i <= 12000) do
-insert into t1 values (i, 'c', 'd');
-insert into t2 values (i, 'a', 'b');
-insert into t3 values (i, 'a', 'b');
-set i = i + 1;
-end while;
-end|
-set global innodb_file_per_table = 1;
-create table tNUMBER
-(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
-index cNUMBER_idx(cNUMBER))
-engine=innodb row_format=compact
-key_block_size=NUMBER;
-Warnings:
-Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED.
-create table t2
-(i int, c1 char(100), c2 char(100),
-index c1_idx(c1))
-engine=innodb row_format=compact
-key_block_size=16;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
-create temporary table t3
-(i int, c1 char(100), c2 char(100),
-index c1_idx(c1))
-engine=innodb row_format=compact
-key_block_size=16;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-begin;
-call populate();
-commit;
-select count(*) from t1;
-count(*)
-5000
-select count(*) from t2;
-count(*)
-5000
-select count(*) from t3;
-count(*)
-5000
-truncate table t1;
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-5000
-select count(*) from t3;
-count(*)
-5000
-call populate_small();
-select count(*) from t1;
-count(*)
-2000
-select count(*) from t2;
-count(*)
-7000
-select count(*) from t3;
-count(*)
-7000
-truncate table t2;
-truncate table t3;
-select count(*) from t1;
-count(*)
-2000
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-call populate_small();
-select count(*) from t1;
-count(*)
-4000
-select count(*) from t2;
-count(*)
-2000
-select count(*) from t3;
-count(*)
-2000
-drop table t1;
-drop table t2;
-drop table t3;
-drop procedure populate;
-drop procedure populate_small;
-set global innodb_file_format = Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_per_table = 1;
-set innodb_strict_mode=OFF;
-create procedure populate()
-begin
-declare i int default 1;
-while (i <= 5000) do
-insert into t1 values (i, 'a', 'b');
-insert into t2 values (i, 'a', 'b');
-insert into t3 values (i, 'a', 'b');
-set i = i + 1;
-end while;
-end|
-create procedure populate_small()
-begin
-declare i int default 10001;
-while (i <= 12000) do
-insert into t1 values (i, 'c', 'd');
-insert into t2 values (i, 'a', 'b');
-insert into t3 values (i, 'a', 'b');
-set i = i + 1;
-end while;
-end|
-set global innodb_file_per_table = 1;
-create table tNUMBER
-(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
-index cNUMBER_idx(cNUMBER))
-engine=innodb row_format=compressed
-key_block_size=NUMBER;
-create table t2
-(i int, c1 char(100), c2 char(100),
-index c1_idx(c1))
-engine=innodb row_format=compressed
-key_block_size=16;
-create temporary table t3
-(i int, c1 char(100), c2 char(100),
-index c1_idx(c1))
-engine=innodb row_format=compressed
-key_block_size=16;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
-Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-begin;
-call populate();
-commit;
-select count(*) from t1;
-count(*)
-5000
-select count(*) from t2;
-count(*)
-5000
-select count(*) from t3;
-count(*)
-5000
-truncate table t1;
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-5000
-select count(*) from t3;
-count(*)
-5000
-call populate_small();
-select count(*) from t1;
-count(*)
-2000
-select count(*) from t2;
-count(*)
-7000
-select count(*) from t3;
-count(*)
-7000
-truncate table t2;
-truncate table t3;
-select count(*) from t1;
-count(*)
-2000
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-call populate_small();
-select count(*) from t1;
-count(*)
-4000
-select count(*) from t2;
-count(*)
-2000
-select count(*) from t3;
-count(*)
-2000
-drop table t1;
-drop table t2;
-drop table t3;
-drop procedure populate;
-drop procedure populate_small;
-set global innodb_file_format = Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_per_table = 1;
-set innodb_strict_mode=OFF;
-create procedure populate()
-begin
-declare i int default 1;
-while (i <= 5000) do
-insert into t1 values (i, 'a', 'b');
-insert into t2 values (i, 'a', 'b');
-insert into t3 values (i, 'a', 'b');
-set i = i + 1;
-end while;
-end|
-create procedure populate_small()
-begin
-declare i int default 10001;
-while (i <= 12000) do
-insert into t1 values (i, 'c', 'd');
-insert into t2 values (i, 'a', 'b');
-insert into t3 values (i, 'a', 'b');
-set i = i + 1;
-end while;
-end|
-set global innodb_file_per_table = 0;
-create table tNUMBER
-(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
-index cNUMBER_idx(cNUMBER))
-engine=innodb row_format=compact
-key_block_size=NUMBER;
-Warnings:
-Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
-create table t2
-(i int, c1 char(100), c2 char(100),
-index c1_idx(c1))
-engine=innodb row_format=compact
-key_block_size=16;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
-create temporary table t3
-(i int, c1 char(100), c2 char(100),
-index c1_idx(c1))
-engine=innodb row_format=compact
-key_block_size=16;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-begin;
-call populate();
-commit;
-select count(*) from t1;
-count(*)
-5000
-select count(*) from t2;
-count(*)
-5000
-select count(*) from t3;
-count(*)
-5000
-truncate table t1;
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-5000
-select count(*) from t3;
-count(*)
-5000
-call populate_small();
-select count(*) from t1;
-count(*)
-2000
-select count(*) from t2;
-count(*)
-7000
-select count(*) from t3;
-count(*)
-7000
-truncate table t2;
-truncate table t3;
-select count(*) from t1;
-count(*)
-2000
-select count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-call populate_small();
-select count(*) from t1;
-count(*)
-4000
-select count(*) from t2;
-count(*)
-2000
-select count(*) from t3;
-count(*)
-2000
-drop table t1;
-drop table t2;
-drop table t3;
-drop procedure populate;
-drop procedure populate_small;
-set global innodb_file_format = Barracuda;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-set global innodb_file_per_table = 1;
diff --git a/mysql-test/suite/innodb_zip/t/bug56680.test b/mysql-test/suite/innodb_zip/t/bug56680.test
index da37f6a28b4..54cbc7ca798 100644
--- a/mysql-test/suite/innodb_zip/t/bug56680.test
+++ b/mysql-test/suite/innodb_zip/t/bug56680.test
@@ -1,20 +1,18 @@
#Want to skip this test from daily Valgrind execution
--source include/no_valgrind_without_big.inc
+# Embedded server tests do not support restarting.
+--source include/not_embedded.inc
#
# Bug #56680 InnoDB may return wrong results from a case-insensitive index
#
-- source include/innodb_page_size_small.inc
-- disable_query_log
-SET @tx_isolation_orig = @@tx_isolation;
-SET @innodb_file_per_table_orig = @@innodb_file_per_table;
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
# whenever possible.
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
--- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 1;
-- enable_query_log
SET GLOBAL tx_isolation='REPEATABLE-READ';
@@ -129,11 +127,9 @@ INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
SELECT HEX(b) FROM bug56680_2 LIMIT 3;
CHECK TABLE bug56680_2;
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+
+CHECK TABLE bug56680_2;
DROP TABLE bug56680_2;
DROP TABLE bug56680;
-
--- disable_query_log
-SET GLOBAL tx_isolation = @tx_isolation_orig;
-SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
--- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
-SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb_zip/t/create_options.test b/mysql-test/suite/innodb_zip/t/create_options.test
index 58fd764932c..fce64060df3 100644
--- a/mysql-test/suite/innodb_zip/t/create_options.test
+++ b/mysql-test/suite/innodb_zip/t/create_options.test
@@ -36,8 +36,7 @@
# 4) KEY_BLOCK_SIZE=1,2,4,8 & 16 are incompatible with COMPACT, DYNAMIC &
# REDUNDANT.
# 5) KEY_BLOCK_SIZE=1,2,4,8 & 16 as well as ROW_FORMAT=COMPRESSED
-# are incompatible with innodb_file_format=Antelope
-# and innodb_file_per_table=OFF
+# are incompatible with innodb_file_per_table=OFF
# 6) KEY_BLOCK_SIZE on an ALTER must occur with ROW_FORMAT=COMPRESSED
# or ROW_FORMAT=DEFAULT if the ROW_FORMAT was previously specified
# as COMPACT, DYNAMIC or REDUNDANT.
@@ -49,7 +48,7 @@
# 2. Ignore a bad ROW_FORMAT, defaulting to COMPACT.
# 3. Ignore a valid KEY_BLOCK_SIZE when an incompatible but valid
# ROW_FORMAT is specified.
-# 4. If innodb_file_format=Antelope or innodb_file_per_table=OFF
+# 4. If innodb_file_per_table=OFF
# it will ignore ROW_FORMAT=COMPRESSED and non-zero KEY_BLOCK_SIZEs.
#
# See InnoDB documentation page "SQL Compression Syntax Warnings and Errors"
@@ -60,13 +59,9 @@
--source include/innodb_page_size_small.inc
SET default_storage_engine=InnoDB;
---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;
# The first half of these tests are with strict mode ON.
@@ -215,41 +210,9 @@ CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9;
SHOW WARNINGS;
--echo # Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
---echo # and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope
---echo # and that they can be set to default values during strict mode.
-SET GLOBAL innodb_file_format=Antelope;
---error ER_ILLEGAL_HA,1005
-CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
-SHOW WARNINGS;
---error ER_ILLEGAL_HA,1005
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
-SHOW WARNINGS;
---error 1005
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
-SHOW WARNINGS;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-DROP TABLE t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
-SHOW WARNINGS;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-DROP TABLE t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
-SHOW WARNINGS;
---error ER_ILLEGAL_HA_CREATE_OPTION
-ALTER TABLE t1 KEY_BLOCK_SIZE=2;
-SHOW WARNINGS;
---error ER_ILLEGAL_HA_CREATE_OPTION
-ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
-SHOW WARNINGS;
---error ER_ILLEGAL_HA_CREATE_OPTION
-ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
-SHOW WARNINGS;
-SET GLOBAL innodb_file_format=Barracuda;
-DROP TABLE t1;
+--echo # and a valid non-zero KEY_BLOCK_SIZE
+--echo # can be set to default values during strict mode.
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
-SET GLOBAL innodb_file_format=Antelope;
---error ER_ILLEGAL_HA_CREATE_OPTION
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
SHOW CREATE TABLE t1;
@@ -257,7 +220,6 @@ ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
-SET GLOBAL innodb_file_format=Barracuda;
--echo # Test 8) StrictMode=ON, Make sure ROW_FORMAT=COMPRESSED
--echo # and a valid non-zero KEY_BLOCK_SIZE are rejected with
@@ -466,18 +428,14 @@ CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
---echo # Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
---echo valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT
---echo is reverted to Antelope and then used again when ROW_FORMAT=Barracuda.
+--echo # Test 15) StrictMode=OFF.
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-SET GLOBAL innodb_file_format=Antelope;
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-SET GLOBAL innodb_file_format=Barracuda;
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
@@ -485,11 +443,9 @@ DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-SET GLOBAL innodb_file_format=Antelope;
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-SET GLOBAL innodb_file_format=Barracuda;
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
@@ -527,6 +483,5 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
DROP TABLE t1;
--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;
--enable_query_log
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix.test b/mysql-test/suite/innodb_zip/t/index_large_prefix.test
index d61cce8d484..bc76f52dcbf 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix.test
@@ -137,11 +137,6 @@ create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16;
# See page_zip_empty_size() and Bug #47495 for more detail.
# Test edge cases for indexes using key_block_size=1
-set global innodb_large_prefix=0;
--- error ER_TOO_LONG_KEY,1118
-create index idx1 on worklog5743_1(a2(4000));
-show warnings;
-set global innodb_large_prefix=1;
-- error ER_TOO_LONG_KEY,1118
create index idx2 on worklog5743_1(a2(4000));
show warnings;
@@ -159,12 +154,6 @@ create index idx6 on worklog5743_1(a1, a2(428));
show warnings;
# Test edge cases for indexes using key_block_size=2
-set global innodb_large_prefix=0;
-# Check index creation behavior without STRICT mode
-SET sql_mode= '';
-create index idx1 on worklog5743_2(a2(4000));
-show warnings;
-set global innodb_large_prefix=1;
-- error ER_TOO_BIG_ROWSIZE
create index idx2 on worklog5743_2(a2(4000));
show warnings;
@@ -182,10 +171,6 @@ create index idx6 on worklog5743_2(a1, a2(940));
show warnings;
# Test edge cases for indexes using key_block_size=4
-set global innodb_large_prefix=0;
-create index idx1 on worklog5743_4(a2(4000));
-show warnings;
-set global innodb_large_prefix=1;
-- error ER_TOO_BIG_ROWSIZE
create index idx2 on worklog5743_4(a2(4000));
show warnings;
@@ -203,10 +188,6 @@ create index idx6 on worklog5743_4(a1, a2(1964));
show warnings;
# Test edge cases for indexes using key_block_size=8
-set global innodb_large_prefix=0;
-create index idx1 on worklog5743_8(a2(1000));
-show warnings;
-set global innodb_large_prefix=1;
create index idx2 on worklog5743_8(a2(3073));
show warnings;
create index idx3 on worklog5743_8(a2(3072));
@@ -223,10 +204,6 @@ create index idx7 on worklog5743_8(a1, a2(2000), a3(1068));
show warnings;
# Test edge cases for indexes using key_block_size=16
-set global innodb_large_prefix=0;
-create index idx1 on worklog5743_16(a2(1000));
-show warnings;
-set global innodb_large_prefix=1;
create index idx2 on worklog5743_16(a2(3073));
show warnings;
create index idx3 on worklog5743_16(a2(3072));
@@ -250,16 +227,6 @@ insert into worklog5743_4 values(9, repeat("a", 10000));
insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000));
-# Now if we change the global innodb_large_prefix back to 767,
-# updates to these indexes should still be allowed.
-set global innodb_large_prefix=0;
-insert into worklog5743_1 values(2, repeat("b", 10000));
-insert into worklog5743_2 values(2, repeat("b", 10000));
-insert into worklog5743_4 values(2, repeat("b", 10000));
-insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
-insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000));
-set global innodb_large_prefix=1;
-
select a1, left(a2, 20) from worklog5743_1;
select a1, left(a2, 20) from worklog5743_2;
select a1, left(a2, 20) from worklog5743_4;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test b/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
index cc4f9f5387d..1bfff79e94c 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
@@ -136,7 +136,6 @@ create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
# See page_zip_empty_size() and Bug #47495 for more detail.
# Test edge cases for indexes using key_block_size=1
-set global innodb_large_prefix=0;
-- error ER_TOO_BIG_ROWSIZE
create index idx1 on worklog5743_1(a2(4000));
show warnings;
@@ -154,7 +153,6 @@ create index idx6 on worklog5743_1(a1, a2(428));
show warnings;
# Test edge cases for indexes using key_block_size=2
-set global innodb_large_prefix=1;
SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000));
show warnings;
@@ -169,7 +167,6 @@ show warnings;
create index idx6 on worklog5743_2(a1, a2(764));
show warnings;
# Test edge cases for indexes using key_block_size=4
-set global innodb_large_prefix=0;
create index idx1 on worklog5743_4(a2(4000));
show warnings;
show create table worklog5743_4;
@@ -188,14 +185,6 @@ insert into worklog5743_1 values(9, repeat("a", 10000));
insert into worklog5743_2 values(9, repeat("a", 10000));
insert into worklog5743_4 values(9, repeat("a", 10000));
-# Now if we change the global innodb_large_prefix back to 767,
-# updates to these indexes should still be allowed.
-set global innodb_large_prefix=0;
-insert into worklog5743_1 values(2, repeat("b", 10000));
-insert into worklog5743_2 values(2, repeat("b", 10000));
-insert into worklog5743_4 values(2, repeat("b", 10000));
-set global innodb_large_prefix=1;
-
select a1, left(a2, 20) from worklog5743_1;
select a1, left(a2, 20) from worklog5743_2;
select a1, left(a2, 20) from worklog5743_4;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test b/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
index 81e7df3582f..cb27a9e9776 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
@@ -138,11 +138,6 @@ create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
# See page_zip_empty_size() and Bug #47495 for more detail.
# Test edge cases for indexes using key_block_size=1
-set global innodb_large_prefix=0;
--- error ER_TOO_BIG_ROWSIZE
-create index idx1 on worklog5743_1(a2(4000));
-show warnings;
-set global innodb_large_prefix=1;
-- error ER_TOO_BIG_ROWSIZE
create index idx2 on worklog5743_1(a2(4000));
show warnings;
@@ -160,11 +155,6 @@ create index idx6 on worklog5743_1(a1, a2(428));
show warnings;
# Test edge cases for indexes using key_block_size=2
-set global innodb_large_prefix=0;
-SET sql_mode= '';
-create index idx1 on worklog5743_2(a2(4000));
-show warnings;
-set global innodb_large_prefix=1;
-- error ER_TOO_BIG_ROWSIZE
create index idx2 on worklog5743_2(a2(4000));
show warnings;
@@ -182,10 +172,6 @@ create index idx6 on worklog5743_2(a1, a2(940));
show warnings;
# Test edge cases for indexes using key_block_size=4
-set global innodb_large_prefix=0;
-create index idx1 on worklog5743_4(a2(4000));
-show warnings;
-set global innodb_large_prefix=1;
create index idx3 on worklog5743_4(a2(1537));
show warnings;
create index idx4 on worklog5743_4(a2(1536));
@@ -197,10 +183,6 @@ create index idx6 on worklog5743_4(a1, a2(1532));
show warnings;
# Test edge cases for indexes using key_block_size=8
-set global innodb_large_prefix=0;
-create index idx1 on worklog5743_8(a2(1000));
-show warnings;
-set global innodb_large_prefix=1;
create index idx2 on worklog5743_8(a2(3073));
show warnings;
create index idx3 on worklog5743_8(a2(3072));
@@ -218,15 +200,6 @@ insert into worklog5743_2 values(9, repeat("a", 10000));
insert into worklog5743_4 values(9, repeat("a", 10000));
insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
-# Now if we change the global innodb_large_prefix back to 767,
-# updates to these indexes should still be allowed.
-set global innodb_large_prefix=0;
-insert into worklog5743_1 values(2, repeat("b", 10000));
-insert into worklog5743_2 values(2, repeat("b", 10000));
-insert into worklog5743_4 values(2, repeat("b", 10000));
-insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
-set global innodb_large_prefix=1;
-
select a1, left(a2, 20) from worklog5743_1;
select a1, left(a2, 20) from worklog5743_2;
select a1, left(a2, 20) from worklog5743_4;
diff --git a/mysql-test/suite/innodb_zip/t/innodb-zip.test b/mysql-test/suite/innodb_zip/t/innodb-zip.test
index a2b55144c61..9049b231191 100644
--- a/mysql-test/suite/innodb_zip/t/innodb-zip.test
+++ b/mysql-test/suite/innodb_zip/t/innodb-zip.test
@@ -7,16 +7,12 @@ SELECT table_name, row_format, data_length, index_length
WHERE table_schema='mysqltest_innodb_zip';
let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
-let $innodb_file_format_orig=`select @@innodb_file_format`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata;
---let $query_i_s = SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql'
+--let $query_i_s = SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' order by table_name
set session innodb_strict_mode=0;
set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
SET @@global.innodb_stats_on_metadata=ON;
create table t0(a int primary key) engine=innodb row_format=compressed;
@@ -32,7 +28,6 @@ key_block_size=1 row_format=redundant;
set global innodb_file_per_table=on;
create table t6(a int primary key) engine=innodb
key_block_size=1 row_format=redundant;
-set global innodb_file_format=`1`;
create table t7(a int primary key) engine=innodb
key_block_size=1 row_format=redundant;
create table t8(a int primary key) engine=innodb
@@ -128,34 +123,7 @@ select count(*) from t1 where c4 = repeat('C', 20000);
update t1 set c3 = repeat('E', 20000) where c1 = 1;
drop table t1;
-#
-#
-# Test innodb_file_format
-#
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
--- error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=`2`;
--- error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=`-1`;
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
--- error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=`Cheetah`;
--- error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=`abc`;
--- error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=`1a`;
--- error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format=``;
-
-#test strict mode.
-# this does not work anymore, has been removed from mysqltest
-# -- enable_errors
set global innodb_file_per_table = on;
-set global innodb_file_format = `1`;
set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
@@ -282,79 +250,12 @@ create table t9 (id int primary key) engine = innodb row_format = redundant;
--eval $query_i_s
drop table t7, t8, t9;
-#test valid values with innodb_file_format unset
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-
---replace_regex / - .*[0-9]*[)]/)/
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
---replace_regex / - .*[0-9]*[)]/)/
-show warnings;
---replace_regex / - .*[0-9]*[)]/)/
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
---replace_regex / - .*[0-9]*[)]/)/
-show warnings;
---replace_regex / - .*[0-9]*[)]/)/
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show warnings;
-
-# Tests for key_block_size = 8 and 16 were moved to innodb_16k, innodb_8k
-# and innodb_4k since they get different warnings with smaller page sizes.
-
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
---replace_regex / - .*[0-9]*[)]/)/
-show warnings;
---replace_regex / - .*[0-9]*[)]/)/
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
---replace_regex / - .*[0-9]*[)]/)/
-show warnings;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-
---replace_result 16384 {valid} 8192 {valid} 4096 {valid}
---eval $query_i_s
-drop table t8, t9;
-
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
-#
-# Testing of tablespace tagging
-#
--- disable_info
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format_max=`Antelope`;
-create table normal_table (
- c1 int
-) engine = innodb;
-select @@innodb_file_format_max;
-create table zip_table (
- c1 int
-) engine = innodb key_block_size = 4;
-select @@innodb_file_format_max;
-set global innodb_file_format_max=`Antelope`;
-select @@innodb_file_format_max;
--- disable_result_log
-show table status;
--- enable_result_log
-select @@innodb_file_format_max;
-drop table normal_table, zip_table;
--- disable_result_log
-
#
# restore environment to the state it was before this test execution
#
-- disable_query_log
-eval set global innodb_file_format=$format;
eval set global innodb_file_per_table=$per_table;
-eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
SET @@global.innodb_stats_on_metadata=@save_innodb_stats_on_metadata;
--enable_query_log
diff --git a/mysql-test/suite/innodb_zip/t/page_size.test b/mysql-test/suite/innodb_zip/t/page_size.test
index bb4d2da077f..575259a7855 100644
--- a/mysql-test/suite/innodb_zip/t/page_size.test
+++ b/mysql-test/suite/innodb_zip/t/page_size.test
@@ -500,15 +500,6 @@ SHOW WARNINGS;
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
SHOW WARNINGS;
SET GLOBAL innodb_file_per_table = ON;
-SET GLOBAL innodb_file_format = `Antelope`;
---error ER_CANT_CREATE_TABLE
-CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
-SHOW WARNINGS;
---error ER_CANT_CREATE_TABLE
-CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
-SHOW WARNINGS;
-SET GLOBAL innodb_file_format = `Barracuda`;
-
if ($INNODB_PAGE_SIZE == 16384) {
--echo # Test 7) This series of tests were moved from innodb-index to here
diff --git a/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test b/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
index c52ef09fe90..55e69c5fca5 100644
--- a/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
@@ -16,9 +16,6 @@
--source include/have_innodb_16k.inc
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
-
-SET @large_prefix_orig = @@GLOBAL.innodb_large_prefix;
-
# Prefix index with VARCHAR data type , primary/secondary index and DML ops
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
@@ -1117,8 +1114,8 @@ AND col_2_varbinary = REPEAT("o", 4000);
DROP INDEX prefix_idx ON worklog5743;
# Again add index length > 3072.
-# If "innodb_large_prefix" is turned on, than the index prefix larger than 3072
-# will be truncated to 3072. If the table is REDUNDANT and COMPACT, which does
+# index prefix larger than 3072 will be truncated to 3072
+# For the ROW_FORMAT of REDUNDANT or COMPACT, which do
# not support prefix > 767, the create index will be rejected.
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (4000));
@@ -1174,9 +1171,10 @@ WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
DROP INDEX prefix_idx ON worklog5743;
# Again add index length > 3072.
-# If "innodb_large_prefix" is turned on, than the index prefix larger than 3072
-# will be truncated to 3072. In STRICT mode, the statement will fail with error.
-# If the table is REDUNDANT or COMPACT, which does not support prefix > 767, the create index will be rejected.
+# index prefix larger than 3072 will be truncated to 3072
+# In STRICT mode, the statement will fail with error.
+# For ROW_FORMAT of REDUNDANT or COMPACT, which does not support prefix > 767,
+# the create index will be rejected.
# --error ER_TOO_LONG_KEY
CREATE INDEX prefix_idx ON worklog5743(col_1_text (4000));
#CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072));
@@ -1262,8 +1260,8 @@ ALTER TABLE worklog5743 DROP PRIMARY KEY;
# Again add index length > 3072. Expect error.Length exceeds maximum supported
# key length
# Again add index length > 3072.
-# If "innodb_large_prefix" is turned on, than the index prefix larger than 3072
-# will be truncated to 3072. If the table is REDUNDANT and COMPACT, which does
+# index prefix larger than 3072 will be truncated to 3072.
+# For ROW_FORMAT of REDUNDANT or COMPACT, which do
# not support prefix > 767, the create index will be rejected.
# Index length is truncated only for 'create index' , but error if we add
# prefix index with length > 3072
@@ -1303,13 +1301,13 @@ ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000));
DROP TABLE worklog5743;
# -----------------------------------------------------------------------------
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_large_prefix=0;
-# Prefix index > 767 is allowed if innodb_large_prefix is set to 1
---error ER_TOO_LONG_KEY
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY (col_1_varchar(3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
+DROP TABLE worklog5743;
# -----------------------------------------------------------------------------
@@ -1322,13 +1320,11 @@ PRIMARY KEY (col_1_varchar(767))
INSERT INTO worklog5743 VALUES(REPEAT('a',4000),REPEAT('b',4000));
# Prefix index > 767 is truncated with REDUNDANT and COMPACT
--enable_info
-# FIXME: MDEV-15257 Invalid CREATE INDEX fails to report error correctly
-#--error ER_TOO_LONG_KEY
-#CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1000));
-CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (767));
-ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT;
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1000));
+--error ER_INDEX_COLUMN_TOO_LONG
+ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE;
+--error ER_INDEX_COLUMN_TOO_LONG
+ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=COPY;
--disable_info
SHOW CREATE TABLE worklog5743;
DROP TABLE worklog5743;
-
-SET GLOBAL innodb_large_prefix = @large_prefix_orig;
diff --git a/mysql-test/suite/innodb_zip/t/recover.test b/mysql-test/suite/innodb_zip/t/recover.test
index 0cfc2b672fb..f32ff3d3783 100644
--- a/mysql-test/suite/innodb_zip/t/recover.test
+++ b/mysql-test/suite/innodb_zip/t/recover.test
@@ -1,5 +1,4 @@
---source include/have_innodb.inc
---source include/have_innodb_max_16k.inc
+--source include/innodb_page_size_small.inc
--source include/not_embedded.inc
--disable_query_log
diff --git a/mysql-test/suite/innodb_zip/t/restart.opt b/mysql-test/suite/innodb_zip/t/restart.opt
index 8101a8573fc..52314cbf241 100644
--- a/mysql-test/suite/innodb_zip/t/restart.opt
+++ b/mysql-test/suite/innodb_zip/t/restart.opt
@@ -1,4 +1,3 @@
--loose-innodb-sys-tables
--loose-innodb-sys-tablespaces
--loose-innodb-sys-datafiles
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_1.opt b/mysql-test/suite/innodb_zip/t/wl6501_1.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_1.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_1.test b/mysql-test/suite/innodb_zip/t/wl6501_1.test
deleted file mode 100644
index dd8b5f65b31..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_1.test
+++ /dev/null
@@ -1,451 +0,0 @@
-
-####################################################################
-# TC to check truncate table statement atomicity for single #
-# tablespace #
-# Sceanrio covered: #
-# 1. Debug points added for worklog #
-# 2. Table with differnt row types #
-# 3. Transactional statement. #
-####################################################################
-
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/big_test.inc
---source include/have_innodb_16k.inc
-
-# Valgrind would result in a "long semaphore wait" inside InnoDB
---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
-
-#-----------------------------------------------------------------------
---disable_query_log
-let $MYSQL_DATA_DIR= `select @@datadir`;
-let $data_directory = data directory='$MYSQL_TMP_DIR/alt_dir';
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-call mtr.add_suppression("InnoDB.*table did not exist in the InnoDB data dictionary.*");
-call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds.*");
-call mtr.add_suppression("InnoDB: Cannot create file.*");
-call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'.*");
-call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds");
-call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
---enable_query_log
-
-#-----------------------------------------------------------------------
-set global innodb_file_per_table=on;
---echo # Verify that 'TRUNCATE TABLE' statement works fine and the size
---echo # of .ibd file is equal to the initial size after truncation.
-
-#-----------------------------------------------------------------------
-drop table if exists t1,t2,t3,t4,t6;
-let $cnt = 6;
-while ($cnt) {
-
- # table with basic data type + primary ,secondary,composite,prefix index
- create table t1(c1 int not null,
- c2 int not null,
- c3 char(255) not null,
- c4 text(500) not null,
- c5 blob(500) not null,
- c6 varchar(500) not null,
- c7 varchar(500) not null,
- c8 datetime,
- c9 decimal(5,3),
- primary key (c1),
- index (c3,c4(50),c5(50)),
- index (c2))
- engine=innodb row_format=redundant;
-
-
- create table t2(c1 int not null,
- c2 int not null,
- c3 char(255) not null,
- c4 text(500) not null,
- c5 blob(500) not null,
- c6 varchar(500) not null,
- c7 varchar(500) not null,
- c8 datetime,
- c9 decimal(5,3),
- primary key (c1),
- index (c3,c4(50),c5(50)),
- index (c2))
- engine=innodb row_format=compact;
-
-
- # with row type , key block size = 4K
- create table t3(c1 int not null,
- c2 int not null,
- c3 char(255) not null,
- c4 text(500) not null,
- c5 blob(500) not null,
- c6 varchar(500) not null,
- c7 varchar(500) not null,
- c8 datetime,
- c9 decimal(5,3),
- primary key (c1),
- index (c3,c4(50),c5(50)),
- index (c2))
- engine=innodb row_format=compressed key_block_size=4;
-
-
- create table t4(c1 int not null,
- c2 int not null,
- c3 char(255) not null,
- c4 text(500) not null,
- c5 blob(500) not null,
- c6 varchar(500) not null,
- c7 varchar(500) not null,
- c8 datetime,
- c9 decimal(5,3),
- primary key (c1),
- index (c3,c4(50),c5(50)),
- index (c2))
- engine=innodb row_format=dynamic;
-
-
- create temporary table t5(c1 int not null,
- c2 int not null,
- c3 char(255) not null,
- c4 text(500) not null,
- c5 blob(500) not null,
- c6 varchar(500) not null,
- c7 varchar(500) not null,
- c8 datetime,
- c9 decimal(5,3),
- primary key (c1),
- index (c3,c4(50),c5(50)),
- index (c2))
- engine=innodb;
-
- create table t6 ( a int ) engine = innodb;
- insert into t6 values (50),(100),(150);
-
- --disable_query_log
- --disable_result_log
- let $n=5;
-
- # load created tables.
- while ($n)
- {
- start transaction;
-
- eval insert ignore into t1 values(
- $n, $n,
- repeat(concat(' tc3_',$n), 42),
- repeat(concat(' tc4_',$n), 300),
- repeat(concat(' tc5_',$n), 300),
- repeat(concat(' tc6_',$n), 300),
- repeat(concat(' tc7_',$n), 300),
- now(), (100.55+$n));
-
- eval insert ignore into t2 values(
- $n, $n,
- repeat(concat(' tc3_',$n), 42),
- repeat(concat(' tc4_',$n), 300),
- repeat(concat(' tc5_',$n), 300),
- repeat(concat(' tc6_',$n), 300),
- repeat(concat(' tc7_',$n), 300),
- now(), (100.55+$n));
-
- eval insert ignore into t3 values(
- $n, $n,
- repeat(concat(' tc3_',$n), 42),
- repeat(concat(' tc4_',$n), 300),
- repeat(concat(' tc5_',$n), 300),
- repeat(concat(' tc6_',$n), 300),
- repeat(concat(' tc7_',$n), 300),
- now(), (100.55+$n));
-
- eval insert ignore into t4 values(
- $n, $n,
- repeat(concat(' tc3_',$n), 42),
- repeat(concat(' tc4_',$n), 300),
- repeat(concat(' tc5_',$n), 300),
- repeat(concat(' tc6_',$n), 300),
- repeat(concat(' tc7_',$n), 300),
- now(), (100.55+$n));
-
- eval insert ignore into t5 values(
- $n, $n,
- repeat(concat(' tc3_',$n), 42),
- repeat(concat(' tc4_',$n), 300),
- repeat(concat(' tc5_',$n), 300),
- repeat(concat(' tc6_',$n), 300),
- repeat(concat(' tc7_',$n), 300),
- now(), (100.55+$n));
-
- if ($n <= 3)
- {
- commit;
- }
-
- if ($n > 3)
- {
- rollback;
- }
-
- dec $n;
- }
-
- # validate loading of the tables.
- --enable_result_log
- --enable_query_log
- select count(*) from t1;
- select count(*) from t2;
- select count(*) from t3;
- select count(*) from t4;
- select count(*) from t5;
- select count(*) from t6;
-
- # set the debug crash point and exercise them.
- if ($cnt == 6)
- {
- set session debug="+d,ib_trunc_crash_during_drop_index_temp_table";
- --echo "---debug ib_trunc_crash_during_drop_index_temp_table point---"
- }
- if ($cnt == 5)
- {
- set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start";
- --echo "---debug ib_trunc_crash_drop_reinit_done_create_to_start---"
- }
-
- if ($cnt >= 5) {
- --echo # Write file to make mysql-test-run.pl expect crash and restart
- --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --echo # Run the crashing query
- --error 2013
- truncate table t5;
- --source include/wait_until_disconnected.inc
- --enable_reconnect
- --echo # Restart the MySQL server
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --source include/wait_until_connected_again.inc
- --disable_reconnect
- select count(*) from t1;
- select count(*) from t2;
- select count(*) from t3;
- select count(*) from t4;
- --error ER_NO_SUCH_TABLE
- select count(*) from t5;
- select count(*) from t6;
- }
-
- # set the debug crash point and exercise them.
- if ($cnt == 6)
- {
- set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
- --echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
- }
- if ($cnt == 5)
- {
- set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
- --echo "---debug ib_trunc_crash_on_create_of_sec_index---"
- }
- if ($cnt == 4)
- {
- set session debug="+d,ib_trunc_crash_before_log_removal";
- --echo "---debug ib_trunc_crash_before_log_removal point---"
- }
- if ($cnt == 3)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 2)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 1)
- {
- set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
- --echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
- }
-
- --echo # Write file to make mysql-test-run.pl expect crash and restart
- --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --echo # Run the crashing query
- --error 2013
- truncate table t1;
- --source include/wait_until_disconnected.inc
- --enable_reconnect
- --echo # Restart the MySQL server
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --source include/wait_until_connected_again.inc
- --disable_reconnect
- select count(*) from t1;
- select count(*) from t2;
- select count(*) from t3;
- select count(*) from t4;
- --error ER_NO_SUCH_TABLE
- select count(*) from t5;
- select count(*) from t6;
-
- if ($cnt == 6)
- {
- set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
- --echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
- }
- if ($cnt == 5)
- {
- set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
- --echo "---debug ib_trunc_crash_on_create_of_sec_index---"
- }
- if ($cnt == 4)
- {
- set session debug="+d,ib_trunc_crash_before_log_removal";
- --echo "---debug ib_trunc_crash_before_log_removal point---"
- }
- if ($cnt == 3)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 2)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 1)
- {
- set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
- --echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
- }
-
-
- --echo # Write file to make mysql-test-run.pl expect crash and restart
- --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --echo # Run the crashing query
- --error 2013
- truncate table t2;
- --source include/wait_until_disconnected.inc
- --enable_reconnect
- --echo # Restart the MySQL server
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --source include/wait_until_connected_again.inc
- --disable_reconnect
- select count(*) from t1;
- select count(*) from t2;
- select count(*) from t3;
- select count(*) from t4;
- --error ER_NO_SUCH_TABLE
- select count(*) from t5;
- select count(*) from t6;
-
- if ($cnt == 6)
- {
- set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
- --echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
- }
- if ($cnt == 5)
- {
- set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
- --echo "---debug ib_trunc_crash_on_create_of_sec_index---"
- }
- if ($cnt == 4)
- {
- set session debug="+d,ib_trunc_crash_before_log_removal";
- --echo "---debug ib_trunc_crash_before_log_removal point---"
- }
- if ($cnt == 3)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 2)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 1)
- {
- set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
- --echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
- }
-
-
- --echo # Write file to make mysql-test-run.pl expect crash and restart
- --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --echo # Run the crashing query
- --error 2013
- truncate table t3;
- --source include/wait_until_disconnected.inc
- --enable_reconnect
- --echo # Restart the MySQL server
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --source include/wait_until_connected_again.inc
- --disable_reconnect
- select count(*) from t1;
- select count(*) from t2;
- select count(*) from t3;
- select count(*) from t4;
- --error ER_NO_SUCH_TABLE
- select count(*) from t5;
- select count(*) from t6;
-
-
- if ($cnt == 6)
- {
- set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
- --echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
- }
- if ($cnt == 5)
- {
- set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
- --echo "---debug ib_trunc_crash_on_create_of_sec_index---"
- }
- if ($cnt == 4)
- {
- set session debug="+d,ib_trunc_crash_before_log_removal";
- --echo "---debug ib_trunc_crash_before_log_removal point---"
- }
- if ($cnt == 3)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 2)
- {
- set session debug="+d,ib_trunc_crash_after_truncate_done";
- --echo "---debug ib_trunc_crash_after_truncate_done point---"
- }
- if ($cnt == 1)
- {
- set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
- --echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
- }
-
- --echo # Write file to make mysql-test-run.pl expect crash and restart
- --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --echo # Run the crashing query
- --error 2013
- truncate table t4;
- --source include/wait_until_disconnected.inc
- --enable_reconnect
- --echo # Restart the MySQL server
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
- --source include/wait_until_connected_again.inc
- --disable_reconnect
- select count(*) from t1;
- select count(*) from t2;
- select count(*) from t3;
- select count(*) from t4;
- --error ER_NO_SUCH_TABLE
- select count(*) from t5;
- select count(*) from t6;
-
- drop table t1, t2, t3, t4, t6;
-
- dec $cnt;
-
- --disable_query_log
- eval set global innodb_file_per_table=$innodb_file_per_table_orig;
- --enable_query_log
-}
-
-
-
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt b/mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_3.test b/mysql-test/suite/innodb_zip/t/wl6501_crash_3.test
deleted file mode 100644
index 3ec990b4715..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_crash_3.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# WL#6501: make truncate table atomic
-#
-
-# TC tries to hit crash point during truncate of
-# compressed non-temp table residing in single tablespace
-# with page-size=16k
-
---source include/have_innodb.inc
---source include/have_innodb_16k.inc
---source include/have_debug.inc
---source include/big_test.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
-
-let $wl6501_file_per_table = 1;
-let $wl6501_row_fmt = compressed;
-let $wl6501_kbs = 16;
---source suite/innodb/include/innodb_wl6501_crash.inc
-
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt b/mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_4.test b/mysql-test/suite/innodb_zip/t/wl6501_crash_4.test
deleted file mode 100644
index f54df3c128c..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_crash_4.test
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# WL#6501: make truncate table atomic
-#
-
-# TC tries to hit crash point during truncate of
-# compressed non-temp table residing in single tablespace.
-# with page-size=4k
-
---source include/have_innodb.inc
---source include/have_innodb_4k.inc
---source include/have_debug.inc
---source include/big_test.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
-
-let $wl6501_file_per_table = 1;
-let $wl6501_row_fmt = compressed;
-let $wl6501_kbs = 4;
---source suite/innodb/include/innodb_wl6501_crash.inc
-
-let $wl6501_temp = temporary;
---source suite/innodb/include/innodb_wl6501_crash_temp.inc
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt b/mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_5.test b/mysql-test/suite/innodb_zip/t/wl6501_crash_5.test
deleted file mode 100644
index 2f9847ae5fb..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_crash_5.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# WL#6501: make truncate table atomic
-#
-
-# TC tries to hit crash point during truncate of
-# compressed non-temp table residing in single tablespace.
-# with page-size=8k
-
---source include/have_innodb.inc
---source include/have_innodb_8k.inc
---source include/have_debug.inc
---source include/big_test.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
-
-let $wl6501_file_per_table = 1;
-let $wl6501_row_fmt = compressed;
-let $wl6501_kbs = 8;
---source suite/innodb/include/innodb_wl6501_crash.inc
-
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt b/mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt
deleted file mode 100644
index 658bd901f47..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-safe-truncate=0
diff --git a/mysql-test/suite/innodb_zip/t/wl6501_scale_1.test b/mysql-test/suite/innodb_zip/t/wl6501_scale_1.test
deleted file mode 100644
index e6392759d5e..00000000000
--- a/mysql-test/suite/innodb_zip/t/wl6501_scale_1.test
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# WL#6501: make truncate table atomic
-#
-
-# load table with some significiant amount of data
-# and then try truncate
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/big_test.inc
---source include/have_innodb_16k.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
-
-
-# Single-Tablespace/Non-Compressed
-let $wl6501_file_per_table = 1;
-let $wl6501_row_fmt = compact;
-let $wl6501_kbs = 16;
---source suite/innodb_zip/include/innodb_wl6501_scale.inc
-
-# Single-Tablespace/Compressed
-let $wl6501_file_per_table = 1;
-let $wl6501_row_fmt = compressed;
-let $wl6501_kbs = 16;
---source suite/innodb_zip/include/innodb_wl6501_scale.inc
-
-# System-Tablespace/Non-Compressed
-let $wl6501_file_per_table = 0;
-let $wl6501_row_fmt = compact;
-let $wl6501_kbs = 16;
---source suite/innodb_zip/include/innodb_wl6501_scale.inc
diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result
index 93524e1c443..78c80c27cc5 100644
--- a/mysql-test/suite/jp/r/jp_create_db_sjis.result
+++ b/mysql-test/suite/jp/r/jp_create_db_sjis.result
@@ -6,7 +6,7 @@ drop database if exists `ƒ\\•\`;
CREATE DATABASE `ÆÎݺÞ`;
CREATE DATABASE `“ú–{Œê`;
CREATE DATABASE `ƒ\\•\`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
schema_name
information_schema
mysql
diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result
index c6a2ff78b4f..380fcf09389 100644
--- a/mysql-test/suite/jp/r/jp_create_db_ucs2.result
+++ b/mysql-test/suite/jp/r/jp_create_db_ucs2.result
@@ -7,7 +7,7 @@ SET character_set_server = ucs2;
CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
schema_name
information_schema
mysql
diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result
index e5e0c2f1ad8..529a225e4ed 100644
--- a/mysql-test/suite/jp/r/jp_create_db_ujis.result
+++ b/mysql-test/suite/jp/r/jp_create_db_ujis.result
@@ -6,7 +6,7 @@ SET character_set_database = ujis;
CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
schema_name
information_schema
mysql
diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result
index f07a36fd7c7..7d950ea53f9 100644
--- a/mysql-test/suite/jp/r/jp_create_db_utf8.result
+++ b/mysql-test/suite/jp/r/jp_create_db_utf8.result
@@ -6,7 +6,7 @@ SET character_set_database = utf8;
CREATE DATABASE `ニホï¾ï½ºï¾ž`;
CREATE DATABASE `日本語`;
CREATE DATABASE `龔龖龗`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
schema_name
information_schema
mysql
diff --git a/mysql-test/suite/jp/t/jp_create_db_sjis.test b/mysql-test/suite/jp/t/jp_create_db_sjis.test
index 49647bf1753..5458e6f0abd 100644
--- a/mysql-test/suite/jp/t/jp_create_db_sjis.test
+++ b/mysql-test/suite/jp/t/jp_create_db_sjis.test
@@ -16,7 +16,7 @@ CREATE DATABASE `ÆÎݺÞ`;
CREATE DATABASE `“ú–{Œê`;
CREATE DATABASE `ƒ\\•\`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
USE `ÆÎݺÞ`;
USE `“ú–{Œê`;
diff --git a/mysql-test/suite/jp/t/jp_create_db_ucs2.test b/mysql-test/suite/jp/t/jp_create_db_ucs2.test
index 8be8cf62f15..a3f64d1ebc7 100644
--- a/mysql-test/suite/jp/t/jp_create_db_ucs2.test
+++ b/mysql-test/suite/jp/t/jp_create_db_ucs2.test
@@ -18,7 +18,7 @@ CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
USE `ŽÆŽÎŽÝŽºŽÞ`;
USE `ÆüËܸì`;
diff --git a/mysql-test/suite/jp/t/jp_create_db_ujis.test b/mysql-test/suite/jp/t/jp_create_db_ujis.test
index 382c7937552..514745aad43 100644
--- a/mysql-test/suite/jp/t/jp_create_db_ujis.test
+++ b/mysql-test/suite/jp/t/jp_create_db_ujis.test
@@ -17,7 +17,7 @@ CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`;
CREATE DATABASE `ÆüËܸì`;
CREATE DATABASE `íÜíÝíÞ`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
USE `ŽÆŽÎŽÝŽºŽÞ`;
USE `ÆüËܸì`;
diff --git a/mysql-test/suite/jp/t/jp_create_db_utf8.test b/mysql-test/suite/jp/t/jp_create_db_utf8.test
index 2df5b9e1f6f..8617af57c7b 100644
--- a/mysql-test/suite/jp/t/jp_create_db_utf8.test
+++ b/mysql-test/suite/jp/t/jp_create_db_utf8.test
@@ -16,7 +16,7 @@ CREATE DATABASE `ニホï¾ï½ºï¾ž`;
CREATE DATABASE `日本語`;
CREATE DATABASE `龔龖龗`;
-SELECT schema_name from information_schema.schemata where schema_name <> 'mtr';
+SELECT schema_name from information_schema.schemata where schema_name <> 'mtr' ORDER BY schema_name;
USE `ニホï¾ï½ºï¾ž`;
USE `日本語`;
diff --git a/mysql-test/suite/json/r/json_no_table.result b/mysql-test/suite/json/r/json_no_table.result
index b8ac19bd09e..6a33e3cf83b 100644
--- a/mysql-test/suite/json/r/json_no_table.result
+++ b/mysql-test/suite/json/r/json_no_table.result
@@ -2396,7 +2396,7 @@ json_object( 'a', true, 'b', false, 'c', json_compact( 'null') )
{"a": true, "b": false, "c": null}
select json_valid( json_object( '"a"', 1 ) );
json_valid( json_object( '"a"', 1 ) )
-0
+1
select json_object( REPEAT('a', 64 * 1024), 1 );
json_object( REPEAT('a', 64 * 1024), 1 )
{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": 1}
diff --git a/mysql-test/suite/maria/lock.result b/mysql-test/suite/maria/lock.result
index 381f745b198..de24b987524 100644
--- a/mysql-test/suite/maria/lock.result
+++ b/mysql-test/suite/maria/lock.result
@@ -143,3 +143,27 @@ UNLOCK TABLES;
DROP VIEW v2;
DROP TABLE t1, t2;
# End of 10.2 tests
+#
+# MDEV-14669 Assertion `file->trn == trn' failed in ha_maria::start_stmt
+#
+CREATE TABLE t1 (i INT) ENGINE=Aria;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (c CHAR(1)) ENGINE=Aria;
+INSERT INTO t2 VALUES ('a'),('b');
+connect con1,localhost,root,,test;
+LOCK TABLE t1 WRITE;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+connection default;
+DELETE FROM t2 WHERE c < 1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+connection con1;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+disconnect con1;
+connection default;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/maria/lock.test b/mysql-test/suite/maria/lock.test
index 9bac569de50..bb709f8a69c 100644
--- a/mysql-test/suite/maria/lock.test
+++ b/mysql-test/suite/maria/lock.test
@@ -165,3 +165,23 @@ DROP VIEW v2;
DROP TABLE t1, t2;
--echo # End of 10.2 tests
+
+--echo #
+--echo # MDEV-14669 Assertion `file->trn == trn' failed in ha_maria::start_stmt
+--echo #
+
+CREATE TABLE t1 (i INT) ENGINE=Aria;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (c CHAR(1)) ENGINE=Aria;
+INSERT INTO t2 VALUES ('a'),('b');
+--connect (con1,localhost,root,,test)
+LOCK TABLE t1 WRITE;
+OPTIMIZE TABLE t1;
+--connection default
+DELETE FROM t2 WHERE c < 1;
+--connection con1
+OPTIMIZE TABLE t1;
+# Cleanup
+--disconnect con1
+--connection default
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/maria/maria-recover.result b/mysql-test/suite/maria/maria-recover.result
index b96cf8811db..4d0b4317afe 100644
--- a/mysql-test/suite/maria/maria-recover.result
+++ b/mysql-test/suite/maria/maria-recover.result
@@ -27,7 +27,6 @@ ThursdayMorningsMarket
ThursdayMorningsMarketb
Warnings:
Error 145 t_corrupted2' is marked as crashed and should be repaired
-Error 1194 t_corrupted2' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly
Error 1034 Wrong base information on indexpage at page: 1
select * from t_corrupted2;
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index 35ec098f7a8..fcfecd31eb9 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -901,7 +901,7 @@ CREATE TABLE t1 (
PRIMARY KEY (`_id`),
UNIQUE KEY `sequence_name_index` (`name`(50)),
KEY (`length_`)
-) DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1 row_format=dynamic;
INSERT INTO t1 VALUES
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
@@ -924,9 +924,9 @@ _id
8
9
DELETE FROM t1 WHERE _id < 8;
-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 Aria 10 Page 2 # # # # 0 # # # # # #
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
+table_name engine version row_format Table_rows Data_free create_options table_comment
+t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -936,9 +936,9 @@ test.t1 optimize status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
-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 Aria 10 Page 2 # # # # 0 # # # # # #
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
+table_name engine version row_format Table_rows Data_free create_options table_comment
+t1 Aria 10 Dynamic 2 0 row_format=DYNAMIC
SELECT _id FROM t1;
_id
8
@@ -960,7 +960,7 @@ CREATE TABLE t1 (
PRIMARY KEY (`_id`),
UNIQUE KEY `sequence_name_index` (`name`(50)),
KEY (`length_`)
-) DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1 row_format=dynamic;
INSERT INTO t1 VALUES
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
@@ -983,9 +983,9 @@ _id
8
9
DELETE FROM t1 WHERE _id < 8;
-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 Aria 10 Page 2 # # # # 0 # # # # # #
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
+table_name engine version row_format Table_rows Data_free create_options table_comment
+t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -995,9 +995,9 @@ test.t1 repair status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
-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 Aria 10 Page 2 # # # # 0 # # # # # #
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
+table_name engine version row_format Table_rows Data_free create_options table_comment
+t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC
SELECT _id FROM t1;
_id
8
@@ -1761,28 +1761,28 @@ a
DROP TABLE t1;
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2));
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 Aria 10 Page 0 # # # 8192 # # # # # # #
+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 Max_index_length Temporary
+t1 Aria 10 Page 0 # # # 8192 # # # # # # # # N
INSERT INTO t1 VALUES (1,1);
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 Aria 10 Page 1 # # # 24576 # # # # # # #
+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 Max_index_length Temporary
+t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N
ALTER TABLE t1 DISABLE KEYS;
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 Aria 10 Page 1 # # # 24576 # # # # # # #
+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 Max_index_length Temporary
+t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N
ALTER TABLE t1 ENABLE KEYS;
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 Aria 10 Page 1 # # # 24576 # # # # # # #
+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 Max_index_length Temporary
+t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N
ALTER TABLE t1 DISABLE KEYS;
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 Aria 10 Page 1 # # # 24576 # # # # # # #
+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 Max_index_length Temporary
+t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N
ALTER TABLE t1 ENABLE KEYS;
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 Aria 10 Page 1 # # # 24576 # # # # # # #
+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 Max_index_length Temporary
+t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N
# Enable keys with parallel repair
SET @@aria_repair_threads=2;
ALTER TABLE t1 DISABLE KEYS;
@@ -1904,7 +1904,28 @@ t1 CREATE TABLE `t1` (
KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048
+alter table t1 key_block_size=4096;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` varchar(2048) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL,
+ KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
+ KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
+ KEY `c` (`c`) KEY_BLOCK_SIZE=8192
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=4096
alter table t1 key_block_size=0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` varchar(2048) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL,
+ KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
+ KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
+ KEY `c` (`c`) KEY_BLOCK_SIZE=8192
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
alter table t1 add d int, add key (d);
show create table t1;
Table Create Table
@@ -2206,9 +2227,9 @@ Block_size: 8192
Recordlength: 99
Table description:
-Key Start Len Index Type
-1 2 30 multip. varchar
-2 33 30 multip. char NULL
+Key Start Len Index Type
+1 2 30 multip. varchar
+2 33 30 multip. char NULL
DROP TABLE t1;
create table t1 (n int not null, c char(1)) transactional=1;
show create table t1;
diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test
index 6de2c5dccbc..19aab4aa944 100644
--- a/mysql-test/suite/maria/maria.test
+++ b/mysql-test/suite/maria/maria.test
@@ -839,7 +839,7 @@ CREATE TABLE t1 (
PRIMARY KEY (`_id`),
UNIQUE KEY `sequence_name_index` (`name`(50)),
KEY (`length_`)
-) DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1 row_format=dynamic;
#
INSERT INTO t1 VALUES
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
@@ -854,13 +854,11 @@ INSERT INTO t1 VALUES
#
SELECT _id FROM t1;
DELETE FROM t1 WHERE _id < 8;
---replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
-SHOW TABLE STATUS LIKE 't1';
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
CHECK TABLE t1 EXTENDED;
OPTIMIZE TABLE t1;
CHECK TABLE t1 EXTENDED;
---replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
-SHOW TABLE STATUS LIKE 't1';
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
SELECT _id FROM t1;
DROP TABLE t1;
#
@@ -881,7 +879,7 @@ CREATE TABLE t1 (
PRIMARY KEY (`_id`),
UNIQUE KEY `sequence_name_index` (`name`(50)),
KEY (`length_`)
-) DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1 row_format=dynamic;
#
INSERT INTO t1 VALUES
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
@@ -896,13 +894,11 @@ INSERT INTO t1 VALUES
#
SELECT _id FROM t1;
DELETE FROM t1 WHERE _id < 8;
---replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
-SHOW TABLE STATUS LIKE 't1';
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
CHECK TABLE t1 EXTENDED;
REPAIR TABLE t1 QUICK;
CHECK TABLE t1 EXTENDED;
---replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
-SHOW TABLE STATUS LIKE 't1';
+SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1';
SELECT _id FROM t1;
DROP TABLE t1;
#
@@ -1082,22 +1078,22 @@ DROP TABLE t1;
# Bug#4692 - DISABLE/ENABLE KEYS waste a space
#
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2));
---replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 19 #
SHOW TABLE STATUS LIKE 't1';
INSERT INTO t1 VALUES (1,1);
---replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 19 #
SHOW TABLE STATUS LIKE 't1';
ALTER TABLE t1 DISABLE KEYS;
---replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 19 #
SHOW TABLE STATUS LIKE 't1';
ALTER TABLE t1 ENABLE KEYS;
---replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 19 #
SHOW TABLE STATUS LIKE 't1';
ALTER TABLE t1 DISABLE KEYS;
---replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 19 #
SHOW TABLE STATUS LIKE 't1';
ALTER TABLE t1 ENABLE KEYS;
---replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 19 #
SHOW TABLE STATUS LIKE 't1';
#--exec ls -log var/mysqld.1/data/test/t1
#--exec aria_chk -dvv var/mysqld.1/data/test/t1
@@ -1170,7 +1166,10 @@ alter table t1 key_block_size=2048;
show create table t1;
alter table t1 add c int, add key (c);
show create table t1;
+alter table t1 key_block_size=4096;
+show create table t1;
alter table t1 key_block_size=0;
+show create table t1;
alter table t1 add d int, add key (d);
show create table t1;
drop table t1;
diff --git a/mysql-test/suite/maria/max_length.result b/mysql-test/suite/maria/max_length.result
index 177810f32a3..93478e033f4 100644
--- a/mysql-test/suite/maria/max_length.result
+++ b/mysql-test/suite/maria/max_length.result
@@ -6,9 +6,9 @@ create table t1 (id int(10) unsigned not null auto_increment primary key, v varc
create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria;
lock tables t1 write,t2 write;
show table status like "t_";
-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 Aria 10 Page 0 0 8192 268320768 8192 0 1 # # # latin1_swedish_ci NULL max_rows=2 row_format=PAGE
-t2 Aria 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE
+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 Max_index_length Temporary
+t1 Aria 10 Page 0 0 8192 268320768 8192 0 1 # # # latin1_swedish_ci NULL max_rows=2 row_format=PAGE 536862720 N
+t2 Aria 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE 536862720 N
insert into t1 values(null, repeat("ab",100),repeat("def",1000));
insert into t1 values(null, repeat("de",200),repeat("ghi",2000));
insert into t1 values(null, repeat("fe",300),repeat("ghi",3000));
@@ -158,4 +158,11 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check warning Datafile is almost full, 268320768 of 268320768 used
test.t1 check status OK
+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 Max_index_length Temporary
+t1 Aria 10 Page 6189940 43 268320768 268320768 8192 0 NULL # # # latin1_swedish_ci NULL max_rows=10 row_format=PAGE 137438945280 N
+create index seq on t1(c1);
+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 Max_index_length Temporary
+t1 Aria 10 Page 6189940 43 268320768 268320768 49750016 0 NULL # # # latin1_swedish_ci NULL max_rows=10 page_checksum=1 row_format=PAGE 536862720 N
drop table t1;
diff --git a/mysql-test/suite/maria/max_length.test b/mysql-test/suite/maria/max_length.test
index 2be3da8e1b0..fdfe2aae4ac 100644
--- a/mysql-test/suite/maria/max_length.test
+++ b/mysql-test/suite/maria/max_length.test
@@ -121,4 +121,9 @@ show create table t1;
insert into t1 select seq,seq from seq_1_to_10000000;
select count(*) from t1;
check table t1;
+--replace_column 12 # 13 # 14 #
+show table status like "t1";
+create index seq on t1(c1);
+--replace_column 12 # 13 # 14 #
+show table status like "t1";
drop table t1;
diff --git a/mysql-test/suite/maria/partition.result b/mysql-test/suite/maria/partition.result
new file mode 100644
index 00000000000..929c6bab22e
--- /dev/null
+++ b/mysql-test/suite/maria/partition.result
@@ -0,0 +1,4 @@
+CREATE TABLE t (a INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2;
+SELECT * FROM t PARTITION (p1);
+a
+DROP TABLE t;
diff --git a/mysql-test/suite/maria/partition.test b/mysql-test/suite/maria/partition.test
new file mode 100644
index 00000000000..86f976a05e7
--- /dev/null
+++ b/mysql-test/suite/maria/partition.test
@@ -0,0 +1,11 @@
+--source include/have_partition.inc
+
+#
+# MDEV-19254
+# Server crashes in maria_status / ha_maria::info upon SELECT with partition
+# pruning
+#
+
+CREATE TABLE t (a INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2;
+SELECT * FROM t PARTITION (p1);
+DROP TABLE t;
diff --git a/mysql-test/suite/maria/ps_maria.result b/mysql-test/suite/maria/ps_maria.result
index bc03e40a717..bd5f2b4c55b 100644
--- a/mysql-test/suite/maria/ps_maria.result
+++ b/mysql-test/suite/maria/ps_maria.result
@@ -1932,26 +1932,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 38 63
def @arg12 246 83 6 Y 32896 38 63
-def @arg13 250 16777215 10 Y 0 39 8
-def @arg14 250 16777215 19 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 8 Y 0 39 8
+def @arg13 251 16777215 10 Y 0 39 8
+def @arg14 251 16777215 19 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 8 Y 0 39 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 250 16777215 1 Y 0 39 8
-def @arg21 250 16777215 10 Y 0 39 8
-def @arg22 250 16777215 30 Y 0 39 8
-def @arg23 250 16777215 8 Y 128 39 63
-def @arg24 250 16777215 8 Y 0 39 8
-def @arg25 250 16777215 4 Y 128 39 63
-def @arg26 250 16777215 4 Y 0 39 8
-def @arg27 250 16777215 10 Y 128 39 63
-def @arg28 250 16777215 10 Y 0 39 8
-def @arg29 250 16777215 8 Y 128 39 63
-def @arg30 250 16777215 8 Y 0 39 8
-def @arg31 250 16777215 3 Y 0 39 8
-def @arg32 250 16777215 6 Y 0 39 8
+def @arg20 251 16777215 1 Y 0 39 8
+def @arg21 251 16777215 10 Y 0 39 8
+def @arg22 251 16777215 30 Y 0 39 8
+def @arg23 251 16777215 8 Y 128 39 63
+def @arg24 251 16777215 8 Y 0 39 8
+def @arg25 251 16777215 4 Y 128 39 63
+def @arg26 251 16777215 4 Y 0 39 8
+def @arg27 251 16777215 10 Y 128 39 63
+def @arg28 251 16777215 10 Y 0 39 8
+def @arg29 251 16777215 8 Y 128 39 63
+def @arg30 251 16777215 8 Y 0 39 8
+def @arg31 251 16777215 3 Y 0 39 8
+def @arg32 251 16777215 6 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1979,26 +1979,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 38 63
def @arg12 246 83 0 Y 32896 38 63
-def @arg13 250 16777215 0 Y 0 39 8
-def @arg14 250 16777215 0 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 0 Y 0 39 8
+def @arg13 251 16777215 0 Y 0 39 8
+def @arg14 251 16777215 0 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 0 Y 0 39 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 250 16777215 0 Y 0 39 8
-def @arg21 250 16777215 0 Y 0 39 8
-def @arg22 250 16777215 0 Y 0 39 8
-def @arg23 250 16777215 0 Y 128 39 63
-def @arg24 250 16777215 0 Y 0 39 8
-def @arg25 250 16777215 0 Y 128 39 63
-def @arg26 250 16777215 0 Y 0 39 8
-def @arg27 250 16777215 0 Y 128 39 63
-def @arg28 250 16777215 0 Y 0 39 8
-def @arg29 250 16777215 0 Y 128 39 63
-def @arg30 250 16777215 0 Y 0 39 8
-def @arg31 250 16777215 0 Y 0 39 8
-def @arg32 250 16777215 0 Y 0 39 8
+def @arg20 251 16777215 0 Y 0 39 8
+def @arg21 251 16777215 0 Y 0 39 8
+def @arg22 251 16777215 0 Y 0 39 8
+def @arg23 251 16777215 0 Y 128 39 63
+def @arg24 251 16777215 0 Y 0 39 8
+def @arg25 251 16777215 0 Y 128 39 63
+def @arg26 251 16777215 0 Y 0 39 8
+def @arg27 251 16777215 0 Y 128 39 63
+def @arg28 251 16777215 0 Y 0 39 8
+def @arg29 251 16777215 0 Y 128 39 63
+def @arg30 251 16777215 0 Y 0 39 8
+def @arg31 251 16777215 0 Y 0 39 8
+def @arg32 251 16777215 0 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2029,26 +2029,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 38 63
def @arg12 246 83 6 Y 32896 38 63
-def @arg13 250 16777215 10 Y 0 39 8
-def @arg14 250 16777215 19 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 8 Y 0 39 8
+def @arg13 251 16777215 10 Y 0 39 8
+def @arg14 251 16777215 19 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 8 Y 0 39 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 250 16777215 1 Y 0 39 8
-def @arg21 250 16777215 10 Y 0 39 8
-def @arg22 250 16777215 30 Y 0 39 8
-def @arg23 250 16777215 8 Y 128 39 63
-def @arg24 250 16777215 8 Y 0 39 8
-def @arg25 250 16777215 4 Y 128 39 63
-def @arg26 250 16777215 4 Y 0 39 8
-def @arg27 250 16777215 10 Y 128 39 63
-def @arg28 250 16777215 10 Y 0 39 8
-def @arg29 250 16777215 8 Y 128 39 63
-def @arg30 250 16777215 8 Y 0 39 8
-def @arg31 250 16777215 3 Y 0 39 8
-def @arg32 250 16777215 6 Y 0 39 8
+def @arg20 251 16777215 1 Y 0 39 8
+def @arg21 251 16777215 10 Y 0 39 8
+def @arg22 251 16777215 30 Y 0 39 8
+def @arg23 251 16777215 8 Y 128 39 63
+def @arg24 251 16777215 8 Y 0 39 8
+def @arg25 251 16777215 4 Y 128 39 63
+def @arg26 251 16777215 4 Y 0 39 8
+def @arg27 251 16777215 10 Y 128 39 63
+def @arg28 251 16777215 10 Y 0 39 8
+def @arg29 251 16777215 8 Y 128 39 63
+def @arg30 251 16777215 8 Y 0 39 8
+def @arg31 251 16777215 3 Y 0 39 8
+def @arg32 251 16777215 6 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2069,26 +2069,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 38 63
def @arg12 246 83 0 Y 32896 38 63
-def @arg13 250 16777215 0 Y 0 39 8
-def @arg14 250 16777215 0 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 0 Y 0 39 8
+def @arg13 251 16777215 0 Y 0 39 8
+def @arg14 251 16777215 0 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 0 Y 0 39 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 250 16777215 0 Y 0 39 8
-def @arg21 250 16777215 0 Y 0 39 8
-def @arg22 250 16777215 0 Y 0 39 8
-def @arg23 250 16777215 0 Y 128 39 63
-def @arg24 250 16777215 0 Y 0 39 8
-def @arg25 250 16777215 0 Y 128 39 63
-def @arg26 250 16777215 0 Y 0 39 8
-def @arg27 250 16777215 0 Y 128 39 63
-def @arg28 250 16777215 0 Y 0 39 8
-def @arg29 250 16777215 0 Y 128 39 63
-def @arg30 250 16777215 0 Y 0 39 8
-def @arg31 250 16777215 0 Y 0 39 8
-def @arg32 250 16777215 0 Y 0 39 8
+def @arg20 251 16777215 0 Y 0 39 8
+def @arg21 251 16777215 0 Y 0 39 8
+def @arg22 251 16777215 0 Y 0 39 8
+def @arg23 251 16777215 0 Y 128 39 63
+def @arg24 251 16777215 0 Y 0 39 8
+def @arg25 251 16777215 0 Y 128 39 63
+def @arg26 251 16777215 0 Y 0 39 8
+def @arg27 251 16777215 0 Y 128 39 63
+def @arg28 251 16777215 0 Y 0 39 8
+def @arg29 251 16777215 0 Y 128 39 63
+def @arg30 251 16777215 0 Y 0 39 8
+def @arg31 251 16777215 0 Y 0 39 8
+def @arg32 251 16777215 0 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2117,26 +2117,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 38 63
def @arg12 246 83 6 Y 32896 38 63
-def @arg13 250 16777215 10 Y 0 39 8
-def @arg14 250 16777215 19 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 8 Y 0 39 8
+def @arg13 251 16777215 10 Y 0 39 8
+def @arg14 251 16777215 19 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 8 Y 0 39 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 250 16777215 1 Y 0 39 8
-def @arg21 250 16777215 10 Y 0 39 8
-def @arg22 250 16777215 30 Y 0 39 8
-def @arg23 250 16777215 8 Y 128 39 63
-def @arg24 250 16777215 8 Y 0 39 8
-def @arg25 250 16777215 4 Y 128 39 63
-def @arg26 250 16777215 4 Y 0 39 8
-def @arg27 250 16777215 10 Y 128 39 63
-def @arg28 250 16777215 10 Y 0 39 8
-def @arg29 250 16777215 8 Y 128 39 63
-def @arg30 250 16777215 8 Y 0 39 8
-def @arg31 250 16777215 3 Y 0 39 8
-def @arg32 250 16777215 6 Y 0 39 8
+def @arg20 251 16777215 1 Y 0 39 8
+def @arg21 251 16777215 10 Y 0 39 8
+def @arg22 251 16777215 30 Y 0 39 8
+def @arg23 251 16777215 8 Y 128 39 63
+def @arg24 251 16777215 8 Y 0 39 8
+def @arg25 251 16777215 4 Y 128 39 63
+def @arg26 251 16777215 4 Y 0 39 8
+def @arg27 251 16777215 10 Y 128 39 63
+def @arg28 251 16777215 10 Y 0 39 8
+def @arg29 251 16777215 8 Y 128 39 63
+def @arg30 251 16777215 8 Y 0 39 8
+def @arg31 251 16777215 3 Y 0 39 8
+def @arg32 251 16777215 6 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2161,26 +2161,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 38 63
def @arg12 246 83 0 Y 32896 38 63
-def @arg13 250 16777215 0 Y 0 39 8
-def @arg14 250 16777215 0 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 0 Y 0 39 8
+def @arg13 251 16777215 0 Y 0 39 8
+def @arg14 251 16777215 0 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 0 Y 0 39 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 250 16777215 0 Y 0 39 8
-def @arg21 250 16777215 0 Y 0 39 8
-def @arg22 250 16777215 0 Y 0 39 8
-def @arg23 250 16777215 0 Y 128 39 63
-def @arg24 250 16777215 0 Y 0 39 8
-def @arg25 250 16777215 0 Y 128 39 63
-def @arg26 250 16777215 0 Y 0 39 8
-def @arg27 250 16777215 0 Y 128 39 63
-def @arg28 250 16777215 0 Y 0 39 8
-def @arg29 250 16777215 0 Y 128 39 63
-def @arg30 250 16777215 0 Y 0 39 8
-def @arg31 250 16777215 0 Y 0 39 8
-def @arg32 250 16777215 0 Y 0 39 8
+def @arg20 251 16777215 0 Y 0 39 8
+def @arg21 251 16777215 0 Y 0 39 8
+def @arg22 251 16777215 0 Y 0 39 8
+def @arg23 251 16777215 0 Y 128 39 63
+def @arg24 251 16777215 0 Y 0 39 8
+def @arg25 251 16777215 0 Y 128 39 63
+def @arg26 251 16777215 0 Y 0 39 8
+def @arg27 251 16777215 0 Y 128 39 63
+def @arg28 251 16777215 0 Y 0 39 8
+def @arg29 251 16777215 0 Y 128 39 63
+def @arg30 251 16777215 0 Y 0 39 8
+def @arg31 251 16777215 0 Y 0 39 8
+def @arg32 251 16777215 0 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2207,26 +2207,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 32896 38 63
def @arg12 246 83 6 Y 32896 38 63
-def @arg13 250 16777215 10 Y 0 39 8
-def @arg14 250 16777215 19 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 8 Y 0 39 8
+def @arg13 251 16777215 10 Y 0 39 8
+def @arg14 251 16777215 19 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 8 Y 0 39 8
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 250 16777215 1 Y 0 39 8
-def @arg21 250 16777215 10 Y 0 39 8
-def @arg22 250 16777215 30 Y 0 39 8
-def @arg23 250 16777215 8 Y 128 39 63
-def @arg24 250 16777215 8 Y 0 39 8
-def @arg25 250 16777215 4 Y 128 39 63
-def @arg26 250 16777215 4 Y 0 39 8
-def @arg27 250 16777215 10 Y 128 39 63
-def @arg28 250 16777215 10 Y 0 39 8
-def @arg29 250 16777215 8 Y 128 39 63
-def @arg30 250 16777215 8 Y 0 39 8
-def @arg31 250 16777215 3 Y 0 39 8
-def @arg32 250 16777215 6 Y 0 39 8
+def @arg20 251 16777215 1 Y 0 39 8
+def @arg21 251 16777215 10 Y 0 39 8
+def @arg22 251 16777215 30 Y 0 39 8
+def @arg23 251 16777215 8 Y 128 39 63
+def @arg24 251 16777215 8 Y 0 39 8
+def @arg25 251 16777215 4 Y 128 39 63
+def @arg26 251 16777215 4 Y 0 39 8
+def @arg27 251 16777215 10 Y 128 39 63
+def @arg28 251 16777215 10 Y 0 39 8
+def @arg29 251 16777215 8 Y 128 39 63
+def @arg30 251 16777215 8 Y 0 39 8
+def @arg31 251 16777215 3 Y 0 39 8
+def @arg32 251 16777215 6 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2245,26 +2245,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 32896 38 63
def @arg12 246 83 0 Y 32896 38 63
-def @arg13 250 16777215 0 Y 0 39 8
-def @arg14 250 16777215 0 Y 0 39 8
-def @arg15 250 16777215 19 Y 0 39 8
-def @arg16 250 16777215 0 Y 0 39 8
+def @arg13 251 16777215 0 Y 0 39 8
+def @arg14 251 16777215 0 Y 0 39 8
+def @arg15 251 16777215 19 Y 0 39 8
+def @arg16 251 16777215 0 Y 0 39 8
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 250 16777215 0 Y 0 39 8
-def @arg21 250 16777215 0 Y 0 39 8
-def @arg22 250 16777215 0 Y 0 39 8
-def @arg23 250 16777215 0 Y 128 39 63
-def @arg24 250 16777215 0 Y 0 39 8
-def @arg25 250 16777215 0 Y 128 39 63
-def @arg26 250 16777215 0 Y 0 39 8
-def @arg27 250 16777215 0 Y 128 39 63
-def @arg28 250 16777215 0 Y 0 39 8
-def @arg29 250 16777215 0 Y 128 39 63
-def @arg30 250 16777215 0 Y 0 39 8
-def @arg31 250 16777215 0 Y 0 39 8
-def @arg32 250 16777215 0 Y 0 39 8
+def @arg20 251 16777215 0 Y 0 39 8
+def @arg21 251 16777215 0 Y 0 39 8
+def @arg22 251 16777215 0 Y 0 39 8
+def @arg23 251 16777215 0 Y 128 39 63
+def @arg24 251 16777215 0 Y 0 39 8
+def @arg25 251 16777215 0 Y 128 39 63
+def @arg26 251 16777215 0 Y 0 39 8
+def @arg27 251 16777215 0 Y 128 39 63
+def @arg28 251 16777215 0 Y 0 39 8
+def @arg29 251 16777215 0 Y 128 39 63
+def @arg30 251 16777215 0 Y 0 39 8
+def @arg31 251 16777215 0 Y 0 39 8
+def @arg32 251 16777215 0 Y 0 39 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/suite/mariabackup/binlog.result b/mysql-test/suite/mariabackup/binlog.result
new file mode 100644
index 00000000000..4f8ed4185ce
--- /dev/null
+++ b/mysql-test/suite/mariabackup/binlog.result
@@ -0,0 +1,8 @@
+CREATE TABLE t(a varchar(60)) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+SHOW VARIABLES like 'log_bin';
+Variable_name Value
+log_bin ON
+FOUND 1 /Last binlog file .*, position .*/ in current_test
+# expect FOUND
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/binlog.test b/mysql-test/suite/mariabackup/binlog.test
new file mode 100644
index 00000000000..998397bb495
--- /dev/null
+++ b/mysql-test/suite/mariabackup/binlog.test
@@ -0,0 +1,25 @@
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
+
+CREATE TABLE t(a varchar(60)) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+
+SHOW VARIABLES like 'log_bin';
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+--enable_result_log
+
+exec $XTRABACKUP --prepare --binlog-info=1 --apply-log-only --target-dir=$basedir ;
+
+let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test;
+--let SEARCH_PATTERN= Last binlog file .*, position .*
+--source include/search_pattern_in_file.inc
+--echo # expect FOUND
+
+DROP TABLE t;
+
+# Cleanup
+rmdir $basedir;
diff --git a/mysql-test/suite/mariabackup/compress_qpress.result b/mysql-test/suite/mariabackup/compress_qpress.result
index f8dfb46e4db..69427f5fc4d 100644
--- a/mysql-test/suite/mariabackup/compress_qpress.result
+++ b/mysql-test/suite/mariabackup/compress_qpress.result
@@ -3,6 +3,7 @@ INSERT INTO t VALUES(1);
# xtrabackup backup
INSERT INTO t VALUES(2);
# xtrabackup prepare
+db.opt.qp
t.frm.qp
t.ibd.qp
# shutdown server
diff --git a/mysql-test/suite/mariabackup/encrypted_page_compressed.result b/mysql-test/suite/mariabackup/encrypted_page_compressed.result
index 06d41b3697f..293addd2b03 100644
--- a/mysql-test/suite/mariabackup/encrypted_page_compressed.result
+++ b/mysql-test/suite/mariabackup/encrypted_page_compressed.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Table `test`.`t1` has an unreadable root page");
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes encrypted=yes;
insert into t1(b, c) values("mariadb", "mariabackup");
# Corrupt the table
diff --git a/mysql-test/suite/mariabackup/encrypted_page_compressed.test b/mysql-test/suite/mariabackup/encrypted_page_compressed.test
index d8e2d072912..b0bcdd9e33b 100644
--- a/mysql-test/suite/mariabackup/encrypted_page_compressed.test
+++ b/mysql-test/suite/mariabackup/encrypted_page_compressed.test
@@ -1,4 +1,5 @@
source include/have_file_key_management.inc;
+call mtr.add_suppression("InnoDB: Table `test`.`t1` has an unreadable root page");
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes encrypted=yes;
insert into t1(b, c) values("mariadb", "mariabackup");
@@ -35,7 +36,7 @@ echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
--error 1
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backuplog;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --core-file > $backuplog;
--enable_result_log
--let SEARCH_PATTERN=Database page corruption detected.*
diff --git a/mysql-test/suite/mariabackup/encrypted_page_corruption.result b/mysql-test/suite/mariabackup/encrypted_page_corruption.result
index bb2b01f1fab..9a6202a5ea1 100644
--- a/mysql-test/suite/mariabackup/encrypted_page_corruption.result
+++ b/mysql-test/suite/mariabackup/encrypted_page_corruption.result
@@ -1,4 +1,5 @@
call mtr.add_suppression("\\[ERROR\\] InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=3\\] in file '.*test.t1\\.ibd' cannot be decrypted.");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Table `test`\\.`t1` has an unreadable root page");
CREATE TABLE t1(c VARCHAR(128)) ENGINE INNODB, encrypted=yes;
insert into t1 select repeat('a',100);
# Corrupt the table
diff --git a/mysql-test/suite/mariabackup/encrypted_page_corruption.test b/mysql-test/suite/mariabackup/encrypted_page_corruption.test
index 130ffd0760d..5ba77597b35 100644
--- a/mysql-test/suite/mariabackup/encrypted_page_corruption.test
+++ b/mysql-test/suite/mariabackup/encrypted_page_corruption.test
@@ -2,6 +2,7 @@
--source include/innodb_page_size.inc
call mtr.add_suppression("\\[ERROR\\] InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=3\\] in file '.*test.t1\\.ibd' cannot be decrypted.");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Table `test`\\.`t1` has an unreadable root page");
CREATE TABLE t1(c VARCHAR(128)) ENGINE INNODB, encrypted=yes;
insert into t1 select repeat('a',100);
@@ -50,7 +51,7 @@ let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
--disable_result_log
--error 1
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --extended-validation --target-dir=$targetdir > $backuplog;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --extended-validation --target-dir=$targetdir --core-file > $backuplog;
--enable_result_log
diff --git a/mysql-test/suite/mariabackup/huge_lsn.test b/mysql-test/suite/mariabackup/huge_lsn.test
index 22e4e59a1d5..3349ef40df8 100644
--- a/mysql-test/suite/mariabackup/huge_lsn.test
+++ b/mysql-test/suite/mariabackup/huge_lsn.test
@@ -15,6 +15,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=
--source include/shutdown_mysqld.inc
perl;
+do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
my $file= "$ENV{MYSQLD_DATADIR}/ibdata1";
open(FILE, "+<", $file) or die "Unable to open $file\n";
binmode FILE;
@@ -22,8 +23,11 @@ my $ps= $ENV{INNODB_PAGE_SIZE};
my $page;
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
substr($page,26,8) = pack("NN", 4096, ~1024);
-substr($page,0,4)=pack("N",0xdeadbeef);
-substr($page,$ps-8,4)=pack("N",0xdeadbeef);
+my $polynomial = 0x82f63b78; # CRC-32C
+my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
+substr($page,0,4)=$ck;
+substr($page,$ps-8,4)=$ck;
sysseek(FILE, 0, 0) || die "Unable to rewind $file\n";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file\n";
diff --git a/mysql-test/suite/mariabackup/log_checksum_mismatch.test b/mysql-test/suite/mariabackup/log_checksum_mismatch.test
index f041b0aeedd..c8baf66e917 100644
--- a/mysql-test/suite/mariabackup/log_checksum_mismatch.test
+++ b/mysql-test/suite/mariabackup/log_checksum_mismatch.test
@@ -7,7 +7,7 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
--disable_result_log
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,log_intermittent_checksum_mismatch > $backuplog;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,log_intermittent_checksum_mismatch --core-file > $backuplog;
--enable_result_log
--let SEARCH_RANGE = 10000000
diff --git a/mysql-test/suite/mariabackup/system_versioning.result b/mysql-test/suite/mariabackup/system_versioning.result
new file mode 100644
index 00000000000..0e1e9253dd0
--- /dev/null
+++ b/mysql-test/suite/mariabackup/system_versioning.result
@@ -0,0 +1,49 @@
+create table t (a int) with system versioning;
+insert into t values (1);
+update t set a=2;
+insert into t values (3);
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t;
+a
+2
+select a from t for system_time all;
+a
+2
+1
+create or replace table t (
+a int,
+s bigint unsigned as row start invisible,
+e bigint unsigned as row end invisible,
+period for system_time(s, e)
+) with system versioning engine=innodb;
+insert into t values (1);
+update t set a=2;
+insert into t values (3);
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `s` bigint(20) unsigned GENERATED ALWAYS AS ROW START INVISIBLE,
+ `e` bigint(20) unsigned GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`s`, `e`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t;
+a
+2
+select a from t for system_time all;
+a
+2
+1
+drop table t;
diff --git a/mysql-test/suite/mariabackup/system_versioning.test b/mysql-test/suite/mariabackup/system_versioning.test
new file mode 100644
index 00000000000..1ced00b4588
--- /dev/null
+++ b/mysql-test/suite/mariabackup/system_versioning.test
@@ -0,0 +1,50 @@
+create table t (a int) with system versioning;
+insert into t values (1);
+update t set a=2;
+
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+--enable_result_log
+
+insert into t values (3);
+
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
+show create table t;
+select * from t;
+select a from t for system_time all;
+
+rmdir $targetdir;
+
+create or replace table t (
+ a int,
+ s bigint unsigned as row start invisible,
+ e bigint unsigned as row end invisible,
+ period for system_time(s, e)
+) with system versioning engine=innodb;
+insert into t values (1);
+update t set a=2;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+--enable_result_log
+
+insert into t values (3);
+
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+show create table t;
+select * from t;
+select a from t for system_time all;
+
+drop table t;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/truncate_during_backup.opt b/mysql-test/suite/mariabackup/truncate_during_backup.opt
deleted file mode 100644
index 9622465d71f..00000000000
--- a/mysql-test/suite/mariabackup/truncate_during_backup.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-safe-truncate=1
diff --git a/mysql-test/suite/mariabackup/undo_space_id.opt b/mysql-test/suite/mariabackup/undo_space_id.opt
index 2e68759e37e..006e17a2535 100644
--- a/mysql-test/suite/mariabackup/undo_space_id.opt
+++ b/mysql-test/suite/mariabackup/undo_space_id.opt
@@ -1,3 +1,3 @@
---debug=d,innodb_undo_upgrade
+--debug=d,innodb_undo_upgrade,force_rebootstrap
--innodb_data_file_path=ib_mysql:10M
--innodb_undo_tablespaces=2
diff --git a/mysql-test/suite/mariabackup/unencrypted_page_compressed.result b/mysql-test/suite/mariabackup/unencrypted_page_compressed.result
index 238e5377bca..daeb9ecf8b7 100644
--- a/mysql-test/suite/mariabackup/unencrypted_page_compressed.result
+++ b/mysql-test/suite/mariabackup/unencrypted_page_compressed.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Table `test`.`t1` has an unreadable root page");
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes;
insert into t1(b, c) values("mariadb", "mariabackup");
diff --git a/mysql-test/suite/mariabackup/unencrypted_page_compressed.test b/mysql-test/suite/mariabackup/unencrypted_page_compressed.test
index b313f4fccf5..ce5c94a1c57 100644
--- a/mysql-test/suite/mariabackup/unencrypted_page_compressed.test
+++ b/mysql-test/suite/mariabackup/unencrypted_page_compressed.test
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Table `test`.`t1` has an unreadable root page");
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes;
insert into t1(b, c) values("mariadb", "mariabackup");
@@ -37,7 +38,7 @@ echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
--error 1
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backuplog;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --core-file > $backuplog;
--enable_result_log
--let SEARCH_PATTERN=Database page corruption detected.*
diff --git a/mysql-test/suite/mariabackup/xb_aws_key_management.result b/mysql-test/suite/mariabackup/xb_aws_key_management.result
index 6efc76a8be3..fd12344dfa0 100644
--- a/mysql-test/suite/mariabackup/xb_aws_key_management.result
+++ b/mysql-test/suite/mariabackup/xb_aws_key_management.result
@@ -11,6 +11,4 @@ INSERT INTO t VALUES('foobar1');
SELECT * from t;
c
foobar1
-Warnings:
-Note 1105 AWS KMS plugin: loaded key 1, version 1, key length 128 bit
DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
index e6cbe00bb7c..8baef973470 100644
--- a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
+++ b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
@@ -6,4 +6,3 @@
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
--innodb_strict_mode
--innodb_file_per_table
---innodb_file_format=Barracuda
diff --git a/mysql-test/suite/multi_source/disabled.def b/mysql-test/suite/multi_source/disabled.def
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/suite/multi_source/disabled.def
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.result b/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
index 92d096245c7..96627b42c97 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
@@ -65,6 +65,7 @@ include/wait_for_slave_to_start.inc
set default_master_connection = '';
connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CALL mtr.add_suppression("This change will not take full effect until all SQL threads have been restarted");
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
BEGIN;
@@ -491,17 +492,21 @@ SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
connection server_1;
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
include/reset_master_slave.inc
disconnect server_1;
connection server_2;
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
include/reset_master_slave.inc
disconnect server_2;
connection server_3;
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
include/reset_master_slave.inc
disconnect server_3;
connection server_4;
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
include/reset_master_slave.inc
disconnect server_4;
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
index 218d91aa7fb..b61da0f0f33 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
@@ -86,6 +86,7 @@ set default_master_connection = '';
--connection server_1
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CALL mtr.add_suppression("This change will not take full effect until all SQL threads have been restarted");
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
BEGIN;
@@ -431,20 +432,24 @@ SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
--connection server_1
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
--source include/reset_master_slave.inc
--disconnect server_1
--connection server_2
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
--source include/reset_master_slave.inc
--disconnect server_2
--connection server_3
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
--source include/reset_master_slave.inc
--disconnect server_3
--connection server_4
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
--source include/reset_master_slave.inc
--disconnect server_4
diff --git a/mysql-test/suite/multi_source/gtid_slave_pos.result b/mysql-test/suite/multi_source/gtid_slave_pos.result
new file mode 100644
index 00000000000..d57cfc17959
--- /dev/null
+++ b/mysql-test/suite/multi_source/gtid_slave_pos.result
@@ -0,0 +1,155 @@
+connect slave1,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connection slave1;
+CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+set default_master_connection = 'slave1';
+START SLAVE;
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'slave2';
+START SLAVE;
+include/wait_for_slave_to_start.inc
+set default_master_connection = '';
+connection master1;
+SET GLOBAL gtid_domain_id= 1;
+SET SESSION gtid_domain_id= 1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
+INSERT INTO t1 VALUES (1, "initial");
+INSERT INTO t3 VALUES (101, "initial 1");
+include/save_master_gtid.inc
+connection master2;
+SET GLOBAL gtid_domain_id= 2;
+SET SESSION gtid_domain_id= 2;
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, "initial");
+connection slave1;
+include/sync_with_master_gtid.inc
+connection master2;
+include/save_master_gtid.inc
+connection slave1;
+include/sync_with_master_gtid.inc
+*** Add an innodb gtid_slave_pos table. It is not used yet as slaves are already running ***
+SET sql_log_bin=0;
+CREATE TABLE mysql.gtid_slave_pos_innodb LIKE mysql.gtid_slave_pos;
+ALTER TABLE mysql.gtid_slave_pos_innodb ENGINE=InnoDB;
+SET sql_log_bin=0;
+connection master1;
+INSERT INTO t3 VALUES (102, "secondary");
+include/save_master_gtid.inc
+connection slave1;
+include/sync_with_master_gtid.inc
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id max(seq_no)
+1 5
+2 2
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos_innodb GROUP BY domain_id;
+domain_id max(seq_no)
+*** Restart one slave thread, the other keeps running. Now the new table is used ***
+connection slave1;
+set default_master_connection = 'slave1';
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+connection master1;
+INSERT INTO t1 VALUES (2, "followup");
+include/save_master_gtid.inc
+connection slave1;
+include/sync_with_master_gtid.inc
+connection master2;
+INSERT INTO t2 VALUES (2, "secondary2");
+include/save_master_gtid.inc
+connection slave1;
+include/sync_with_master_gtid.inc
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id max(seq_no)
+1 6
+2 2
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos_innodb GROUP BY domain_id;
+domain_id max(seq_no)
+2 3
+*** Remove a gtid_slave_posXXX table, restart one slave ***
+*** Get a warning that the change is not yet picked up ***
+*** See that updates fail due to trying to use the missing table ***
+connection slave1;
+SET sql_log_bin=0;
+DROP TABLE mysql.gtid_slave_pos_innodb;
+SET sql_log_bin=1;
+set default_master_connection = 'slave2';
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+CALL mtr.add_suppression("The table mysql.gtid_slave_pos_innodb was removed.");
+connection master2;
+INSERT INTO t2 VALUES (3, "tertiary 2");
+connection slave1;
+include/wait_for_slave_sql_error.inc [errno=1942]
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id max(seq_no)
+1 6
+2 2
+*** Stop both slaves, see that the drop of mysql.gtid_slave_pos_innodb is now picked up ***
+connection slave1;
+set default_master_connection = 'slave1';
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+set default_master_connection = 'slave2';
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+set default_master_connection = 'slave1';
+START SLAVE;
+include/wait_for_slave_to_start.inc
+connection master1;
+INSERT INTO t1 VALUES (3, "more stuff");
+include/save_master_gtid.inc
+connection slave1;
+include/sync_with_master_gtid.inc
+set default_master_connection = 'slave2';
+START SLAVE;
+include/wait_for_slave_to_start.inc
+connection master2;
+include/save_master_gtid.inc
+connection slave1;
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 initial
+2 followup
+3 more stuff
+SELECT * FROM t2 ORDER BY a;
+a b
+1 initial
+2 secondary2
+3 tertiary 2
+SELECT * FROM t3 ORDER BY a;
+a b
+101 initial 1
+102 secondary
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id max(seq_no)
+1 7
+2 4
+connection master1;
+DROP TABLE t1;
+DROP TABLE t3;
+connection master2;
+DROP TABLE t2;
+connection slave1;
+SET GLOBAL gtid_domain_id=0;
+STOP ALL SLAVES;
+Warnings:
+Note 1938 SLAVE 'slave1' stopped
+Note 1938 SLAVE 'slave2' stopped
+include/reset_master_slave.inc
+disconnect slave1;
+connection master1;
+SET GLOBAL gtid_domain_id=0;
+include/reset_master_slave.inc
+disconnect master1;
+connection master2;
+SET GLOBAL gtid_domain_id=0;
+include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/gtid_slave_pos.test b/mysql-test/suite/multi_source/gtid_slave_pos.test
new file mode 100644
index 00000000000..c01130f8cd5
--- /dev/null
+++ b/mysql-test/suite/multi_source/gtid_slave_pos.test
@@ -0,0 +1,173 @@
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+#
+# Test multiple mysql.gtid_slave_posXXX tables with multiple master connections
+#
+
+--connect (slave1,127.0.0.1,root,,,$SERVER_MYPORT_3)
+--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+
+--connection slave1
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+set default_master_connection = 'slave1';
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+set default_master_connection = 'slave2';
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+set default_master_connection = '';
+
+
+--connection master1
+SET GLOBAL gtid_domain_id= 1;
+SET SESSION gtid_domain_id= 1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
+INSERT INTO t1 VALUES (1, "initial");
+INSERT INTO t3 VALUES (101, "initial 1");
+--source include/save_master_gtid.inc
+
+--connection master2
+SET GLOBAL gtid_domain_id= 2;
+SET SESSION gtid_domain_id= 2;
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, "initial");
+
+
+--connection slave1
+--source include/sync_with_master_gtid.inc
+
+--connection master2
+--source include/save_master_gtid.inc
+
+--connection slave1
+--source include/sync_with_master_gtid.inc
+
+
+--echo *** Add an innodb gtid_slave_pos table. It is not used yet as slaves are already running ***
+
+SET sql_log_bin=0;
+CREATE TABLE mysql.gtid_slave_pos_innodb LIKE mysql.gtid_slave_pos;
+ALTER TABLE mysql.gtid_slave_pos_innodb ENGINE=InnoDB;
+SET sql_log_bin=0;
+
+--connection master1
+INSERT INTO t3 VALUES (102, "secondary");
+--source include/save_master_gtid.inc
+
+--connection slave1
+--source include/sync_with_master_gtid.inc
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos_innodb GROUP BY domain_id;
+
+--echo *** Restart one slave thread, the other keeps running. Now the new table is used ***
+--connection slave1
+set default_master_connection = 'slave1';
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+# Send through a transaction on the slave1 connection, to be sure that it has
+# had time to update the state with the new table.
+--connection master1
+INSERT INTO t1 VALUES (2, "followup");
+--source include/save_master_gtid.inc
+--connection slave1
+--source include/sync_with_master_gtid.inc
+
+--connection master2
+INSERT INTO t2 VALUES (2, "secondary2");
+--source include/save_master_gtid.inc
+
+--connection slave1
+--source include/sync_with_master_gtid.inc
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos_innodb GROUP BY domain_id;
+
+--echo *** Remove a gtid_slave_posXXX table, restart one slave ***
+--echo *** Get a warning that the change is not yet picked up ***
+--echo *** See that updates fail due to trying to use the missing table ***
+--connection slave1
+SET sql_log_bin=0;
+DROP TABLE mysql.gtid_slave_pos_innodb;
+SET sql_log_bin=1;
+set default_master_connection = 'slave2';
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+CALL mtr.add_suppression("The table mysql.gtid_slave_pos_innodb was removed.");
+
+--connection master2
+INSERT INTO t2 VALUES (3, "tertiary 2");
+
+--connection slave1
+--let $slave_sql_errno= 1942
+--source include/wait_for_slave_sql_error.inc
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+
+--echo *** Stop both slaves, see that the drop of mysql.gtid_slave_pos_innodb is now picked up ***
+--connection slave1
+set default_master_connection = 'slave1';
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+set default_master_connection = 'slave2';
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+set default_master_connection = 'slave1';
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+# Send through a transaction on the slave1 connection, to be sure that it has
+# had time to update the state with the new table.
+--connection master1
+INSERT INTO t1 VALUES (3, "more stuff");
+--source include/save_master_gtid.inc
+--connection slave1
+--source include/sync_with_master_gtid.inc
+set default_master_connection = 'slave2';
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+--connection master2
+--source include/save_master_gtid.inc
+--connection slave1
+--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;
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+
+
+# Cleanup.
+--connection master1
+DROP TABLE t1;
+DROP TABLE t3;
+
+--connection master2
+DROP TABLE t2;
+
+--connection slave1
+SET GLOBAL gtid_domain_id=0;
+--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.tables WHERE table_name IN ("t1", "t2", "t3") AND table_schema = "test"
+--source include/wait_condition.inc
+--sorted_result
+STOP ALL SLAVES;
+--source include/reset_master_slave.inc
+--disconnect slave1
+
+
+--connection master1
+SET GLOBAL gtid_domain_id=0;
+--source include/reset_master_slave.inc
+--disconnect master1
+
+--connection master2
+SET GLOBAL gtid_domain_id=0;
+--source include/reset_master_slave.inc
+--disconnect master2
diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result
index e177c9826a9..531a6178cdb 100644
--- a/mysql-test/suite/multi_source/info_logs.result
+++ b/mysql-test/suite/multi_source/info_logs.result
@@ -89,17 +89,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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 0 1073741824 6 0 60.000
#
# List of files matching '*info*' pattern
# after slave server restart
diff --git a/mysql-test/suite/multi_source/multi_parallel.cnf b/mysql-test/suite/multi_source/multi_parallel.cnf
new file mode 100644
index 00000000000..0f0dc5c9a82
--- /dev/null
+++ b/mysql-test/suite/multi_source/multi_parallel.cnf
@@ -0,0 +1,6 @@
+!include my.cnf
+[mysqld.1]
+gtid_domain_id=1
+
+[mysqld.2]
+gtid_domain_id=2
diff --git a/mysql-test/suite/multi_source/multi_parallel.result b/mysql-test/suite/multi_source/multi_parallel.result
new file mode 100644
index 00000000000..bca01d57932
--- /dev/null
+++ b/mysql-test/suite/multi_source/multi_parallel.result
@@ -0,0 +1,64 @@
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+set global slave_parallel_threads=10;
+change master 'master1' to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+change master 'master2' to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+start all slaves;
+set default_master_connection = 'master1';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'master2';
+include/wait_for_slave_to_start.inc
+## Slave status variable
+set default_master_connection = 'master1';
+show status like 'slave_running';
+Variable_name Value
+Slave_running ON
+set default_master_connection = 'master2';
+show status like 'slave_running';
+Variable_name Value
+Slave_running ON
+#master 1
+connection master1;
+##Running CURD operation
+connection slave;
+Slave_DDL_Groups= 20;
+Slave_Non_Transactional_Groups= 20;
+Slave_Transactional_Groups= 0;
+#master 2
+connection master2;
+##Running CURD operation
+connection slave;
+Slave_DDL_Groups= 20;
+Slave_Non_Transactional_Groups= 20;
+Slave_Transactional_Groups= 0;
+#master 1
+connection master1;
+##Running CURD operation
+connection slave;
+Slave_DDL_Groups= 40;
+Slave_Non_Transactional_Groups= 20;
+Slave_Transactional_Groups= 20;
+stop all slaves;
+Warnings:
+Note 1938 SLAVE 'master2' stopped
+Note 1938 SLAVE 'master1' stopped
+set default_master_connection = 'master1';
+include/wait_for_slave_to_stop.inc
+set default_master_connection = 'master2';
+include/wait_for_slave_to_stop.inc
+set global slave_parallel_threads=0;
+include/reset_master_slave.inc
+disconnect slave;
+connection master1;
+include/reset_master_slave.inc
+disconnect master1;
+connection master2;
+include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/multi_parallel.test b/mysql-test/suite/multi_source/multi_parallel.test
new file mode 100644
index 00000000000..a1385198b61
--- /dev/null
+++ b/mysql-test/suite/multi_source/multi_parallel.test
@@ -0,0 +1,125 @@
+# This test file tests events counter like Slave_ddl_groups,
+# Slave_non_transactional_groups, Slave_transactional_groups
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--let $rpl_server_count= 0
+
+--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+#save state
+--let $par_thd= `select @@slave_parallel_threads;`
+
+set global slave_parallel_threads=10;
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'master1' to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master 'master2' to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+
+#start all slaves
+--disable_warnings
+start all slaves;
+--enable_warnings
+set default_master_connection = 'master1';
+--source include/wait_for_slave_to_start.inc
+
+set default_master_connection = 'master2';
+--source include/wait_for_slave_to_start.inc
+
+--echo ## Slave status variable
+
+set default_master_connection = 'master1';
+show status like 'slave_running';
+
+set default_master_connection = 'master2';
+show status like 'slave_running';
+
+
+--echo #master 1
+--connection master1
+
+--let $loop_counter=10
+--let $table_engine=myisam
+--source multi_parallel_loop.inc
+--save_master_pos
+
+--connection slave
+
+--sync_with_master 0,'master1'
+--let $status= query_get_value(show slave 'master1' status, Slave_DDL_Groups, 1)
+--echo Slave_DDL_Groups= $status;
+
+--let $status= query_get_value(show slave 'master1' status, Slave_Non_Transactional_Groups, 1)
+--echo Slave_Non_Transactional_Groups= $status;
+
+--let $status= query_get_value(show slave 'master1' status, Slave_Transactional_Groups, 1)
+--echo Slave_Transactional_Groups= $status;
+
+--echo #master 2
+--connection master2
+
+--let $loop_counter=10
+--let $table_engine=myisam
+--source multi_parallel_loop.inc
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master2'
+--let $status= query_get_value(show slave 'master2' status, Slave_DDL_Groups, 1)
+--echo Slave_DDL_Groups= $status;
+
+--let $status= query_get_value(show slave 'master2' status, Slave_Non_Transactional_Groups, 1)
+--echo Slave_Non_Transactional_Groups= $status;
+
+--let $status= query_get_value(show slave 'master2' status, Slave_Transactional_Groups, 1)
+--echo Slave_Transactional_Groups= $status;
+
+--echo #master 1
+--connection master1
+
+--let $loop_counter=10
+--let $table_engine=innodb
+--source multi_parallel_loop.inc
+--save_master_pos
+
+--connection slave
+
+--sync_with_master 0,'master1'
+--let $status= query_get_value(show slave 'master1' status, Slave_DDL_Groups, 1)
+--echo Slave_DDL_Groups= $status;
+
+--let $status= query_get_value(show slave 'master1' status, Slave_Non_Transactional_Groups, 1)
+--echo Slave_Non_Transactional_Groups= $status;
+
+--let $status= query_get_value(show slave 'master1' status, Slave_Transactional_Groups, 1)
+--echo Slave_Transactional_Groups= $status;
+
+
+# Cleanup
+stop all slaves;
+set default_master_connection = 'master1';
+--source include/wait_for_slave_to_stop.inc
+
+set default_master_connection = 'master2';
+--source include/wait_for_slave_to_stop.inc
+
+--eval set global slave_parallel_threads=$par_thd
+
+--source include/reset_master_slave.inc
+--disconnect slave
+--connection master1
+--source include/reset_master_slave.inc
+--disconnect master1
+--connection master2
+--source include/reset_master_slave.inc
+--disconnect master2
diff --git a/mysql-test/suite/multi_source/multi_parallel_loop.inc b/mysql-test/suite/multi_source/multi_parallel_loop.inc
new file mode 100644
index 00000000000..bf692b28ede
--- /dev/null
+++ b/mysql-test/suite/multi_source/multi_parallel_loop.inc
@@ -0,0 +1,19 @@
+#create a table,insert data and drop table
+
+#parameters
+# loop_counter
+# table_engine
+--echo ##Running CURD operation
+--disable_query_log
+while ($loop_counter)
+{
+ #DDL statement
+ --eval create table t1(a int primary key) engine=$table_engine;
+
+ #non trans update statement
+ insert into t1 values(1);
+ insert into t1 values(2);
+ drop table t1;
+ --dec $loop_counter
+}
+--enable_query_log
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index d99a377f0c5..928c9799854 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -47,6 +47,8 @@ drop database if exists db1;
create database db1;
use db1;
create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
insert into t1 (f1) values ('one'),('two');
connection slave;
select * from db1.t1;
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index fc58fe81803..53d9f40877f 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -1 +1 @@
---source extra/rpl_tests/multisource.inc
+--source suite/rpl/include/multisource.inc
diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result
index 353970ac8ff..c1d74ab9f3f 100644
--- a/mysql-test/suite/multi_source/reset_slave.result
+++ b/mysql-test/suite/multi_source/reset_slave.result
@@ -13,15 +13,15 @@ insert into t1 values (1),(2);
connection slave;
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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State
- 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 0 NULL
+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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups
+ 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 0 NULL 2 1 0
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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State
- 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 0 NULL
+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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups
+ 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 0 NULL 2 1 0
reset slave 'master1' all;
show slave 'master1' status;
ERROR HY000: There is no master connection 'master1'
diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result
index 419b9951905..93ea1c023bc 100644
--- a/mysql-test/suite/multi_source/simple.result
+++ b/mysql-test/suite/multi_source/simple.result
@@ -18,9 +18,9 @@ connection slave;
connection master2;
connection slave;
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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 0 1073741824 7 0 60.000
start all slaves;
stop slave 'slave1';
show slave 'slave1' status;
@@ -74,21 +74,24 @@ Parallel_Mode conservative
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
+Slave_DDL_Groups 0
+Slave_Non_Transactional_Groups 0
+Slave_Transactional_Groups 0
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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 NULL 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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 NULL 0 0 0 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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 NULL Slave has read all relay log; waiting for the slave I/O thread to update it 0 0 0 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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 NULL 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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 NULL 0 0 0 0 1073741824 7 0 60.000
stop all slaves;
include/reset_master_slave.inc
disconnect slave;
diff --git a/mysql-test/suite/multi_source/syntax.result b/mysql-test/suite/multi_source/syntax.result
index a17a61d3e7c..35f4b3048ad 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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups
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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups
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 Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups 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/parts/r/alter_data_directory_innodb.result b/mysql-test/suite/parts/r/alter_data_directory_innodb.result
index 2f049f2bb16..de2da0b9a05 100644
--- a/mysql-test/suite/parts/r/alter_data_directory_innodb.result
+++ b/mysql-test/suite/parts/r/alter_data_directory_innodb.result
@@ -18,6 +18,8 @@ t CREATE TABLE `t` (
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
@@ -39,6 +41,8 @@ t CREATE TABLE `t` (
SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE;
SET GLOBAL INNODB_FILE_PER_TABLE=OFF;
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
diff --git a/mysql-test/suite/parts/r/cache.result b/mysql-test/suite/parts/r/cache.result
new file mode 100644
index 00000000000..fb40526f379
--- /dev/null
+++ b/mysql-test/suite/parts/r/cache.result
@@ -0,0 +1,15 @@
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, f4 INT, KEY (f4),
+KEY (f1,f4,f3,f2)
+) PARTITION BY RANGE(f1) ( PARTITION p VALUES LESS THAN MAXVALUE );
+INSERT IGNORE INTO t1 VALUES
+(140,0,0,7),(143,92,NULL,0),(0,0,NULL,154),(NULL,255,117,197),(0,0,NULL,0),(60,0,0,1);
+CREATE TABLE t2 (f INT);
+INSERT INTO t2 VALUES (NULL),(35),(NULL),(2);
+SELECT * FROM t1, t2 WHERE f4 >= f;
+f1 f2 f3 f4 f
+0 0 NULL 154 2
+0 0 NULL 154 35
+140 0 0 7 2
+NULL 255 117 197 2
+NULL 255 117 197 35
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/parts/r/fulltext.result b/mysql-test/suite/parts/r/fulltext.result
new file mode 100644
index 00000000000..6495c9aa5a1
--- /dev/null
+++ b/mysql-test/suite/parts/r/fulltext.result
@@ -0,0 +1,6 @@
+create table t1 (i int, f1 varchar(512), f2 varchar(512), fulltext (f1)) engine=myisam partition by hash (i);
+select * from t1 where match (f1) against ('foo');
+i f1 f2
+select * from t1 where match (f2) against ('bar' in boolean mode) ;
+i f1 f2
+drop table t1;
diff --git a/mysql-test/suite/parts/r/optimizer.result b/mysql-test/suite/parts/r/optimizer.result
index cdf0b2b83dc..465c6c7d762 100644
--- a/mysql-test/suite/parts/r/optimizer.result
+++ b/mysql-test/suite/parts/r/optimizer.result
@@ -22,7 +22,7 @@ INSERT INTO t2 SELECT * FROM t1;
# plans should be identical
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index for group-by
+1 SIMPLE t1 range a a 5 NULL 2 Using where; Using index
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by
@@ -33,7 +33,7 @@ a MAX(b)
# Should be no more than 4 reads.
SHOW status LIKE 'handler_read_key';
Variable_name Value
-Handler_read_key 4
+Handler_read_key 2
FLUSH status;
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
a MAX(b)
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
index 617e2d258c2..455ce2a3d2e 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
@@ -2318,7 +2318,7 @@ t55 CREATE TABLE `t55` (
`col1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY LIST (`colint`)
-SUBPARTITION BY HASH (`col1` % 10)
+SUBPARTITION BY HASH (`col1` MOD 10)
SUBPARTITIONS 5
(PARTITION `p0` VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
PARTITION `p1` VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
index 490a79155a2..9697328ff25 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
@@ -2318,7 +2318,7 @@ t55 CREATE TABLE `t55` (
`col1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY LIST (`colint`)
-SUBPARTITION BY HASH (`col1` % 10)
+SUBPARTITION BY HASH (`col1` MOD 10)
SUBPARTITIONS 5
(PARTITION `p0` VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
PARTITION `p1` VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
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 ac56faae01e..5f3610b7999 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
@@ -1067,7 +1067,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -3084,7 +3084,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3592,7 +3592,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -5081,7 +5081,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -7098,7 +7098,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7606,7 +7606,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -9128,7 +9128,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -11209,7 +11209,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -11733,7 +11733,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -13270,7 +13270,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -15351,7 +15351,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -15875,7 +15875,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -17384,7 +17384,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -19405,7 +19405,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -19914,7 +19914,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -21406,7 +21406,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -23427,7 +23427,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -23936,7 +23936,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -25428,7 +25428,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -27449,7 +27449,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -27958,7 +27958,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 93862512ea1..ce3dd51496e 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
@@ -1123,7 +1123,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -3284,7 +3284,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3829,7 +3829,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -5413,7 +5413,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -7574,7 +7574,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -8119,7 +8119,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
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 c0a14ee8de0..12f028782ed 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
@@ -1385,7 +1385,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -3404,7 +3404,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3912,7 +3912,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -5401,7 +5401,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -7420,7 +7420,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7928,7 +7928,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -9450,7 +9450,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -11533,7 +11533,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -12057,7 +12057,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -13594,7 +13594,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -15677,7 +15677,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -16201,7 +16201,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 91dd960f516..a276e1593ee 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
@@ -1282,7 +1282,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -3445,7 +3445,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3990,7 +3990,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -5574,7 +5574,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -7737,7 +7737,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -8282,7 +8282,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
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 9b00fb9d7b3..36823665fa1 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
@@ -961,7 +961,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2772,7 +2772,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3228,7 +3228,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -4561,7 +4561,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6372,7 +6372,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -6828,7 +6828,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -8193,7 +8193,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10068,7 +10068,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -10540,7 +10540,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -11893,7 +11893,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -13702,7 +13702,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -14158,7 +14158,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -15491,7 +15491,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -17300,7 +17300,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -17756,7 +17756,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -19122,7 +19122,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -20995,7 +20995,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -21467,7 +21467,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -22848,7 +22848,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -24721,7 +24721,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -25193,7 +25193,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -26543,7 +26543,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -28352,7 +28352,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -28808,7 +28808,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -30141,7 +30141,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -31950,7 +31950,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -32406,7 +32406,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -33771,7 +33771,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -35644,7 +35644,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -36116,7 +36116,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 e10fb459e99..b4e1ddc577b 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
@@ -1016,7 +1016,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -2971,7 +2971,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3464,7 +3464,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -4896,7 +4896,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -6849,7 +6849,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -7342,7 +7342,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -8770,7 +8770,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -10723,7 +10723,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -11216,7 +11216,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -12644,7 +12644,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -14597,7 +14597,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -15090,7 +15090,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
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 cd0a3380311..586b24e4049 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
@@ -994,7 +994,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2869,7 +2869,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3341,7 +3341,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -4800,7 +4800,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6827,7 +6827,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7337,7 +7337,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -8832,7 +8832,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10859,7 +10859,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -11369,7 +11369,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -12893,7 +12893,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -14976,7 +14976,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -15500,7 +15500,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -17037,7 +17037,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -19120,7 +19120,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -19644,7 +19644,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 cfca64afa1f..5a71f1063f5 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
@@ -990,7 +990,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2863,7 +2863,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3335,7 +3335,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -4796,7 +4796,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6825,7 +6825,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7336,7 +7336,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -8834,7 +8834,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10863,7 +10863,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -11374,7 +11374,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -12899,7 +12899,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -14980,7 +14980,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -15504,7 +15504,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -17041,7 +17041,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -19122,7 +19122,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -19646,7 +19646,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 4504319a3fd..7196be3a602 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_maria.result
@@ -1018,7 +1018,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -2973,7 +2973,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -3466,7 +3466,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -5000,7 +5000,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -7163,7 +7163,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -7708,7 +7708,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -9292,7 +9292,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -11455,7 +11455,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -12000,7 +12000,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -13484,7 +13484,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -15437,7 +15437,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -15930,7 +15930,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -17464,7 +17464,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -19625,7 +19625,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -20170,7 +20170,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -21754,7 +21754,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -23915,7 +23915,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -24460,7 +24460,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
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 ee587189113..59039b97f65 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
@@ -1018,7 +1018,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -2973,7 +2973,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3466,7 +3466,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -5000,7 +5000,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -7163,7 +7163,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -7708,7 +7708,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -9292,7 +9292,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -11455,7 +11455,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -12000,7 +12000,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -13484,7 +13484,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -15437,7 +15437,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -15930,7 +15930,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -17464,7 +17464,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -19625,7 +19625,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -20170,7 +20170,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -21754,7 +21754,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -23915,7 +23915,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -24460,7 +24460,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
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 d6352fb9b1f..1d90f8f6368 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
@@ -998,7 +998,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2877,7 +2877,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3351,7 +3351,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -4815,7 +4815,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6846,7 +6846,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7358,7 +7358,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -8859,7 +8859,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10890,7 +10890,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -11402,7 +11402,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -12932,7 +12932,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -15019,7 +15019,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -15545,7 +15545,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -17088,7 +17088,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -19175,7 +19175,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -19701,7 +19701,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 4bf99bd6acc..4b0a481340f 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
@@ -995,7 +995,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2886,7 +2886,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3361,7 +3361,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -4831,7 +4831,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6878,7 +6878,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7392,7 +7392,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -8899,7 +8899,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10946,7 +10946,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -11460,7 +11460,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -12994,7 +12994,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -15093,7 +15093,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -15620,7 +15620,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -17166,7 +17166,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -19265,7 +19265,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -19792,7 +19792,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
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 6dcdfe2d0e5..66d5770e20e 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_maria.result
@@ -1022,7 +1022,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -2981,7 +2981,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -3476,7 +3476,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -5016,7 +5016,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -7183,7 +7183,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -7730,7 +7730,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -9320,7 +9320,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -11487,7 +11487,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -12034,7 +12034,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -13525,7 +13525,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -15496,7 +15496,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -15992,7 +15992,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -17535,7 +17535,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -19714,7 +19714,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -20262,7 +20262,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
@@ -21855,7 +21855,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = Aria,
PARTITION `part_2` VALUES IN (-2) ENGINE = Aria,
PARTITION `part_1` VALUES IN (-1) ENGINE = Aria,
@@ -24034,7 +24034,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = Aria,
@@ -24582,7 +24582,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=Aria DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = Aria,
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 5fef45b630d..69548fdb94b 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
@@ -1022,7 +1022,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -2981,7 +2981,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3476,7 +3476,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -5016,7 +5016,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -7183,7 +7183,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -7730,7 +7730,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -9320,7 +9320,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -11487,7 +11487,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -12034,7 +12034,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -13525,7 +13525,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -15496,7 +15496,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -15992,7 +15992,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -17535,7 +17535,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -19714,7 +19714,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -20262,7 +20262,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -21855,7 +21855,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -24034,7 +24034,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -24582,7 +24582,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result
index 1c3edcb386d..644a5f32f84 100644
--- a/mysql-test/suite/parts/r/partition_alter4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result
@@ -1004,7 +1004,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2887,7 +2887,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3361,7 +3361,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -4754,7 +4754,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6637,7 +6637,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7111,7 +7111,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -8504,7 +8504,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10387,7 +10387,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -10861,7 +10861,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -12254,7 +12254,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -14137,7 +14137,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -14611,7 +14611,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -16004,7 +16004,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -17887,7 +17887,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -18361,7 +18361,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -19757,7 +19757,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -21640,7 +21640,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -22114,7 +22114,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -23507,7 +23507,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -25390,7 +25390,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -25864,7 +25864,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -27257,7 +27257,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -29140,7 +29140,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -29614,7 +29614,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -31007,7 +31007,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -32890,7 +32890,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -33364,7 +33364,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -34757,7 +34757,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -36640,7 +36640,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -37114,7 +37114,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -38513,7 +38513,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -40400,7 +40400,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -40875,7 +40875,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -42271,7 +42271,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -44158,7 +44158,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -44633,7 +44633,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -46026,7 +46026,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -47909,7 +47909,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -48383,7 +48383,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -49776,7 +49776,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -51659,7 +51659,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -52133,7 +52133,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -53529,7 +53529,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -55416,7 +55416,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -55891,7 +55891,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -57281,7 +57281,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -59156,7 +59156,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -59628,7 +59628,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -61015,7 +61015,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -62890,7 +62890,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -63362,7 +63362,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -65069,7 +65069,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -66944,7 +66944,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -67416,7 +67416,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -68812,7 +68812,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -70695,7 +70695,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -71169,7 +71169,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -72562,7 +72562,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -74445,7 +74445,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -74919,7 +74919,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -76312,7 +76312,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -78195,7 +78195,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -78669,7 +78669,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -80062,7 +80062,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -81945,7 +81945,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -82419,7 +82419,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
@@ -83812,7 +83812,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -85695,7 +85695,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -86169,7 +86169,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = InnoDB,
diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result
index 326c3bb8a80..41723a268e1 100644
--- a/mysql-test/suite/parts/r/partition_alter4_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result
@@ -1028,7 +1028,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -2991,7 +2991,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3486,7 +3486,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -4926,7 +4926,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -6889,7 +6889,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -7384,7 +7384,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -8824,7 +8824,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -10787,7 +10787,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -11282,7 +11282,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -12722,7 +12722,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -14685,7 +14685,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -15180,7 +15180,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -16620,7 +16620,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -18583,7 +18583,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -19078,7 +19078,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -20521,7 +20521,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -22484,7 +22484,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -22979,7 +22979,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -24419,7 +24419,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -26382,7 +26382,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -26877,7 +26877,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -28317,7 +28317,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -30280,7 +30280,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -30775,7 +30775,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -32215,7 +32215,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -34178,7 +34178,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -34673,7 +34673,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -36113,7 +36113,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -38076,7 +38076,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -38571,7 +38571,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -40014,7 +40014,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -41977,7 +41977,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -42472,7 +42472,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -43912,7 +43912,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -45875,7 +45875,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -46370,7 +46370,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -47810,7 +47810,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -49773,7 +49773,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -50268,7 +50268,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -51708,7 +51708,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -53671,7 +53671,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -54166,7 +54166,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -55606,7 +55606,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -57569,7 +57569,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -58064,7 +58064,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -59501,7 +59501,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -61456,7 +61456,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -61949,7 +61949,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -63383,7 +63383,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -65338,7 +65338,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -65831,7 +65831,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -67585,7 +67585,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -69540,7 +69540,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -70033,7 +70033,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -71476,7 +71476,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -73439,7 +73439,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -73934,7 +73934,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -75374,7 +75374,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -77337,7 +77337,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -77832,7 +77832,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -79272,7 +79272,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -81235,7 +81235,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -81730,7 +81730,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -83170,7 +83170,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -85133,7 +85133,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -85628,7 +85628,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
@@ -87068,7 +87068,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -89031,7 +89031,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part_1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -89526,7 +89526,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part_1` VALUES IN (0) ENGINE = MyISAM,
diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result
index edaeefe45b3..570a30bcd81 100644
--- a/mysql-test/suite/parts/r/partition_basic_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_innodb.result
@@ -998,7 +998,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -2903,7 +2903,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -3382,7 +3382,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -4777,7 +4777,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -6676,7 +6676,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -7155,7 +7155,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -8630,7 +8630,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -10683,7 +10683,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -11199,7 +11199,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -12704,7 +12704,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -14757,7 +14757,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -15273,7 +15273,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -16810,7 +16810,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -18927,7 +18927,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -19459,7 +19459,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -20985,7 +20985,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -23032,7 +23032,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -23548,7 +23548,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -25053,7 +25053,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -27100,7 +27100,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -27616,7 +27616,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
@@ -29153,7 +29153,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = InnoDB,
PARTITION `part_2` VALUES IN (-2) ENGINE = InnoDB,
PARTITION `part_1` VALUES IN (-1) ENGINE = InnoDB,
@@ -31264,7 +31264,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = InnoDB,
@@ -31796,7 +31796,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = InnoDB,
diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result
index e32cd4394ad..3b84c0295f2 100644
--- a/mysql-test/suite/parts/r/partition_basic_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_myisam.result
@@ -1007,7 +1007,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -2946,7 +2946,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -3434,7 +3434,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -4848,7 +4848,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -6781,7 +6781,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -7269,7 +7269,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -8795,7 +8795,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -10946,7 +10946,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -11487,7 +11487,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
@@ -13064,7 +13064,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) ENGINE = MyISAM,
@@ -15209,7 +15209,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` ENGINE = MyISAM,
@@ -15750,7 +15750,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) ENGINE = MyISAM,
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 51e6f282ad0..5e59c8f08ba 100644
--- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
@@ -1059,7 +1059,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -3102,7 +3102,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -3612,7 +3612,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -5092,7 +5092,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -7133,7 +7133,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -7643,7 +7643,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -9235,7 +9235,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -11490,7 +11490,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -12053,7 +12053,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int1`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -13696,7 +13696,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST ((`f_int1` + `f_int2`) % 4)
+ PARTITION BY LIST ((`f_int1` + `f_int2`) MOD 4)
(PARTITION `part_3` VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -15949,7 +15949,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int2` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -16512,7 +16512,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 2))
+ PARTITION BY LIST (abs(`f_int1` MOD 2))
SUBPARTITION BY KEY (`f_int2`)
SUBPARTITIONS 3
(PARTITION `part1` VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -18139,7 +18139,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 4)
+ PARTITION BY LIST (`f_int1` MOD 4)
(PARTITION `part_3` VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
PARTITION `part_2` VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
PARTITION `part_1` VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
@@ -20324,7 +20324,7 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (abs(`f_int1` % 3))
+ PARTITION BY LIST (abs(`f_int1` MOD 3))
SUBPARTITION BY HASH (`f_int1` + 1)
(PARTITION `part1` VALUES IN (0)
(SUBPARTITION `sp11` DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
index 03ef0ed2c09..2e31fc57dd4 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
+GRANT USAGE ON *.* TO `test1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
index 03ef0ed2c09..2e31fc57dd4 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
+GRANT USAGE ON *.* TO `test1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_6.result b/mysql-test/suite/parts/r/partition_exch_qa_6.result
index 6de40ee614a..880886b4fac 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_6.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_6.result
@@ -59,8 +59,8 @@ GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -114,8 +114,8 @@ connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 'tp'
disconnect test2;
@@ -126,8 +126,8 @@ connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
ERROR 42000: CREATE command denied to user 'test2'@'localhost' for table 'tsp'
disconnect test2;
@@ -137,8 +137,8 @@ REVOKE DROP ON test.* FROM test2@localhost;
connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: DROP command denied to user 'test2'@'localhost' for table 'tp'
disconnect test2;
diff --git a/mysql-test/suite/parts/r/partition_open.result b/mysql-test/suite/parts/r/partition_open.result
new file mode 100644
index 00000000000..98600d98ce3
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_open.result
@@ -0,0 +1,8 @@
+select * from t1 partition (p1);
+x
+300
+select * from t1 partition (p0);
+ERROR HY000: Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
+drop table t1;
+Warnings:
+Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
diff --git a/mysql-test/suite/parts/r/partition_recover_myisam.result b/mysql-test/suite/parts/r/partition_recover_myisam.result
index ccbc9a6c9ef..4b9e3f5c283 100644
--- a/mysql-test/suite/parts/r/partition_recover_myisam.result
+++ b/mysql-test/suite/parts/r/partition_recover_myisam.result
@@ -18,7 +18,6 @@ a
11
Warnings:
Error 145 Table 't1_will_crash' is marked as crashed and should be repaired
-Error 1194 Table 't1_will_crash' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly
Error 1034 Size of indexfile is: 1024 Should be: 2048
Error 1034 Size of datafile is: 77 Should be: 7
@@ -48,7 +47,6 @@ a
11
Warnings:
Error 145 Table 't1_will_crash#P#p1' is marked as crashed and should be repaired
-Error 1194 Table 't1_will_crash' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly
Error 1034 Size of indexfile is: 1024 Should be: 2048
Error 1034 Size of datafile is: 28 Should be: 7
diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result
index 596ecc7b717..8171141127a 100644
--- a/mysql-test/suite/parts/r/partition_syntax_innodb.result
+++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result
@@ -658,7 +658,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 2)
+ PARTITION BY LIST (`f_int1` MOD 2)
(PARTITION `part1` VALUES IN (NULL) ENGINE = InnoDB,
PARTITION `part3` VALUES IN (1) ENGINE = InnoDB)
@@ -685,7 +685,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 2)
+ PARTITION BY LIST (`f_int1` MOD 2)
(PARTITION `part1` VALUES IN (NULL) ENGINE = InnoDB,
PARTITION `part2` VALUES IN (0) ENGINE = InnoDB,
PARTITION `part3` VALUES IN (1) ENGINE = InnoDB)
diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result
index aaa11001cbd..16882b33176 100644
--- a/mysql-test/suite/parts/r/partition_syntax_myisam.result
+++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result
@@ -658,7 +658,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 2)
+ PARTITION BY LIST (`f_int1` MOD 2)
(PARTITION `part1` VALUES IN (NULL) ENGINE = MyISAM,
PARTITION `part3` VALUES IN (1) ENGINE = MyISAM)
@@ -693,7 +693,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
- PARTITION BY LIST (`f_int1` % 2)
+ PARTITION BY LIST (`f_int1` MOD 2)
(PARTITION `part1` VALUES IN (NULL) ENGINE = MyISAM,
PARTITION `part2` VALUES IN (0) ENGINE = MyISAM,
PARTITION `part3` VALUES IN (1) ENGINE = MyISAM)
diff --git a/mysql-test/suite/parts/r/print_error.result b/mysql-test/suite/parts/r/print_error.result
new file mode 100644
index 00000000000..74a13afeb46
--- /dev/null
+++ b/mysql-test/suite/parts/r/print_error.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2;
+XA START 'xid';
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+connect con1,localhost,root,,test;
+CREATE TABLE t2 SELECT * FROM t1;;
+connect con2,localhost,root,,test;
+SET max_statement_time= 1;
+DELETE FROM t1 PARTITION (p1) ORDER BY i LIMIT 2;
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
+disconnect con2;
+connection default;
+XA END 'xid';
+XA ROLLBACK 'xid';
+connection con1;
+disconnect con1;
+connection default;
+call mtr.add_suppression('Sort aborted');
+DROP TABLE IF EXISTS t2, t1;
diff --git a/mysql-test/suite/parts/r/reorganize_partition_innodb.result b/mysql-test/suite/parts/r/reorganize_partition_innodb.result
index c4e2cb7e039..a0a3344a39d 100644
--- a/mysql-test/suite/parts/r/reorganize_partition_innodb.result
+++ b/mysql-test/suite/parts/r/reorganize_partition_innodb.result
@@ -18,6 +18,8 @@ t CREATE TABLE `t` (
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
@@ -39,6 +41,8 @@ t CREATE TABLE `t` (
SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE;
SET GLOBAL INNODB_FILE_PER_TABLE=OFF;
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
diff --git a/mysql-test/suite/parts/r/show_create.result b/mysql-test/suite/parts/r/show_create.result
index 17f89161f5e..c7b0ecdb6d9 100644
--- a/mysql-test/suite/parts/r/show_create.result
+++ b/mysql-test/suite/parts/r/show_create.result
@@ -108,6 +108,6 @@ set sql_mode='ansi_quotes';
alter table t1 add partition (partition p1 values less than (10));
set sql_mode= default;
show table status;
-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 0 0 0 0 2048 0 NULL X X NULL latin1_swedish_ci NULL partitioned
+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 Max_index_length Temporary
+t1 MyISAM 10 Fixed 0 0 0 0 2048 0 NULL X X NULL latin1_swedish_ci NULL partitioned 0 N
drop table t1;
diff --git a/mysql-test/suite/parts/t/cache.test b/mysql-test/suite/parts/t/cache.test
new file mode 100644
index 00000000000..fcf2ba5d6b6
--- /dev/null
+++ b/mysql-test/suite/parts/t/cache.test
@@ -0,0 +1,22 @@
+#
+# Test cases related to row cache
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, f4 INT, KEY (f4),
+ KEY (f1,f4,f3,f2)
+) PARTITION BY RANGE(f1) ( PARTITION p VALUES LESS THAN MAXVALUE );
+
+INSERT IGNORE INTO t1 VALUES
+(140,0,0,7),(143,92,NULL,0),(0,0,NULL,154),(NULL,255,117,197),(0,0,NULL,0),(60,0,0,1);
+
+CREATE TABLE t2 (f INT);
+INSERT INTO t2 VALUES (NULL),(35),(NULL),(2);
+
+--sorted_result
+SELECT * FROM t1, t2 WHERE f4 >= f;
+
+# Cleanup
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/parts/t/fulltext.test b/mysql-test/suite/parts/t/fulltext.test
new file mode 100644
index 00000000000..c591e660e5b
--- /dev/null
+++ b/mysql-test/suite/parts/t/fulltext.test
@@ -0,0 +1,9 @@
+--source include/have_partition.inc
+
+#
+# MDEV-17627 Assertion `inited==RND' failed in handler::ha_rnd_end() upon actions on partitioned table with FTS
+#
+create table t1 (i int, f1 varchar(512), f2 varchar(512), fulltext (f1)) engine=myisam partition by hash (i);
+select * from t1 where match (f1) against ('foo');
+select * from t1 where match (f2) against ('bar' in boolean mode) ;
+drop table t1;
diff --git a/mysql-test/suite/parts/t/partition_debug_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_innodb-master.opt
index 5253df4563a..4fa3cb12e29 100644
--- a/mysql-test/suite/parts/t/partition_debug_innodb-master.opt
+++ b/mysql-test/suite/parts/t/partition_debug_innodb-master.opt
@@ -1 +1 @@
---loose-innodb-file-format-check --loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
+--loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_12.test b/mysql-test/suite/parts/t/partition_exch_qa_12.test
index 7e048f79017..80fd7ebba82 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_12.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_12.test
@@ -164,6 +164,7 @@ SELECT * FROM tsp_04;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
#--error ER_TABLES_DIFFERENT_METADATA
#ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10 IGNORE;
+--sorted_result
SELECT TABLE_NAME, ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test'
AND TABLE_NAME IN ('tp', 't_100');
ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t_100;
diff --git a/mysql-test/suite/parts/t/partition_open.test b/mysql-test/suite/parts/t/partition_open.test
new file mode 100644
index 00000000000..de6873aacec
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_open.test
@@ -0,0 +1,24 @@
+#
+# MDEV-11084 Select statement with partition selection against MyISAM table opens all partitions.
+#
+--source include/have_partition.inc
+
+let $datadir=`select @@datadir`;
+
+# Table declared as having 2 partitions
+# create table t1 (x int) egine=myisam
+# partition by range columns (x)
+# ( partition p0 values less than (100), partition p1 values less than (1000));
+#
+# But we copy only second partition. So the 'p0' can't be opened.
+
+copy_file std_data/mdev11084.frm $datadir/test/t1.frm;
+copy_file std_data/mdev11084.par $datadir/test/t1.par;
+copy_file std_data/mdev11084.part1.MYD $datadir/test/t1#P#p1.MYD;
+copy_file std_data/mdev11084.part1.MYI $datadir/test/t1#P#p1.MYI;
+select * from t1 partition (p1);
+--replace_result $datadir ./
+--error ER_FILE_NOT_FOUND
+select * from t1 partition (p0);
+--replace_result $datadir ./
+drop table t1;
diff --git a/mysql-test/suite/parts/t/print_error.test b/mysql-test/suite/parts/t/print_error.test
new file mode 100644
index 00000000000..79da0d87f4b
--- /dev/null
+++ b/mysql-test/suite/parts/t/print_error.test
@@ -0,0 +1,30 @@
+#
+# MDEV-15336 Server crashes in handler::print_error / ha_partition::print_error upon query timeout
+#
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/have_partition.inc
+
+CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2;
+XA START 'xid';
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+
+--connect (con1,localhost,root,,test)
+--send CREATE TABLE t2 SELECT * FROM t1;
+
+--connect (con2,localhost,root,,test)
+SET max_statement_time= 1;
+--error ER_STATEMENT_TIMEOUT
+DELETE FROM t1 PARTITION (p1) ORDER BY i LIMIT 2;
+
+# Cleanup
+--disconnect con2
+--connection default
+XA END 'xid';
+XA ROLLBACK 'xid';
+--connection con1
+--reap
+--disconnect con1
+--connection default
+call mtr.add_suppression('Sort aborted');
+DROP TABLE IF EXISTS t2, t1;
diff --git a/mysql-test/suite/percona/disabled.def b/mysql-test/suite/percona/disabled.def
deleted file mode 100644
index cd3fd72cc54..00000000000
--- a/mysql-test/suite/percona/disabled.def
+++ /dev/null
@@ -1,45 +0,0 @@
-percona_sync_flush: removed from XtraDB-26.0
-
-percona_suppress_log_warning_1592: Feature not merged into MariaDB
-percona_log_slow_slave_statements: Feature not merged into MariaDB
-percona_log_slow_slave_statements-and-use_global_long_query_time: Feature not merged into MariaDB
-percona_slow_query_log-control_global_slow: Feature not merged into MariaDB
-percona_slow_query_log-microseconds_in_slow_query_log: Feature not merged into MariaDB
-percona_query_cache_with_comments: Feature not merged into MariaDB
-percona_query_cache_with_comments_prepared_statements: Feature not merged into MariaDB
-percona_show_temp_tables: Feature not merged into MariaDB
-percona_slow_query_log-use_global_long_query_time: Feature not merged into MariaDB
-percona_query_cache_with_comments_disable: Feature not merged into MariaDB
-percona_log_connection_error: Feature not merged into MariaDB
-percona_query_response_time: Feature not merged into MariaDB
-percona_query_response_time-stored: Feature not merged into MariaDB
-percona_sql_no_fcache: Feature not merged into MariaDB
-percona_status_wait_query_cache_mutex: Feature not merged into MariaDB
-percona_slave_innodb_stats: Feature not merged into MariaDB
-percona_query_response_time-replication: Feature not merged into MariaDB
-percona_server_variables_debug: Feature not merged into MariaDB
-percona_server_variables_release: Feature not merged into MariaDB
-percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB
-percona_innodb_buffer_pool_shm: Requires big shmmax not default on many systems
-percona_log_warnings_suppress: Feature not merged into MariaDB
-percona_slow_extended-log_slow_sp_statements-cl: Feature not merged into MariaDB
-percona_slow_extended-log_slow_verbosity-cl: Feature not merged into MariaDB
-slow_query_log_use_global_control: Feature not merged into MariaDB
-percona_slow_extended-use_global_control: Feature not merged into MariaDB
-percona_slow_query_log-log_slow_verbosity: Feature not merged into MariaDB
-percona_slow_extended-log_slow_verbosity: Feature not merged into MariaDB
-percona_slow_extended-microseconds_in_slow_extended: Feature not merged into MariaDB
-percona_slow_extended-use_global_long_query_time: Feature not merged into MariaDB
-percona_slow_extended-slow_query_log_timestamp_always-cl: Feature not merged into MariaDB
-percona_slow_extended-slow_query_log_microseconds_timestamp-cl: Feature not merged into MariaDB
-percona_bug643149: Feature not merged into MariaDB
-percona_processlist_row_stats: Feature not merged into MariaDB
-percona_server_variables_debug: Feature not merged into MariaDB
-percona_slow_extended-slave_statements: Feature not merged into MariaDB
-percona_show_slave_status_nolock: Feature not merged into MariaDB
-percona_slow_extended-slave_innodb_stats: Feature not merged into MariaDB
-percona_slow_extended-slave_statements-and-use_global_long_query_time: Feature not merged into MariaDB
-userstat_bug602047: Feature not merged into MariaDB
-percona_innodb_expand_fast_index_creation: Feature not merged into MariaDB
-percona_innodb_kill_idle_trx: Feature not merged into MariaDB
-percona_innodb_kill_idle_trx_locks: Feature not merged into MariaDB
diff --git a/mysql-test/suite/percona/have_response_time_distribution.inc b/mysql-test/suite/percona/have_response_time_distribution.inc
deleted file mode 100644
index 45650133b31..00000000000
--- a/mysql-test/suite/percona/have_response_time_distribution.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-if (`SELECT @@have_response_time_distribution != 'YES'`)
-{
- --skip No response time distribution
-}
diff --git a/mysql-test/suite/percona/have_response_time_distribution.require b/mysql-test/suite/percona/have_response_time_distribution.require
deleted file mode 100644
index fd7196830ff..00000000000
--- a/mysql-test/suite/percona/have_response_time_distribution.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-have_response_time_distribution YES
diff --git a/mysql-test/suite/percona/innodb_sys_index.result b/mysql-test/suite/percona/innodb_sys_index.result
deleted file mode 100644
index 2bf2d576086..00000000000
--- a/mysql-test/suite/percona/innodb_sys_index.result
+++ /dev/null
@@ -1,11 +0,0 @@
-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%' ;
-drop table test.t1;
-SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
-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%' ;
-SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
-drop table test.t1;
-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
deleted file mode 100644
index 8e242bda98e..00000000000
--- a/mysql-test/suite/percona/innodb_sys_index.test
+++ /dev/null
@@ -1,19 +0,0 @@
---source include/big_test.inc
---source include/have_xtradb.inc
-
-#
-# test for bug LP#875797 "Using 'innodb_sys_indexes' causes core dump"
-#
---disable_result_log
-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%' ;
-drop table test.t1;
-SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
-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%' ;
-SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
-drop table test.t1;
-SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
---enable_result_log
diff --git a/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error-master.opt b/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error-master.opt
deleted file mode 100644
index 4658d62af60..00000000000
--- a/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-error
diff --git a/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.result b/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.result
deleted file mode 100644
index 352c9ca2a99..00000000000
--- a/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.result
+++ /dev/null
@@ -1,16 +0,0 @@
-SET @old_max_connections = @@max_connections;
-SET @old_log_warnings = @@log_warnings;
-SET GLOBAL max_connections=2;
-SET GLOBAL LOG_WARNINGS = 0;
-connect(localhost,root,,test,port,socket);
-ERROR HY000: Too many connections
-SET GLOBAL LOG_WARNINGS = 1;
-connect(localhost,root,,test,port,socket);
-ERROR HY000: Too many connections
-SET GLOBAL LOG_WARNINGS = 0;
-connect(localhost,root,,test,port,socket);
-ERROR HY000: Too many connections
-SET GLOBAL max_connections = @old_max_connections;
-SET GLOBAL log_warnings = @old_log_warnings;
-[log_grep.inc] file: percona.log_connection_error.err pattern: Too many connections
-[log_grep.inc] lines: 1
diff --git a/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.test b/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.test
deleted file mode 100644
index 048102d0499..00000000000
--- a/mysql-test/suite/percona/log_connection_error.patch/percona_log_connection_error.test
+++ /dev/null
@@ -1,54 +0,0 @@
---source include/not_embedded.inc
-
-connect (main,localhost,root,,);
-connection main;
-SET @old_max_connections = @@max_connections;
-SET @old_log_warnings = @@log_warnings;
-SET GLOBAL max_connections=2;
-let $port=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'port'`;
-let $socket=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'socket'`;
-
-SET GLOBAL LOG_WARNINGS = 0;
---connect (conn0,localhost,root,,)
-connection conn0;
-replace_result $port port $socket socket;
---error 1040
---connect(conn1,localhost,root,,)
-disconnect conn0;
-SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
-
-connection main;
-SET GLOBAL LOG_WARNINGS = 1;
---connect (conn1,localhost,root,,)
-replace_result $port port $socket socket;
---error 1040
---connect (conn0,localhost,root,,)
-disconnect conn1;
-SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
-
-connection main;
-SET GLOBAL LOG_WARNINGS = 0;
---connect (conn0,localhost,root,,)
-replace_result $port port $socket socket;
---error 1040
---connect(conn1,localhost,root,,)
-disconnect conn0;
-SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
-
-connection main;
-SET GLOBAL max_connections = @old_max_connections;
-SET GLOBAL log_warnings = @old_log_warnings;
-let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!`select LENGTH('$log_error_')`)
-{
- # MySQL Server on windows is started with --console and thus
- # does not know the location of its .err log, use default location
- let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
-}
-
---let log_error=$log_error_
---let log_file=percona.log_connection_error.err
---let log_file_full_path=$log_error
---let grep_pattern= Too many connections
---source log_grep.inc
-
diff --git a/mysql-test/suite/percona/percona_flush_contiguous_neighbors-master.opt b/mysql-test/suite/percona/percona_flush_contiguous_neighbors-master.opt
deleted file mode 100644
index f61926581b7..00000000000
--- a/mysql-test/suite/percona/percona_flush_contiguous_neighbors-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb_flush_neighbor_pages=cont
diff --git a/mysql-test/suite/percona/percona_flush_contiguous_neighbors.result b/mysql-test/suite/percona/percona_flush_contiguous_neighbors.result
deleted file mode 100644
index 8c6b81f0848..00000000000
--- a/mysql-test/suite/percona/percona_flush_contiguous_neighbors.result
+++ /dev/null
@@ -1,21 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (id INT AUTO_INCREMENT, foo CHAR(255), PRIMARY KEY (id)) ENGINE=InnoDB;
-INSERT INTO t1(foo) VALUES ('a'), ('b');
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_flush_contiguous_neighbors.test b/mysql-test/suite/percona/percona_flush_contiguous_neighbors.test
deleted file mode 100644
index 728081fc493..00000000000
--- a/mysql-test/suite/percona/percona_flush_contiguous_neighbors.test
+++ /dev/null
@@ -1,37 +0,0 @@
-# Test for innodb_flush_neighbor_pages=contiguous.
-# The test is very crude: we simply overflow the buffer pool with such a number of
-# new/modified pages that some flushing is bound to happen.
-
---source include/have_xtradb.inc
---source include/big_test.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (id INT AUTO_INCREMENT, foo CHAR(255), PRIMARY KEY (id)) ENGINE=InnoDB;
-
-INSERT INTO t1(foo) VALUES ('a'), ('b');
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-INSERT INTO t1(foo) SELECT foo FROM t1;
-
-# TODO: cannot record a stable value here. A check of > 0 should be enough,
-# but the variable is not accessible through INFORMATION_SCHEMA currently.
-# SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_flushed';
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt
deleted file mode 100644
index 5974ef6e2be..00000000000
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb_buffer_pool_shm_key=123456
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
deleted file mode 100644
index e5373606099..00000000000
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
+++ /dev/null
@@ -1,4 +0,0 @@
-show variables like 'innodb_buffer_pool_shm%';
-Variable_name Value
-innodb_buffer_pool_shm_checksum ON
-innodb_buffer_pool_shm_key 123456
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
deleted file mode 100644
index 7b26c217893..00000000000
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
+++ /dev/null
@@ -1,2 +0,0 @@
---source include/have_xtradb.inc
-show variables like 'innodb_buffer_pool_shm%';
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.result b/mysql-test/suite/percona/percona_innodb_deadlock_count.result
deleted file mode 100644
index b2af780778d..00000000000
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.result
+++ /dev/null
@@ -1,28 +0,0 @@
-connect con1,localhost,root,,;
-connect con2,localhost,root,,;
-connect con3,localhost,root,,;
-# Drop test table
-drop table if exists t;
-# Create test table
-create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
-# Insert two rows to test table
-insert into t values(2,1);
-insert into t values(1,2);
-connection con1;
-BEGIN;
-SELECT b FROM t WHERE a=1 FOR UPDATE;
-connection con2;
-BEGIN;
-SELECT b FROM t WHERE a=2 FOR UPDATE;
-connection con1;
-SELECT b FROM t WHERE a=2 FOR UPDATE;
-connection con2;
-SELECT b FROM t WHERE a=1 FOR UPDATE;
-connection con1;
-ROLLBACK;
-connection con2;
-ROLLBACK;
-connection con3;
-Deadlocks: 1
-# Drop test table
-drop table t;
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.test b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
deleted file mode 100644
index da1273bc038..00000000000
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.test
+++ /dev/null
@@ -1,51 +0,0 @@
---source include/have_xtradb.inc
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connect (con3,localhost,root,,);
---echo # Drop test table
---disable_warnings
-drop table if exists t;
---enable_warnings
-
---echo # Create test table
-create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
---echo # Insert two rows to test table
-insert into t values(2,1);
-insert into t values(1,2);
-
-#--echo # Save current deadlock count
-let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
-
---disable_result_log
-
-connection con1;
-BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
-
-connection con2;
-BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
-
-connection con1;
-SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
-
-connection con2;
-SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
-
-connection con1;
---error 0, ER_LOCK_DEADLOCK
-reap;
-ROLLBACK;
-
-connection con2;
---error 0, ER_LOCK_DEADLOCK
-reap;
-ROLLBACK;
-
-connection con3;
-let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
-
---enable_result_log
-
-let $diff = `SELECT $result - $current`;
-echo Deadlocks: $diff;
---echo # Drop test table
-drop table t;
diff --git a/mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.result b/mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.result
deleted file mode 100644
index b8cec3d4398..00000000000
--- a/mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.result
+++ /dev/null
@@ -1,64 +0,0 @@
-CREATE TABLE t1(
-id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-a CHAR(1) NOT NULL,
-b CHAR(36) NOT NULL) ENGINE=InnoDB;
-INSERT INTO t1(a,b) VALUES ('a','b');
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-ALTER TABLE t1 ADD KEY (a);
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
-EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
-id 1
-select_type SIMPLE
-table t1
-type ALL
-possible_keys a
-key NULL
-key_len NULL
-ref NULL
-rows 16
-Extra
-id 1
-select_type SIMPLE
-table t2
-type ref
-possible_keys a
-key a
-key_len 1
-ref test.t1.a
-rows 1
-Extra Using where
-ALTER TABLE t1 DROP KEY a;
-SET expand_fast_index_creation = 1;
-SELECT @@expand_fast_index_creation;
-@@expand_fast_index_creation
-1
-ALTER TABLE t1 ADD KEY (a);
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
-EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
-id 1
-select_type SIMPLE
-table t1
-type ALL
-possible_keys a
-key NULL
-key_len NULL
-ref NULL
-rows 16
-Extra
-id 1
-select_type SIMPLE
-table t2
-type ALL
-possible_keys a
-key NULL
-key_len NULL
-ref NULL
-rows 16
-Extra Using where; Using join buffer
-SET expand_fast_index_creation = 0;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.test b/mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.test
deleted file mode 100644
index 06e6c719c17..00000000000
--- a/mysql-test/suite/percona/percona_innodb_expand_fast_index_creation.test
+++ /dev/null
@@ -1,45 +0,0 @@
---source include/have_innodb.inc
-
-########################################################################
-# Bug #857590: Fast index creation does not update index statistics
-########################################################################
-
-CREATE TABLE t1(
- id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- a CHAR(1) NOT NULL,
- b CHAR(36) NOT NULL) ENGINE=InnoDB;
-
-INSERT INTO t1(a,b) VALUES ('a','b');
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-
-# Check that fast index creation is used
---enable_info
-ALTER TABLE t1 ADD KEY (a);
---disable_info
-
-# The default (wrong) plan due to bogus statistics
---vertical_results
-EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
---horizontal_results
-
-ALTER TABLE t1 DROP KEY a;
-
-SET expand_fast_index_creation = 1;
-SELECT @@expand_fast_index_creation;
-
-# Check that stats are updated with the option enabled
-
---enable_info
-ALTER TABLE t1 ADD KEY (a);
---disable_info
-
---vertical_results
-EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
---horizontal_results
-
-SET expand_fast_index_creation = 0;
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.result b/mysql-test/suite/percona/percona_innodb_fake_changes.result
deleted file mode 100644
index 1b870fdbb92..00000000000
--- a/mysql-test/suite/percona/percona_innodb_fake_changes.result
+++ /dev/null
@@ -1,55 +0,0 @@
-DROP TABLE IF EXISTS t1;
-# Checking variables
-SHOW VARIABLES LIKE 'innodb_fake_changes';
-Variable_name Value
-innodb_fake_changes OFF
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
-VARIABLE_VALUE
-OFF
-SET innodb_fake_changes=1;
-SHOW VARIABLES LIKE 'innodb_fake_changes';
-Variable_name Value
-innodb_fake_changes ON
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
-VARIABLE_VALUE
-ON
-SET innodb_fake_changes=default;
-SHOW VARIABLES LIKE 'innodb_fake_changes';
-Variable_name Value
-innodb_fake_changes OFF
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
-VARIABLE_VALUE
-OFF
-# Explicit COMMIT should fail when innodb_fake_changes is enabled
-# DML should be fine
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-SET autocommit=0;
-SET innodb_fake_changes=1;
-BEGIN;
-INSERT INTO t1 VALUES (2);
-UPDATE t1 SET a=0;
-DELETE FROM t1 LIMIT 1;
-SELECT * FROM t1;
-a
-1
-COMMIT;
-ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
-SET innodb_fake_changes=default;
-DROP TABLE t1;
-# DDL must result in error
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-SET autocommit=0;
-SET innodb_fake_changes=1;
-BEGIN;
-CREATE TABLE t2 (a INT) ENGINE=InnoDB;
-ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database")
-DROP TABLE t1;
-ERROR HY000: Storage engine InnoDB of the table `test`.`t1` doesn't have this option
-TRUNCATE TABLE t1;
-ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
-ALTER TABLE t1 ENGINE=MyISAM;
-ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
-ROLLBACK;
-SET innodb_fake_changes=default;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.test b/mysql-test/suite/percona/percona_innodb_fake_changes.test
deleted file mode 100644
index 67f5450ba45..00000000000
--- a/mysql-test/suite/percona/percona_innodb_fake_changes.test
+++ /dev/null
@@ -1,49 +0,0 @@
---source include/have_xtradb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-
---echo # Checking variables
-SHOW VARIABLES LIKE 'innodb_fake_changes';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
-SET innodb_fake_changes=1;
-SHOW VARIABLES LIKE 'innodb_fake_changes';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
-SET innodb_fake_changes=default;
-SHOW VARIABLES LIKE 'innodb_fake_changes';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
-
---echo # Explicit COMMIT should fail when innodb_fake_changes is enabled
---echo # DML should be fine
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-SET autocommit=0;
-SET innodb_fake_changes=1;
-BEGIN;
-INSERT INTO t1 VALUES (2);
-UPDATE t1 SET a=0;
-DELETE FROM t1 LIMIT 1;
-SELECT * FROM t1;
---error 1180
-COMMIT;
-SET innodb_fake_changes=default;
-DROP TABLE t1;
-
---echo # DDL must result in error
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-SET autocommit=0;
-SET innodb_fake_changes=1;
-BEGIN;
---error 1005
-CREATE TABLE t2 (a INT) ENGINE=InnoDB;
---error 1031
-DROP TABLE t1;
---error 1180
-TRUNCATE TABLE t1;
---error 1180
-ALTER TABLE t1 ENGINE=MyISAM;
-ROLLBACK;
-SET innodb_fake_changes=default;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result b/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result
deleted file mode 100644
index 233b55b8ac4..00000000000
--- a/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result
+++ /dev/null
@@ -1,23 +0,0 @@
-DROP TABLE IF EXISTS t1;
-# Verifying that X_LOCK not acquired
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-connect conn1,localhost,root,,;
-connection conn1;
-SET autocommit=0;
-SET innodb_fake_changes=1;
-BEGIN;
-SELECT * FROM t1 FOR UPDATE;
-a
-1
-connection default;
-SET innodb_lock_wait_timeout=3;
-UPDATE t1 SET a=2;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-SELECT * FROM t1 LOCK IN SHARE MODE;
-a
-1
-connection conn1;
-ROLLBACK;
-SET innodb_fake_changes=default;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes_locks.test b/mysql-test/suite/percona/percona_innodb_fake_changes_locks.test
deleted file mode 100644
index ce15fc0bf43..00000000000
--- a/mysql-test/suite/percona/percona_innodb_fake_changes_locks.test
+++ /dev/null
@@ -1,24 +0,0 @@
---source include/have_xtradb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
---echo # Verifying that X_LOCK not acquired
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
---connect (conn1,localhost,root,,)
---connection conn1
-SET autocommit=0;
-SET innodb_fake_changes=1;
-BEGIN;
-SELECT * FROM t1 FOR UPDATE;
---connection default
-SET innodb_lock_wait_timeout=3;
---error 1205
-UPDATE t1 SET a=2;
-SELECT * FROM t1 LOCK IN SHARE MODE;
---connection conn1
-ROLLBACK;
-SET innodb_fake_changes=default;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_innodb_kill_idle_trx.result b/mysql-test/suite/percona/percona_innodb_kill_idle_trx.result
deleted file mode 100644
index a05b5a912fe..00000000000
--- a/mysql-test/suite/percona/percona_innodb_kill_idle_trx.result
+++ /dev/null
@@ -1,41 +0,0 @@
-DROP TABLE IF EXISTS t1;
-SET autocommit=0;
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-Variable_name Value
-innodb_kill_idle_transaction 0
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_KILL_IDLE_TRANSACTION 0
-SET GLOBAL innodb_kill_idle_transaction=1;
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-Variable_name Value
-innodb_kill_idle_transaction 1
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_KILL_IDLE_TRANSACTION 1
-BEGIN;
-INSERT INTO t1 VALUES (1),(2),(3);
-COMMIT;
-SELECT * FROM t1;
-a
-1
-2
-3
-BEGIN;
-INSERT INTO t1 VALUES (4),(5),(6);
-SELECT * FROM t1;
-ERROR HY000: MySQL server has gone away
-SELECT * FROM t1;
-a
-1
-2
-3
-DROP TABLE t1;
-SET GLOBAL innodb_kill_idle_transaction=0;
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-Variable_name Value
-innodb_kill_idle_transaction 0
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_KILL_IDLE_TRANSACTION 0
diff --git a/mysql-test/suite/percona/percona_innodb_kill_idle_trx.test b/mysql-test/suite/percona/percona_innodb_kill_idle_trx.test
deleted file mode 100644
index e1b7b778a31..00000000000
--- a/mysql-test/suite/percona/percona_innodb_kill_idle_trx.test
+++ /dev/null
@@ -1,28 +0,0 @@
---source include/have_innodb.inc
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-SET autocommit=0;
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-
---source percona_innodb_kill_idle_trx_show.inc
-SET GLOBAL innodb_kill_idle_transaction=1;
---source percona_innodb_kill_idle_trx_show.inc
-
-BEGIN;
-INSERT INTO t1 VALUES (1),(2),(3);
-COMMIT;
-SELECT * FROM t1;
-
-BEGIN;
-INSERT INTO t1 VALUES (4),(5),(6);
-sleep 3;
-
---enable_reconnect
---error 2006 --error CR_SERVER_GONE_ERROR
-SELECT * FROM t1;
-SELECT * FROM t1;
-DROP TABLE t1;
-SET GLOBAL innodb_kill_idle_transaction=0;
---source percona_innodb_kill_idle_trx_show.inc
diff --git a/mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.result b/mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.result
deleted file mode 100644
index 6bdd2617805..00000000000
--- a/mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.result
+++ /dev/null
@@ -1,45 +0,0 @@
-DROP TABLE IF EXISTS t1;
-SET autocommit=0;
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-Variable_name Value
-innodb_kill_idle_transaction 0
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_KILL_IDLE_TRANSACTION 0
-SET GLOBAL innodb_kill_idle_transaction=5;
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-Variable_name Value
-innodb_kill_idle_transaction 5
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_KILL_IDLE_TRANSACTION 5
-BEGIN;
-INSERT INTO t1 VALUES (1),(2),(3);
-COMMIT;
-SELECT * FROM t1;
-a
-1
-2
-3
-### Locking rows. Lock should be released when idle trx is killed.
-BEGIN;
-SELECT * FROM t1 FOR UPDATE;
-a
-1
-2
-3
-UPDATE t1 set a=4;
-SELECT * FROM t1;
-a
-4
-4
-4
-DROP TABLE t1;
-SET GLOBAL innodb_kill_idle_transaction=0;
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-Variable_name Value
-innodb_kill_idle_transaction 0
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_KILL_IDLE_TRANSACTION 0
diff --git a/mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.test b/mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.test
deleted file mode 100644
index c283f38de42..00000000000
--- a/mysql-test/suite/percona/percona_innodb_kill_idle_trx_locks.test
+++ /dev/null
@@ -1,31 +0,0 @@
---source include/have_innodb.inc
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-SET autocommit=0;
-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
-
---source percona_innodb_kill_idle_trx_show.inc
-SET GLOBAL innodb_kill_idle_transaction=5;
---source percona_innodb_kill_idle_trx_show.inc
-
-connect (conn1,localhost,root,,);
-connection conn1;
-
-BEGIN;
-INSERT INTO t1 VALUES (1),(2),(3);
-COMMIT;
-SELECT * FROM t1;
-
---echo ### Locking rows. Lock should be released when idle trx is killed.
-BEGIN;
-SELECT * FROM t1 FOR UPDATE;
-
-connection default;
-UPDATE t1 set a=4;
-
-SELECT * FROM t1;
-DROP TABLE t1;
-SET GLOBAL innodb_kill_idle_transaction=0;
---source percona_innodb_kill_idle_trx_show.inc
diff --git a/mysql-test/suite/percona/percona_innodb_kill_idle_trx_show.inc b/mysql-test/suite/percona/percona_innodb_kill_idle_trx_show.inc
deleted file mode 100644
index c85c0311c81..00000000000
--- a/mysql-test/suite/percona/percona_innodb_kill_idle_trx_show.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
-SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
diff --git a/mysql-test/suite/percona/percona_log_warnings_suppress-master.opt b/mysql-test/suite/percona/percona_log_warnings_suppress-master.opt
deleted file mode 100644
index 4658d62af60..00000000000
--- a/mysql-test/suite/percona/percona_log_warnings_suppress-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-error
diff --git a/mysql-test/suite/percona/percona_log_warnings_suppress.result b/mysql-test/suite/percona/percona_log_warnings_suppress.result
deleted file mode 100644
index 1ee6c46738a..00000000000
--- a/mysql-test/suite/percona/percona_log_warnings_suppress.result
+++ /dev/null
@@ -1,31 +0,0 @@
-SET @old_log_warnings = @@log_warnings;
-SET @old_log_warnings_suppress = @@log_warnings_suppress;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
-SET GLOBAL log_warnings_suppress='';
-SET GLOBAL LOG_WARNINGS=0;
-SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
-Variable_name Value
-log_warnings_suppress
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
-SET GLOBAL LOG_WARNINGS=1;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
-SET GLOBAL log_warnings_suppress='1592';
-SET GLOBAL LOG_WARNINGS=0;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
-SET GLOBAL LOG_WARNINGS=1;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
-DROP TABLE t1;
-SET GLOBAL log_warnings = @old_log_warnings;
-SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
-# Count the number of times the "Unsafe" message was printed
-# to the error log.
-Occurrences: 1
diff --git a/mysql-test/suite/percona/percona_log_warnings_suppress.test b/mysql-test/suite/percona/percona_log_warnings_suppress.test
deleted file mode 100644
index 82221013f0b..00000000000
--- a/mysql-test/suite/percona/percona_log_warnings_suppress.test
+++ /dev/null
@@ -1,47 +0,0 @@
--- source include/have_log_bin.inc
--- source include/have_binlog_format_statement.inc
-
-SET @old_log_warnings = @@log_warnings;
-SET @old_log_warnings_suppress = @@log_warnings_suppress;
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
-SET GLOBAL log_warnings_suppress='';
-SET GLOBAL LOG_WARNINGS=0;
-SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-SET GLOBAL LOG_WARNINGS=1;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-SET GLOBAL log_warnings_suppress='1592';
-SET GLOBAL LOG_WARNINGS=0;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-SET GLOBAL LOG_WARNINGS=1;
-INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
-DROP TABLE t1;
-
-SET GLOBAL log_warnings = @old_log_warnings;
-SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
-
-let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!`select LENGTH('$log_error_')`)
-{
- # MySQL Server on windows is started with --console and thus
- # does not know the location of its .err log, use default location
- let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
-}
-# Assign env variable LOG_ERROR
-let LOG_ERROR=$log_error_;
-
---echo # Count the number of times the "Unsafe" message was printed
---echo # to the error log.
-
-perl;
- use strict;
- my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
- open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
- my $count = () = grep(/suppress_1592/g,<FILE>);
- print "Occurrences: $count\n";
- close(FILE);
-EOF
diff --git a/mysql-test/suite/percona/percona_processlist_row_stats.result b/mysql-test/suite/percona/percona_processlist_row_stats.result
deleted file mode 100644
index 109b6a912d9..00000000000
--- a/mysql-test/suite/percona/percona_processlist_row_stats.result
+++ /dev/null
@@ -1,70 +0,0 @@
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-CREATE TABLE t2 (a INT);
-INSERT INTO t2 VALUES(10);
-INSERT INTO t2 VALUES(10);
-INSERT INTO t2 VALUES(20);
-INSERT INTO t2 VALUES(10);
-INSERT INTO t2 VALUES(20);
-SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
-CREATE TABLE t1 (a INT);
-SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
-SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
-SELECT a FROM t2 WHERE a > 15;
-SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
-SHOW PROCESSLIST;
-Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
-### root ### test Query ### ### SHOW PROCESSLIST 0 0 2
-### root ### test Query ### ### CREATE TABLE t1 (a INT) 0 0 1
-### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 2 5 6
-SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
-id info rows_sent rows_examined rows_read
-### SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id 0 0 1
-### CREATE TABLE t1 (a INT) 0 0 1
-### SELECT a FROM t2 WHERE a > 15 2 5 6
-SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
-a
-20
-20
-SET DEBUG_SYNC= 'sent_row SIGNAL thread1_ready WAIT_FOR threads_dumped';
-SELECT a FROM t2 WHERE a < 15;
-SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
-SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
-SELECT a FROM t2 WHERE a > 15;
-SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
-SHOW PROCESSLIST;
-Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
-### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
-### root ### test Query ### ### SELECT a FROM t2 WHERE a < 15 1 0 1
-### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 1 0 3
-SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
-id info rows_sent rows_examined rows_read
-### SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id 0 0 1
-### SELECT a FROM t2 WHERE a < 15 1 0 1
-### SELECT a FROM t2 WHERE a > 15 1 0 3
-SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
-a
-10
-10
-10
-a
-20
-20
-SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread1_ready WAIT_FOR threads_dumped';
-UPDATE t2 SET a = 15 WHERE a = 20;
-SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
-SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
-UPDATE t2 SET a = 15 WHERE a = 10;
-SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
-SHOW PROCESSLIST;
-Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
-### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
-### root ### test Query ### ### UPDATE t2 SET a = 15 WHERE a = 20 0 5 6
-### root ### test Query ### ### UPDATE t2 SET a = 15 WHERE a = 10 0 5 6
-SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
-id info rows_sent rows_examined rows_read
-### SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id 0 0 1
-### UPDATE t2 SET a = 15 WHERE a = 20 0 5 6
-### UPDATE t2 SET a = 15 WHERE a = 10 0 5 6
-SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
-DROP TABLES t1, t2;
diff --git a/mysql-test/suite/percona/percona_processlist_row_stats.test b/mysql-test/suite/percona/percona_processlist_row_stats.test
deleted file mode 100644
index 17ebfedfa40..00000000000
--- a/mysql-test/suite/percona/percona_processlist_row_stats.test
+++ /dev/null
@@ -1,79 +0,0 @@
-# Testing of INFORMATION_SCHEMA.PROCESSLIST fields ROWS_SENT, ROWS_EXAMINED, ROWS_READ
---source include/have_debug_sync.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
---enable_warnings
-
-CREATE TABLE t2 (a INT);
-INSERT INTO t2 VALUES(10);
-INSERT INTO t2 VALUES(10);
-INSERT INTO t2 VALUES(20);
-INSERT INTO t2 VALUES(10);
-INSERT INTO t2 VALUES(20);
-
---connect (conn1, localhost, root, ,)
---connect (conn2, localhost, root, ,)
-
---connection conn1
-SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
-send CREATE TABLE t1 (a INT);
---connection default
-SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
-
---connection conn2
-SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
-send SELECT a FROM t2 WHERE a > 15;
---connection default
-SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
-
---source include/percona_processlist_row_stats_show.inc
-
---connection conn1
-reap;
---connection conn2
-reap;
-
---connection conn1
-SET DEBUG_SYNC= 'sent_row SIGNAL thread1_ready WAIT_FOR threads_dumped';
-send SELECT a FROM t2 WHERE a < 15;
---connection default
-SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
-
---connection conn2
-SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
-send SELECT a FROM t2 WHERE a > 15;
---connection default
-SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
-
---source include/percona_processlist_row_stats_show.inc
-
---connection conn1
-reap;
---connection conn2
-reap;
-
---connection conn1
-SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread1_ready WAIT_FOR threads_dumped';
-send UPDATE t2 SET a = 15 WHERE a = 20;
---connection default
-SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
-
---connection conn2
-SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
-send UPDATE t2 SET a = 15 WHERE a = 10;
---connection default
-SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
-
---source include/percona_processlist_row_stats_show.inc
-
---connection conn1
-reap;
---connection conn2
-reap;
-
---connection default
-disconnect conn1;
-disconnect conn2;
-DROP TABLES t1, t2;
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup b/mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup
deleted file mode 100644
index 4b5b31e9239..00000000000
--- a/mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup
+++ /dev/null
@@ -1,88 +0,0 @@
---source include/percona_query_cache_with_comments_clear.inc
-let $query=/* with comment first */select * from t1;
-eval $query;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=# with comment first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=-- with comment first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=/* with comment first and "quote" */select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=# with comment first and "quote"
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=-- with comment first and "quote"
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=
- /* with comment and whitespaces first */select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=
- # with comment and whitespaces first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=
- -- with comment and whitespaces first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $internal=* internal comment *;
-
-let $query=select * /$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $internal=* internal comment with "quote" *;
-
-let $query=select * /$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 ;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 ;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* comment in the end */;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* comment in the end */
-;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 #comment in the end;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 #comment in the end
-;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 -- comment in the end;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 -- comment in the end
-;
---source include/percona_query_cache_with_comments_eval.inc
diff --git a/mysql-test/suite/percona/percona_query_response_time-replication.result b/mysql-test/suite/percona/percona_query_response_time-replication.result
deleted file mode 100644
index a6e88be6103..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-replication.result
+++ /dev/null
@@ -1,727 +0,0 @@
-SET GLOBAL query_exec_time=0.1;
-include/master-slave.inc
-[connection master]
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 1 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 1 0.100000
- 0.250000 0 0.000000
- 0.500000 30 10.650000
- 1.000000 3 1.500000
- 2.000000 15 19.500000
- 4.000000 12 30.000000
- 8.000000 6 27.599997
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 1 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 1 0.100000
- 0.250000 0 0.000000
- 0.500000 30 10.650000
- 1.000000 3 1.500000
- 2.000000 15 19.500000
- 4.000000 12 30.000000
- 8.000000 6 27.599997
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 1 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 1 0.100000
- 0.250000 0 0.000000
- 0.500000 30 10.650000
- 1.000000 3 1.500000
- 2.000000 15 19.500000
- 4.000000 12 30.000000
- 8.000000 6 27.599997
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 1 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 1 0.100000
- 0.250000 0 0.000000
- 0.500000 30 10.650000
- 1.000000 3 1.500000
- 2.000000 15 19.500000
- 4.000000 12 30.000000
- 8.000000 6 27.599997
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 1 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 34 12.250000
- 10.000000 33 77.099997
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 1 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 34 12.250000
- 10.000000 33 77.099997
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 1 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 1 0.100000
- 1.000000 33 12.150000
- 7.000000 33 77.099997
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 1 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 1 0.100000
- 1.000000 33 12.150000
- 7.000000 33 77.099997
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000041 1 0.000000
- 0.006410 0 0.000000
- 1.000000 34 12.250000
- 156.000000 33 77.099997
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000041 1 0.000000
- 0.006410 0 0.000000
- 1.000000 34 12.250000
- 156.000000 33 77.099997
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 1 0.000000
- 0.001000 0 0.000000
- 1.000000 34 12.250000
- 1000.000000 33 77.099997
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 1 0.000000
- 0.001000 0 0.000000
- 1.000000 34 12.250000
- 1000.000000 33 77.099997
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-CREATE TABLE t(id INT);
-SET GLOBAL query_exec_time = 0.1;
-include/restart_slave.inc
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time = 0.31;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1;
-INSERT INTO t VALUES(1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 1 0.000000
- 0.001000 0 0.000000
- 1.000000 34 12.250000
- 1000.000000 33 77.099997
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 1 0.000000
- 0.001000 0 0.000000
- 1.000000 34 12.250000
- 1000.000000 33 77.099997
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP TABLE t;
-include/rpl_end.inc
-SET GLOBAL query_exec_time=default;
-SET GLOBAL query_exec_time=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time-replication.test b/mysql-test/suite/percona/percona_query_response_time-replication.test
deleted file mode 100644
index 1207e5d1c3d..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-replication.test
+++ /dev/null
@@ -1,28 +0,0 @@
-SET GLOBAL query_exec_time=0.1;
-
---source include/have_response_time_distribution.inc
---source include/have_debug.inc
---source include/have_binlog_format_statement.inc
---source include/master-slave.inc
-
---let base=1
---source include/query_response_time-replication.inc
---let base=2
---source include/query_response_time-replication.inc
---let base=10
---source include/query_response_time-replication.inc
---let base=7
---source include/query_response_time-replication.inc
---let base=156
---source include/query_response_time-replication.inc
---let base=1000
---source include/query_response_time-replication.inc
---let base=1001
---source include/query_response_time-replication.inc
-
---source include/rpl_end.inc
-
-SET GLOBAL query_exec_time=default;
-
-connection slave;
-SET GLOBAL query_exec_time=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time-stored.result b/mysql-test/suite/percona/percona_query_response_time-stored.result
deleted file mode 100644
index fb458d6e7ab..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-stored.result
+++ /dev/null
@@ -1,544 +0,0 @@
-CREATE TABLE t(a INT);
-CREATE PROCEDURE test_f(t DECIMAL(3,2))
-BEGIN
-SET SESSION query_exec_time=t;
-INSERT INTO t VALUES(1);
-SET SESSION query_exec_time=0.1;
-DELETE FROM t;
-END^
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 45 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 44 4.400000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 45 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 44 4.400000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 45 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 44 4.400000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 45 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 44 4.400000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 45 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 55 8.450000
- 10.000000 11 25.699999
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 45 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 55 8.450000
- 10.000000 11 25.699999
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 45 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 44 4.400000
- 1.000000 11 4.050000
- 7.000000 11 25.699999
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 45 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 44 4.400000
- 1.000000 11 4.050000
- 7.000000 11 25.699999
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000041 45 0.000000
- 0.006410 0 0.000000
- 1.000000 55 8.450000
- 156.000000 11 25.699999
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000041 45 0.000000
- 0.006410 0 0.000000
- 1.000000 55 8.450000
- 156.000000 11 25.699999
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 45 0.000000
- 0.001000 0 0.000000
- 1.000000 55 8.450000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 45 0.000000
- 0.001000 0 0.000000
- 1.000000 55 8.450000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 45 0.000000
- 0.001000 0 0.000000
- 1.000000 55 8.450000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 45 0.000000
- 0.001000 0 0.000000
- 1.000000 55 8.450000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-DROP PROCEDURE test_f;
-DROP TABLE t;
diff --git a/mysql-test/suite/percona/percona_query_response_time-stored.test b/mysql-test/suite/percona/percona_query_response_time-stored.test
deleted file mode 100644
index 847ff223b3f..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-stored.test
+++ /dev/null
@@ -1,36 +0,0 @@
---source include/have_response_time_distribution.inc
---source include/have_debug.inc
-
-CREATE TABLE t(a INT);
-
-delimiter ^;
-CREATE PROCEDURE test_f(t DECIMAL(3,2))
-BEGIN
- SET SESSION query_exec_time=t;
- INSERT INTO t VALUES(1);
- SET SESSION query_exec_time=0.1;
- DELETE FROM t;
-END^
-delimiter ;^
-
---let base=1
---source include/query_response_time-stored.inc
---let base=2
---source include/query_response_time-stored.inc
---let base=10
---source include/query_response_time-stored.inc
---let base=7
---source include/query_response_time-stored.inc
---let base=156
---source include/query_response_time-stored.inc
---let base=1000
---source include/query_response_time-stored.inc
---let base=1001
---source include/query_response_time-stored.inc
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-
-DROP PROCEDURE test_f;
-
-DROP TABLE t;
diff --git a/mysql-test/suite/percona/percona_query_response_time.result b/mysql-test/suite/percona/percona_query_response_time.result
deleted file mode 100644
index 1eb90d3cdd4..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time.result
+++ /dev/null
@@ -1,1307 +0,0 @@
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 0 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 0 0.000000
- 1.000000 0 0.000000
- 2.000000 0 0.000000
- 4.000000 0 0.000000
- 8.000000 0 0.000000
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 0 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 0 0.000000
- 1.000000 0 0.000000
- 2.000000 0 0.000000
- 4.000000 0 0.000000
- 8.000000 0 0.000000
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 24 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 24 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 0 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 0 0.000000
- 1.000000 0 0.000000
- 2.000000 0 0.000000
- 4.000000 0 0.000000
- 8.000000 0 0.000000
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 0 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 0 0.000000
- 1.000000 0 0.000000
- 2.000000 0 0.000000
- 4.000000 0 0.000000
- 8.000000 0 0.000000
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 24 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 24 0.000000
- 0.000003 0 0.000000
- 0.000007 0 0.000000
- 0.000015 0 0.000000
- 0.000030 0 0.000000
- 0.000061 0 0.000000
- 0.000122 0 0.000000
- 0.000244 0 0.000000
- 0.000488 0 0.000000
- 0.000976 0 0.000000
- 0.001953 0 0.000000
- 0.003906 0 0.000000
- 0.007812 0 0.000000
- 0.015625 0 0.000000
- 0.031250 0 0.000000
- 0.062500 0 0.000000
- 0.125000 0 0.000000
- 0.250000 0 0.000000
- 0.500000 10 3.550000
- 1.000000 1 0.500000
- 2.000000 5 6.500000
- 4.000000 4 10.000000
- 8.000000 2 9.199999
- 16.000000 0 0.000000
- 32.000000 0 0.000000
- 64.000000 0 0.000000
- 128.000000 0 0.000000
- 256.000000 0 0.000000
- 512.000000 0 0.000000
- 1024.000000 0 0.000000
- 2048.000000 0 0.000000
- 4096.000000 0 0.000000
- 8192.000000 0 0.000000
- 16384.000000 0 0.000000
- 32768.000000 0 0.000000
- 65536.000000 0 0.000000
- 131072.000000 0 0.000000
- 262144.000000 0 0.000000
- 524288.000000 0 0.000000
-1048576.000000 0 0.000000
-2097152.000000 0 0.000000
-4194304.000000 0 0.000000
-8388608.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 0 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 0 0.000000
- 10.000000 0 0.000000
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 0 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 0 0.000000
- 10.000000 0 0.000000
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 24 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 11 4.050000
- 10.000000 11 25.699999
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 24 0.000000
- 0.000010 0 0.000000
- 0.000100 0 0.000000
- 0.001000 0 0.000000
- 0.010000 0 0.000000
- 0.100000 0 0.000000
- 1.000000 11 4.050000
- 10.000000 11 25.699999
- 100.000000 0 0.000000
- 1000.000000 0 0.000000
- 10000.000000 0 0.000000
- 100000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 0 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 0 0.000000
- 1.000000 0 0.000000
- 7.000000 0 0.000000
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 0 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 0 0.000000
- 1.000000 0 0.000000
- 7.000000 0 0.000000
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 24 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 0 0.000000
- 1.000000 11 4.050000
- 7.000000 11 25.699999
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 24 0.000000
- 0.000008 0 0.000000
- 0.000059 0 0.000000
- 0.000416 0 0.000000
- 0.002915 0 0.000000
- 0.020408 0 0.000000
- 0.142857 0 0.000000
- 1.000000 11 4.050000
- 7.000000 11 25.699999
- 49.000000 0 0.000000
- 343.000000 0 0.000000
- 2401.000000 0 0.000000
- 16807.000000 0 0.000000
- 117649.000000 0 0.000000
- 823543.000000 0 0.000000
-5764801.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000041 0 0.000000
- 0.006410 0 0.000000
- 1.000000 0 0.000000
- 156.000000 0 0.000000
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000041 0 0.000000
- 0.006410 0 0.000000
- 1.000000 0 0.000000
- 156.000000 0 0.000000
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000041 24 0.000000
- 0.006410 0 0.000000
- 1.000000 11 4.050000
- 156.000000 11 25.699999
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000041 24 0.000000
- 0.006410 0 0.000000
- 1.000000 11 4.050000
- 156.000000 11 25.699999
- 24336.000000 0 0.000000
-3796416.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 0 0.000000
- 0.001000 0 0.000000
- 1.000000 0 0.000000
- 1000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 0 0.000000
- 0.001000 0 0.000000
- 1.000000 0 0.000000
- 1000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 24 0.000000
- 0.001000 0 0.000000
- 1.000000 11 4.050000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 24 0.000000
- 0.001000 0 0.000000
- 1.000000 11 4.050000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-FLUSH QUERY_RESPONSE_TIME;
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 0 0.000000
- 0.001000 0 0.000000
- 1.000000 0 0.000000
- 1000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 0 0.000000
- 0.001000 0 0.000000
- 1.000000 0 0.000000
- 1000.000000 0 0.000000
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-SET SESSION query_exec_time=0.31;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.32;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.33;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.34;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.35;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.36;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.37;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.38;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.39;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.2;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=1.4;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.3;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=2.5;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=3.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=4.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=5.1;
-SELECT 1;
-1
-1
-SET SESSION query_exec_time=0.1;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SHOW QUERY_RESPONSE_TIME;
-
- 0.000001 24 0.000000
- 0.001000 0 0.000000
- 1.000000 11 4.050000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time count total
- 0.000001 24 0.000000
- 0.001000 0 0.000000
- 1.000000 11 4.050000
- 1000.000000 11 25.699999
-1000000.000000 0 0.000000
-TOO LONG 0 TOO LONG
-SET SESSION query_exec_time=default;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time.test b/mysql-test/suite/percona/percona_query_response_time.test
deleted file mode 100644
index d4fb9c61388..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time.test
+++ /dev/null
@@ -1,20 +0,0 @@
---source include/have_response_time_distribution.inc
---source include/have_debug.inc
-
---let base=1
---source include/query_response_time.inc
---let base=2
---source include/query_response_time.inc
---let base=10
---source include/query_response_time.inc
---let base=7
---source include/query_response_time.inc
---let base=156
---source include/query_response_time.inc
---let base=1000
---source include/query_response_time.inc
---let base=1001
---source include/query_response_time.inc
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
diff --git a/mysql-test/suite/percona/percona_query_response_time_flush.inc b/mysql-test/suite/percona/percona_query_response_time_flush.inc
deleted file mode 100644
index 44bb320fe13..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time_flush.inc
+++ /dev/null
@@ -1 +0,0 @@
-FLUSH QUERY_RESPONSE_TIME;
diff --git a/mysql-test/suite/percona/percona_query_response_time_show.inc b/mysql-test/suite/percona/percona_query_response_time_show.inc
deleted file mode 100644
index 709abf9872e..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time_show.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
diff --git a/mysql-test/suite/percona/percona_query_response_time_sleep.inc b/mysql-test/suite/percona/percona_query_response_time_sleep.inc
deleted file mode 100644
index d889fd9f98d..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time_sleep.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-SET SESSION debug="+d,query_exec_time_0.31";
-SET SESSION debug="+d,query_exec_time_0.32";
-SET SESSION debug="+d,query_exec_time_0.33";
-SET SESSION debug="+d,query_exec_time_0.34";
-SET SESSION debug="+d,query_exec_time_0.35";
-SET SESSION debug="+d,query_exec_time_0.36";
-SET SESSION debug="+d,query_exec_time_0.37";
-SET SESSION debug="+d,query_exec_time_0.38";
-SET SESSION debug="+d,query_exec_time_0.39";
-SET SESSION debug="+d,query_exec_time_0.4";
-SET SESSION debug="+d,query_exec_time_1.1";
-SET SESSION debug="+d,query_exec_time_1.2";
-SET SESSION debug="+d,query_exec_time_1.3";
-SET SESSION debug="+d,query_exec_time_1.5";
-SET SESSION debug="+d,query_exec_time_1.4";
-SET SESSION debug="+d,query_exec_time_0.5";
-SET SESSION debug="+d,query_exec_time_2.1";
-SET SESSION debug="+d,query_exec_time_2.3";
-SET SESSION debug="+d,query_exec_time_2.5";
diff --git a/mysql-test/suite/percona/percona_server_variables.inc b/mysql-test/suite/percona/percona_server_variables.inc
deleted file mode 100644
index 60c8e0ba759..00000000000
--- a/mysql-test/suite/percona/percona_server_variables.inc
+++ /dev/null
@@ -1,3 +0,0 @@
---source have_response_time_distribution.inc
---source include/have_xtradb.inc
-SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
diff --git a/mysql-test/suite/percona/percona_server_variables_debug.result b/mysql-test/suite/percona/percona_server_variables_debug.result
deleted file mode 100644
index ae02a48c8fa..00000000000
--- a/mysql-test/suite/percona/percona_server_variables_debug.result
+++ /dev/null
@@ -1,382 +0,0 @@
-SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
-Variable_name
-AUTOCOMMIT
-AUTOMATIC_SP_PRIVILEGES
-AUTO_INCREMENT_INCREMENT
-AUTO_INCREMENT_OFFSET
-BACK_LOG
-BASEDIR
-BIG_TABLES
-BINLOG_CACHE_SIZE
-BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
-BINLOG_FORMAT
-BINLOG_STMT_CACHE_SIZE
-BULK_INSERT_BUFFER_SIZE
-CHARACTER_SETS_DIR
-CHARACTER_SET_CLIENT
-CHARACTER_SET_CONNECTION
-CHARACTER_SET_DATABASE
-CHARACTER_SET_FILESYSTEM
-CHARACTER_SET_RESULTS
-CHARACTER_SET_SERVER
-CHARACTER_SET_SYSTEM
-COLLATION_CONNECTION
-COLLATION_DATABASE
-COLLATION_SERVER
-COMPLETION_TYPE
-CONCURRENT_INSERT
-CONNECT_TIMEOUT
-DATADIR
-DATETIME_FORMAT
-DATE_FORMAT
-DEBUG
-DEBUG_SYNC
-DEFAULT_STORAGE_ENGINE
-DEFAULT_WEEK_FORMAT
-DELAYED_INSERT_LIMIT
-DELAYED_INSERT_TIMEOUT
-DELAYED_QUEUE_SIZE
-DELAY_KEY_WRITE
-DIV_PRECISION_INCREMENT
-ENGINE_CONDITION_PUSHDOWN
-ERROR_COUNT
-EVENT_SCHEDULER
-EXPAND_FAST_INDEX_CREATION
-EXPIRE_LOGS_DAYS
-EXTERNAL_USER
-FAST_INDEX_CREATION
-FLUSH
-FLUSH_TIME
-FOREIGN_KEY_CHECKS
-FT_BOOLEAN_SYNTAX
-FT_MAX_WORD_LEN
-FT_MIN_WORD_LEN
-FT_QUERY_EXPANSION_LIMIT
-FT_STOPWORD_FILE
-GENERAL_LOG
-GENERAL_LOG_FILE
-GROUP_CONCAT_MAX_LEN
-HAVE_COMPRESS
-HAVE_CRYPT
-HAVE_CSV
-HAVE_DYNAMIC_LOADING
-HAVE_GEOMETRY
-HAVE_INNODB
-HAVE_NDBCLUSTER
-HAVE_OPENSSL
-HAVE_PARTITIONING
-HAVE_PROFILING
-HAVE_QUERY_CACHE
-HAVE_RESPONSE_TIME_DISTRIBUTION
-HAVE_RTREE_KEYS
-HAVE_SSL
-HAVE_SYMLINK
-HOSTNAME
-IDENTITY
-IGNORE_BUILTIN_INNODB
-INIT_CONNECT
-INIT_FILE
-INIT_SLAVE
-INNODB_ADAPTIVE_FLUSHING
-INNODB_ADAPTIVE_FLUSHING_METHOD
-INNODB_ADAPTIVE_HASH_INDEX
-INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
-INNODB_ADDITIONAL_MEM_POOL_SIZE
-INNODB_AUTOEXTEND_INCREMENT
-INNODB_AUTOINC_LOCK_MODE
-INNODB_BLOCKING_BUFFER_POOL_RESTORE
-INNODB_BUFFER_POOL_INSTANCES
-INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
-INNODB_BUFFER_POOL_SHM_CHECKSUM
-INNODB_BUFFER_POOL_SHM_KEY
-INNODB_BUFFER_POOL_SIZE
-INNODB_CHANGE_BUFFERING
-INNODB_CHANGE_BUFFERING_DEBUG
-INNODB_CHECKPOINT_AGE_TARGET
-INNODB_CHECKSUMS
-INNODB_COMMIT_CONCURRENCY
-INNODB_CONCURRENCY_TICKETS
-INNODB_CORRUPT_TABLE_ACTION
-INNODB_DATA_FILE_PATH
-INNODB_DATA_HOME_DIR
-INNODB_DICT_SIZE_LIMIT
-INNODB_DOUBLEWRITE
-INNODB_DOUBLEWRITE_FILE
-INNODB_FAKE_CHANGES
-INNODB_FAST_CHECKSUM
-INNODB_FAST_SHUTDOWN
-INNODB_FILE_FORMAT
-INNODB_FILE_FORMAT_CHECK
-INNODB_FILE_FORMAT_MAX
-INNODB_FILE_PER_TABLE
-INNODB_FLUSH_CHECKPOINT_DEBUG
-INNODB_FLUSH_LOG_AT_TRX_COMMIT
-INNODB_FLUSH_METHOD
-INNODB_FLUSH_NEIGHBOR_PAGES
-INNODB_FORCE_LOAD_CORRUPTED
-INNODB_FORCE_RECOVERY
-INNODB_IBUF_ACCEL_RATE
-INNODB_IBUF_ACTIVE_CONTRACT
-INNODB_IBUF_MAX_SIZE
-INNODB_IMPORT_TABLE_FROM_XTRABACKUP
-INNODB_IO_CAPACITY
-INNODB_KILL_IDLE_TRANSACTION
-INNODB_LARGE_PREFIX
-INNODB_LAZY_DROP_TABLE
-INNODB_LOCKS_UNSAFE_FOR_BINLOG
-INNODB_LOCK_WAIT_TIMEOUT
-INNODB_LOG_BLOCK_SIZE
-INNODB_LOG_BUFFER_SIZE
-INNODB_LOG_FILES_IN_GROUP
-INNODB_LOG_FILE_SIZE
-INNODB_LOG_GROUP_HOME_DIR
-INNODB_MAX_DIRTY_PAGES_PCT
-INNODB_MAX_PURGE_LAG
-INNODB_MIRRORED_LOG_GROUPS
-INNODB_OLD_BLOCKS_PCT
-INNODB_OLD_BLOCKS_TIME
-INNODB_OPEN_FILES
-INNODB_PAGE_SIZE
-INNODB_PURGE_BATCH_SIZE
-INNODB_PURGE_THREADS
-INNODB_RANDOM_READ_AHEAD
-INNODB_READ_AHEAD
-INNODB_READ_AHEAD_THRESHOLD
-INNODB_READ_IO_THREADS
-INNODB_RECOVERY_STATS
-INNODB_RECOVERY_UPDATE_RELAY_LOG
-INNODB_REPLICATION_DELAY
-INNODB_ROLLBACK_ON_TIMEOUT
-INNODB_ROLLBACK_SEGMENTS
-INNODB_SHOW_LOCKS_HELD
-INNODB_SHOW_VERBOSE_LOCKS
-INNODB_SPIN_WAIT_DELAY
-INNODB_STATS_AUTO_UPDATE
-INNODB_STATS_METHOD
-INNODB_STATS_ON_METADATA
-INNODB_STATS_SAMPLE_PAGES
-INNODB_STATS_UPDATE_NEED_LOCK
-INNODB_STRICT_MODE
-INNODB_SUPPORT_XA
-INNODB_SYNC_SPIN_LOOPS
-INNODB_TABLE_LOCKS
-INNODB_THREAD_CONCURRENCY
-INNODB_THREAD_CONCURRENCY_TIMER_BASED
-INNODB_THREAD_SLEEP_DELAY
-INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
-INNODB_USE_NATIVE_AIO
-INNODB_USE_SYS_MALLOC
-INNODB_USE_SYS_STATS_TABLE
-INNODB_VERSION
-INNODB_WRITE_IO_THREADS
-INSERT_ID
-INTERACTIVE_TIMEOUT
-JOIN_BUFFER_SIZE
-KEEP_FILES_ON_CREATE
-KEY_BUFFER_SIZE
-KEY_CACHE_AGE_THRESHOLD
-KEY_CACHE_BLOCK_SIZE
-KEY_CACHE_DIVISION_LIMIT
-LARGE_FILES_SUPPORT
-LARGE_PAGES
-LARGE_PAGE_SIZE
-LAST_INSERT_ID
-LC_MESSAGES
-LC_MESSAGES_DIR
-LC_TIME_NAMES
-LICENSE
-LOCAL_INFILE
-LOCKED_IN_MEMORY
-LOCK_WAIT_TIMEOUT
-LOG
-LOG_BIN
-LOG_BIN_TRUST_FUNCTION_CREATORS
-LOG_ERROR
-LOG_OUTPUT
-LOG_QUERIES_NOT_USING_INDEXES
-LOG_SLAVE_UPDATES
-LOG_SLOW_ADMIN_STATEMENTS
-LOG_SLOW_FILTER
-LOG_SLOW_QUERIES
-LOG_SLOW_RATE_LIMIT
-LOG_SLOW_SLAVE_STATEMENTS
-LOG_SLOW_SP_STATEMENTS
-LOG_SLOW_VERBOSITY
-LOG_WARNINGS
-LOG_WARNINGS_SUPPRESS
-LONG_QUERY_TIME
-LOWER_CASE_FILE_SYSTEM
-LOWER_CASE_TABLE_NAMES
-LOW_PRIORITY_UPDATES
-MAX_ALLOWED_PACKET
-MAX_BINLOG_CACHE_SIZE
-MAX_BINLOG_SIZE
-MAX_BINLOG_STMT_CACHE_SIZE
-MAX_CONNECTIONS
-MAX_CONNECT_ERRORS
-MAX_DELAYED_THREADS
-MAX_ERROR_COUNT
-MAX_HEAP_TABLE_SIZE
-MAX_INSERT_DELAYED_THREADS
-MAX_JOIN_SIZE
-MAX_LENGTH_FOR_SORT_DATA
-MAX_LONG_DATA_SIZE
-MAX_PREPARED_STMT_COUNT
-MAX_RELAY_LOG_SIZE
-MAX_SEEKS_FOR_KEY
-MAX_SORT_LENGTH
-MAX_SP_RECURSION_DEPTH
-MAX_TMP_TABLES
-MAX_USER_CONNECTIONS
-MAX_WRITE_LOCK_COUNT
-METADATA_LOCKS_CACHE_SIZE
-MIN_EXAMINED_ROW_LIMIT
-MULTI_RANGE_COUNT
-MYISAM_DATA_POINTER_SIZE
-MYISAM_MAX_SORT_FILE_SIZE
-MYISAM_MMAP_SIZE
-MYISAM_RECOVER_OPTIONS
-MYISAM_REPAIR_THREADS
-MYISAM_SORT_BUFFER_SIZE
-MYISAM_STATS_METHOD
-MYISAM_USE_MMAP
-NET_BUFFER_LENGTH
-NET_READ_TIMEOUT
-NET_RETRY_COUNT
-NET_WRITE_TIMEOUT
-NEW
-OLD
-OLD_ALTER_TABLE
-OLD_PASSWORDS
-OPEN_FILES_LIMIT
-OPTIMIZER_FIX
-OPTIMIZER_PRUNE_LEVEL
-OPTIMIZER_SEARCH_DEPTH
-OPTIMIZER_SWITCH
-PERFORMANCE_SCHEMA
-PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
-PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
-PERFORMANCE_SCHEMA_MAX_COND_CLASSES
-PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
-PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
-PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
-PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
-PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
-PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
-PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
-PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
-PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
-PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
-PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
-PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
-PID_FILE
-PLUGIN_DIR
-PORT
-PRELOAD_BUFFER_SIZE
-PROFILING
-PROFILING_HISTORY_SIZE
-PROTOCOL_VERSION
-PROXY_USER
-PSEUDO_THREAD_ID
-QUERY_ALLOC_BLOCK_SIZE
-QUERY_CACHE_LIMIT
-QUERY_CACHE_MIN_RES_UNIT
-QUERY_CACHE_SIZE
-QUERY_CACHE_STRIP_COMMENTS
-QUERY_CACHE_TYPE
-QUERY_CACHE_WLOCK_INVALIDATE
-QUERY_EXEC_TIME
-QUERY_PREALLOC_SIZE
-QUERY_RESPONSE_TIME_RANGE_BASE
-QUERY_RESPONSE_TIME_STATS
-RAND_SEED1
-RAND_SEED2
-RANGE_ALLOC_BLOCK_SIZE
-READ_BUFFER_SIZE
-READ_ONLY
-READ_RND_BUFFER_SIZE
-RELAY_LOG
-RELAY_LOG_INDEX
-RELAY_LOG_INFO_FILE
-RELAY_LOG_PURGE
-RELAY_LOG_RECOVERY
-RELAY_LOG_SPACE_LIMIT
-REPORT_HOST
-REPORT_PASSWORD
-REPORT_PORT
-REPORT_USER
-RPL_RECOVERY_RANK
-SECURE_AUTH
-SECURE_FILE_PRIV
-SERVER_ID
-SKIP_EXTERNAL_LOCKING
-SKIP_NAME_RESOLVE
-SKIP_NETWORKING
-SKIP_SHOW_DATABASE
-SLAVE_COMPRESSED_PROTOCOL
-SLAVE_EXEC_MODE
-SLAVE_LOAD_TMPDIR
-SLAVE_NET_TIMEOUT
-SLAVE_SKIP_ERRORS
-SLAVE_TRANSACTION_RETRIES
-SLAVE_TYPE_CONVERSIONS
-SLOW_LAUNCH_TIME
-SLOW_QUERY_LOG
-SLOW_QUERY_LOG_FILE
-SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
-SLOW_QUERY_LOG_TIMESTAMP_PRECISION
-SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
-SOCKET
-SORT_BUFFER_SIZE
-SQL_AUTO_IS_NULL
-SQL_BIG_SELECTS
-SQL_BIG_TABLES
-SQL_BUFFER_RESULT
-SQL_LOG_BIN
-SQL_LOG_OFF
-SQL_LOW_PRIORITY_UPDATES
-SQL_MAX_JOIN_SIZE
-SQL_MODE
-SQL_NOTES
-SQL_QUOTE_SHOW_CREATE
-SQL_SAFE_UPDATES
-SQL_SELECT_LIMIT
-SQL_SLAVE_SKIP_COUNTER
-SQL_WARNINGS
-SSL_CA
-SSL_CAPATH
-SSL_CERT
-SSL_CIPHER
-SSL_KEY
-STORAGE_ENGINE
-SYNC_BINLOG
-SYNC_FRM
-SYNC_MASTER_INFO
-SYNC_RELAY_LOG
-SYNC_RELAY_LOG_INFO
-SYSTEM_TIME_ZONE
-TABLE_DEFINITION_CACHE
-TABLE_OPEN_CACHE
-THREAD_CACHE_SIZE
-THREAD_CONCURRENCY
-THREAD_HANDLING
-THREAD_STACK
-THREAD_STATISTICS
-TIMED_MUTEXES
-TIMESTAMP
-TIME_FORMAT
-TIME_ZONE
-TMPDIR
-TMP_TABLE_SIZE
-TRANSACTION_ALLOC_BLOCK_SIZE
-TRANSACTION_PREALLOC_SIZE
-TX_ISOLATION
-UNIQUE_CHECKS
-UPDATABLE_VIEWS_WITH_LIMIT
-USERSTAT
-VERSION
-VERSION_COMMENT
-VERSION_COMPILE_MACHINE
-VERSION_COMPILE_OS
-WAIT_TIMEOUT
-WARNING_COUNT
diff --git a/mysql-test/suite/percona/percona_server_variables_debug.test b/mysql-test/suite/percona/percona_server_variables_debug.test
deleted file mode 100644
index 971f6bae689..00000000000
--- a/mysql-test/suite/percona/percona_server_variables_debug.test
+++ /dev/null
@@ -1,2 +0,0 @@
---source include/have_debug.inc
---source percona_server_variables.inc
diff --git a/mysql-test/suite/percona/percona_server_variables_release.result b/mysql-test/suite/percona/percona_server_variables_release.result
deleted file mode 100644
index 29ac402c144..00000000000
--- a/mysql-test/suite/percona/percona_server_variables_release.result
+++ /dev/null
@@ -1,377 +0,0 @@
-SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
-Variable_name
-AUTOCOMMIT
-AUTOMATIC_SP_PRIVILEGES
-AUTO_INCREMENT_INCREMENT
-AUTO_INCREMENT_OFFSET
-BACK_LOG
-BASEDIR
-BIG_TABLES
-BINLOG_CACHE_SIZE
-BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
-BINLOG_FORMAT
-BINLOG_STMT_CACHE_SIZE
-BULK_INSERT_BUFFER_SIZE
-CHARACTER_SETS_DIR
-CHARACTER_SET_CLIENT
-CHARACTER_SET_CONNECTION
-CHARACTER_SET_DATABASE
-CHARACTER_SET_FILESYSTEM
-CHARACTER_SET_RESULTS
-CHARACTER_SET_SERVER
-CHARACTER_SET_SYSTEM
-COLLATION_CONNECTION
-COLLATION_DATABASE
-COLLATION_SERVER
-COMPLETION_TYPE
-CONCURRENT_INSERT
-CONNECT_TIMEOUT
-DATADIR
-DATETIME_FORMAT
-DATE_FORMAT
-DEFAULT_STORAGE_ENGINE
-DEFAULT_WEEK_FORMAT
-DELAYED_INSERT_LIMIT
-DELAYED_INSERT_TIMEOUT
-DELAYED_QUEUE_SIZE
-DELAY_KEY_WRITE
-DIV_PRECISION_INCREMENT
-ENGINE_CONDITION_PUSHDOWN
-ERROR_COUNT
-EVENT_SCHEDULER
-EXPAND_FAST_INDEX_CREATION
-EXPIRE_LOGS_DAYS
-EXTERNAL_USER
-FAST_INDEX_CREATION
-FLUSH
-FLUSH_TIME
-FOREIGN_KEY_CHECKS
-FT_BOOLEAN_SYNTAX
-FT_MAX_WORD_LEN
-FT_MIN_WORD_LEN
-FT_QUERY_EXPANSION_LIMIT
-FT_STOPWORD_FILE
-GENERAL_LOG
-GENERAL_LOG_FILE
-GROUP_CONCAT_MAX_LEN
-HAVE_COMPRESS
-HAVE_CRYPT
-HAVE_CSV
-HAVE_DYNAMIC_LOADING
-HAVE_GEOMETRY
-HAVE_INNODB
-HAVE_NDBCLUSTER
-HAVE_OPENSSL
-HAVE_PARTITIONING
-HAVE_PROFILING
-HAVE_QUERY_CACHE
-HAVE_RESPONSE_TIME_DISTRIBUTION
-HAVE_RTREE_KEYS
-HAVE_SSL
-HAVE_SYMLINK
-HOSTNAME
-IDENTITY
-IGNORE_BUILTIN_INNODB
-INIT_CONNECT
-INIT_FILE
-INIT_SLAVE
-INNODB_ADAPTIVE_FLUSHING
-INNODB_ADAPTIVE_FLUSHING_METHOD
-INNODB_ADAPTIVE_HASH_INDEX
-INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
-INNODB_ADDITIONAL_MEM_POOL_SIZE
-INNODB_AUTOEXTEND_INCREMENT
-INNODB_AUTOINC_LOCK_MODE
-INNODB_BLOCKING_BUFFER_POOL_RESTORE
-INNODB_BUFFER_POOL_INSTANCES
-INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
-INNODB_BUFFER_POOL_SHM_CHECKSUM
-INNODB_BUFFER_POOL_SHM_KEY
-INNODB_BUFFER_POOL_SIZE
-INNODB_CHANGE_BUFFERING
-INNODB_CHECKPOINT_AGE_TARGET
-INNODB_CHECKSUMS
-INNODB_COMMIT_CONCURRENCY
-INNODB_CONCURRENCY_TICKETS
-INNODB_CORRUPT_TABLE_ACTION
-INNODB_DATA_FILE_PATH
-INNODB_DATA_HOME_DIR
-INNODB_DICT_SIZE_LIMIT
-INNODB_DOUBLEWRITE
-INNODB_DOUBLEWRITE_FILE
-INNODB_FAKE_CHANGES
-INNODB_FAST_CHECKSUM
-INNODB_FAST_SHUTDOWN
-INNODB_FILE_FORMAT
-INNODB_FILE_FORMAT_CHECK
-INNODB_FILE_FORMAT_MAX
-INNODB_FILE_PER_TABLE
-INNODB_FLUSH_LOG_AT_TRX_COMMIT
-INNODB_FLUSH_METHOD
-INNODB_FLUSH_NEIGHBOR_PAGES
-INNODB_FORCE_LOAD_CORRUPTED
-INNODB_FORCE_RECOVERY
-INNODB_IBUF_ACCEL_RATE
-INNODB_IBUF_ACTIVE_CONTRACT
-INNODB_IBUF_MAX_SIZE
-INNODB_IMPORT_TABLE_FROM_XTRABACKUP
-INNODB_IO_CAPACITY
-INNODB_KILL_IDLE_TRANSACTION
-INNODB_LARGE_PREFIX
-INNODB_LAZY_DROP_TABLE
-INNODB_LOCKS_UNSAFE_FOR_BINLOG
-INNODB_LOCK_WAIT_TIMEOUT
-INNODB_LOG_BLOCK_SIZE
-INNODB_LOG_BUFFER_SIZE
-INNODB_LOG_FILES_IN_GROUP
-INNODB_LOG_FILE_SIZE
-INNODB_LOG_GROUP_HOME_DIR
-INNODB_MAX_DIRTY_PAGES_PCT
-INNODB_MAX_PURGE_LAG
-INNODB_MIRRORED_LOG_GROUPS
-INNODB_OLD_BLOCKS_PCT
-INNODB_OLD_BLOCKS_TIME
-INNODB_OPEN_FILES
-INNODB_PAGE_SIZE
-INNODB_PURGE_BATCH_SIZE
-INNODB_PURGE_THREADS
-INNODB_RANDOM_READ_AHEAD
-INNODB_READ_AHEAD
-INNODB_READ_AHEAD_THRESHOLD
-INNODB_READ_IO_THREADS
-INNODB_RECOVERY_STATS
-INNODB_RECOVERY_UPDATE_RELAY_LOG
-INNODB_REPLICATION_DELAY
-INNODB_ROLLBACK_ON_TIMEOUT
-INNODB_ROLLBACK_SEGMENTS
-INNODB_SHOW_LOCKS_HELD
-INNODB_SHOW_VERBOSE_LOCKS
-INNODB_SPIN_WAIT_DELAY
-INNODB_STATS_AUTO_UPDATE
-INNODB_STATS_METHOD
-INNODB_STATS_ON_METADATA
-INNODB_STATS_SAMPLE_PAGES
-INNODB_STATS_UPDATE_NEED_LOCK
-INNODB_STRICT_MODE
-INNODB_SUPPORT_XA
-INNODB_SYNC_SPIN_LOOPS
-INNODB_TABLE_LOCKS
-INNODB_THREAD_CONCURRENCY
-INNODB_THREAD_CONCURRENCY_TIMER_BASED
-INNODB_THREAD_SLEEP_DELAY
-INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
-INNODB_USE_NATIVE_AIO
-INNODB_USE_SYS_MALLOC
-INNODB_USE_SYS_STATS_TABLE
-INNODB_VERSION
-INNODB_WRITE_IO_THREADS
-INSERT_ID
-INTERACTIVE_TIMEOUT
-JOIN_BUFFER_SIZE
-KEEP_FILES_ON_CREATE
-KEY_BUFFER_SIZE
-KEY_CACHE_AGE_THRESHOLD
-KEY_CACHE_BLOCK_SIZE
-KEY_CACHE_DIVISION_LIMIT
-LARGE_FILES_SUPPORT
-LARGE_PAGES
-LARGE_PAGE_SIZE
-LAST_INSERT_ID
-LC_MESSAGES
-LC_MESSAGES_DIR
-LC_TIME_NAMES
-LICENSE
-LOCAL_INFILE
-LOCKED_IN_MEMORY
-LOCK_WAIT_TIMEOUT
-LOG
-LOG_BIN
-LOG_BIN_TRUST_FUNCTION_CREATORS
-LOG_ERROR
-LOG_OUTPUT
-LOG_QUERIES_NOT_USING_INDEXES
-LOG_SLAVE_UPDATES
-LOG_SLOW_ADMIN_STATEMENTS
-LOG_SLOW_FILTER
-LOG_SLOW_QUERIES
-LOG_SLOW_RATE_LIMIT
-LOG_SLOW_SLAVE_STATEMENTS
-LOG_SLOW_SP_STATEMENTS
-LOG_SLOW_VERBOSITY
-LOG_WARNINGS
-LOG_WARNINGS_SUPPRESS
-LONG_QUERY_TIME
-LOWER_CASE_FILE_SYSTEM
-LOWER_CASE_TABLE_NAMES
-LOW_PRIORITY_UPDATES
-MAX_ALLOWED_PACKET
-MAX_BINLOG_CACHE_SIZE
-MAX_BINLOG_SIZE
-MAX_BINLOG_STMT_CACHE_SIZE
-MAX_CONNECTIONS
-MAX_CONNECT_ERRORS
-MAX_DELAYED_THREADS
-MAX_ERROR_COUNT
-MAX_HEAP_TABLE_SIZE
-MAX_INSERT_DELAYED_THREADS
-MAX_JOIN_SIZE
-MAX_LENGTH_FOR_SORT_DATA
-MAX_LONG_DATA_SIZE
-MAX_PREPARED_STMT_COUNT
-MAX_RELAY_LOG_SIZE
-MAX_SEEKS_FOR_KEY
-MAX_SORT_LENGTH
-MAX_SP_RECURSION_DEPTH
-MAX_TMP_TABLES
-MAX_USER_CONNECTIONS
-MAX_WRITE_LOCK_COUNT
-METADATA_LOCKS_CACHE_SIZE
-MIN_EXAMINED_ROW_LIMIT
-MULTI_RANGE_COUNT
-MYISAM_DATA_POINTER_SIZE
-MYISAM_MAX_SORT_FILE_SIZE
-MYISAM_MMAP_SIZE
-MYISAM_RECOVER_OPTIONS
-MYISAM_REPAIR_THREADS
-MYISAM_SORT_BUFFER_SIZE
-MYISAM_STATS_METHOD
-MYISAM_USE_MMAP
-NET_BUFFER_LENGTH
-NET_READ_TIMEOUT
-NET_RETRY_COUNT
-NET_WRITE_TIMEOUT
-NEW
-OLD
-OLD_ALTER_TABLE
-OLD_PASSWORDS
-OPEN_FILES_LIMIT
-OPTIMIZER_FIX
-OPTIMIZER_PRUNE_LEVEL
-OPTIMIZER_SEARCH_DEPTH
-OPTIMIZER_SWITCH
-PERFORMANCE_SCHEMA
-PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
-PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
-PERFORMANCE_SCHEMA_MAX_COND_CLASSES
-PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
-PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
-PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
-PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
-PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
-PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
-PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
-PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
-PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
-PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
-PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
-PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
-PID_FILE
-PLUGIN_DIR
-PORT
-PRELOAD_BUFFER_SIZE
-PROFILING
-PROFILING_HISTORY_SIZE
-PROTOCOL_VERSION
-PROXY_USER
-PSEUDO_THREAD_ID
-QUERY_ALLOC_BLOCK_SIZE
-QUERY_CACHE_LIMIT
-QUERY_CACHE_MIN_RES_UNIT
-QUERY_CACHE_SIZE
-QUERY_CACHE_STRIP_COMMENTS
-QUERY_CACHE_TYPE
-QUERY_CACHE_WLOCK_INVALIDATE
-QUERY_PREALLOC_SIZE
-QUERY_RESPONSE_TIME_RANGE_BASE
-QUERY_RESPONSE_TIME_STATS
-RAND_SEED1
-RAND_SEED2
-RANGE_ALLOC_BLOCK_SIZE
-READ_BUFFER_SIZE
-READ_ONLY
-READ_RND_BUFFER_SIZE
-RELAY_LOG
-RELAY_LOG_INDEX
-RELAY_LOG_INFO_FILE
-RELAY_LOG_PURGE
-RELAY_LOG_RECOVERY
-RELAY_LOG_SPACE_LIMIT
-REPORT_HOST
-REPORT_PASSWORD
-REPORT_PORT
-REPORT_USER
-RPL_RECOVERY_RANK
-SECURE_AUTH
-SECURE_FILE_PRIV
-SERVER_ID
-SKIP_EXTERNAL_LOCKING
-SKIP_NAME_RESOLVE
-SKIP_NETWORKING
-SKIP_SHOW_DATABASE
-SLAVE_COMPRESSED_PROTOCOL
-SLAVE_EXEC_MODE
-SLAVE_LOAD_TMPDIR
-SLAVE_NET_TIMEOUT
-SLAVE_SKIP_ERRORS
-SLAVE_TRANSACTION_RETRIES
-SLAVE_TYPE_CONVERSIONS
-SLOW_LAUNCH_TIME
-SLOW_QUERY_LOG
-SLOW_QUERY_LOG_FILE
-SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
-SLOW_QUERY_LOG_TIMESTAMP_PRECISION
-SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
-SOCKET
-SORT_BUFFER_SIZE
-SQL_AUTO_IS_NULL
-SQL_BIG_SELECTS
-SQL_BIG_TABLES
-SQL_BUFFER_RESULT
-SQL_LOG_BIN
-SQL_LOG_OFF
-SQL_LOW_PRIORITY_UPDATES
-SQL_MAX_JOIN_SIZE
-SQL_MODE
-SQL_NOTES
-SQL_QUOTE_SHOW_CREATE
-SQL_SAFE_UPDATES
-SQL_SELECT_LIMIT
-SQL_SLAVE_SKIP_COUNTER
-SQL_WARNINGS
-SSL_CA
-SSL_CAPATH
-SSL_CERT
-SSL_CIPHER
-SSL_KEY
-STORAGE_ENGINE
-SYNC_BINLOG
-SYNC_FRM
-SYNC_MASTER_INFO
-SYNC_RELAY_LOG
-SYNC_RELAY_LOG_INFO
-SYSTEM_TIME_ZONE
-TABLE_DEFINITION_CACHE
-TABLE_OPEN_CACHE
-THREAD_CACHE_SIZE
-THREAD_CONCURRENCY
-THREAD_HANDLING
-THREAD_STACK
-THREAD_STATISTICS
-TIMED_MUTEXES
-TIMESTAMP
-TIME_FORMAT
-TIME_ZONE
-TMPDIR
-TMP_TABLE_SIZE
-TRANSACTION_ALLOC_BLOCK_SIZE
-TRANSACTION_PREALLOC_SIZE
-TX_ISOLATION
-UNIQUE_CHECKS
-UPDATABLE_VIEWS_WITH_LIMIT
-USERSTAT
-VERSION
-VERSION_COMMENT
-VERSION_COMPILE_MACHINE
-VERSION_COMPILE_OS
-WAIT_TIMEOUT
-WARNING_COUNT
diff --git a/mysql-test/suite/percona/percona_server_variables_release.test b/mysql-test/suite/percona/percona_server_variables_release.test
deleted file mode 100644
index 6427045864c..00000000000
--- a/mysql-test/suite/percona/percona_server_variables_release.test
+++ /dev/null
@@ -1,2 +0,0 @@
---source include/not_debug.inc
---source percona_server_variables.inc
diff --git a/mysql-test/suite/percona/percona_show_temp_tables.result b/mysql-test/suite/percona/percona_show_temp_tables.result
deleted file mode 100644
index cbcb0331896..00000000000
--- a/mysql-test/suite/percona/percona_show_temp_tables.result
+++ /dev/null
@@ -1,58 +0,0 @@
-drop table if exists t1,t2,t3;
-drop database if exists showtemp;
-create database if not exists showtemp;
-use test;
-create temporary table t1(id int);
-create temporary table t2(id int);
-create temporary table showtemp.t3(id int);
-insert into t1 values(10),(20),(30),(40);
-insert into showtemp.t3 values(999);
-show temporary tables;
-Temp_tables_in_test
-t2
-t1
-show temporary tables from test;
-Temp_tables_in_test
-t2
-t1
-show temporary tables in showtemp;
-Temp_tables_in_showtemp
-t3
-select table_schema, table_name, engine, table_rows from Information_schema.temporary_tables;
-table_schema table_name engine table_rows
-showtemp t3 MyISAM 1
-test t2 MyISAM 0
-test t1 MyISAM 4
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
-table_schema table_name engine table_rows
-showtemp t3 MyISAM 1
-test t2 MyISAM 0
-test t1 MyISAM 4
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='showtemp';
-table_schema table_name engine table_rows
-showtemp t3 MyISAM 1
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='temp';
-table_schema table_name engine table_rows
-drop table if exists showtemp.t2;
-create temporary table t1(id int);
-create temporary table showtemp.t2(id int);
-show temporary tables;
-Temp_tables_in_test
-t1
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
-table_schema table_name engine table_rows
-showtemp t2 MyISAM 0
-test t1 MyISAM 0
-showtemp t3 MyISAM 1
-test t2 MyISAM 0
-test t1 MyISAM 4
-drop table showtemp.t2;
-drop table t1;
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
-table_schema table_name engine table_rows
-showtemp t3 MyISAM 1
-test t2 MyISAM 0
-test t1 MyISAM 4
-drop table t1, t2;
-drop table showtemp.t3;
-drop database showtemp;
diff --git a/mysql-test/suite/percona/percona_show_temp_tables.test b/mysql-test/suite/percona/percona_show_temp_tables.test
deleted file mode 100644
index 8837df199c5..00000000000
--- a/mysql-test/suite/percona/percona_show_temp_tables.test
+++ /dev/null
@@ -1,65 +0,0 @@
-# Uses GRANT commands that usually disabled in embedded server
--- source include/not_embedded.inc
-
-# Save the initial number of concurrent sessions
---source include/count_sessions.inc
-
-#
-# Test of SHOW [GLOBAL] TEMPORARY TABLES [FROM/IN] DB and
-# Information_schema.temporary_tables and global_temporary_tables
-#
-
-connect(stcon1,localhost,root,,test);
-connect(stcon2,localhost,root,,test);
-
-connection stcon1;
-
---disable_warnings
-drop table if exists t1,t2,t3;
-drop database if exists showtemp;
-create database if not exists showtemp;
---enable_warnings
-
-use test;
-create temporary table t1(id int);
-create temporary table t2(id int);
-create temporary table showtemp.t3(id int);
-insert into t1 values(10),(20),(30),(40);
-insert into showtemp.t3 values(999);
-
-show temporary tables;
-# "Session" is not same value always. mysql-test cannot test it always.
-#show global temporary tables;
-show temporary tables from test;
-show temporary tables in showtemp;
-select table_schema, table_name, engine, table_rows from Information_schema.temporary_tables;
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='showtemp';
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='temp';
-
-connection stcon2;
-
---disable_warnings
-drop table if exists showtemp.t2;
---enable_warnings
-create temporary table t1(id int);
-create temporary table showtemp.t2(id int);
-show temporary tables;
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
-drop table showtemp.t2;
-drop table t1;
-
-disconnect stcon2;
-
-connection stcon1;
-select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
-
-drop table t1, t2;
-drop table showtemp.t3;
-drop database showtemp;
-
-connection default;
-disconnect stcon1;
-
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt
deleted file mode 100644
index 233b50a1f89..00000000000
--- a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow_query_log_timestamp_always
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result
deleted file mode 100644
index 13684fad10c..00000000000
--- a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.result
+++ /dev/null
@@ -1,3 +0,0 @@
-show global variables like 'slow_query_log_timestamp_always';
-Variable_name Value
-slow_query_log_timestamp_always ON
diff --git a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test b/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test
deleted file mode 100644
index e73c4202869..00000000000
--- a/mysql-test/suite/percona/percona_slow_extended-slow_query_log_timestamp_always-cl.test
+++ /dev/null
@@ -1 +0,0 @@
-show global variables like 'slow_query_log_timestamp_always';
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt b/mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt
deleted file mode 100644
index bd62c08c475..00000000000
--- a/mysql-test/suite/percona/percona_slow_extended-use_global_control-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-control_global_slow.log --long-query-time=1
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_control.result b/mysql-test/suite/percona/percona_slow_extended-use_global_control.result
deleted file mode 100644
index 699c95e9671..00000000000
--- a/mysql-test/suite/percona/percona_slow_extended-use_global_control.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set global log_slow_verbosity=innodb;
-set global slow_query_log_use_global_control="log_slow_verbosity,long_query_time";
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_use_global_control='';
-set global log_slow_verbosity='';
-FLUSH LOGS;
-1
diff --git a/mysql-test/suite/percona/percona_slow_extended-use_global_control.test b/mysql-test/suite/percona/percona_slow_extended-use_global_control.test
deleted file mode 100644
index 199b652561c..00000000000
--- a/mysql-test/suite/percona/percona_slow_extended-use_global_control.test
+++ /dev/null
@@ -1,12 +0,0 @@
-source include/have_xtradb.inc;
-SELECT sleep(2);
-set global log_slow_verbosity=innodb;
-set global slow_query_log_use_global_control="log_slow_verbosity,long_query_time";
-SELECT sleep(2);
-set global slow_query_log_use_global_control='';
-set global log_slow_verbosity='';
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-control_global_slow.log
---let grep_pattern = No InnoDB statistics available for this query
---source grep.inc
diff --git a/mysql-test/suite/percona/percona_sync_flush.result b/mysql-test/suite/percona/percona_sync_flush.result
deleted file mode 100644
index 12335257b32..00000000000
--- a/mysql-test/suite/percona/percona_sync_flush.result
+++ /dev/null
@@ -1,35 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (id INT AUTO_INCREMENT, foo CHAR(255), PRIMARY KEY (id)) ENGINE=InnoDB;
-SET @@global.innodb_flush_checkpoint_debug=1;
-INSERT INTO t1(foo) VALUES ('a'), ('b');
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-INSERT INTO t1(foo) SELECT foo FROM t1;
-UPDATE t1 SET foo='c';
-SET @@global.innodb_flush_checkpoint_debug=0;
-UPDATE t1 SET foo='d' WHERE foo='c';
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_sync_flush.test b/mysql-test/suite/percona/percona_sync_flush.test
deleted file mode 100644
index 4252bf03e7f..00000000000
--- a/mysql-test/suite/percona/percona_sync_flush.test
+++ /dev/null
@@ -1,33 +0,0 @@
-# Test for InnoDB sync state flushing.
-
---source include/have_xtradb.inc
---source include/have_debug.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (id INT AUTO_INCREMENT, foo CHAR(255), PRIMARY KEY (id)) ENGINE=InnoDB;
-
-# It is hard to get to InnoDB sync state flushing in MTR with regular workload. Perhaps
-# it is possible with many parallel connections, but that would be brittle anyway.
-# So, just disable preflushing and checkpointing and issue simple workload.
-SET @@global.innodb_flush_checkpoint_debug=1;
-
-INSERT INTO t1(foo) VALUES ('a'), ('b');
-
-let $rep=0;
-while ($rep < 14)
-{
- INSERT INTO t1(foo) SELECT foo FROM t1;
- UPDATE t1 SET foo='c';
- inc $rep;
-}
-
-# By now checkpoint age should be well past sync flush point. Allow
-# preflushing/checkpointing again and do some work in order to do the sync flush.
-SET @@global.innodb_flush_checkpoint_debug=0;
-
-UPDATE t1 SET foo='d' WHERE foo='c';
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/percona_xtradb_bug317074.result b/mysql-test/suite/percona/percona_xtradb_bug317074.result
deleted file mode 100644
index 7c1876fb7bf..00000000000
--- a/mysql-test/suite/percona/percona_xtradb_bug317074.result
+++ /dev/null
@@ -1,5 +0,0 @@
-SET @old_innodb_file_format=@@innodb_file_format;
-SET @old_innodb_file_format_max=@@innodb_file_format_max;
-SET @old_innodb_file_per_table=@@innodb_file_per_table;
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
diff --git a/mysql-test/suite/percona/percona_xtradb_bug317074.test b/mysql-test/suite/percona/percona_xtradb_bug317074.test
deleted file mode 100644
index 5f9db073060..00000000000
--- a/mysql-test/suite/percona/percona_xtradb_bug317074.test
+++ /dev/null
@@ -1,48 +0,0 @@
--- source include/have_xtradb.inc
-
-SET @old_innodb_file_format=@@innodb_file_format;
-SET @old_innodb_file_format_max=@@innodb_file_format_max;
-SET @old_innodb_file_per_table=@@innodb_file_per_table;
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
-
--- disable_query_log
--- disable_result_log
-
-DROP TABLE IF EXISTS `test1`;
-CREATE TABLE IF NOT EXISTS `test1` (
- `a` int primary key auto_increment,
- `b` int default 0,
- `c` char(100) default 'testtest'
-) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
-
-set autocommit=0;
-delimiter |;
-CREATE PROCEDURE insert_many(p1 int)
-BEGIN
-SET @x = 0;
-SET @y = 0;
-start transaction;
-REPEAT
- insert into test1 set b=1;
- SET @x = @x + 1;
- SET @y = @y + 1;
- IF @y >= 1000 THEN
- commit;
- start transaction;
- SET @y = 0;
- END IF;
-UNTIL @x >= p1 END REPEAT;
-commit;
-END|
-delimiter ;|
-call insert_many(100000);
-DROP PROCEDURE insert_many;
-
-# The bug is hangup at the following statement
-ALTER TABLE test1 ENGINE=MyISAM;
-
-DROP TABLE test1;
-SET GLOBAL innodb_file_format=@old_innodb_file_format;
-SET GLOBAL innodb_file_format_max=@old_innodb_file_format_max;
-SET GLOBAL innodb_file_per_table=@old_innodb_file_per_table;
diff --git a/mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.result b/mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.result
deleted file mode 100644
index 1a447a194e7..00000000000
--- a/mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.result
+++ /dev/null
@@ -1,21 +0,0 @@
-SET @old_slow_query_log_file=@@global.slow_query_log_file;
-SET GLOBAL slow_query_log=on;
-SET LOCAL log_slow_verbosity='profiling';
-SET LOCAL long_query_time=0;
-SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug643149_slow.log';;
-SELECT 1;
-1
-1
-# User@Host: root[root] @ localhost []
-# Thread_id: X Schema: test Last_errno: X Killed: X
-# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
-# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
-# Profile_starting: X.X Profile_starting_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
-# Profile_total: X.X Profile_total_cpu: X.X
-# User@Host: root[root] @ localhost []
-# Thread_id: X Schema: test Last_errno: X Killed: X
-# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
-# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
-# Profile_starting: X.X Profile_starting_cpu: X.X Profile_checking_permissions: X.X Profile_checking_permissions_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_init: X.X Profile_init_cpu: X.X Profile_optimizing: X.X Profile_optimizing_cpu: X.X Profile_executing: X.X Profile_executing_cpu: X.X Profile_end: X.X Profile_end_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
-# Profile_total: X.X Profile_total_cpu: X.X
-SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
diff --git a/mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.test b/mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.test
deleted file mode 100644
index fa31b169a19..00000000000
--- a/mysql-test/suite/percona/profiling_slow.patch/percona_bug643149.test
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# This test suffers from server
-# Bug#38124 "general_log_file" variable silently unset when using expression
-# In short:
-# SET GLOBAL general_log_file = @<whatever>
-# SET GLOBAL slow_query_log = @<whatever>
-# cause that the value of these server system variables is set to default
-# instead of the assigned values. There comes no error message or warning.
-# If this bug is fixed please
-# 1. try this test with "let $fixed_bug38124 = 0;"
-# 2. remove all workarounds if 1. was successful.
---source include/have_profiling.inc
-let $fixed_bug38124 = 0;
-
-SET @old_slow_query_log_file=@@global.slow_query_log_file;
-SET GLOBAL slow_query_log=on;
-SET LOCAL log_slow_verbosity='profiling';
-SET LOCAL long_query_time=0;
-
-let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---eval SET GLOBAL slow_query_log_file='$slogfile';
-
-SELECT 1;
-
-perl;
- $slogfile= $ENV{'slogfile'};
-
- open(FILE, "$slogfile") or
- die("Unable to read slow query log file $slogfile: $!\n");
- while(<FILE>) {
- next if (!/^#/);
- next if (/^# Time:/);
- s/[0-9]+/X/g;
- print;
- }
-
- close(FILE);
-EOF
-
-SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
-
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc
deleted file mode 100644
index d9804722147..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc
+++ /dev/null
@@ -1,117 +0,0 @@
---source percona_query_cache_with_comments_clear.inc
-let $query=/* with comment first */select * from t1;
-eval $query;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=# with comment first
-select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=-- with comment first
-select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=/* with comment first and "quote" */select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=# with comment first and "quote"
-select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=-- with comment first and "quote"
-select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=
- /* with comment and whitespaces first */select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=
- # with comment and whitespaces first
-select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=
- -- with comment and whitespaces first
-select * from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $internal=* internal comment *;
-
-let $query=select * /$internal/ from t1;
---source percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/ from t1;
---source percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $internal=* internal comment with "quote" *;
-
-let $query=select * /$internal/ from t1;
---source percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/ from t1;
---source percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 ;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 ;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* comment in the end */;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* *\/ */;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* comment in the end */
-;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 #comment in the end;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 #comment in the end
-;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 -- comment in the end;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 -- comment in the end
-;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select */* a comment \*/from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select *# a comment \\
-from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select *-- a comment \\
-from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select "\\\\"" /* not a comment */" from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select "\\\\"" /*! not a comment */" from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-# following two queries related to bug #856404.
-# There are different queries, but opt_query_cache_strip_comments thinks that they are equal.
-let $query=select ' \' ' from t1;
---source percona_query_cache_with_comments_eval.inc
-
-let $query=select ' \' /* comment inside quotes with internal backslash quote */' from t1;
---source percona_query_cache_with_comments_eval.inc
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup
deleted file mode 100644
index 4b5b31e9239..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup
+++ /dev/null
@@ -1,88 +0,0 @@
---source include/percona_query_cache_with_comments_clear.inc
-let $query=/* with comment first */select * from t1;
-eval $query;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=# with comment first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=-- with comment first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=/* with comment first and "quote" */select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=# with comment first and "quote"
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=-- with comment first and "quote"
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=
- /* with comment and whitespaces first */select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=
- # with comment and whitespaces first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=
- -- with comment and whitespaces first
-select * from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $internal=* internal comment *;
-
-let $query=select * /$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $internal=* internal comment with "quote" *;
-
-let $query=select * /$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/ from t1;
---source include/percona_query_cache_with_comments_eval.inc
-let $query=select */$internal/from t1;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 ;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 ;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* comment in the end */;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1
-/* comment in the end */
-;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 #comment in the end;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 #comment in the end
-;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 -- comment in the end;
---source include/percona_query_cache_with_comments_eval.inc
-
-let $query=select * from t1 -- comment in the end
-;
---source include/percona_query_cache_with_comments_eval.inc
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result
deleted file mode 100644
index d1a6ded08d7..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result
+++ /dev/null
@@ -1,1058 +0,0 @@
-set global query_cache_strip_comments=ON;
-set GLOBAL query_cache_size=1355776;
-drop table if exists t1;
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-/* with comment first */select * from t1;
-a
-1
-2
-3
------------------------------------------------------
-/* with comment first */select * from t1
------------------------------------------------------
-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 0
-/* with comment first */select * from t1;
-a
-1
-2
-3
-/* with comment first */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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
------------------------------------------------------
-# with comment first
-select * from t1
------------------------------------------------------
-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 2
-# with comment first
-select * from t1;
-a
-1
-2
-3
-# with comment first
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
------------------------------------------------------
--- with comment first
-select * from t1
------------------------------------------------------
-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 4
--- with comment first
-select * from t1;
-a
-1
-2
-3
--- with comment first
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 6
------------------------------------------------------
-/* with comment first and "quote" */select * from t1
------------------------------------------------------
-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 6
-/* with comment first and "quote" */select * from t1;
-a
-1
-2
-3
-/* with comment first and "quote" */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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 8
------------------------------------------------------
-# with comment first and "quote"
-select * from t1
------------------------------------------------------
-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 8
-# with comment first and "quote"
-select * from t1;
-a
-1
-2
-3
-# with comment first and "quote"
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 10
------------------------------------------------------
--- with comment first and "quote"
-select * from t1
------------------------------------------------------
-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 10
--- with comment first and "quote"
-select * from t1;
-a
-1
-2
-3
--- with comment first and "quote"
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 12
------------------------------------------------------
-/* with comment and whitespaces first */select * from t1
------------------------------------------------------
-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 12
-/* with comment and whitespaces first */select * from t1;
-a
-1
-2
-3
-/* with comment and whitespaces first */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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 14
------------------------------------------------------
-# with comment and whitespaces first
-select * from t1
------------------------------------------------------
-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 14
-# with comment and whitespaces first
-select * from t1;
-a
-1
-2
-3
-# with comment and whitespaces first
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 16
------------------------------------------------------
--- with comment and whitespaces first
-select * from t1
------------------------------------------------------
-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 16
--- with comment and whitespaces first
-select * from t1;
-a
-1
-2
-3
--- with comment and whitespaces first
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 18
------------------------------------------------------
-select * /* internal comment */ from t1
------------------------------------------------------
-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 18
-select * /* internal comment */ from t1;
-a
-1
-2
-3
-select * /* internal comment */ 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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 20
------------------------------------------------------
-select */* internal comment */ from t1
------------------------------------------------------
-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 20
-select */* internal comment */ from t1;
-a
-1
-2
-3
-select */* internal comment */ 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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 22
------------------------------------------------------
-select */* internal comment */from t1
------------------------------------------------------
-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 22
-select */* internal comment */from t1;
-a
-1
-2
-3
-select */* internal comment */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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 24
------------------------------------------------------
-select * /* internal comment with "quote" */ from t1
------------------------------------------------------
-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 24
-select * /* internal comment with "quote" */ from t1;
-a
-1
-2
-3
-select * /* internal comment with "quote" */ 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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 26
------------------------------------------------------
-select */* internal comment with "quote" */ from t1
------------------------------------------------------
-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 26
-select */* internal comment with "quote" */ from t1;
-a
-1
-2
-3
-select */* internal comment with "quote" */ 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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 28
------------------------------------------------------
-select */* internal comment with "quote" */from t1
------------------------------------------------------
-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 28
-select */* internal comment with "quote" */from t1;
-a
-1
-2
-3
-select */* internal comment with "quote" */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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 30
------------------------------------------------------
-select * from t1
-
------------------------------------------------------
-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 30
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 32
------------------------------------------------------
-select * from t1
------------------------------------------------------
-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 32
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 34
------------------------------------------------------
-select * from t1
------------------------------------------------------
-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 34
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 36
------------------------------------------------------
-select * from t1
-/* comment in the end */
------------------------------------------------------
-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 36
-select * from t1
-/* comment in the end */;
-a
-1
-2
-3
-select * from t1
-/* comment in the end */;
-a
-1
-2
-3
-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 38
------------------------------------------------------
-select * from t1
-/* *\/ */
------------------------------------------------------
-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 38
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 40
------------------------------------------------------
-select * from t1
-/* comment in the end */
-
------------------------------------------------------
-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 40
-select * from t1
-/* comment in the end */
-;
-a
-1
-2
-3
-select * from t1
-/* comment in the end */
-;
-a
-1
-2
-3
-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 42
------------------------------------------------------
-select * from t1 #comment in the end
------------------------------------------------------
-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 42
-select * from t1 #comment in the end;
-a
-1
-2
-3
-select * from t1 #comment in the end;
-a
-1
-2
-3
-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 44
------------------------------------------------------
-select * from t1 #comment in the end
-
------------------------------------------------------
-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 44
-select * from t1 #comment in the end
-;
-a
-1
-2
-3
-select * from t1 #comment in the end
-;
-a
-1
-2
-3
-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 46
------------------------------------------------------
-select * from t1 -- comment in the end
------------------------------------------------------
-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 46
-select * from t1 -- comment in the end;
-a
-1
-2
-3
-select * from t1 -- comment in the end;
-a
-1
-2
-3
-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 48
------------------------------------------------------
-select * from t1 -- comment in the end
-
------------------------------------------------------
-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 48
-select * from t1 -- comment in the end
-;
-a
-1
-2
-3
-select * from t1 -- comment in the end
-;
-a
-1
-2
-3
-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 50
------------------------------------------------------
-select */* a comment \*/from t1
------------------------------------------------------
-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 50
-select */* a comment \*/from t1;
-a
-1
-2
-3
-select */* a comment \*/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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 52
------------------------------------------------------
-select *# a comment \
-from t1
------------------------------------------------------
-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 52
-select *# a comment \
-from t1;
-a
-1
-2
-3
-select *# a comment \
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 54
------------------------------------------------------
-select *-- a comment \
-from t1
------------------------------------------------------
-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 54
-select *-- a comment \
-from t1;
-a
-1
-2
-3
-select *-- a comment \
-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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 56
------------------------------------------------------
-select "\\"" /* not a comment */" from t1
------------------------------------------------------
-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 56
-select "\\"" /* not a comment */" from t1;
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-select "\\"" /* not a comment */" from t1;
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 57
------------------------------------------------------
-select "\\"" /*! not a comment */" from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 57
-select "\\"" /*! not a comment */" from t1;
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-select "\\"" /*! not a comment */" from t1;
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 58
------------------------------------------------------
-select ' \' ' from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 58
-select ' \' ' from t1;
-'
- '
- '
- '
-select ' \' ' from t1;
-'
- '
- '
- '
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 4
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 59
------------------------------------------------------
-select ' \' /* comment inside quotes with internal backslash quote */' from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 4
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 59
-select ' \' /* comment inside quotes with internal backslash quote */' from t1;
-' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
-select ' \' /* comment inside quotes with internal backslash quote */' from t1;
-' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 60
-DROP TABLE t1;
-SET GLOBAL query_cache_size=default;
-set global query_cache_strip_comments=OFF;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test
deleted file mode 100644
index 0b93441f364..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test
+++ /dev/null
@@ -1,5 +0,0 @@
---disable_ps_protocol
-set global query_cache_strip_comments=ON;
--- source include/percona_query_cache_with_comments_begin.inc
--- source include/percona_query_cache_with_comments.inc
--- source include/percona_query_cache_with_comments_end.inc
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc
deleted file mode 100644
index 6bfd2bfbc83..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc
+++ /dev/null
@@ -1,12 +0,0 @@
--- source include/have_query_cache.inc
-
-set GLOBAL query_cache_size=1355776;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-
---source percona_query_cache_with_comments_clear.inc
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc
deleted file mode 100644
index 728a19a3c97..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-# Reset query cache variables.
-flush query cache; # This crashed in some versions
-flush query cache; # This crashed in some versions
-reset query cache;
-flush status;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result
deleted file mode 100644
index 32bd3645ec4..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result
+++ /dev/null
@@ -1,21 +0,0 @@
-set GLOBAL query_cache_size=1355776;
-drop table if exists t1;
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-( select * from t1 );
-a
-1
-2
-3
-/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := REPLACE(REPLACE(@@SQL_MODE, 'ANSI_QUOTES', ''), ',,', ','), @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
-/* only comment */;
-# only comment
-;
--- only comment
-;
-DROP TABLE t1;
-SET GLOBAL query_cache_size= default;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test
deleted file mode 100644
index e125c75c3de..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test
+++ /dev/null
@@ -1,22 +0,0 @@
--- source include/have_query_cache.inc
-set GLOBAL query_cache_size=1355776;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-flush query cache; # This crashed in some versions
-flush query cache; # This crashed in some versions
-reset query cache;
-flush status;
-( select * from t1 );
-/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := REPLACE(REPLACE(@@SQL_MODE, 'ANSI_QUOTES', ''), ',,', ','), @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
-/* only comment */;
-let query=# only comment
-;
-eval $query;
-let query=-- only comment
-;
-eval $query;
-DROP TABLE t1;
-SET GLOBAL query_cache_size= default;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result
deleted file mode 100644
index 7e793a942c5..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result
+++ /dev/null
@@ -1,1057 +0,0 @@
-set GLOBAL query_cache_size=1355776;
-drop table if exists t1;
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-/* with comment first */select * from t1;
-a
-1
-2
-3
------------------------------------------------------
-/* with comment first */select * from t1
------------------------------------------------------
-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 0
-/* with comment first */select * from t1;
-a
-1
-2
-3
-/* with comment first */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_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
------------------------------------------------------
-# with comment first
-select * from t1
------------------------------------------------------
-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 2
-# with comment first
-select * from t1;
-a
-1
-2
-3
-# with comment first
-select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
------------------------------------------------------
--- with comment first
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
--- with comment first
-select * from t1;
-a
-1
-2
-3
--- with comment first
-select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
------------------------------------------------------
-/* with comment first and "quote" */select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-/* with comment first and "quote" */select * from t1;
-a
-1
-2
-3
-/* with comment first and "quote" */select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 4
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
------------------------------------------------------
-# with comment first and "quote"
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 4
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-# with comment first and "quote"
-select * from t1;
-a
-1
-2
-3
-# with comment first and "quote"
-select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
------------------------------------------------------
--- with comment first and "quote"
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
--- with comment first and "quote"
-select * from t1;
-a
-1
-2
-3
--- with comment first and "quote"
-select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
------------------------------------------------------
-/* with comment and whitespaces first */select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-/* with comment and whitespaces first */select * from t1;
-a
-1
-2
-3
-/* with comment and whitespaces first */select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 7
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
------------------------------------------------------
-# with comment and whitespaces first
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 7
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
-# with comment and whitespaces first
-select * from t1;
-a
-1
-2
-3
-# with comment and whitespaces first
-select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 8
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 8
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
------------------------------------------------------
--- with comment and whitespaces first
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 8
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 8
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
--- with comment and whitespaces first
-select * from t1;
-a
-1
-2
-3
--- with comment and whitespaces first
-select * from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 9
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 9
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
------------------------------------------------------
-select * /* internal comment */ from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 9
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 9
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
-select * /* internal comment */ from t1;
-a
-1
-2
-3
-select * /* internal comment */ from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 10
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 10
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 5
------------------------------------------------------
-select */* internal comment */ from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 10
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 10
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 5
-select */* internal comment */ from t1;
-a
-1
-2
-3
-select */* internal comment */ from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 11
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 11
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 6
------------------------------------------------------
-select */* internal comment */from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 11
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 11
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 6
-select */* internal comment */from t1;
-a
-1
-2
-3
-select */* internal comment */from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 12
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 12
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
------------------------------------------------------
-select * /* internal comment with "quote" */ from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 12
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 12
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-select * /* internal comment with "quote" */ from t1;
-a
-1
-2
-3
-select * /* internal comment with "quote" */ from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 13
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 13
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 8
------------------------------------------------------
-select */* internal comment with "quote" */ from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 13
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 13
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 8
-select */* internal comment with "quote" */ from t1;
-a
-1
-2
-3
-select */* internal comment with "quote" */ from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 14
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 14
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 9
------------------------------------------------------
-select */* internal comment with "quote" */from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 14
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 14
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 9
-select */* internal comment with "quote" */from t1;
-a
-1
-2
-3
-select */* internal comment with "quote" */from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 15
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 15
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 10
------------------------------------------------------
-select * from t1
-
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 15
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 15
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 10
-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 16
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 16
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 11
------------------------------------------------------
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 16
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 16
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 11
-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 16
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 16
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 13
------------------------------------------------------
-select * from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 16
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 16
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 13
-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 16
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 16
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 15
------------------------------------------------------
-select * from t1
-/* comment in the end */
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 16
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 16
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 15
-select * from t1
-/* comment in the end */;
-a
-1
-2
-3
-select * from t1
-/* comment in the end */;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 17
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 17
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 16
------------------------------------------------------
-select * from t1
-/* *\/ */
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 17
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 17
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 16
-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 18
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 18
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 17
------------------------------------------------------
-select * from t1
-/* comment in the end */
-
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 18
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 18
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 17
-select * from t1
-/* comment in the end */
-;
-a
-1
-2
-3
-select * from t1
-/* comment in the end */
-;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 18
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 18
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 19
------------------------------------------------------
-select * from t1 #comment in the end
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 18
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 18
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 19
-select * from t1 #comment in the end;
-a
-1
-2
-3
-select * from t1 #comment in the end;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 19
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 19
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 20
------------------------------------------------------
-select * from t1 #comment in the end
-
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 19
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 19
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 20
-select * from t1 #comment in the end
-;
-a
-1
-2
-3
-select * from t1 #comment in the end
-;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 19
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 19
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 22
------------------------------------------------------
-select * from t1 -- comment in the end
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 19
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 19
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 22
-select * from t1 -- comment in the end;
-a
-1
-2
-3
-select * from t1 -- comment in the end;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 20
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 20
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 23
------------------------------------------------------
-select * from t1 -- comment in the end
-
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 20
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 20
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 23
-select * from t1 -- comment in the end
-;
-a
-1
-2
-3
-select * from t1 -- comment in the end
-;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 20
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 20
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 25
------------------------------------------------------
-select */* a comment \*/from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 20
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 20
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 25
-select */* a comment \*/from t1;
-a
-1
-2
-3
-select */* a comment \*/from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 21
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 21
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 26
------------------------------------------------------
-select *# a comment \
-from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 21
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 21
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 26
-select *# a comment \
-from t1;
-a
-1
-2
-3
-select *# a comment \
-from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 22
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 22
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 27
------------------------------------------------------
-select *-- a comment \
-from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 22
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 22
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 27
-select *-- a comment \
-from t1;
-a
-1
-2
-3
-select *-- a comment \
-from t1;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 23
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 23
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 28
------------------------------------------------------
-select "\\"" /* not a comment */" from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 23
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 23
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 28
-select "\\"" /* not a comment */" from t1;
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-select "\\"" /* not a comment */" from t1;
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-\" /* not a comment */
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 24
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 24
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 29
------------------------------------------------------
-select "\\"" /*! not a comment */" from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 24
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 24
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 29
-select "\\"" /*! not a comment */" from t1;
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-select "\\"" /*! not a comment */" from t1;
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-\" /*! not a comment */
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 25
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 25
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 30
------------------------------------------------------
-select ' \' ' from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 25
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 25
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 30
-select ' \' ' from t1;
-'
- '
- '
- '
-select ' \' ' from t1;
-'
- '
- '
- '
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 26
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 26
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 31
------------------------------------------------------
-select ' \' /* comment inside quotes with internal backslash quote */' from t1
------------------------------------------------------
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 26
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 26
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 31
-select ' \' /* comment inside quotes with internal backslash quote */' from t1;
-' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
-select ' \' /* comment inside quotes with internal backslash quote */' from t1;
-' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
- ' /* comment inside quotes with internal backslash quote */
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 27
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 27
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 32
-DROP TABLE t1;
-SET GLOBAL query_cache_size=default;
-set global query_cache_strip_comments=OFF;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test
deleted file mode 100644
index ad59ac3566c..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test
+++ /dev/null
@@ -1,3 +0,0 @@
--- source include/percona_query_cache_with_comments_begin.inc
--- source include/percona_query_cache_with_comments.inc
--- source include/percona_query_cache_with_comments_end.inc
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc
deleted file mode 100644
index d5356359d7e..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-DROP TABLE t1;
-SET GLOBAL query_cache_size=default;
-set global query_cache_strip_comments=OFF;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc
deleted file mode 100644
index f0c200245e0..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-echo -----------------------------------------------------;
-echo $query;
-echo -----------------------------------------------------;
---source percona_query_cache_with_comments_show.inc
-eval $query;
-eval $query;
---source percona_query_cache_with_comments_show.inc
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result
deleted file mode 100644
index 9b28b7f0b62..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result
+++ /dev/null
@@ -1,396 +0,0 @@
-set GLOBAL query_cache_size=1355776;
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-drop table if exists t1;
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-set global query_cache_strip_comments=ON;
-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 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-prepare stmt from '/* with comment */ select * from t1';
-execute stmt;
-a
-1
-2
-3
-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 0
-execute stmt;
-a
-1
-2
-3
-execute stmt;
-a
-1
-2
-3
-execute stmt;
-a
-1
-2
-3
-execute stmt;
-a
-1
-2
-3
-execute stmt;
-a
-1
-2
-3
-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 5
-prepare stmt from 'select * from t1';
-execute stmt;
-a
-1
-2
-3
-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 6
-prepare stmt from 'select * /*internal comment*/from t1';
-execute stmt;
-a
-1
-2
-3
-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 7
-prepare stmt from 'select * /*internal comment*/ from t1';
-execute stmt;
-a
-1
-2
-3
-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 8
-prepare stmt from 'select * from t1 /* at the end */';
-execute stmt;
-a
-1
-2
-3
-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 9
-prepare stmt from 'select * from t1 /* with "quote" */';
-execute stmt;
-a
-1
-2
-3
-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 10
-prepare stmt from 'select * from t1 /* with \'quote\' */';
-execute stmt;
-a
-1
-2
-3
-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 11
-prepare stmt from 'select * from t1 # 123
-';
-execute stmt;
-a
-1
-2
-3
-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 12
-prepare stmt from 'select * from t1 # 123 with "quote"
-';
-execute stmt;
-a
-1
-2
-3
-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 13
-prepare stmt from 'select * from t1 # 123 with \'quote\'
-';
-execute stmt;
-a
-1
-2
-3
-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 14
-prepare stmt from 'select * from t1
-# 123
-';
-execute stmt;
-a
-1
-2
-3
-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 15
-prepare stmt from '#456
-select * from t1
-# 123
-';
-execute stmt;
-a
-1
-2
-3
-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 16
-prepare stmt from 'select * from t1 -- 123
-';
-execute stmt;
-a
-1
-2
-3
-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 17
-prepare stmt from 'select * from t1
--- 123
-';
-execute stmt;
-a
-1
-2
-3
-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 18
-prepare stmt from '-- comment in first
-select * from t1
-# 123
-';
-execute stmt;
-a
-1
-2
-3
-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 19
-prepare stmt from '(#456(
-select * from t1
-# 123(
-)';
-execute stmt;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 19
-prepare stmt from '/*test*/(-- comment in first(
-select * from t1
--- 123 asdasd
-/* test */)';
-execute stmt;
-a
-1
-2
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 20
-prepare stmt from 'select "test",a from t1';
-execute stmt;
-test a
-test 1
-test 2
-test 3
-execute stmt;
-test a
-test 1
-test 2
-test 3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 21
-prepare stmt from 'select "test /* internal \'comment\' */",a from t1';
-execute stmt;
-test /* internal 'comment' */ a
-test /* internal 'comment' */ 1
-test /* internal 'comment' */ 2
-test /* internal 'comment' */ 3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 4
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 21
-prepare stmt from 'select "test #internal comment" ,a from t1';
-execute stmt;
-test #internal comment a
-test #internal comment 1
-test #internal comment 2
-test #internal comment 3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 21
-prepare stmt from 'select "test #internal comment" #external comment
-,a from t1';
-execute stmt;
-test #internal comment a
-test #internal comment 1
-test #internal comment 2
-test #internal comment 3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 22
-DROP TABLE t1;
-SET GLOBAL query_cache_size= default;
-set global query_cache_strip_comments=OFF;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test
deleted file mode 100644
index 78cb7220aff..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test
+++ /dev/null
@@ -1,208 +0,0 @@
--- source include/have_query_cache.inc
-
-set GLOBAL query_cache_size=1355776;
-
-# Reset query cache variables.
-flush query cache; # This crashed in some versions
-flush query cache; # This crashed in some versions
-reset query cache;
-flush status;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# First simple test
-#
-
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-
-set global query_cache_strip_comments=ON;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from '/* with comment */ select * from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-execute stmt;
-execute stmt;
-execute stmt;
-execute stmt;
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * /*internal comment*/from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * /*internal comment*/ from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 /* at the end */';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 /* with "quote" */';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 /* with \'quote\' */';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 # 123
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 # 123 with "quote"
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 # 123 with \'quote\'
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1
-# 123
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from '#456
-select * from t1
-# 123
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1 -- 123
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select * from t1
--- 123
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from '-- comment in first
-select * from t1
-# 123
-';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from '(#456(
-select * from t1
-# 123(
-)';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from '/*test*/(-- comment in first(
-select * from t1
--- 123 asdasd
-/* test */)';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select "test",a from t1';
-execute stmt;
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select "test /* internal \'comment\' */",a from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select "test #internal comment" ,a from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-prepare stmt from 'select "test #internal comment" #external comment
-,a from t1';
-execute stmt;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-DROP TABLE t1;
-SET GLOBAL query_cache_size= default;
-set global query_cache_strip_comments=OFF;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc
deleted file mode 100644
index 71aa5211cfd..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-let $show=show status like "Qcache_queries_in_cache";
-eval $show;
-let $show=show status like "Qcache_inserts";
-eval $show;
-let $show=show status like "Qcache_hits";
-eval $show;
-
-
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result
deleted file mode 100644
index c243b8ad02f..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result
+++ /dev/null
@@ -1,20 +0,0 @@
-SET GLOBAL query_cache_size=1355776;
-flush query cache;
-flush query cache;
-reset query cache;
-flush status;
-SET DEBUG_SYNC='after_query_cache_mutex SIGNAL mutex_locked WAIT_FOR unlock_mutex';
-SELECT "mutex_locked_query" as action;
-SET DEBUG_SYNC='now WAIT_FOR mutex_locked';
-SET DEBUG_SYNC='before_query_cache_mutex SIGNAL try_lock_mutex';
-SELECT "try_lock_mutex_query" as action;
-SET DEBUG_SYNC='now WAIT_FOR try_lock_mutex';
-SELECT SQL_NO_CACHE state FROM INFORMATION_SCHEMA.PROCESSLIST WHERE info='SELECT "try_lock_mutex_query" as action';
-state
-Waiting on query cache mutex
-SET DEBUG_SYNC='now SIGNAL unlock_mutex';
-action
-mutex_locked_query
-action
-try_lock_mutex_query
-SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test
deleted file mode 100644
index b20f088d6ae..00000000000
--- a/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test
+++ /dev/null
@@ -1,35 +0,0 @@
---source include/have_query_cache.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
-SET GLOBAL query_cache_size=1355776;
---source include/percona_query_cache_with_comments_clear.inc
---let try_lock_mutex_query=SELECT "try_lock_mutex_query" as action
-
---connect (mutex_locked_conn, localhost, root,,)
---connect (try_mutex_lock_conn, localhost, root,,)
-
---connection mutex_locked_conn
-SET DEBUG_SYNC='after_query_cache_mutex SIGNAL mutex_locked WAIT_FOR unlock_mutex';
-send SELECT "mutex_locked_query" as action;
-
---connection default
-SET DEBUG_SYNC='now WAIT_FOR mutex_locked';
-
---connection try_mutex_lock_conn
-SET DEBUG_SYNC='before_query_cache_mutex SIGNAL try_lock_mutex';
-send_eval $try_lock_mutex_query;
-
---connection default
-SET DEBUG_SYNC='now WAIT_FOR try_lock_mutex';
-eval SELECT SQL_NO_CACHE state FROM INFORMATION_SCHEMA.PROCESSLIST WHERE info='$try_lock_mutex_query';
-SET DEBUG_SYNC='now SIGNAL unlock_mutex';
-
---connection mutex_locked_conn
-reap;
---connection try_mutex_lock_conn
-reap;
-
---connection default
---disconnect mutex_locked_conn
---disconnect try_mutex_lock_conn
-SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/percona/query_response_time-replication.inc b/mysql-test/suite/percona/query_response_time-replication.inc
deleted file mode 100644
index 9bd811a9a1b..00000000000
--- a/mysql-test/suite/percona/query_response_time-replication.inc
+++ /dev/null
@@ -1,57 +0,0 @@
-connection master;
-
-CREATE TABLE t(id INT);
-
-connection slave;
-SET GLOBAL query_exec_time = 0.1;
---source include/restart_slave_sql.inc
-
-connection slave;
-
-SET SESSION query_exec_time=0.1;
-
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
---eval SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-
-connection master;
-
-SET SESSION query_exec_time = 0.31; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.32; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.33; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.34; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.35; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.36; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.37; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.38; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.39; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.4; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.1; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.2; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.3; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.5; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 1.4; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 0.5; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.1; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.3; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 2.5; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 3.1; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 4.1; INSERT INTO t VALUES(1);
-SET SESSION query_exec_time = 5.1; INSERT INTO t VALUES(1);
-
-sync_slave_with_master;
-
-connection slave;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SHOW QUERY_RESPONSE_TIME;
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
-
-connection master;
-DROP TABLE t;
-
-sync_slave_with_master;
diff --git a/mysql-test/suite/percona/query_response_time-stored.inc b/mysql-test/suite/percona/query_response_time-stored.inc
deleted file mode 100644
index a1fc8912aab..00000000000
--- a/mysql-test/suite/percona/query_response_time-stored.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-SET SESSION query_exec_time=0.1;
-
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-
-CALL test_f(0.31);
-CALL test_f(0.32);
-CALL test_f(0.33);
-CALL test_f(0.34);
-CALL test_f(0.35);
-CALL test_f(0.36);
-CALL test_f(0.37);
-CALL test_f(0.38);
-CALL test_f(0.39);
-CALL test_f(0.4);
-CALL test_f(1.1);
-CALL test_f(1.2);
-CALL test_f(1.3);
-CALL test_f(1.5);
-CALL test_f(1.4);
-CALL test_f(0.5);
-CALL test_f(2.1);
-CALL test_f(2.3);
-CALL test_f(2.5);
-CALL test_f(3.1);
-CALL test_f(4.1);
-CALL test_f(5.1);
-
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SHOW QUERY_RESPONSE_TIME;
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-SET SESSION query_exec_time=default;
diff --git a/mysql-test/suite/percona/query_response_time.inc b/mysql-test/suite/percona/query_response_time.inc
deleted file mode 100644
index 734d3f5a262..00000000000
--- a/mysql-test/suite/percona/query_response_time.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-SET SESSION query_exec_time=0.1;
-
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-EVAL SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=$base;
-FLUSH QUERY_RESPONSE_TIME;
-# Following two queries check works of FLUSH and
-# respecting of "QUERY_RESPONSE_TIME_STATS" variable (see launchpad bug #855312)
-SHOW QUERY_RESPONSE_TIME;
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
-
-SET SESSION query_exec_time=0.31; SELECT 1;
-SET SESSION query_exec_time=0.32; SELECT 1;
-SET SESSION query_exec_time=0.33; SELECT 1;
-SET SESSION query_exec_time=0.34; SELECT 1;
-SET SESSION query_exec_time=0.35; SELECT 1;
-SET SESSION query_exec_time=0.36; SELECT 1;
-SET SESSION query_exec_time=0.37; SELECT 1;
-SET SESSION query_exec_time=0.38; SELECT 1;
-SET SESSION query_exec_time=0.39; SELECT 1;
-SET SESSION query_exec_time=0.4; SELECT 1;
-SET SESSION query_exec_time=1.1; SELECT 1;
-SET SESSION query_exec_time=1.2; SELECT 1;
-SET SESSION query_exec_time=1.3; SELECT 1;
-SET SESSION query_exec_time=1.5; SELECT 1;
-SET SESSION query_exec_time=1.4; SELECT 1;
-SET SESSION query_exec_time=0.5; SELECT 1;
-SET SESSION query_exec_time=2.1; SELECT 1;
-SET SESSION query_exec_time=2.3; SELECT 1;
-SET SESSION query_exec_time=2.5; SELECT 1;
-SET SESSION query_exec_time=3.1; SELECT 1;
-SET SESSION query_exec_time=4.1; SELECT 1;
-SET SESSION query_exec_time=5.1; SELECT 1;
-
-SET SESSION query_exec_time=0.1;
-
-SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SHOW QUERY_RESPONSE_TIME;
-SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-SET SESSION query_exec_time=default;
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.result b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.result
deleted file mode 100644
index 950cdbf7532..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.result
+++ /dev/null
@@ -1,70 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-SET SESSION debug="+d,response_time_distribution_log_only_more_300_milliseconds";
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT);
-SELECT * from t;
-id
-SELECT * from t;
-id
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
-INSERT INTO t SELECT SLEEP(0.4);
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-INSERT INTO t SELECT SLEEP(0.4);
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-2
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-3
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-FLUSH QUERY_RESPONSE_TIME;
-INSERT INTO t SELECT SLEEP(0.4);
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-INSERT INTO t SELECT SLEEP(0.4);
-Warnings:
-Note 1592 Statement may not be safe to log in statement format.
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-2
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-3
-DROP TABLE IF EXISTS t;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
-SET SESSION debug="-d,response_time_distribution_log_only_more_300_milliseconds";
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.test b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.test
deleted file mode 100644
index b215d3b45b2..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-replication.test
+++ /dev/null
@@ -1,57 +0,0 @@
---source include/have_response_time_distribution.inc
---source include/master-slave.inc
---source include/have_binlog_format_statement.inc
---source include/have_debug.inc
-SET SESSION debug="+d,response_time_distribution_log_only_more_300_milliseconds";
-
-connection master;
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-CREATE TABLE t(id INT);
-SELECT * from t;
-
-sync_slave_with_master;
-
-connection slave;
-SELECT * from t;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
-
-connection master;
-INSERT INTO t SELECT SLEEP(0.4);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-INSERT INTO t SELECT SLEEP(0.4);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-sync_slave_with_master;
-
-connection slave;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-source include/percona_query_response_time_flush.inc;
-
-connection master;
-INSERT INTO t SELECT SLEEP(0.4);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-INSERT INTO t SELECT SLEEP(0.4);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-sync_slave_with_master;
-
-connection slave;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-connection master;
-DROP TABLE IF EXISTS t;
-sync_slave_with_master;
-connection slave;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
-SET SESSION debug="-d,response_time_distribution_log_only_more_300_milliseconds";
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.result b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.result
deleted file mode 100644
index 6ca471867ab..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.result
+++ /dev/null
@@ -1,313 +0,0 @@
-SET SESSION debug="+d,response_time_distribution_log_only_more_300_milliseconds";
-CREATE FUNCTION test_f()
-RETURNS CHAR(30) DETERMINISTIC
-BEGIN
-DECLARE first VARCHAR(5);
-DECLARE second VARCHAR(5);
-DECLARE result VARCHAR(20);
-SELECT SLEEP(1.11) INTO first;
-SET first= 'Hello';
-SET second=', ';
-SET result= CONCAT(first,second);
-SET result= CONCAT(result,'world!');
-RETURN result;
-END/
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-FLUSH QUERY_RESPONSE_TIME;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SELECT test_f();
-test_f()
-Hello, world!
-SELECT test_f();
-test_f()
-Hello, world!
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-4 4 4 1 44
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 1 1 1 14
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-14
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000010
- 0.000100
- 0.001000
- 0.010000
- 0.100000
- 1.000000
- 10.000000
- 100.000000
- 1000.000000
- 10000.000000
- 100000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 1 1 1 17
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-17
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000008
- 0.000059
- 0.000416
- 0.002915
- 0.020408
- 0.142857
- 1.000000
- 7.000000
- 49.000000
- 343.000000
- 2401.000000
- 16807.000000
- 117649.000000
- 823543.000000
- 5764801.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 1 1 1 7
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-7
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000041
- 0.006410
- 1.000000
- 156.000000
- 24336.000000
- 3796416.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 1 1 1 6
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-6
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.001000
- 1.000000
- 1000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-DROP FUNCTION test_f;
-SET SESSION debug="-d,response_time_distribution_log_only_more_300_milliseconds";
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.test b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.test
deleted file mode 100644
index 01651aae928..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time-stored.test
+++ /dev/null
@@ -1,90 +0,0 @@
---source include/have_response_time_distribution.inc
---source include/have_debug.inc
-SET SESSION debug="+d,response_time_distribution_log_only_more_300_milliseconds";
-
-delimiter /;
-CREATE FUNCTION test_f()
-RETURNS CHAR(30) DETERMINISTIC
-BEGIN
- DECLARE first VARCHAR(5);
- DECLARE second VARCHAR(5);
- DECLARE result VARCHAR(20);
- SELECT SLEEP(1.11) INTO first;
- SET first= 'Hello';
- SET second=', ';
- SET result= CONCAT(first,second);
- SET result= CONCAT(result,'world!');
- RETURN result;
-END/
-delimiter ;/
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-source include/percona_query_response_time_show.inc;
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SELECT test_f();
-SELECT test_f();
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-
-DROP FUNCTION test_f;
-SET SESSION debug="-d,response_time_distribution_log_only_more_300_milliseconds";
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.result b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.result
deleted file mode 100644
index 7599c9f0263..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.result
+++ /dev/null
@@ -1,567 +0,0 @@
-SET SESSION debug="+d,response_time_distribution_log_only_more_300_milliseconds";
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-FLUSH QUERY_RESPONSE_TIME;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-10 19 15 4 44
-1 19 15 4 44
-5 19 15 4 44
-3 19 15 4 44
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-11 19 17 2 14
-8 19 17 2 14
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-14
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000010
- 0.000100
- 0.001000
- 0.010000
- 0.100000
- 1.000000
- 10.000000
- 100.000000
- 1000.000000
- 10000.000000
- 100000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-11 19 17 2 17
-8 19 17 2 17
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-17
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000008
- 0.000059
- 0.000416
- 0.002915
- 0.020408
- 0.142857
- 1.000000
- 7.000000
- 49.000000
- 343.000000
- 2401.000000
- 16807.000000
- 117649.000000
- 823543.000000
- 5764801.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-11 19 17 2 7
-8 19 17 2 7
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-7
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000041
- 0.006410
- 1.000000
- 156.000000
- 24336.000000
- 3796416.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-11 19 17 2 6
-8 19 17 2 6
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-6
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.001000
- 1.000000
- 1000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-SET SESSION debug="-d,response_time_distribution_log_only_more_300_milliseconds";
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.test b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.test
deleted file mode 100644
index 6dd0f54abf5..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time.test
+++ /dev/null
@@ -1,68 +0,0 @@
---source include/have_response_time_distribution.inc
---source include/have_debug.inc
-SET SESSION debug="+d,response_time_distribution_log_only_more_300_milliseconds";
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-source include/percona_query_response_time_show.inc;
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-SET SESSION debug="-d,response_time_distribution_log_only_more_300_milliseconds";
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_flush.inc b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_flush.inc
deleted file mode 100644
index 44bb320fe13..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_flush.inc
+++ /dev/null
@@ -1 +0,0 @@
-FLUSH QUERY_RESPONSE_TIME;
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_show.inc b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_show.inc
deleted file mode 100644
index 709abf9872e..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_show.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
diff --git a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_sleep.inc b/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_sleep.inc
deleted file mode 100644
index 40688b173b0..00000000000
--- a/mysql-test/suite/percona/response-time-distribution.patch/percona_query_response_time_sleep.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-SELECT SLEEP(0.31);
-SELECT SLEEP(0.32);
-SELECT SLEEP(0.33);
-SELECT SLEEP(0.34);
-SELECT SLEEP(0.35);
-SELECT SLEEP(0.36);
-SELECT SLEEP(0.37);
-SELECT SLEEP(0.38);
-SELECT SLEEP(0.39);
-SELECT SLEEP(0.40);
-SELECT SLEEP(1.1);
-SELECT SLEEP(1.2);
-SELECT SLEEP(1.3);
-SELECT SLEEP(1.5);
-SELECT SLEEP(1.4);
-SELECT SLEEP(0.5);
-SELECT SLEEP(2.1);
-SELECT SLEEP(2.3);
-SELECT SLEEP(2.5);
diff --git a/mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result b/mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result
deleted file mode 100644
index b98e4a93953..00000000000
--- a/mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result
+++ /dev/null
@@ -1,69 +0,0 @@
-include/master-slave.inc
-[connection master]
-call mtr.add_suppression("Slave SQL: Request to stop slave SQL Thread received while applying a group that has non-transactional changes");
-include/rpl_connect.inc [creating slave_lock]
-include/rpl_connect.inc [creating slave_nolock]
-[master]
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT);
-[slave]
-SET DEBUG_SYNC='RESET';
-SET GLOBAL DEBUG="+d,after_mysql_insert,after_show_slave_status";
-[master]
-INSERT INTO t VALUES(0);
-[slave]
-check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - both should work fine
-
-[slave_lock]
-SHOW SLAVE STATUS;
-SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1';
-SIGNAL after SHOW SLAVE STATUS is 'signal.after_show_slave_status'
-[slave]
-SET DEBUG_SYNC='now SIGNAL signal.empty';
-[slave_nolock]
-SHOW SLAVE STATUS NOLOCK;
-SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1';
-# should be 'signal.after_show_slave_status'
-SIGNAL after SHOW SLAVE STATUS NOLOCK is 'signal.after_show_slave_status'
-[slave]
-SET DEBUG_SYNC='now SIGNAL signal.continue';
-[slave]
-SET DEBUG_SYNC='now SIGNAL signal.empty';
-
-[master]
-INSERT INTO t VALUES(1);
-[slave]
-include/rpl_connect.inc [creating slave_stop]
-[slave_stop]
-STOP SLAVE;
-[slave]
-check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - just NOLOCK version should works fine
-
-[slave_lock]
-SHOW SLAVE STATUS;
-SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1';
-SIGNAL after SHOW SLAVE STATUS is 'signal.empty'
-[slave]
-SET DEBUG_SYNC='now SIGNAL signal.empty';
-[slave_nolock]
-SHOW SLAVE STATUS NOLOCK;
-SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1';
-# should be 'signal.after_show_slave_status'
-SIGNAL after SHOW SLAVE STATUS NOLOCK is 'signal.after_show_slave_status'
-[slave]
-SET DEBUG_SYNC='now SIGNAL signal.continue';
-[slave]
-SET DEBUG_SYNC='now SIGNAL signal.empty';
-
-[slave_stop]
-include/wait_for_slave_to_stop.inc
-START SLAVE;
-include/wait_for_slave_to_start.inc
-[master]
-SET DEBUG_SYNC='RESET';
-[slave]
-SET GLOBAL DEBUG='';
-SET DEBUG_SYNC='RESET';
-[master]
-DROP TABLE t;
-include/rpl_end.inc
diff --git a/mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test b/mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test
deleted file mode 100644
index df595214ff7..00000000000
--- a/mysql-test/suite/percona/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test
+++ /dev/null
@@ -1,90 +0,0 @@
---source include/master-slave.inc
---source include/have_debug_sync.inc
---source include/have_binlog_format_statement.inc
-
-call mtr.add_suppression("Slave SQL: Request to stop slave SQL Thread received while applying a group that has non-transactional changes");
-
---let $rpl_connection_name=slave_lock
---let $rpl_server_number=2
---source include/rpl_connect.inc
-
---let $rpl_connection_name=slave_nolock
---let $rpl_server_number=2
---source include/rpl_connect.inc
-
---let $show_statement= SHOW PROCESSLIST
---let $field= Info
-
-connection master;
---echo [master]
---disable_warnings
-DROP TABLE IF EXISTS t;
---enable_warnings
-CREATE TABLE t(id INT);
-sync_slave_with_master;
-
-connection slave;
---echo [slave]
-SET DEBUG_SYNC='RESET';
-SET GLOBAL DEBUG="+d,after_mysql_insert,after_show_slave_status";
-
-connection master;
---echo [master]
-INSERT INTO t VALUES(0);
-
-connection slave;
---echo [slave]
---let $condition= 'INSERT INTO t VALUES(0)'
---source include/wait_show_condition.inc
-
---echo check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - both should work fine
---source include/percona_show_slave_status_nolock.inc
-
-connection master;
---echo [master]
-INSERT INTO t VALUES(1);
-
-connection slave;
---echo [slave]
---let $condition= 'INSERT INTO t VALUES(1)'
---source include/wait_show_condition.inc
-
---let $rpl_connection_name=slave_stop
---let $rpl_server_number=2
---source include/rpl_connect.inc
-
-connection slave_stop;
---echo [slave_stop]
-send STOP SLAVE;
-
-connection slave;
---echo [slave]
---let $condition= 'STOP SLAVE'
---source include/wait_show_condition.inc
-
---echo check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - just NOLOCK version should works fine
---source include/percona_show_slave_status_nolock.inc
-
-
-connection slave_stop;
---echo [slave_stop]
-reap;
---source include/wait_for_slave_to_stop.inc
-START SLAVE;
---source include/wait_for_slave_to_start.inc
-
-connection master;
---echo [master]
-SET DEBUG_SYNC='RESET';
-
-connection slave;
---echo [slave]
-SET GLOBAL DEBUG='';
-SET DEBUG_SYNC='RESET';
-
-connection master;
---echo [master]
-DROP TABLE t;
-sync_slave_with_master;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/grep.inc b/mysql-test/suite/percona/slow_extended.patch/grep.inc
deleted file mode 100644
index c9c823fa695..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/grep.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-perl;
-
- $file = $ENV{'grep_file'};
- $pattern = $ENV{'grep_pattern'};
-
- open(FILE, "$file")
- or die("Cannot open file $file: $!\n");
-
- $lines = 0;
- while(<FILE>) {
- $lines++ if (/$pattern/);
- }
- print "$lines\n";
-
- close(FILE);
-EOF
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined-master.opt
deleted file mode 100644
index b6f54503c34..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---use_global_long_query_time --log_slow_verbosity="full"
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.result
deleted file mode 100644
index d51e0722fa2..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.result
+++ /dev/null
@@ -1,18 +0,0 @@
-show variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
-show variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control long_query_time
-show variables like 'log_slow_verbosity';
-Variable_name Value
-log_slow_verbosity microtime,query_plan,innodb
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
-show global variables like 'log_slow_verbosity';
-Variable_name Value
-log_slow_verbosity microtime,query_plan,innodb
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control long_query_time
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.test
deleted file mode 100644
index 9a4d57a3efc..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined.test
+++ /dev/null
@@ -1,6 +0,0 @@
-show variables like 'use_global_long_query_time';
-show variables like 'use_global_log_slow_control';
-show variables like 'log_slow_verbosity';
-show global variables like 'use_global_long_query_time';
-show global variables like 'log_slow_verbosity';
-show global variables like 'use_global_log_slow_control';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2-master.opt
deleted file mode 100644
index 267fe17fabe..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---use_global_log_slow_control="long_query_time"
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.result
deleted file mode 100644
index e66a7dc1968..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.result
+++ /dev/null
@@ -1,12 +0,0 @@
-show variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
-show variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control long_query_time
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
-show global variables like 'use_global_log_slow_control';
-Variable_name Value
-use_global_log_slow_control long_query_time
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.test
deleted file mode 100644
index 2c79c137844..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-combined2.test
+++ /dev/null
@@ -1,4 +0,0 @@
-show variables like 'use_global_long_query_time';
-show variables like 'use_global_log_slow_control';
-show global variables like 'use_global_long_query_time';
-show global variables like 'use_global_log_slow_control';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt
deleted file mode 100644
index bd62c08c475..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-control_global_slow.log --long-query-time=1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result
deleted file mode 100644
index f91d1af2fb3..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set global log_slow_verbosity=innodb;
-set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
-SELECT sleep(2);
-sleep(2)
-0
-set global use_global_log_slow_control=none;
-set global log_slow_verbosity=microtime;
-FLUSH LOGS;
-1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test
deleted file mode 100644
index bbf90f8ec9b..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test
+++ /dev/null
@@ -1,12 +0,0 @@
-source include/have_innodb.inc;
-SELECT sleep(2);
-set global log_slow_verbosity=innodb;
-set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
-SELECT sleep(2);
-set global use_global_log_slow_control=none;
-set global log_slow_verbosity=microtime;
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-control_global_slow.log
---let grep_pattern = No InnoDB statistics available for this query
---source include/grep.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt
deleted file mode 100644
index 865dc70ba38..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1 --slow_query_log=OFF
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result
deleted file mode 100644
index 2f22ef5457b..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result
+++ /dev/null
@@ -1,25 +0,0 @@
-drop table if exists t;
-# Create test table
-create table t(id INT PRIMARY KEY) engine=InnoDB;
-# Insert two rows to test table
-insert into t values(1);
-insert into t values(2);
-insert into t values(3);
-SET GLOBAL SLOW_QUERY_LOG=ON;
-SELECT sleep(2);
-sleep(2)
-0
-set log_slow_filter=full_join;
-SELECT sleep(2) union select t2.id from t as t1,t as t2;
-sleep(2)
-0
-1
-2
-3
-SELECT sleep(2);
-sleep(2)
-0
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-drop table if exists t;
-FLUSH LOGS;
-2
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test
deleted file mode 100644
index 292c1651e34..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test
+++ /dev/null
@@ -1,32 +0,0 @@
-source include/have_xtradb.inc;
-
---disable_warnings
-drop table if exists t;
---enable_warnings
-
---echo # Create test table
-create table t(id INT PRIMARY KEY) engine=InnoDB;
---echo # Insert two rows to test table
-insert into t values(1);
-insert into t values(2);
-insert into t values(3);
-
-SET GLOBAL SLOW_QUERY_LOG=ON;
-
-SELECT sleep(2);
-
-set log_slow_filter=full_join;
-
-SELECT sleep(2) union select t2.id from t as t1,t as t2;
-SELECT sleep(2);
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-
---disable_warnings
-drop table if exists t;
---enable_warnings
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_filter.log
---let grep_pattern = Query_time
---source grep.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl-master.opt
deleted file mode 100644
index 4368453928a..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log_slow_sp_statements
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.result
deleted file mode 100644
index c5653429327..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.result
+++ /dev/null
@@ -1,3 +0,0 @@
-show global variables like 'log_slow_sp_statements';
-Variable_name Value
-log_slow_sp_statements ON
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.test
deleted file mode 100644
index 47bd960feb5..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_sp_statements-cl.test
+++ /dev/null
@@ -1 +0,0 @@
-show global variables like 'log_slow_sp_statements';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl-master.opt
deleted file mode 100644
index 8595eaf73d2..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log_slow_timestamp_every
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.result
deleted file mode 100644
index 119bc26a743..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.result
+++ /dev/null
@@ -1,3 +0,0 @@
-show global variables like 'log_slow_timestamp_every';
-Variable_name Value
-log_slow_timestamp_every ON
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.test
deleted file mode 100644
index f1d058b9ba4..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_timestamp_every-cl.test
+++ /dev/null
@@ -1 +0,0 @@
-show global variables like 'log_slow_timestamp_every';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl-master.opt
deleted file mode 100644
index d8809c36981..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log_slow_verbosity="full"
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.result
deleted file mode 100644
index eb8228efb08..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.result
+++ /dev/null
@@ -1,9 +0,0 @@
-show global variables like 'log_slow_verbosity';
-Variable_name Value
-log_slow_verbosity microtime,query_plan,innodb
-show variables like 'log_slow_verbosity';
-Variable_name Value
-log_slow_verbosity microtime,query_plan,innodb
-select @@log_slow_verbosity;
-@@log_slow_verbosity
-microtime,query_plan,innodb
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.test
deleted file mode 100644
index 740c4deaebd..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-cl.test
+++ /dev/null
@@ -1,3 +0,0 @@
-show global variables like 'log_slow_verbosity';
-show variables like 'log_slow_verbosity';
-select @@log_slow_verbosity;
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt
deleted file mode 100644
index 19ae9c117f0..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-log_slow_verbosity.log --long-query-time=1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result
deleted file mode 100644
index 1e7db10c8bd..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result
+++ /dev/null
@@ -1,9 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set log_slow_verbosity=innodb;
-SELECT sleep(2);
-sleep(2)
-0
-FLUSH LOGS;
-1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test
deleted file mode 100644
index e95ab54af61..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test
+++ /dev/null
@@ -1,12 +0,0 @@
-source include/have_xtradb.inc;
-
-SELECT sleep(2);
-
-set log_slow_verbosity=innodb;
-
-SELECT sleep(2);
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log
---let grep_pattern = No InnoDB statistics available for this query
---source grep.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt
deleted file mode 100644
index 62e1e981558..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=2 --slow-query-log=OFF
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result
deleted file mode 100644
index f2da4e4d9d6..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result
+++ /dev/null
@@ -1,24 +0,0 @@
-SET GLOBAL SLOW_QUERY_LOG=ON;
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(3);
-sleep(3)
-0
-SELECT sleep(5);
-sleep(5)
-0
-set long_query_time=4;
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(3);
-sleep(3)
-0
-SELECT sleep(5);
-sleep(5)
-0
-set long_query_time=2;
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-FLUSH LOGS;
-3
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test
deleted file mode 100644
index 716cc7cb0c3..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test
+++ /dev/null
@@ -1,23 +0,0 @@
-source include/have_xtradb.inc;
-
-SET GLOBAL SLOW_QUERY_LOG=ON;
-
-SELECT sleep(1);
-SELECT sleep(3);
-SELECT sleep(5);
-
-set long_query_time=4;
-
-SELECT sleep(1);
-SELECT sleep(3);
-SELECT sleep(5);
-
-set long_query_time=2;
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-long_query_time.log
---let grep_pattern = Query_time
---source grep.inc
-
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt
deleted file mode 100644
index ca486d356f5..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-microseconds_in_slow_query_log.log --long-query-time=1 --slow_query_log=OFF
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result
deleted file mode 100644
index ce27c518efe..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result
+++ /dev/null
@@ -1,13 +0,0 @@
-SET GLOBAL SLOW_QUERY_LOG=ON;
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_timestamp_precision='microsecond';
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_timestamp_precision='second';
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-FLUSH LOGS;
-1
-2
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test
deleted file mode 100644
index 4b437b21e4c..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test
+++ /dev/null
@@ -1,23 +0,0 @@
-source include/have_xtradb.inc;
-
-SET GLOBAL SLOW_QUERY_LOG=ON;
-
-SELECT sleep(2);
-
-set global slow_query_log_timestamp_precision='microsecond';
-
-SELECT sleep(2);
-
-set global slow_query_log_timestamp_precision='second';
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
---let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+
---source grep.inc
-
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
---let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+
---source grep.inc
-
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt
deleted file mode 100644
index c1cf3ebdb30..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-min_examined_row_limit.log --long-query-time=1 --slow-query-log=OFF
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result
deleted file mode 100644
index 1e8bc0723ac..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result
+++ /dev/null
@@ -1,25 +0,0 @@
-drop table if exists t;
-# Create test table
-create table t(id INT PRIMARY KEY) engine=InnoDB;
-# Insert two rows to test table
-insert into t values(1);
-insert into t values(2);
-insert into t values(3);
-SET GLOBAL SLOW_QUERY_LOG=ON;
-SELECT sleep(2);
-sleep(2)
-0
-set min_examined_row_limit=5;
-SELECT sleep(2) union select t2.id from t as t1,t as t2;
-sleep(2)
-0
-1
-2
-3
-SELECT sleep(2);
-sleep(2)
-0
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-drop table if exists t;
-FLUSH LOGS;
-2
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test
deleted file mode 100644
index ca68658a6c5..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test
+++ /dev/null
@@ -1,32 +0,0 @@
-source include/have_xtradb.inc;
-
---disable_warnings
-drop table if exists t;
---enable_warnings
-
---echo # Create test table
-create table t(id INT PRIMARY KEY) engine=InnoDB;
---echo # Insert two rows to test table
-insert into t values(1);
-insert into t values(2);
-insert into t values(3);
-
-SET GLOBAL SLOW_QUERY_LOG=ON;
-
-SELECT sleep(2);
-
-set min_examined_row_limit=5;
-
-SELECT sleep(2) union select t2.id from t as t1,t as t2;
-SELECT sleep(2);
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-
---disable_warnings
-drop table if exists t;
---enable_warnings
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log
---let grep_pattern = Query_time
---source grep.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt
deleted file mode 100644
index 286a9c4484d..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---long_query_time=0 --log_slow_verbosity=innodb --log_slow_slave_statements
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt
deleted file mode 100644
index 286a9c4484d..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---long_query_time=0 --log_slow_verbosity=innodb --log_slow_slave_statements
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result
deleted file mode 100644
index 51993e767c2..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result
+++ /dev/null
@@ -1,22 +0,0 @@
-include/master-slave.inc
-[connection master]
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB;
-INSERT INTO t VALUES
-(1,"aaaaabbbbbcccccdddddeeeeefffff"),
-(2,"aaaaabbbbbcccccdddddeeeeefffff"),
-(3,"aaaaabbbbbcccccdddddeeeeefffff"),
-(4,"aaaaabbbbbcccccdddddeeeeefffff"),
-(5,"aaaaabbbbbcccccdddddeeeeefffff");
-INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
-INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
-START SLAVE;
-include/wait_for_slave_to_start.inc
-INSERT INTO t SELECT t.id,t.data from t;
-DROP TABLE IF EXISTS t;
-FLUSH LOGS;
-4
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test
deleted file mode 100644
index 43af0460118..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test
+++ /dev/null
@@ -1,51 +0,0 @@
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/have_xtradb.inc
--- source include/master-slave.inc
-
-connection master;
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB;
-INSERT INTO t VALUES
-(1,"aaaaabbbbbcccccdddddeeeeefffff"),
-(2,"aaaaabbbbbcccccdddddeeeeefffff"),
-(3,"aaaaabbbbbcccccdddddeeeeefffff"),
-(4,"aaaaabbbbbcccccdddddeeeeefffff"),
-(5,"aaaaabbbbbcccccdddddeeeeefffff");
-INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
-INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
-sync_slave_with_master;
-
-connection slave;
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-wait
-EOF
---shutdown_server
---source include/wait_until_disconnected.inc
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-connection master;
-INSERT INTO t SELECT t.id,t.data from t;
-sync_slave_with_master;
-
-connection master;
-DROP TABLE IF EXISTS t;
-sync_slave_with_master;
-
-connection slave;
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.2/mysqld-slow.log
---let grep_pattern = InnoDB_IO_r_ops
---source grep.inc
-
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt
deleted file mode 100644
index 49038530c56..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt
deleted file mode 100644
index 648f309f744..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
deleted file mode 100644
index e5f4568dd58..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
+++ /dev/null
@@ -1,89 +0,0 @@
-include/master-slave.inc
-[connection master]
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT);
-START SLAVE;
-include/wait_for_slave_to_start.inc
-INSERT INTO t VALUES (1);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (2);
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
-START SLAVE;
-include/wait_for_slave_to_start.inc
-INSERT INTO t VALUES (3);
-show variables like 'long_query_time';
-Variable_name Value
-long_query_time 1.000000
-show global variables like 'long_query_time';
-Variable_name Value
-long_query_time 1.000000
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control
-set global long_query_time=0;
-show variables like 'long_query_time';
-Variable_name Value
-long_query_time 1.000000
-show global variables like 'long_query_time';
-Variable_name Value
-long_query_time 0.000000
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control
-INSERT INTO t VALUES (4);
-show variables like 'long_query_time';
-Variable_name Value
-long_query_time 1.000000
-show global variables like 'long_query_time';
-Variable_name Value
-long_query_time 0.000000
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control
-set global slow_query_log_use_global_control='long_query_time';
-show variables like 'long_query_time';
-Variable_name Value
-long_query_time 0.000000
-show global variables like 'long_query_time';
-Variable_name Value
-long_query_time 0.000000
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control long_query_time
-INSERT INTO t VALUES (5);
-show variables like 'long_query_time';
-Variable_name Value
-long_query_time 0.000000
-show global variables like 'long_query_time';
-Variable_name Value
-long_query_time 0.000000
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control long_query_time
-set global long_query_time=1;
-set global slow_query_log_use_global_control='';
-FLUSH LOGS;
-# Analyse master slow_query_log
-0
-0
-0
-0
-0
-FLUSH LOGS;
-# Analyse slave slow_query_log
-0
-0
-0
-0
-1
-set global log_slow_slave_statements=OFF;
-DROP TABLE t;
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test
deleted file mode 100644
index c718b2c3d28..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test
+++ /dev/null
@@ -1,107 +0,0 @@
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/master-slave.inc
-
-connection master;
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-CREATE TABLE t(id INT);
-
--- disable_warnings
-connection slave;
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
--- enable_warnings
-
-connection master;
-INSERT INTO t VALUES (1);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (2);
-sync_slave_with_master;
-connection slave;
-
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-connection master;
-INSERT INTO t VALUES (3);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-set global long_query_time=0;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-
-connection master;
-INSERT INTO t VALUES (4);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-set global slow_query_log_use_global_control='long_query_time';
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-
-#-- echo # Make insert(5) on master
-connection master;
-INSERT INTO t VALUES (5);
-sync_slave_with_master;
-connection slave;
-show variables like 'long_query_time';
-show global variables like 'long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-set global long_query_time=1;
-set global slow_query_log_use_global_control='';
-
-connection master;
-FLUSH LOGS;
-
--- echo # Analyse master slow_query_log
-let $i=5;
-let $k=1;
-while($i)
-{
- --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
- --let grep_pattern = INSERT INTO t VALUES \($k\)
- --source grep.inc
- dec $i;
- inc $k;
-}
-
-connection slave;
-FLUSH LOGS;
-
--- echo # Analyse slave slow_query_log
-let $i=5;
-let $k=1;
-while($i)
-{
- --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
- --let grep_pattern = INSERT INTO t VALUES \($k\)
- --source grep.inc
- dec $i;
- inc $k;
-}
-set global log_slow_slave_statements=OFF;
-
-connection master;
-DROP TABLE t;
-sync_slave_with_master;
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt
deleted file mode 100644
index ebf25ddd37d..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_log_slow_slave_statements-master.log --long-query-time=0
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt
deleted file mode 100644
index 96cd9004493..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_log_slow_slave_statements-slave.log --long-query-time=0
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result
deleted file mode 100644
index 0548dc370b4..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result
+++ /dev/null
@@ -1,94 +0,0 @@
-include/master-slave.inc
-[connection master]
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT);
-START SLAVE;
-include/wait_for_slave_to_start.inc
-INSERT INTO t VALUES (1);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (2);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
-START SLAVE;
-include/wait_for_slave_to_start.inc
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (3);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-set global log_slow_slave_statements=OFF;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-INSERT INTO t VALUES (4);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
-START SLAVE;
-include/wait_for_slave_to_start.inc
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-INSERT INTO t VALUES (5);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements OFF
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (6);
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
-START SLAVE;
-include/wait_for_slave_to_start.inc
-show variables like 'log_slow_slave_statements';
-Variable_name Value
-log_slow_slave_statements ON
-INSERT INTO t VALUES (7);
-FLUSH LOGS;
-# Analyse master slow_query_log
-1
-1
-1
-1
-1
-1
-1
-FLUSH LOGS;
-# Analyse slave slow_query_log
-0
-0
-1
-0
-0
-0
-1
-set global log_slow_slave_statements=OFF;
-DROP TABLE t;
-STOP SLAVE;
-include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test
deleted file mode 100644
index 88c74bab69b..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test
+++ /dev/null
@@ -1,133 +0,0 @@
--- source include/have_binlog_format_statement.inc
--- source include/master-slave.inc
-
-connection master;
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-
-CREATE TABLE t(id INT);
-
--- disable_warnings
-connection slave;
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
--- enable_warnings
-
-connection master;
-INSERT INTO t VALUES (1);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (2);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (3);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=OFF;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (4);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (5);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-set global log_slow_slave_statements=ON;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (6);
-sync_slave_with_master;
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
-START SLAVE;
--- source include/wait_for_slave_to_start.inc
-
-connection slave;
-show variables like 'log_slow_slave_statements';
-
-connection master;
-INSERT INTO t VALUES (7);
-sync_slave_with_master;
-
-connection master;
-FLUSH LOGS;
-
--- echo # Analyse master slow_query_log
-let $i=7;
-let $k=1;
-while($i)
-{
- --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
- --let grep_pattern = INSERT INTO t VALUES \($k\)
- --source grep.inc
- dec $i;
- inc $k;
-}
-
-connection slave;
-FLUSH LOGS;
-
--- echo # Analyse slave slow_query_log
-let $i=7;
-let $k=1;
-while($i)
-{
- --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
- --let grep_pattern = INSERT INTO t VALUES \($k\)
- --source grep.inc
- dec $i;
- inc $k;
-}
-set global log_slow_slave_statements=OFF;
-
-connection master;
-DROP TABLE t;
-sync_slave_with_master;
-
-STOP SLAVE;
--- source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt
deleted file mode 100644
index c3ebcd95326..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow_query_log_timestamp_precision='microsecond'
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result
deleted file mode 100644
index 5355922bb45..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.result
+++ /dev/null
@@ -1,3 +0,0 @@
-show global variables like 'slow_query_log_timestamp_precision';
-Variable_name Value
-slow_query_log_timestamp_precision microsecond
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test
deleted file mode 100644
index 8f6291e9897..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slow_query_log_microseconds_timestamp-cl.test
+++ /dev/null
@@ -1 +0,0 @@
-show global variables like 'slow_query_log_timestamp_precision';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl-master.opt
deleted file mode 100644
index cf93591c365..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---use_global_long_query_time
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.result
deleted file mode 100644
index d554a64bdb4..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.result
+++ /dev/null
@@ -1,3 +0,0 @@
-show global variables like 'use_global_long_query_time';
-Variable_name Value
-use_global_long_query_time ON
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.test
deleted file mode 100644
index 662aee24ebe..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-cl.test
+++ /dev/null
@@ -1 +0,0 @@
-show global variables like 'use_global_long_query_time';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt
deleted file mode 100644
index 16b6ca5b714..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 --slow_query_log_use_global_control=long_query_time --slow-query-log=OFF
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result
deleted file mode 100644
index e89edf0430f..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result
+++ /dev/null
@@ -1,46 +0,0 @@
-SET GLOBAL SLOW_QUERY_LOG=ON;
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(3);
-sleep(3)
-0
-SELECT sleep(5);
-sleep(5)
-0
-set global long_query_time=4;
-set global slow_query_log_use_global_control='long_query_time';
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(3);
-sleep(3)
-0
-SELECT sleep(5);
-sleep(5)
-0
-set global long_query_time=2;
-set global slow_query_log_use_global_control='';
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-FLUSH LOGS;
-3
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control
-set global slow_query_log_use_global_control='long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control long_query_time
-set global slow_query_log_use_global_control='log_slow_filter,long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control log_slow_filter,long_query_time
-set global slow_query_log_use_global_control='log_slow_filter';
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control log_slow_filter
-set global slow_query_log_use_global_control='';
-show global variables like 'slow_query_log_use_global_control';
-Variable_name Value
-slow_query_log_use_global_control
-set global slow_query_log_use_global_control='long_query_time';
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test
deleted file mode 100644
index 61b2dabd23d..00000000000
--- a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test
+++ /dev/null
@@ -1,40 +0,0 @@
-source include/have_xtradb.inc;
-
-SET GLOBAL SLOW_QUERY_LOG=ON;
-
-SELECT sleep(1);
-SELECT sleep(3);
-SELECT sleep(5);
-
-set global long_query_time=4;
-set global slow_query_log_use_global_control='long_query_time';
-
-SELECT sleep(1);
-SELECT sleep(3);
-SELECT sleep(5);
-
-set global long_query_time=2;
-set global slow_query_log_use_global_control='';
-
-SET GLOBAL SLOW_QUERY_LOG=OFF;
-
-FLUSH LOGS;
---let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log
---let grep_pattern = Query_time
---source grep.inc
-
-show global variables like 'slow_query_log_use_global_control';
-
-set global slow_query_log_use_global_control='long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-
-set global slow_query_log_use_global_control='log_slow_filter,long_query_time';
-show global variables like 'slow_query_log_use_global_control';
-
-set global slow_query_log_use_global_control='log_slow_filter';
-show global variables like 'slow_query_log_use_global_control';
-
-set global slow_query_log_use_global_control='';
-show global variables like 'slow_query_log_use_global_control';
-
-set global slow_query_log_use_global_control='long_query_time';
diff --git a/mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.result b/mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.result
deleted file mode 100644
index bc1413fb96d..00000000000
--- a/mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.result
+++ /dev/null
@@ -1,12 +0,0 @@
-drop table if exists t1;
-create table t (a int not null);
-insert into t values (1),(2),(3);
-SELECT SQL_NO_FCACHE SLEEP(0);
-SLEEP(0)
-0
-SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
-a
-1
-2
-3
-DROP TABLE t;
diff --git a/mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.test b/mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.test
deleted file mode 100644
index 1ed8be2196b..00000000000
--- a/mysql-test/suite/percona/sql_no_fcache.patch/percona_sql_no_fcache.test
+++ /dev/null
@@ -1,11 +0,0 @@
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t (a int not null);
-insert into t values (1),(2),(3);
-
-SELECT SQL_NO_FCACHE SLEEP(0);
-SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
-
-DROP TABLE t;
diff --git a/mysql-test/suite/percona/userstat_bug602047.result b/mysql-test/suite/percona/userstat_bug602047.result
deleted file mode 100644
index 966439b817d..00000000000
--- a/mysql-test/suite/percona/userstat_bug602047.result
+++ /dev/null
@@ -1,15 +0,0 @@
-DROP TABLE IF EXISTS t1;
-SET GLOBAL userstat=ON;
-CREATE TABLE t1 ( id int(10), PRIMARY KEY (id)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-10
-SELECT ROWS_READ FROM information_schema.table_statistics WHERE TABLE_NAME='t1';
-ROWS_READ
-10
-SELECT ROWS_READ FROM information_schema.index_statistics WHERE TABLE_NAME='t1';
-ROWS_READ
-10
-SET GLOBAL userstat=OFF;
-DROP TABLE t1;
diff --git a/mysql-test/suite/percona/userstat_bug602047.test b/mysql-test/suite/percona/userstat_bug602047.test
deleted file mode 100644
index 31fc36b80e2..00000000000
--- a/mysql-test/suite/percona/userstat_bug602047.test
+++ /dev/null
@@ -1,12 +0,0 @@
---source include/have_xtradb.inc
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-SET GLOBAL userstat=ON;
-CREATE TABLE t1 ( id int(10), PRIMARY KEY (id)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-SELECT COUNT(*) FROM t1;
-SELECT ROWS_READ FROM information_schema.table_statistics WHERE TABLE_NAME='t1';
-SELECT ROWS_READ FROM information_schema.index_statistics WHERE TABLE_NAME='t1';
-SET GLOBAL userstat=OFF;
-DROP TABLE t1;
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
index 7dfefd25235..f116b09ff04 100644
--- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
+++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
@@ -118,10 +118,10 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES'
'idle');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
- where name in ('stage/sql/init',
- 'stage/sql/checking permissions',
+ where name in ('stage/sql/Init', 'stage/sql/Init for update',
+ 'stage/sql/Checking permissions',
'stage/sql/Opening tables',
- 'stage/sql/closing tables');
+ 'stage/sql/Closing tables');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('statement/sql/select',
@@ -247,7 +247,7 @@ prepare dump_stages_account from
"select user, host, event_name, count_star
from performance_schema.events_stages_summary_by_account_by_event_name
where user like \'user%\'
- and event_name in ('stage/sql/init',
+ and event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@@ -257,7 +257,7 @@ prepare dump_stages_user from
"select user, event_name, count_star
from performance_schema.events_stages_summary_by_user_by_event_name
where user like \'user%\'
- and event_name in ('stage/sql/init',
+ and event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@@ -267,7 +267,7 @@ prepare dump_stages_host from
"select host, event_name, count_star
from performance_schema.events_stages_summary_by_host_by_event_name
where host=\'localhost\'
- and event_name in ('stage/sql/init',
+ and event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@@ -276,7 +276,7 @@ prepare dump_stages_host from
prepare dump_stages_global from
"select event_name, count_star
from performance_schema.events_stages_summary_global_by_event_name
- where event_name in ('stage/sql/init',
+ where event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@@ -285,7 +285,7 @@ prepare dump_stages_global from
prepare dump_stages_history from
"select event_name, count(event_name)
from performance_schema.events_stages_history_long
- where event_name in ('stage/sql/init',
+ where event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc
index 41dcfd8ecb5..8cbd40c2bc1 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -13,6 +13,7 @@ select count(*) from performance_schema.setup_timers;
# Make sure we don't crash, no matter what the starting parameters are
--disable_result_log
+--disable_query_log
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
@@ -66,11 +67,7 @@ select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
--enable_result_log
-
-# This has a stable output, printing the result:
-show variables where
- `Variable_name` != "performance_schema_max_statement_classes" and
- `Variable_name` like "performance_schema%";
+--enable_query_log
# This has an unrepeatable output, it does depends too much on
# - the platform hardware (sizeof structures, padding)
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_load.inc b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
index ae548d11627..80c622d77be 100644
--- a/mysql-test/suite/perfschema/include/table_aggregate_load.inc
+++ b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
@@ -29,10 +29,12 @@ truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
# Check the configuration is ok
-show variables where
- `Variable_name` != "performance_schema_max_statement_classes" and
- `Variable_name` like "performance_schema%";
-show status like "performance_schema%";
+# We don't print this as it causes too many changes in test cases if
+# one variable changes value
+#show variables where
+# `Variable_name` != "performance_schema_max_statement_classes" and
+# `Variable_name` like "performance_schema%";
+#show status like "performance_schema%";
echo "================== Step 1 ==================";
call dump_thread();
@@ -493,4 +495,3 @@ execute dump_objects_summary;
# On test failures, may help to track the root cause
show status like "performance_schema%";
-
diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result
index f88a5615e16..b8fff059240 100644
--- a/mysql-test/suite/perfschema/r/column_privilege.result
+++ b/mysql-test/suite/perfschema/r/column_privilege.result
@@ -1,6 +1,6 @@
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+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;
diff --git a/mysql-test/suite/perfschema/r/dml_handler.result b/mysql-test/suite/perfschema/r/dml_handler.result
index 2a1cc7035af..ab850aee933 100644
--- a/mysql-test/suite/perfschema/r/dml_handler.result
+++ b/mysql-test/suite/perfschema/r/dml_handler.result
@@ -3,7 +3,8 @@
CREATE TEMPORARY TABLE table_list (id INT AUTO_INCREMENT, PRIMARY KEY (id)) AS
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_SCHEMA='performance_schema';
+WHERE TABLE_SCHEMA='performance_schema'
+ ORDER BY TABLE_NAME;
SELECT COUNT(*) FROM table_list INTO @table_count;
# For each table in the performance schema, attempt HANDLER...OPEN,
@@ -67,11 +68,11 @@ SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=34;
HANDLER performance_schema.mutex_instances OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`mutex_instances` doesn't have this option
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=33;
-HANDLER performance_schema.hosts OPEN;
-ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`hosts` doesn't have this option
-SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=32;
HANDLER performance_schema.host_cache OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`host_cache` doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=32;
+HANDLER performance_schema.hosts OPEN;
+ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`hosts` doesn't have this option
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=31;
HANDLER performance_schema.file_summary_by_instance OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`file_summary_by_instance` doesn't have this option
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index 10d576a0583..a5184782af8 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -4,6 +4,7 @@ where name like 'Wait/Synch/Mutex/sql/%'
and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
order by name limit 10;
NAME ENABLED TIMED
+wait/synch/mutex/sql/Ack_receiver::mutex YES YES
wait/synch/mutex/sql/Cversion_lock YES YES
wait/synch/mutex/sql/Delayed_insert::mutex YES YES
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state YES YES
@@ -13,7 +14,6 @@ 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
select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Rwlock/sql/%'
and name not in (
@@ -23,6 +23,7 @@ order by name limit 10;
NAME ENABLED TIMED
wait/synch/rwlock/sql/LOCK_dboptions YES YES
wait/synch/rwlock/sql/LOCK_grant YES YES
+wait/synch/rwlock/sql/LOCK_SEQUENCE 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
@@ -30,7 +31,6 @@ 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 (
@@ -38,6 +38,8 @@ where name like 'Wait/Synch/Cond/sql/%'
'wait/synch/cond/sql/DEBUG_SYNC::cond')
order by name limit 10;
NAME ENABLED TIMED
+wait/synch/cond/sql/Ack_receiver::cond YES YES
+wait/synch/cond/sql/COND_binlog_send YES YES
wait/synch/cond/sql/COND_flush_thread_cache YES YES
wait/synch/cond/sql/COND_group_commit_orderer YES YES
wait/synch/cond/sql/COND_gtid_ignore_duplicates YES YES
@@ -46,8 +48,6 @@ wait/synch/cond/sql/COND_parallel_entry YES YES
wait/synch/cond/sql/COND_prepare_ordered YES YES
wait/synch/cond/sql/COND_queue_state YES YES
wait/synch/cond/sql/COND_rpl_thread YES YES
-wait/synch/cond/sql/COND_rpl_thread_pool YES YES
-wait/synch/cond/sql/COND_rpl_thread_queue YES YES
select * from performance_schema.setup_instruments
where name='Wait';
select * from performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/event_aggregate.result b/mysql-test/suite/perfschema/r/event_aggregate.result
index 1f168cee431..9ab62329fc9 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate.result
@@ -32,15 +32,17 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -115,27 +117,31 @@ event_name count(event_name)
wait/io/file/sql/query_log 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -228,33 +234,38 @@ wait/io/file/sql/query_log 4
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -351,41 +362,48 @@ wait/io/file/sql/query_log 5
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -499,41 +517,48 @@ wait/io/file/sql/query_log 8
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -651,49 +676,58 @@ wait/io/file/sql/query_log 9
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -828,49 +862,58 @@ wait/io/file/sql/query_log 12
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -1009,57 +1052,68 @@ wait/io/file/sql/query_log 13
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -1215,57 +1269,68 @@ wait/io/file/sql/query_log 16
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 24
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 20
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1412,57 +1477,68 @@ wait/synch/mutex/sql/LOCK_connection_count 1
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 25
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 21
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1607,57 +1683,68 @@ wait/synch/mutex/sql/LOCK_connection_count 2
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 26
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 22
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1799,57 +1886,68 @@ wait/synch/mutex/sql/LOCK_connection_count 3
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 27
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 23
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1988,57 +2086,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2178,57 +2287,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2367,57 +2487,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2556,57 +2687,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2745,57 +2887,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2934,57 +3087,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3123,57 +3287,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3312,57 +3487,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3501,57 +3687,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3690,57 +3887,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3879,57 +4087,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4068,57 +4287,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4257,57 +4487,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4446,57 +4687,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4635,57 +4887,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4824,57 +5087,68 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4999,39 +5273,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -5122,21 +5403,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -5207,21 +5491,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
index 7c9c3794d5f..ece0402335d 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
@@ -32,15 +32,17 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -112,21 +114,24 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -211,27 +216,31 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -316,31 +325,36 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -437,31 +451,36 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -558,35 +577,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -695,35 +720,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -832,39 +863,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -985,39 +1023,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 24
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 20
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1129,39 +1174,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 25
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 21
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1271,39 +1323,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 26
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 22
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1410,39 +1469,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 27
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 23
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1546,39 +1612,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1683,39 +1756,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1819,39 +1899,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1955,39 +2042,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2091,39 +2185,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2227,39 +2328,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2363,39 +2471,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2499,39 +2614,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2635,39 +2757,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2771,39 +2900,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2907,39 +3043,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3043,39 +3186,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3179,39 +3329,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3315,39 +3472,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3451,39 +3615,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3587,39 +3758,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3723,39 +3901,46 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3845,21 +4030,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3929,21 +4117,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
index c8a9233e2a6..083e1bffdd2 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
@@ -30,9 +30,10 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -95,17 +96,19 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -181,23 +184,26 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -273,27 +279,31 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -381,27 +391,31 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -489,31 +503,36 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -613,31 +632,36 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -737,35 +761,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -877,35 +907,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1008,35 +1044,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1137,35 +1179,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1263,35 +1311,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1386,35 +1440,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1510,35 +1570,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1633,35 +1699,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1756,35 +1828,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1879,35 +1957,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2002,35 +2086,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2125,35 +2215,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2248,35 +2344,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2371,35 +2473,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2494,35 +2602,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2617,35 +2731,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2740,35 +2860,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2863,35 +2989,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2986,35 +3118,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3109,35 +3247,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3232,35 +3376,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3355,35 +3505,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3466,15 +3622,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3537,15 +3695,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
index 95b46de4b57..c9b2b768691 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
@@ -32,15 +32,17 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -109,15 +111,17 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -194,21 +198,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -281,21 +288,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -375,21 +385,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -465,21 +478,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -562,21 +578,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -655,21 +674,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -755,21 +777,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 24
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 20
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -846,21 +871,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 25
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 21
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -935,21 +963,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 26
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 22
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1021,21 +1052,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 27
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 23
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1104,21 +1138,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1188,21 +1225,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1271,21 +1311,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1354,21 +1397,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1437,21 +1483,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1520,21 +1569,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1603,21 +1655,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1686,21 +1741,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1769,21 +1827,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1852,21 +1913,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1935,21 +1999,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2018,21 +2085,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2101,21 +2171,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2184,21 +2257,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2267,21 +2343,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2350,21 +2429,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2433,21 +2515,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2516,21 +2601,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2599,21 +2687,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
index 2dda100704f..89443515f31 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
@@ -30,9 +30,10 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -94,9 +95,10 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -166,15 +168,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -240,15 +244,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -321,15 +327,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -398,15 +406,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -482,15 +492,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -562,15 +574,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -649,15 +663,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -727,15 +743,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -803,15 +821,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -876,15 +896,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -946,15 +968,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1017,15 +1041,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1087,15 +1113,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1157,15 +1185,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1227,15 +1257,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1297,15 +1329,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1367,15 +1401,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1437,15 +1473,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1507,15 +1545,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1577,15 +1617,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1647,15 +1689,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1717,15 +1761,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1787,15 +1833,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1857,15 +1905,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1927,15 +1977,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1997,15 +2049,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2067,15 +2121,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2137,15 +2193,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2207,15 +2265,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
index 86edcf225c7..0ea5d90ea41 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
@@ -30,9 +30,10 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -98,23 +99,26 @@ event_name count(event_name)
wait/io/file/sql/query_log 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -198,29 +202,33 @@ wait/io/file/sql/query_log 4
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -308,37 +316,43 @@ wait/io/file/sql/query_log 5
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -443,37 +457,43 @@ wait/io/file/sql/query_log 8
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -582,45 +602,53 @@ wait/io/file/sql/query_log 9
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -746,45 +774,53 @@ wait/io/file/sql/query_log 12
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -914,53 +950,63 @@ wait/io/file/sql/query_log 13
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -1107,53 +1153,63 @@ wait/io/file/sql/query_log 16
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 6
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 5
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1291,53 +1347,63 @@ wait/synch/mutex/sql/LOCK_connection_count 1
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 6
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 5
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1473,53 +1539,63 @@ wait/synch/mutex/sql/LOCK_connection_count 2
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 6
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 5
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1652,53 +1728,63 @@ wait/synch/mutex/sql/LOCK_connection_count 3
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 6
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 5
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1828,53 +1914,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2005,53 +2101,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2181,53 +2287,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2357,53 +2473,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2533,53 +2659,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2709,53 +2845,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2885,53 +3031,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3061,53 +3217,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 3
-user1 stage/sql/closing tables 3
-user1 stage/sql/init 7
+user1 stage/sql/Checking permissions 3
+user1 stage/sql/Closing tables 4
+user1 stage/sql/Init 6
+user1 stage/sql/Init for update 1
user1 stage/sql/Opening tables 3
-user2 stage/sql/checking permissions 3
-user2 stage/sql/closing tables 3
-user2 stage/sql/init 7
+user2 stage/sql/Checking permissions 3
+user2 stage/sql/Closing tables 4
+user2 stage/sql/Init 6
+user2 stage/sql/Init for update 1
user2 stage/sql/Opening tables 3
-user3 stage/sql/checking permissions 3
-user3 stage/sql/closing tables 3
-user3 stage/sql/init 7
+user3 stage/sql/Checking permissions 3
+user3 stage/sql/Closing tables 4
+user3 stage/sql/Init 6
+user3 stage/sql/Init for update 1
user3 stage/sql/Opening tables 3
-user4 stage/sql/checking permissions 3
-user4 stage/sql/closing tables 3
-user4 stage/sql/init 7
+user4 stage/sql/Checking permissions 3
+user4 stage/sql/Closing tables 4
+user4 stage/sql/Init 6
+user4 stage/sql/Init for update 1
user4 stage/sql/Opening tables 3
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3237,53 +3403,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3413,53 +3589,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3589,53 +3775,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3765,53 +3961,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3941,53 +4147,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4117,53 +4333,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4293,53 +4519,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4469,53 +4705,63 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4631,35 +4877,41 @@ execute dump_stages_account;
user host event_name count_star
execute dump_stages_user;
user event_name count_star
-user1 stage/sql/checking permissions 0
-user1 stage/sql/closing tables 0
-user1 stage/sql/init 0
+user1 stage/sql/Checking permissions 0
+user1 stage/sql/Closing tables 0
+user1 stage/sql/Init 0
+user1 stage/sql/Init for update 0
user1 stage/sql/Opening tables 0
-user2 stage/sql/checking permissions 0
-user2 stage/sql/closing tables 0
-user2 stage/sql/init 0
+user2 stage/sql/Checking permissions 0
+user2 stage/sql/Closing tables 0
+user2 stage/sql/Init 0
+user2 stage/sql/Init for update 0
user2 stage/sql/Opening tables 0
-user3 stage/sql/checking permissions 0
-user3 stage/sql/closing tables 0
-user3 stage/sql/init 0
+user3 stage/sql/Checking permissions 0
+user3 stage/sql/Closing tables 0
+user3 stage/sql/Init 0
+user3 stage/sql/Init for update 0
user3 stage/sql/Opening tables 0
-user4 stage/sql/checking permissions 0
-user4 stage/sql/closing tables 0
-user4 stage/sql/init 0
+user4 stage/sql/Checking permissions 0
+user4 stage/sql/Closing tables 0
+user4 stage/sql/Init 0
+user4 stage/sql/Init for update 0
user4 stage/sql/Opening tables 0
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4743,15 +4995,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -4815,15 +5069,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
index f5c4044f40f..52c674024bd 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
@@ -32,15 +32,17 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -110,23 +112,26 @@ event_name count(event_name)
wait/io/file/sql/query_log 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -209,29 +214,33 @@ wait/io/file/sql/query_log 4
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -314,33 +323,38 @@ wait/io/file/sql/query_log 5
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 3
-localhost stage/sql/closing tables 3
-localhost stage/sql/init 6
+localhost stage/sql/Checking permissions 3
+localhost stage/sql/Closing tables 4
+localhost stage/sql/Init 5
+localhost stage/sql/Init for update 1
localhost stage/sql/Opening tables 3
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -435,33 +449,38 @@ wait/io/file/sql/query_log 8
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -556,37 +575,43 @@ wait/io/file/sql/query_log 9
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 6
-localhost stage/sql/closing tables 6
-localhost stage/sql/init 12
+localhost stage/sql/Checking permissions 6
+localhost stage/sql/Closing tables 8
+localhost stage/sql/Init 10
+localhost stage/sql/Init for update 2
localhost stage/sql/Opening tables 6
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -693,37 +718,43 @@ wait/io/file/sql/query_log 12
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -830,41 +861,48 @@ wait/io/file/sql/query_log 13
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 9
-localhost stage/sql/closing tables 9
-localhost stage/sql/init 18
+localhost stage/sql/Checking permissions 9
+localhost stage/sql/Closing tables 12
+localhost stage/sql/Init 15
+localhost stage/sql/Init for update 3
localhost stage/sql/Opening tables 9
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -983,41 +1021,48 @@ wait/io/file/sql/query_log 16
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 24
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 20
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1127,41 +1172,48 @@ wait/synch/mutex/sql/LOCK_connection_count 1
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 25
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 21
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1269,41 +1321,48 @@ wait/synch/mutex/sql/LOCK_connection_count 2
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 26
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 22
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1408,41 +1467,48 @@ wait/synch/mutex/sql/LOCK_connection_count 3
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 27
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 23
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1544,41 +1610,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1681,41 +1754,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1817,41 +1897,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1953,41 +2040,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2089,41 +2183,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2225,41 +2326,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2361,41 +2469,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2497,41 +2612,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2633,41 +2755,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 12
-localhost stage/sql/init 28
+localhost stage/sql/Checking permissions 12
+localhost stage/sql/Closing tables 16
+localhost stage/sql/Init 24
+localhost stage/sql/Init for update 4
localhost stage/sql/Opening tables 12
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2769,41 +2898,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2905,41 +3041,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3041,41 +3184,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3177,41 +3327,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3313,41 +3470,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3449,41 +3613,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3585,41 +3756,48 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3709,21 +3887,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3793,21 +3974,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3877,21 +4061,24 @@ execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
-localhost stage/sql/checking permissions 0
-localhost stage/sql/closing tables 0
-localhost stage/sql/init 0
+localhost stage/sql/Checking permissions 0
+localhost stage/sql/Closing tables 0
+localhost stage/sql/Init 0
+localhost stage/sql/Init for update 0
localhost stage/sql/Opening tables 0
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
index 5b40823e6ff..a493631d71f 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
@@ -30,9 +30,10 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -93,9 +94,10 @@ event_name count(event_name)
wait/io/file/sql/query_log 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -103,9 +105,10 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
@@ -179,9 +182,10 @@ wait/io/file/sql/query_log 4
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -189,15 +193,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -271,13 +277,15 @@ wait/io/file/sql/query_log 5
wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -285,15 +293,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 3
-stage/sql/closing tables 3
-stage/sql/init 6
+stage/sql/Checking permissions 3
+stage/sql/Closing tables 4
+stage/sql/Init 5
+stage/sql/Init for update 1
stage/sql/Opening tables 3
execute dump_statements_account;
user host event_name count_star
@@ -379,13 +389,15 @@ wait/io/file/sql/query_log 8
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -393,15 +405,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -487,17 +501,20 @@ wait/io/file/sql/query_log 9
wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -505,15 +522,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 6
-stage/sql/closing tables 6
-stage/sql/init 12
+stage/sql/Checking permissions 6
+stage/sql/Closing tables 8
+stage/sql/Init 10
+stage/sql/Init for update 2
stage/sql/Opening tables 6
execute dump_statements_account;
user host event_name count_star
@@ -611,17 +630,20 @@ wait/io/file/sql/query_log 12
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -629,15 +651,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -735,21 +759,25 @@ wait/io/file/sql/query_log 13
wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -757,15 +785,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 9
-stage/sql/closing tables 9
-stage/sql/init 18
+stage/sql/Checking permissions 9
+stage/sql/Closing tables 12
+stage/sql/Init 15
+stage/sql/Init for update 3
stage/sql/Opening tables 9
execute dump_statements_account;
user host event_name count_star
@@ -875,21 +905,25 @@ wait/io/file/sql/query_log 16
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 5
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -897,15 +931,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 24
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 20
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1006,21 +1042,25 @@ wait/synch/mutex/sql/LOCK_connection_count 1
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 5
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1028,15 +1068,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 25
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 21
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1135,21 +1177,25 @@ wait/synch/mutex/sql/LOCK_connection_count 2
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 5
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1157,15 +1203,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 26
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 22
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1261,21 +1309,25 @@ wait/synch/mutex/sql/LOCK_connection_count 3
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 5
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1283,15 +1335,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 27
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 23
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1384,21 +1438,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1406,15 +1464,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1508,21 +1568,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1530,15 +1594,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1631,21 +1697,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1653,15 +1723,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1754,21 +1826,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1776,15 +1852,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -1877,21 +1955,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -1899,15 +1981,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2000,21 +2084,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -2022,15 +2110,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2123,21 +2213,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 3
-user1 localhost stage/sql/closing tables 3
-user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Checking permissions 3
+user1 localhost stage/sql/Closing tables 4
+user1 localhost stage/sql/Init 6
+user1 localhost stage/sql/Init for update 1
user1 localhost stage/sql/Opening tables 3
-user2 localhost stage/sql/checking permissions 3
-user2 localhost stage/sql/closing tables 3
-user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Checking permissions 3
+user2 localhost stage/sql/Closing tables 4
+user2 localhost stage/sql/Init 6
+user2 localhost stage/sql/Init for update 1
user2 localhost stage/sql/Opening tables 3
-user3 localhost stage/sql/checking permissions 3
-user3 localhost stage/sql/closing tables 3
-user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Checking permissions 3
+user3 localhost stage/sql/Closing tables 4
+user3 localhost stage/sql/Init 6
+user3 localhost stage/sql/Init for update 1
user3 localhost stage/sql/Opening tables 3
-user4 localhost stage/sql/checking permissions 3
-user4 localhost stage/sql/closing tables 3
-user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Checking permissions 3
+user4 localhost stage/sql/Closing tables 4
+user4 localhost stage/sql/Init 6
+user4 localhost stage/sql/Init for update 1
user4 localhost stage/sql/Opening tables 3
execute dump_stages_user;
user event_name count_star
@@ -2145,15 +2239,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2246,21 +2342,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -2268,15 +2368,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2369,21 +2471,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -2391,15 +2497,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2492,21 +2600,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -2514,15 +2626,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2615,21 +2729,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -2637,15 +2755,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2738,21 +2858,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -2760,15 +2884,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2861,21 +2987,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -2883,15 +3013,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -2984,21 +3116,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -3006,15 +3142,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3107,21 +3245,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -3129,15 +3271,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3230,21 +3374,25 @@ wait/synch/mutex/sql/LOCK_connection_count 4
wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
-user1 localhost stage/sql/checking permissions 0
-user1 localhost stage/sql/closing tables 0
-user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Checking permissions 0
+user1 localhost stage/sql/Closing tables 0
+user1 localhost stage/sql/Init 0
+user1 localhost stage/sql/Init for update 0
user1 localhost stage/sql/Opening tables 0
-user2 localhost stage/sql/checking permissions 0
-user2 localhost stage/sql/closing tables 0
-user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Checking permissions 0
+user2 localhost stage/sql/Closing tables 0
+user2 localhost stage/sql/Init 0
+user2 localhost stage/sql/Init for update 0
user2 localhost stage/sql/Opening tables 0
-user3 localhost stage/sql/checking permissions 0
-user3 localhost stage/sql/closing tables 0
-user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Checking permissions 0
+user3 localhost stage/sql/Closing tables 0
+user3 localhost stage/sql/Init 0
+user3 localhost stage/sql/Init for update 0
user3 localhost stage/sql/Opening tables 0
-user4 localhost stage/sql/checking permissions 0
-user4 localhost stage/sql/closing tables 0
-user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Checking permissions 0
+user4 localhost stage/sql/Closing tables 0
+user4 localhost stage/sql/Init 0
+user4 localhost stage/sql/Init for update 0
user4 localhost stage/sql/Opening tables 0
execute dump_stages_user;
user event_name count_star
@@ -3252,15 +3400,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3343,15 +3493,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3414,15 +3566,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
@@ -3485,15 +3639,17 @@ execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
-stage/sql/checking permissions 0
-stage/sql/closing tables 0
-stage/sql/init 0
+stage/sql/Checking permissions 0
+stage/sql/Closing tables 0
+stage/sql/Init 0
+stage/sql/Init for update 0
stage/sql/Opening tables 0
execute dump_stages_history;
event_name count(event_name)
-stage/sql/checking permissions 12
-stage/sql/closing tables 12
-stage/sql/init 28
+stage/sql/Checking permissions 12
+stage/sql/Closing tables 16
+stage/sql/Init 24
+stage/sql/Init for update 4
stage/sql/Opening tables 12
execute dump_statements_account;
user host event_name count_star
diff --git a/mysql-test/suite/perfschema/r/information_schema.result b/mysql-test/suite/perfschema/r/information_schema.result
index 5e5ce57fb2e..a684fd7b84e 100644
--- a/mysql-test/suite/perfschema/r/information_schema.result
+++ b/mysql-test/suite/perfschema/r/information_schema.result
@@ -1,6 +1,7 @@
select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
TABLE_SCHEMA lower(TABLE_NAME) TABLE_CATALOG
performance_schema accounts def
performance_schema cond_instances def
@@ -33,8 +34,8 @@ performance_schema events_waits_summary_global_by_event_name def
performance_schema file_instances def
performance_schema file_summary_by_event_name def
performance_schema file_summary_by_instance def
-performance_schema host_cache def
performance_schema hosts def
+performance_schema host_cache def
performance_schema mutex_instances def
performance_schema objects_summary_global_by_type def
performance_schema performance_timers def
@@ -56,7 +57,8 @@ performance_schema threads def
performance_schema users def
select lower(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) TABLE_TYPE ENGINE
accounts BASE TABLE PERFORMANCE_SCHEMA
cond_instances BASE TABLE PERFORMANCE_SCHEMA
@@ -89,8 +91,8 @@ events_waits_summary_global_by_event_name BASE TABLE PERFORMANCE_SCHEMA
file_instances BASE TABLE PERFORMANCE_SCHEMA
file_summary_by_event_name BASE TABLE PERFORMANCE_SCHEMA
file_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
-host_cache BASE TABLE PERFORMANCE_SCHEMA
hosts BASE TABLE PERFORMANCE_SCHEMA
+host_cache BASE TABLE PERFORMANCE_SCHEMA
mutex_instances BASE TABLE PERFORMANCE_SCHEMA
objects_summary_global_by_type BASE TABLE PERFORMANCE_SCHEMA
performance_timers BASE TABLE PERFORMANCE_SCHEMA
@@ -112,7 +114,8 @@ threads BASE TABLE PERFORMANCE_SCHEMA
users BASE TABLE PERFORMANCE_SCHEMA
select lower(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) VERSION ROW_FORMAT
accounts 10 Fixed
cond_instances 10 Dynamic
@@ -145,8 +148,8 @@ events_waits_summary_global_by_event_name 10 Dynamic
file_instances 10 Dynamic
file_summary_by_event_name 10 Dynamic
file_summary_by_instance 10 Dynamic
-host_cache 10 Dynamic
hosts 10 Fixed
+host_cache 10 Dynamic
mutex_instances 10 Dynamic
objects_summary_global_by_type 10 Dynamic
performance_timers 10 Fixed
@@ -168,7 +171,8 @@ threads 10 Dynamic
users 10 Fixed
select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH
accounts 1000 0
cond_instances 1000 0
@@ -201,8 +205,8 @@ events_waits_summary_global_by_event_name 1000 0
file_instances 1000 0
file_summary_by_event_name 1000 0
file_summary_by_instance 1000 0
-host_cache 1000 0
hosts 1000 0
+host_cache 1000 0
mutex_instances 1000 0
objects_summary_global_by_type 1000 0
performance_timers 5 0
@@ -224,7 +228,8 @@ threads 1000 0
users 1000 0
select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH
accounts 0 0
cond_instances 0 0
@@ -257,8 +262,8 @@ events_waits_summary_global_by_event_name 0 0
file_instances 0 0
file_summary_by_event_name 0 0
file_summary_by_instance 0 0
-host_cache 0 0
hosts 0 0
+host_cache 0 0
mutex_instances 0 0
objects_summary_global_by_type 0 0
performance_timers 0 0
@@ -280,7 +285,8 @@ threads 0 0
users 0 0
select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT
accounts 0 0 NULL
cond_instances 0 0 NULL
@@ -313,8 +319,8 @@ events_waits_summary_global_by_event_name 0 0 NULL
file_instances 0 0 NULL
file_summary_by_event_name 0 0 NULL
file_summary_by_instance 0 0 NULL
-host_cache 0 0 NULL
hosts 0 0 NULL
+host_cache 0 0 NULL
mutex_instances 0 0 NULL
objects_summary_global_by_type 0 0 NULL
performance_timers 0 0 NULL
@@ -336,7 +342,8 @@ threads 0 0 NULL
users 0 0 NULL
select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME
accounts NULL NULL NULL
cond_instances NULL NULL NULL
@@ -369,8 +376,8 @@ events_waits_summary_global_by_event_name NULL NULL NULL
file_instances NULL NULL NULL
file_summary_by_event_name NULL NULL NULL
file_summary_by_instance NULL NULL NULL
-host_cache NULL NULL NULL
hosts NULL NULL NULL
+host_cache NULL NULL NULL
mutex_instances NULL NULL NULL
objects_summary_global_by_type NULL NULL NULL
performance_timers NULL NULL NULL
@@ -392,7 +399,8 @@ threads NULL NULL NULL
users NULL NULL NULL
select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) TABLE_COLLATION CHECKSUM
accounts utf8_general_ci NULL
cond_instances utf8_general_ci NULL
@@ -425,8 +433,8 @@ events_waits_summary_global_by_event_name utf8_general_ci NULL
file_instances utf8_general_ci NULL
file_summary_by_event_name utf8_general_ci NULL
file_summary_by_instance utf8_general_ci NULL
-host_cache utf8_general_ci NULL
hosts utf8_general_ci NULL
+host_cache utf8_general_ci NULL
mutex_instances utf8_general_ci NULL
objects_summary_global_by_type utf8_general_ci NULL
performance_timers utf8_general_ci NULL
@@ -448,7 +456,8 @@ threads utf8_general_ci NULL
users utf8_general_ci NULL
select lower(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
-where TABLE_SCHEMA='performance_schema';
+where TABLE_SCHEMA='performance_schema'
+ order by table_name;
lower(TABLE_NAME) TABLE_COMMENT
accounts
cond_instances
@@ -481,8 +490,8 @@ events_waits_summary_global_by_event_name
file_instances
file_summary_by_event_name
file_summary_by_instance
-host_cache
hosts
+host_cache
mutex_instances
objects_summary_global_by_type
performance_timers
diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result
index e08aec94845..37681757973 100644
--- a/mysql-test/suite/perfschema/r/nesting.result
+++ b/mysql-test/suite/perfschema/r/nesting.result
@@ -107,138 +107,152 @@ 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 18 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL
-1 4 stage/sql/init (stage) STATEMENT 0
+0 20 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
4 4 wait/io/file/sql/query_log write STAGE 1
-5 5 stage/sql/checking permissions (stage) STATEMENT 0
+5 5 stage/sql/Checking permissions (stage) STATEMENT 0
6 6 stage/sql/Opening tables (stage) STATEMENT 0
7 7 stage/sql/After opening tables (stage) STATEMENT 0
-8 8 stage/sql/init (stage) STATEMENT 0
-9 9 stage/sql/optimizing (stage) STATEMENT 0
-10 10 stage/sql/executing (stage) STATEMENT 0
-11 11 stage/sql/end (stage) STATEMENT 0
-12 12 stage/sql/query end (stage) STATEMENT 0
-13 13 stage/sql/closing tables (stage) STATEMENT 0
-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 18 stage/sql/cleaning up (stage) STATEMENT 0
-18 18 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 17
-19 19 idle idle NULL NULL
-20 38 statement/sql/select select "This is simple statement one" as payload NULL NULL
-21 24 stage/sql/init (stage) STATEMENT 20
-22 22 wait/io/socket/sql/client_connection recv STAGE 21
-23 23 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 21
-24 24 wait/io/file/sql/query_log write STAGE 21
-25 25 stage/sql/checking permissions (stage) STATEMENT 20
-26 26 stage/sql/Opening tables (stage) STATEMENT 20
-27 27 stage/sql/After opening tables (stage) STATEMENT 20
-28 28 stage/sql/init (stage) STATEMENT 20
-29 29 stage/sql/optimizing (stage) STATEMENT 20
-30 30 stage/sql/executing (stage) STATEMENT 20
-31 31 stage/sql/end (stage) STATEMENT 20
-32 32 stage/sql/query end (stage) STATEMENT 20
-33 33 stage/sql/closing tables (stage) STATEMENT 20
-34 34 stage/sql/freeing items (stage) STATEMENT 20
-35 35 wait/io/socket/sql/client_connection send STATEMENT 20
-36 36 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 20
-37 38 stage/sql/cleaning up (stage) STATEMENT 20
-38 38 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 37
-39 39 idle idle NULL NULL
-40 58 statement/sql/select select "This is simple statement two" as payload NULL NULL
-41 44 stage/sql/init (stage) STATEMENT 40
-42 42 wait/io/socket/sql/client_connection recv STAGE 41
-43 43 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 41
-44 44 wait/io/file/sql/query_log write STAGE 41
-45 45 stage/sql/checking permissions (stage) STATEMENT 40
-46 46 stage/sql/Opening tables (stage) STATEMENT 40
-47 47 stage/sql/After opening tables (stage) STATEMENT 40
-48 48 stage/sql/init (stage) STATEMENT 40
-49 49 stage/sql/optimizing (stage) STATEMENT 40
-50 50 stage/sql/executing (stage) STATEMENT 40
-51 51 stage/sql/end (stage) STATEMENT 40
-52 52 stage/sql/query end (stage) STATEMENT 40
-53 53 stage/sql/closing tables (stage) STATEMENT 40
-54 54 stage/sql/freeing items (stage) STATEMENT 40
-55 55 wait/io/socket/sql/client_connection send STATEMENT 40
-56 56 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 40
-57 58 stage/sql/cleaning up (stage) STATEMENT 40
-58 58 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 57
-59 59 idle idle NULL NULL
-60 77 statement/sql/select select "This is the first part of a multi query" as payload;
+8 8 stage/sql/Init (stage) STATEMENT 0
+9 9 stage/sql/Optimizing (stage) STATEMENT 0
+10 10 stage/sql/Executing (stage) STATEMENT 0
+11 11 stage/sql/End of update loop (stage) STATEMENT 0
+12 12 stage/sql/Query end (stage) STATEMENT 0
+13 13 stage/sql/Commit (stage) STATEMENT 0
+14 14 stage/sql/Closing tables (stage) STATEMENT 0
+15 15 stage/sql/Starting cleanup (stage) STATEMENT 0
+16 16 stage/sql/Freeing items (stage) STATEMENT 0
+17 17 wait/io/socket/sql/client_connection send STATEMENT 0
+18 18 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 0
+19 20 stage/sql/Reset for next command (stage) STATEMENT 0
+20 20 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 19
+21 21 idle idle NULL NULL
+22 42 statement/sql/select select "This is simple statement one" as payload NULL NULL
+23 26 stage/sql/Init (stage) STATEMENT 22
+24 24 wait/io/socket/sql/client_connection recv STAGE 23
+25 25 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 23
+26 26 wait/io/file/sql/query_log write STAGE 23
+27 27 stage/sql/Checking permissions (stage) STATEMENT 22
+28 28 stage/sql/Opening tables (stage) STATEMENT 22
+29 29 stage/sql/After opening tables (stage) STATEMENT 22
+30 30 stage/sql/Init (stage) STATEMENT 22
+31 31 stage/sql/Optimizing (stage) STATEMENT 22
+32 32 stage/sql/Executing (stage) STATEMENT 22
+33 33 stage/sql/End of update loop (stage) STATEMENT 22
+34 34 stage/sql/Query end (stage) STATEMENT 22
+35 35 stage/sql/Commit (stage) STATEMENT 22
+36 36 stage/sql/Closing tables (stage) STATEMENT 22
+37 37 stage/sql/Starting cleanup (stage) STATEMENT 22
+38 38 stage/sql/Freeing items (stage) STATEMENT 22
+39 39 wait/io/socket/sql/client_connection send STATEMENT 22
+40 40 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 22
+41 42 stage/sql/Reset for next command (stage) STATEMENT 22
+42 42 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 41
+43 43 idle idle NULL NULL
+44 64 statement/sql/select select "This is simple statement two" as payload NULL NULL
+45 48 stage/sql/Init (stage) STATEMENT 44
+46 46 wait/io/socket/sql/client_connection recv STAGE 45
+47 47 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 45
+48 48 wait/io/file/sql/query_log write STAGE 45
+49 49 stage/sql/Checking permissions (stage) STATEMENT 44
+50 50 stage/sql/Opening tables (stage) STATEMENT 44
+51 51 stage/sql/After opening tables (stage) STATEMENT 44
+52 52 stage/sql/Init (stage) STATEMENT 44
+53 53 stage/sql/Optimizing (stage) STATEMENT 44
+54 54 stage/sql/Executing (stage) STATEMENT 44
+55 55 stage/sql/End of update loop (stage) STATEMENT 44
+56 56 stage/sql/Query end (stage) STATEMENT 44
+57 57 stage/sql/Commit (stage) STATEMENT 44
+58 58 stage/sql/Closing tables (stage) STATEMENT 44
+59 59 stage/sql/Starting cleanup (stage) STATEMENT 44
+60 60 stage/sql/Freeing items (stage) STATEMENT 44
+61 61 wait/io/socket/sql/client_connection send STATEMENT 44
+62 62 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 44
+63 64 stage/sql/Reset for next command (stage) STATEMENT 44
+64 64 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 63
+65 65 idle idle NULL NULL
+66 85 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
-61 65 stage/sql/init (stage) STATEMENT 60
-62 62 wait/io/socket/sql/client_connection recv STAGE 61
-63 63 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 61
-64 64 wait/io/file/sql/query_log write STAGE 61
-65 65 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 61
-66 66 stage/sql/checking permissions (stage) STATEMENT 60
-67 67 stage/sql/Opening tables (stage) STATEMENT 60
-68 68 stage/sql/After opening tables (stage) STATEMENT 60
-69 69 stage/sql/init (stage) STATEMENT 60
-70 70 stage/sql/optimizing (stage) STATEMENT 60
-71 71 stage/sql/executing (stage) STATEMENT 60
-72 72 stage/sql/end (stage) STATEMENT 60
-73 73 stage/sql/query end (stage) STATEMENT 60
-74 74 stage/sql/closing tables (stage) STATEMENT 60
-75 77 stage/sql/freeing items (stage) STATEMENT 60
-76 76 wait/io/socket/sql/client_connection send STAGE 75
-77 77 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 75
-78 93 statement/sql/select select "And this is the second part of a multi query" as payload;
+67 71 stage/sql/Init (stage) STATEMENT 66
+68 68 wait/io/socket/sql/client_connection recv STAGE 67
+69 69 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 67
+70 70 wait/io/file/sql/query_log write STAGE 67
+71 71 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 67
+72 72 stage/sql/Checking permissions (stage) STATEMENT 66
+73 73 stage/sql/Opening tables (stage) STATEMENT 66
+74 74 stage/sql/After opening tables (stage) STATEMENT 66
+75 75 stage/sql/Init (stage) STATEMENT 66
+76 76 stage/sql/Optimizing (stage) STATEMENT 66
+77 77 stage/sql/Executing (stage) STATEMENT 66
+78 78 stage/sql/End of update loop (stage) STATEMENT 66
+79 79 stage/sql/Query end (stage) STATEMENT 66
+80 80 stage/sql/Commit (stage) STATEMENT 66
+81 81 stage/sql/Closing tables (stage) STATEMENT 66
+82 82 stage/sql/Starting cleanup (stage) STATEMENT 66
+83 85 stage/sql/Freeing items (stage) STATEMENT 66
+84 84 wait/io/socket/sql/client_connection send STAGE 83
+85 85 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 83
+86 103 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
-79 81 stage/sql/init (stage) STATEMENT 78
-80 80 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 79
-81 81 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 79
-82 82 stage/sql/checking permissions (stage) STATEMENT 78
-83 83 stage/sql/Opening tables (stage) STATEMENT 78
-84 84 stage/sql/After opening tables (stage) STATEMENT 78
-85 85 stage/sql/init (stage) STATEMENT 78
-86 86 stage/sql/optimizing (stage) STATEMENT 78
-87 87 stage/sql/executing (stage) STATEMENT 78
-88 88 stage/sql/end (stage) STATEMENT 78
-89 89 stage/sql/query end (stage) STATEMENT 78
-90 90 stage/sql/closing tables (stage) STATEMENT 78
-91 93 stage/sql/freeing items (stage) STATEMENT 78
-92 92 wait/io/socket/sql/client_connection send STAGE 91
-93 93 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 91
-94 110 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
-95 96 stage/sql/init (stage) STATEMENT 94
-96 96 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 95
-97 97 stage/sql/checking permissions (stage) STATEMENT 94
-98 98 stage/sql/Opening tables (stage) STATEMENT 94
-99 99 stage/sql/After opening tables (stage) STATEMENT 94
-100 100 stage/sql/init (stage) STATEMENT 94
-101 101 stage/sql/optimizing (stage) STATEMENT 94
-102 102 stage/sql/executing (stage) STATEMENT 94
-103 103 stage/sql/end (stage) STATEMENT 94
-104 104 stage/sql/query end (stage) STATEMENT 94
-105 105 stage/sql/closing tables (stage) STATEMENT 94
-106 106 stage/sql/freeing items (stage) STATEMENT 94
-107 107 wait/io/socket/sql/client_connection send STATEMENT 94
-108 108 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 94
-109 110 stage/sql/cleaning up (stage) STATEMENT 94
-110 110 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 109
-111 111 idle idle NULL NULL
-112 130 statement/sql/select select "MARKER_END" as marker NULL NULL
-113 116 stage/sql/init (stage) STATEMENT 112
-114 114 wait/io/socket/sql/client_connection recv STAGE 113
-115 115 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 113
-116 116 wait/io/file/sql/query_log write STAGE 113
-117 117 stage/sql/checking permissions (stage) STATEMENT 112
-118 118 stage/sql/Opening tables (stage) STATEMENT 112
-119 119 stage/sql/After opening tables (stage) STATEMENT 112
-120 120 stage/sql/init (stage) STATEMENT 112
-121 121 stage/sql/optimizing (stage) STATEMENT 112
-122 122 stage/sql/executing (stage) STATEMENT 112
-123 123 stage/sql/end (stage) STATEMENT 112
-124 124 stage/sql/query end (stage) STATEMENT 112
-125 125 stage/sql/closing tables (stage) STATEMENT 112
-126 126 stage/sql/freeing items (stage) STATEMENT 112
-127 127 wait/io/socket/sql/client_connection send STATEMENT 112
-128 128 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 112
-129 130 stage/sql/cleaning up (stage) STATEMENT 112
-130 130 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 129
+87 89 stage/sql/Init (stage) STATEMENT 86
+88 88 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 87
+89 89 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 87
+90 90 stage/sql/Checking permissions (stage) STATEMENT 86
+91 91 stage/sql/Opening tables (stage) STATEMENT 86
+92 92 stage/sql/After opening tables (stage) STATEMENT 86
+93 93 stage/sql/Init (stage) STATEMENT 86
+94 94 stage/sql/Optimizing (stage) STATEMENT 86
+95 95 stage/sql/Executing (stage) STATEMENT 86
+96 96 stage/sql/End of update loop (stage) STATEMENT 86
+97 97 stage/sql/Query end (stage) STATEMENT 86
+98 98 stage/sql/Commit (stage) STATEMENT 86
+99 99 stage/sql/Closing tables (stage) STATEMENT 86
+100 100 stage/sql/Starting cleanup (stage) STATEMENT 86
+101 103 stage/sql/Freeing items (stage) STATEMENT 86
+102 102 wait/io/socket/sql/client_connection send STAGE 101
+103 103 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 101
+104 122 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
+105 106 stage/sql/Init (stage) STATEMENT 104
+106 106 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 105
+107 107 stage/sql/Checking permissions (stage) STATEMENT 104
+108 108 stage/sql/Opening tables (stage) STATEMENT 104
+109 109 stage/sql/After opening tables (stage) STATEMENT 104
+110 110 stage/sql/Init (stage) STATEMENT 104
+111 111 stage/sql/Optimizing (stage) STATEMENT 104
+112 112 stage/sql/Executing (stage) STATEMENT 104
+113 113 stage/sql/End of update loop (stage) STATEMENT 104
+114 114 stage/sql/Query end (stage) STATEMENT 104
+115 115 stage/sql/Commit (stage) STATEMENT 104
+116 116 stage/sql/Closing tables (stage) STATEMENT 104
+117 117 stage/sql/Starting cleanup (stage) STATEMENT 104
+118 118 stage/sql/Freeing items (stage) STATEMENT 104
+119 119 wait/io/socket/sql/client_connection send STATEMENT 104
+120 120 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 104
+121 122 stage/sql/Reset for next command (stage) STATEMENT 104
+122 122 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 121
+123 123 idle idle NULL NULL
+124 144 statement/sql/select select "MARKER_END" as marker NULL NULL
+125 128 stage/sql/Init (stage) STATEMENT 124
+126 126 wait/io/socket/sql/client_connection recv STAGE 125
+127 127 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 125
+128 128 wait/io/file/sql/query_log write STAGE 125
+129 129 stage/sql/Checking permissions (stage) STATEMENT 124
+130 130 stage/sql/Opening tables (stage) STATEMENT 124
+131 131 stage/sql/After opening tables (stage) STATEMENT 124
+132 132 stage/sql/Init (stage) STATEMENT 124
+133 133 stage/sql/Optimizing (stage) STATEMENT 124
+134 134 stage/sql/Executing (stage) STATEMENT 124
+135 135 stage/sql/End of update loop (stage) STATEMENT 124
+136 136 stage/sql/Query end (stage) STATEMENT 124
+137 137 stage/sql/Commit (stage) STATEMENT 124
+138 138 stage/sql/Closing tables (stage) STATEMENT 124
+139 139 stage/sql/Starting cleanup (stage) STATEMENT 124
+140 140 stage/sql/Freeing items (stage) STATEMENT 124
+141 141 wait/io/socket/sql/client_connection send STATEMENT 124
+142 142 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 124
+143 144 stage/sql/Reset for next command (stage) STATEMENT 124
+144 144 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 143
disconnect con1;
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index bb572237483..299551051c9 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -21,7 +21,8 @@ declare debug integer default 0;
declare pfs_cursor CURSOR FOR
select table_name from information_schema.tables
where table_schema= 'performance_schema'
- and table_name like "events_%_by_event_name%";
+ and table_name like "events_%_by_event_name%"
+ order by table_name;
declare continue handler for sqlstate '02000'
set done = 1;
select (instr_name like "wait/%") or (instr_name like "idle/%") into is_wait;
@@ -120,7 +121,7 @@ performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
+performance_schema_max_stage_classes 160
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index 7bb7627142e..0a038000536 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -1,6 +1,6 @@
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+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;
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index b1bc1857b52..5443c178502 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -50,7 +50,7 @@ performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
+performance_schema_max_stage_classes 160
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result
index 045e3232fda..32e3a724b5e 100644
--- a/mysql-test/suite/perfschema/r/read_only.result
+++ b/mysql-test/suite/perfschema/r/read_only.result
@@ -12,8 +12,8 @@ select @@global.read_only;
0
show grants;
Grants for pfsuser@localhost
-GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
-GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
+GRANT USAGE ON *.* TO `pfsuser`@`localhost`
+GRANT SELECT, UPDATE ON `performance_schema`.* TO `pfsuser`@`localhost`
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
@@ -25,8 +25,8 @@ select @@global.read_only;
1
show grants;
Grants for pfsuser@localhost
-GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
-GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
+GRANT USAGE ON *.* TO `pfsuser`@`localhost`
+GRANT SELECT, UPDATE ON `performance_schema`.* TO `pfsuser`@`localhost`
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
@@ -40,8 +40,8 @@ select @@global.read_only;
1
show grants;
Grants for pfsuser@localhost
-GRANT SUPER ON *.* TO 'pfsuser'@'localhost'
-GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
+GRANT SUPER ON *.* TO `pfsuser`@`localhost`
+GRANT SELECT, UPDATE ON `performance_schema`.* TO `pfsuser`@`localhost`
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index 8dcecf0dc9c..3fcf7367b53 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -62,7 +62,9 @@ where event_name like "%MYSQL_BIN_LOG%"
and event_name not like "%MYSQL_BIN_LOG::COND_xid_list"
order by event_name;
EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_bin_log_updated MANY
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_relay_log_updated 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
@@ -81,7 +83,10 @@ where event_name like "%MYSQL_RELAY_LOG%"
and event_name not like "%MYSQL_RELAY_LOG::update_cond"
order by event_name;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_bin_log_updated 0 0 0 0 0
wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy 0 0 0 0 0
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_relay_log_updated 0 0 0 0 0
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_binlog_end_pos 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
connection slave;
"============ Performance schema on slave ============"
@@ -142,7 +147,9 @@ where event_name like "%MYSQL_BIN_LOG%"
and event_name not like "%MYSQL_BIN_LOG::COND_xid_list"
order by event_name;
EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_bin_log_updated NONE
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_relay_log_updated 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
@@ -184,6 +191,9 @@ where event_name like "%MYSQL_RELAY_LOG%"
and event_name not like "%MYSQL_RELAY_LOG::update_cond"
order by event_name;
EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_bin_log_updated NONE
wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy NONE
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_relay_log_updated MANY
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_binlog_end_pos NONE
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
index b0570d70602..f31bb1a8b7a 100644
--- a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
+++ b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
@@ -10,7 +10,7 @@ WHERE name IN (
AND enabled = 'yes' AND timed = 'no'
ORDER BY name;
NAME ENABLED TIMED
-stage/sql/creating table YES NO
+stage/sql/Creating table YES NO
wait/synch/mutex/sql/LOCK_plugin YES NO
wait/synch/mutex/sql/LOCK_user_conn YES NO
SELECT * FROM performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/sizing_default.result b/mysql-test/suite/perfschema/r/sizing_default.result
index 1ca202e821f..07fbf35619b 100644
--- a/mysql-test/suite/perfschema/r/sizing_default.result
+++ b/mysql-test/suite/perfschema/r/sizing_default.result
@@ -33,7 +33,7 @@ performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 9102
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 322
-performance_schema_max_stage_classes 150
+performance_schema_max_stage_classes\t160
performance_schema_max_table_handles 4000
performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/sizing_high.result b/mysql-test/suite/perfschema/r/sizing_high.result
index b633d5fce8d..1cf84a14d22 100644
--- a/mysql-test/suite/perfschema/r/sizing_high.result
+++ b/mysql-test/suite/perfschema/r/sizing_high.result
@@ -33,7 +33,7 @@ performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 30800
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 420
-performance_schema_max_stage_classes 150
+performance_schema_max_stage_classes\t160
performance_schema_max_table_handles 800
performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/sizing_low.result b/mysql-test/suite/perfschema/r/sizing_low.result
index a698f55aa07..4569ebd7a5e 100644
--- a/mysql-test/suite/perfschema/r/sizing_low.result
+++ b/mysql-test/suite/perfschema/r/sizing_low.result
@@ -33,7 +33,7 @@ performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 1612
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 67
-performance_schema_max_stage_classes 150
+performance_schema_max_stage_classes\t160
performance_schema_max_table_handles 112
performance_schema_max_table_instances 445
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/sizing_med.result b/mysql-test/suite/perfschema/r/sizing_med.result
index 2eda017467a..24fba02d16b 100644
--- a/mysql-test/suite/perfschema/r/sizing_med.result
+++ b/mysql-test/suite/perfschema/r/sizing_med.result
@@ -33,7 +33,7 @@ performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 2222
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 232
-performance_schema_max_stage_classes 150
+performance_schema_max_stage_classes\t160
performance_schema_max_table_handles 573
performance_schema_max_table_instances 556
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/sizing_off.result b/mysql-test/suite/perfschema/r/sizing_off.result
index b4ca7b1b9be..e49a9824f42 100644
--- a/mysql-test/suite/perfschema/r/sizing_off.result
+++ b/mysql-test/suite/perfschema/r/sizing_off.result
@@ -24,7 +24,7 @@ performance_schema_max_rwlock_classes 40
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_stage_classes\t160
performance_schema_max_table_handles -1
performance_schema_max_table_instances -1
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_function.result b/mysql-test/suite/perfschema/r/stage_mdl_function.result
index eb72fa338aa..5f55dd6c28e 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_function.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_function.result
@@ -14,23 +14,23 @@ 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/executing STATEMENT
-user1 stage/sql/Opening tables STATEMENT
-user1 stage/sql/After opening tables STATEMENT
-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/Closing tables STATEMENT
+user1 stage/sql/End of update loop STATEMENT
+user1 stage/sql/Query end STATEMENT
+user1 stage/sql/Commit 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
+user1 stage/sql/Closing tables STATEMENT
+user1 stage/sql/Starting cleanup STATEMENT
+user1 stage/sql/Freeing items STATEMENT
+user1 stage/sql/Reset for next command STATEMENT
call dump_one_thread('user2');
username event_name sql_text
user2 statement/sql/drop_function drop function test.f1
username event_name nesting_event_type
user2 stage/sql/Waiting for stored function metadata lock STATEMENT
username event_name nesting_event_type
-user2 stage/sql/init STATEMENT
+user2 stage/sql/Init STATEMENT
connection con1;
select f1();
f1()
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_global.result b/mysql-test/suite/perfschema/r/stage_mdl_global.result
index 05ffb96af78..5dab04b6044 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_global.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_global.result
@@ -8,21 +8,23 @@ username event_name sql_text
user1 statement/sql/flush flush tables with read lock
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/init STATEMENT
-user1 stage/sql/query end STATEMENT
-user1 stage/sql/closing tables STATEMENT
-user1 stage/sql/freeing items STATEMENT
-user1 stage/sql/cleaning up STATEMENT
+user1 stage/sql/Init STATEMENT
+user1 stage/sql/Init STATEMENT
+user1 stage/sql/Query end STATEMENT
+user1 stage/sql/Commit STATEMENT
+user1 stage/sql/Closing tables STATEMENT
+user1 stage/sql/Commit_implicit STATEMENT
+user1 stage/sql/Starting cleanup STATEMENT
+user1 stage/sql/Freeing items STATEMENT
+user1 stage/sql/Reset for next command STATEMENT
call dump_one_thread('user2');
username event_name sql_text
user2 statement/sql/insert insert into test.t1 values (1), (2), (3)
username event_name nesting_event_type
user2 stage/sql/Waiting for global read lock STATEMENT
username event_name nesting_event_type
-user2 stage/sql/init STATEMENT
-user2 stage/sql/checking permissions STATEMENT
+user2 stage/sql/Init STATEMENT
+user2 stage/sql/Checking permissions STATEMENT
user2 stage/sql/Opening tables STATEMENT
connection con1;
unlock tables;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
index 8f7e70bc740..6362f725b88 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
@@ -21,23 +21,23 @@ 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/closing tables STATEMENT
-user1 stage/sql/Opening tables STATEMENT
-user1 stage/sql/After opening tables STATEMENT
-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/Closing tables STATEMENT
+user1 stage/sql/End of update loop STATEMENT
+user1 stage/sql/Query end STATEMENT
+user1 stage/sql/Commit 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
+user1 stage/sql/Closing tables STATEMENT
+user1 stage/sql/Starting cleanup STATEMENT
+user1 stage/sql/Freeing items STATEMENT
+user1 stage/sql/Reset for next command STATEMENT
call dump_one_thread('user2');
username event_name sql_text
user2 statement/sql/drop_procedure drop procedure test.p1
username event_name nesting_event_type
user2 stage/sql/Waiting for stored procedure metadata lock STATEMENT
username event_name nesting_event_type
-user2 stage/sql/init STATEMENT
+user2 stage/sql/Init STATEMENT
connection con1;
select test.f1();
test.f1()
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_table.result b/mysql-test/suite/perfschema/r/stage_mdl_table.result
index f7d519bedeb..c703e910891 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_table.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_table.result
@@ -16,30 +16,29 @@ 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/statistics STATEMENT
-user1 stage/sql/preparing STATEMENT
-user1 stage/sql/executing STATEMENT
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/End of update loop STATEMENT
+user1 stage/sql/Query end STATEMENT
+user1 stage/sql/Commit 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
+user1 stage/sql/Closing tables STATEMENT
+user1 stage/sql/Starting cleanup STATEMENT
+user1 stage/sql/Freeing items STATEMENT
+user1 stage/sql/Reset for next command STATEMENT
call dump_one_thread('user2');
username event_name sql_text
user2 statement/sql/alter_table alter table test.t1 add column (b int)
username event_name nesting_event_type
user2 stage/sql/Waiting for table metadata lock STATEMENT
username event_name nesting_event_type
-user2 stage/sql/init STATEMENT
-user2 stage/sql/checking permissions STATEMENT
-user2 stage/sql/checking permissions STATEMENT
-user2 stage/sql/init STATEMENT
+user2 stage/sql/Init STATEMENT
+user2 stage/sql/Checking permissions STATEMENT
+user2 stage/sql/Init for update STATEMENT
user2 stage/sql/Opening tables STATEMENT
user2 stage/sql/After opening tables STATEMENT
-user2 stage/sql/setup STATEMENT
-user2 stage/sql/creating table STATEMENT
+user2 stage/sql/Setup STATEMENT
+user2 stage/sql/Creating table STATEMENT
user2 stage/sql/After create STATEMENT
connection con1;
commit;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index 382824458a0..294c3a72f58 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
select * from performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index 6fae8be810f..6ed2234babe 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
select * from performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index ff9c6f93268..f942f2ee570 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
select * from performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 38e1f59cd39..fb02ace2ed4 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
select * from performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index a270b4a6320..cf210c0935c 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show status like "performance_schema%";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index 05d67d88a8b..c02b75e5c33 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 0
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_accounts_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index 574c8d4173b..a3e16b4be8d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 0
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index ea5c7a69125..df5373ead87 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 0
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index 0f93054bfd4..5e6da344a70 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 0
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index 71004d68f5e..33dce305ef3 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 0
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index 329f74a4fff..a4f362b256f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 0
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_hosts_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index cda2719cc37..9fadcc581c7 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 0
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index 0ea5fe44521..c443a4e58db 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 0
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index 29a17e6a3ac..c3939ced060 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 0
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index 8b214077f37..7892c6ba753 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 0
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index 3a0588d616d..24b0ee16685 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 0
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_setup_actors_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index 89763379b99..630284c69be 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 0
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_setup_objects_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index 0b14c6caf15..45e353a1372 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 0
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_socket_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index 599e09f6c99..0c78ec66db9 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 0
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_socket_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index 1d53efc500c..f3e95c3ac7b 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 0
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_stage_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index 370ec61ff67..2e5005323dd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 0
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_events_stages_history_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index d8018e0ba44..cb29a5812fc 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 0
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_events_stages_history_long_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
index a617e7edb0a..d62b4ba1daa 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_statement_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index 8d196aa9a4a..ed4b2870e6d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 0
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_events_statements_history_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 360e8db910b..a48d5fa9339 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 0
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_events_statements_history_long_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index 01b7233582e..5bc38231122 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 0
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_table_instances";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index 5608c324321..def59b8b54b 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 0
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_table_instances";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index b1a7758a9d8..16952409b56 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 0
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index ad0353589ad..e3ccd3f91e6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 0
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index 2e1c097e28b..7f006d6b47a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 0
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_users_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index a3a9cbeee11..27122723030 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 0
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_events_waits_history_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index e5465aa6bbb..16ee8a30343 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 0
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_events_waits_history_long_size";
diff --git a/mysql-test/suite/perfschema/r/start_server_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result
index d28eed31e7d..2aa5658f98c 100644
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 0
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 0
-performance_schema_events_stages_history_size 0
-performance_schema_events_statements_history_long_size 0
-performance_schema_events_statements_history_size 0
-performance_schema_events_waits_history_long_size 0
-performance_schema_events_waits_history_size 0
-performance_schema_hosts_size 0
-performance_schema_max_cond_classes 0
-performance_schema_max_cond_instances 0
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 0
-performance_schema_max_file_handles 0
-performance_schema_max_file_instances 0
-performance_schema_max_mutex_classes 0
-performance_schema_max_mutex_instances 0
-performance_schema_max_rwlock_classes 0
-performance_schema_max_rwlock_instances 0
-performance_schema_max_socket_classes 0
-performance_schema_max_socket_instances 0
-performance_schema_max_stage_classes 0
-performance_schema_max_table_handles 0
-performance_schema_max_table_instances 0
-performance_schema_max_thread_classes 0
-performance_schema_max_thread_instances 0
-performance_schema_session_connect_attrs_size 0
-performance_schema_setup_actors_size 0
-performance_schema_setup_objects_size 0
-performance_schema_users_size 0
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema%";
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index 5666b96be8e..8c8b8a3a7bb 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
0
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema OFF
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show status like "performance_schema%";
@@ -131,6 +44,9 @@ Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
+show variables like "performance_schema";
+Variable_name Value
+performance_schema OFF
select * from performance_schema.setup_consumers;
NAME ENABLED
select * from performance_schema.setup_instruments;
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index a270b4a6320..cf210c0935c 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -17,93 +17,6 @@ count(*) > 3
select count(*) from performance_schema.setup_timers;
count(*)
4
-select * from performance_schema.accounts;
-select * from performance_schema.cond_instances;
-select * from performance_schema.events_stages_current;
-select * from performance_schema.events_stages_history;
-select * from performance_schema.events_stages_history_long;
-select * from performance_schema.events_stages_summary_by_account_by_event_name;
-select * from performance_schema.events_stages_summary_by_host_by_event_name;
-select * from performance_schema.events_stages_summary_by_thread_by_event_name;
-select * from performance_schema.events_stages_summary_by_user_by_event_name;
-select * from performance_schema.events_stages_summary_global_by_event_name;
-select * from performance_schema.events_statements_current;
-select * from performance_schema.events_statements_history;
-select * from performance_schema.events_statements_history_long;
-select * from performance_schema.events_statements_summary_by_account_by_event_name;
-select * from performance_schema.events_statements_summary_by_digest;
-select * from performance_schema.events_statements_summary_by_host_by_event_name;
-select * from performance_schema.events_statements_summary_by_thread_by_event_name;
-select * from performance_schema.events_statements_summary_by_user_by_event_name;
-select * from performance_schema.events_statements_summary_global_by_event_name;
-select * from performance_schema.events_waits_current;
-select * from performance_schema.events_waits_history;
-select * from performance_schema.events_waits_history_long;
-select * from performance_schema.events_waits_summary_by_account_by_event_name;
-select * from performance_schema.events_waits_summary_by_host_by_event_name;
-select * from performance_schema.events_waits_summary_by_instance;
-select * from performance_schema.events_waits_summary_by_thread_by_event_name;
-select * from performance_schema.events_waits_summary_by_user_by_event_name;
-select * from performance_schema.events_waits_summary_global_by_event_name;
-select * from performance_schema.file_instances;
-select * from performance_schema.file_summary_by_event_name;
-select * from performance_schema.file_summary_by_instance;
-select * from performance_schema.host_cache;
-select * from performance_schema.hosts;
-select * from performance_schema.mutex_instances;
-select * from performance_schema.objects_summary_global_by_type;
-select * from performance_schema.performance_timers;
-select * from performance_schema.rwlock_instances;
-select * from performance_schema.session_account_connect_attrs;
-select * from performance_schema.session_connect_attrs;
-select * from performance_schema.setup_actors;
-select * from performance_schema.setup_consumers;
-select * from performance_schema.setup_instruments;
-select * from performance_schema.setup_objects;
-select * from performance_schema.setup_timers;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
-select * from performance_schema.table_io_waits_summary_by_index_usage;
-select * from performance_schema.table_io_waits_summary_by_table;
-select * from performance_schema.table_lock_waits_summary_by_table;
-select * from performance_schema.threads;
-select * from performance_schema.users;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show status like "performance_schema%";
diff --git a/mysql-test/suite/perfschema/r/start_server_variables.result b/mysql-test/suite/perfschema/r/start_server_variables.result
new file mode 100644
index 00000000000..3f2df9603b3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_variables.result
@@ -0,0 +1,56 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_digest_length 1024
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 40
+performance_schema_max_rwlock_instances 5000
+performance_schema_max_socket_classes 10
+performance_schema_max_socket_instances 1000
+performance_schema_max_stage_classes 160
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_session_connect_attrs_size 2048
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
index 73a4696070d..dfaa91a3fbc 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
index bb7cfdc92c7..2a6537fd6bd 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
index 816df3de09a..3eddd735aa2 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
index d44488d75f9..fed189a7667 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
index a70e6ee1df5..ee95e4c0417 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -37,66 +37,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
index d4d19f5db05..d6e4e674258 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -36,66 +36,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
index 7fa8781ad49..2d2a55efa77 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -37,66 +37,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
index e138ad6542a..de8fc4702a6 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -36,66 +36,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result
index 9384f07f0f0..77a714563fe 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
index 42785a22c32..c176679a95d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
index 1066228199d..38c8813ea18 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
index 4e36b9d75a6..9144d81c8a0 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
index ee32194b651..10736990dbe 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
index 2d3d2d38079..a8fd0a7eb72 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
index b47bf2dbe1e..701a25194f4 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
index 92c12d84f0f..4d8d625ee00 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
index 9b78d257e0e..8a8de99fd4f 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
index c5481451fd3..987732538c4 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
index 81f424800d6..324c6534303 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
index 15e62be4b22..914bcc7084b 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
index dbcf7aca9a4..f92ebe8e467 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
index 1230f1e91fe..8eb52d58efc 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
index 1b04e9fe898..fba8a48ad35 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
index f376160939d..2bcabb81def 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
index aae2c54e25c..323570b7d40 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
index 23f800e81d9..3a3d093d91e 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
index 99734474536..04c4fe4d949 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
index fe63232cf52..61783e41b1b 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
index 376333fc794..2be8dbdf5b3 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
index 191bd161d92..0ded9d54590 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
index 80590d5e468..13642f45b5a 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
index e9b39c5db14..61c649bd2cf 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
@@ -39,66 +39,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
index 92a020f1984..5d5282ba899 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
@@ -38,66 +38,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
index 4cdcbc45d7d..8da7fca1d3e 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
index 038335c22cb..88f658778c4 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
index ac5cde25522..72bc52cefa3 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
@@ -41,66 +41,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
index faaf925dacd..d2ee0bd6c5e 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
@@ -40,66 +40,6 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables where
-`Variable_name` != "performance_schema_max_statement_classes" and
-`Variable_name` like "performance_schema%";
-Variable_name Value
-performance_schema ON
-performance_schema_accounts_size 100
-performance_schema_digests_size 200
-performance_schema_events_stages_history_long_size 1000
-performance_schema_events_stages_history_size 10
-performance_schema_events_statements_history_long_size 1000
-performance_schema_events_statements_history_size 10
-performance_schema_events_waits_history_long_size 10000
-performance_schema_events_waits_history_size 10
-performance_schema_hosts_size 100
-performance_schema_max_cond_classes 80
-performance_schema_max_cond_instances 1000
-performance_schema_max_digest_length 1024
-performance_schema_max_file_classes 50
-performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 10000
-performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 40
-performance_schema_max_rwlock_instances 5000
-performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 1000
-performance_schema_max_stage_classes 150
-performance_schema_max_table_handles 1000
-performance_schema_max_table_instances 500
-performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 200
-performance_schema_session_connect_attrs_size 2048
-performance_schema_setup_actors_size 100
-performance_schema_setup_objects_size 100
-performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
"================== Step 1 =================="
call dump_thread();
username status
diff --git a/mysql-test/suite/perfschema/r/threads_innodb,xtradb.rdiff-disabled b/mysql-test/suite/perfschema/r/threads_innodb,xtradb.rdiff-disabled
deleted file mode 100644
index bfa17407049..00000000000
--- a/mysql-test/suite/perfschema/r/threads_innodb,xtradb.rdiff-disabled
+++ /dev/null
@@ -1,10 +0,0 @@
---- suite/perfschema/r/threads_innodb.result 2013-12-20 20:19:06.000000000 +0100
-+++ suite/perfschema/r/threads_innodb.reject 2014-05-06 13:08:05.000000000 +0200
-@@ -6,6 +6,7 @@
- GROUP BY name;
- name type processlist_user processlist_host processlist_db processlist_command processlist_time processlist_state processlist_info parent_thread_id role instrumented
- thread/innodb/io_handler_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
-+thread/innodb/lru_manager_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
- thread/innodb/page_cleaner_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
- thread/innodb/srv_error_monitor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
- thread/innodb/srv_lock_timeout_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result
index 9f9c46fe6a6..31f91fc6464 100644
--- a/mysql-test/suite/perfschema/r/threads_mysql.result
+++ b/mysql-test/suite/perfschema/r/threads_mysql.result
@@ -11,7 +11,7 @@ name thread/sql/main
type BACKGROUND
processlist_user NULL
processlist_host NULL
-processlist_db NULL
+processlist_db mysql
processlist_command NULL
processlist_info NULL
unified_parent_thread_id NULL
@@ -99,7 +99,7 @@ name thread/sql/event_worker
type FOREGROUND
processlist_user root
processlist_host localhost
-processlist_db NULL
+processlist_db test
processlist_command Sleep
processlist_info SELECT SLEEP(3)
unified_parent_thread_id unified parent_thread_id
diff --git a/mysql-test/suite/perfschema/r/view_table_io.result b/mysql-test/suite/perfschema/r/view_table_io.result
index 5d8ad26ae77..2f9a70cdeaa 100644
--- a/mysql-test/suite/perfschema/r/view_table_io.result
+++ b/mysql-test/suite/perfschema/r/view_table_io.result
@@ -51,7 +51,7 @@ bar 2
insert into marker set a = 1;
optimize table test.v1;
Table Op Msg_type Msg_text
-test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize Error 'test.v1' is not of type 'BASE TABLE'
test.v1 optimize status Operation failed
insert into marker set a = 1;
select * from test.v1;
diff --git a/mysql-test/suite/perfschema/t/dml_handler.test b/mysql-test/suite/perfschema/t/dml_handler.test
index db74c85350a..f12cc82f22f 100644
--- a/mysql-test/suite/perfschema/t/dml_handler.test
+++ b/mysql-test/suite/perfschema/t/dml_handler.test
@@ -18,7 +18,8 @@
CREATE TEMPORARY TABLE table_list (id INT AUTO_INCREMENT, PRIMARY KEY (id)) AS
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_SCHEMA='performance_schema';
+ WHERE TABLE_SCHEMA='performance_schema'
+ ORDER BY TABLE_NAME;
SELECT COUNT(*) FROM table_list INTO @table_count;
diff --git a/mysql-test/suite/perfschema/t/information_schema.test b/mysql-test/suite/perfschema/t/information_schema.test
index 24325710174..0152ef21905 100644
--- a/mysql-test/suite/perfschema/t/information_schema.test
+++ b/mysql-test/suite/perfschema/t/information_schema.test
@@ -11,42 +11,52 @@
select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
# TABLESPACE_NAME does not exist in 5.4
# select lower(TABLE_NAME), CREATE_OPTIONS, TABLESPACE_NAME
# from information_schema.tables
-# where TABLE_SCHEMA='performance_schema';
+# where TABLE_SCHEMA='performance_schema'
+# order by table_name;
select lower(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
- where TABLE_SCHEMA='performance_schema';
+ where TABLE_SCHEMA='performance_schema'
+ order by table_name;
diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test
index 9ab59157f50..d0547d8a932 100644
--- a/mysql-test/suite/perfschema/t/nesting.test
+++ b/mysql-test/suite/perfschema/t/nesting.test
@@ -39,6 +39,7 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES'
'wait/io/socket/sql/client_connection',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/synch/mutex/sql/THD::LOCK_thd_data',
+ 'wait/synch/mutex/sql/THD::LOCK_thd_kill',
'wait/io/file/sql/query_log');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
diff --git a/mysql-test/suite/perfschema/t/ortho_iter.test b/mysql-test/suite/perfschema/t/ortho_iter.test
index 0a90831ae70..f7e68538906 100644
--- a/mysql-test/suite/perfschema/t/ortho_iter.test
+++ b/mysql-test/suite/perfschema/t/ortho_iter.test
@@ -35,7 +35,8 @@ begin
declare pfs_cursor CURSOR FOR
select table_name from information_schema.tables
where table_schema= 'performance_schema'
- and table_name like "events_%_by_event_name%";
+ and table_name like "events_%_by_event_name%"
+ order by table_name;
declare continue handler for sqlstate '02000'
set done = 1;
diff --git a/mysql-test/suite/perfschema/t/stage_mdl_global-master.opt b/mysql-test/suite/perfschema/t/stage_mdl_global-master.opt
deleted file mode 100644
index a00258bc48c..00000000000
--- a/mysql-test/suite/perfschema/t/stage_mdl_global-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---query_cache_type=1
diff --git a/mysql-test/suite/perfschema/t/start_server_off.test b/mysql-test/suite/perfschema/t/start_server_off.test
index 8b58f8c0814..400303e05d2 100644
--- a/mysql-test/suite/perfschema/t/start_server_off.test
+++ b/mysql-test/suite/perfschema/t/start_server_off.test
@@ -7,6 +7,7 @@
# Expecting all off / zero
show status like "performance_schema%";
+show variables like "performance_schema";
# Expect all consumers disabled
@@ -44,5 +45,3 @@ truncate performance_schema.events_statements_history_long;
truncate performance_schema.events_waits_history_long;
truncate performance_schema.setup_objects;
truncate performance_schema.setup_actors;
-
-
diff --git a/mysql-test/suite/perfschema/t/start_server_variables.test b/mysql-test/suite/perfschema/t/start_server_variables.test
new file mode 100644
index 00000000000..57656f9e077
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_variables.test
@@ -0,0 +1,11 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# This has a stable output, printing the result:
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
diff --git a/mysql-test/suite/perfschema_stress/t/read.test b/mysql-test/suite/perfschema_stress/t/read.test
index c330444f600..829c03985ed 100644
--- a/mysql-test/suite/perfschema_stress/t/read.test
+++ b/mysql-test/suite/perfschema_stress/t/read.test
@@ -1,4 +1,5 @@
--source include/not_embedded.inc
+--source include/have_perfschema.inc
SELECT * FROM performance_schema.setup_instruments
WHERE ENABLED='NO' AND TIMED='NO';
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
index 4785bef3ef7..7ae385b79cb 100644
--- a/mysql-test/suite/plugins/r/auth_ed25519.result
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -37,7 +37,7 @@ PLUGIN_AUTH_VERSION 1.0
create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
show grants for test1@localhost;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost' IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
+GRANT USAGE ON *.* TO `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
connect(localhost,test1,public,test,PORT,SOCKET);
connect con1, localhost, test1, public;
ERROR 28000: Access denied for user 'test1'@'localhost' (using password: YES)
diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result
index 0a20a1a8a5f..41073359e93 100644
--- a/mysql-test/suite/plugins/r/qc_info.result
+++ b/mysql-test/suite/plugins/r/qc_info.result
@@ -27,15 +27,29 @@ set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary'
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 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 #
+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 HITS
+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 # 0
+test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 # 0
+reset query cache;
+select * from t1;
+a
+1
+2
+3
+select * from t1;
+a
+1
+2
+3
+select hits, statement_text from information_schema.query_cache_info;
+hits statement_text
+1 select * from t1
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 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
+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 HITS
set global query_cache_size= default;
set global query_cache_type=default;
show query_cache_info;
diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result
index c5fcb1f5981..78ea78a33b8 100644
--- a/mysql-test/suite/plugins/r/qc_info_priv.result
+++ b/mysql-test/suite/plugins/r/qc_info_priv.result
@@ -27,9 +27,9 @@ set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary'
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 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 #
+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 HITS
+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 # 0
+test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 # 0
create user mysqltest;
connect conn1,localhost,mysqltest,,;
connection conn1;
diff --git a/mysql-test/suite/plugins/t/qc_info.test b/mysql-test/suite/plugins/t/qc_info.test
index 46184744d7e..8803e907b89 100644
--- a/mysql-test/suite/plugins/t/qc_info.test
+++ b/mysql-test/suite/plugins/t/qc_info.test
@@ -2,6 +2,12 @@ set @save_query_cache_size=@@global.query_cache_size;
--source include/default_charset.inc
--source qc_info_init.inc
+# test that hits are correctly incremented
+reset query cache;
+select * from t1;
+select * from t1;
+select hits, statement_text from information_schema.query_cache_info;
+
drop table t1;
# the query was invalidated
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
diff --git a/mysql-test/suite/roles/acl_statistics.result b/mysql-test/suite/roles/acl_statistics.result
index bf74cbf2e85..46e48b86936 100644
--- a/mysql-test/suite/roles/acl_statistics.result
+++ b/mysql-test/suite/roles/acl_statistics.result
@@ -4,6 +4,8 @@ Acl_column_grants 0
Acl_database_grants 2
Acl_function_grants 0
Acl_procedure_grants 0
+Acl_package_spec_grants 0
+Acl_package_body_grants 0
Acl_proxy_users 2
Acl_role_grants 0
Acl_roles 0
@@ -67,6 +69,8 @@ Acl_column_grants 2
Acl_database_grants 4
Acl_function_grants 3
Acl_procedure_grants 2
+Acl_package_spec_grants 0
+Acl_package_body_grants 0
Acl_proxy_users 3
Acl_role_grants 4
Acl_roles 2
diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result
index 87d2888b47c..a7841fd3b57 100644
--- a/mysql-test/suite/roles/admin.result
+++ b/mysql-test/suite/roles/admin.result
@@ -27,22 +27,22 @@ grant select on *.* to foo@localhost with admin option;
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 'admin option' at line 1
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role1 TO 'foo'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role1` TO `foo`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1'
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1`
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3` WITH ADMIN OPTION
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from mysql.roles_mapping;
Host User Role Admin_option
role1 role2 N
@@ -58,22 +58,22 @@ localhost root role4 Y
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role1 TO 'foo'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role1` TO `foo`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1'
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1`
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3` WITH ADMIN OPTION
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
@@ -89,21 +89,21 @@ revoke admin option for role2 from foo@localhost;
revoke admin option for role1 from root@localhost;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1' WITH ADMIN OPTION
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3'
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1` WITH ADMIN OPTION
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3`
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from mysql.roles_mapping;
Host User Role Admin_option
role1 role2 Y
@@ -118,21 +118,21 @@ localhost root role4 Y
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1' WITH ADMIN OPTION
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3'
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1` WITH ADMIN OPTION
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3`
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 YES NULL
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index a163ee82f42..ad0561aed4d 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -66,8 +66,8 @@ localhost r1 r2 N
localhost root r2 Y
SHOW GRANTS FOR r1@localhost;
Grants for r1@localhost
-GRANT r2 TO 'r1'@'localhost'
-GRANT USAGE ON *.* TO 'r1'@'localhost'
+GRANT `r2` TO `r1`@`localhost`
+GRANT USAGE ON *.* TO `r1`@`localhost`
DROP USER u1;
DROP ROLE r2;
DROP USER r1@localhost;
@@ -85,5 +85,5 @@ select * from mysql.roles_mapping;
Host User Role Admin_option
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
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 1a269d72eb7..afe00ed7729 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
@@ -5,7 +5,7 @@ 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
+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;
ERROR HY000: Operation DROP ROLE failed for 'test_role'
alter table user add column is_role enum('N', 'Y') default 'N' not null
@@ -15,7 +15,7 @@ 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
+ERROR HY000: Column count of mysql.user is wrong. Expected 46, found 45. 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
diff --git a/mysql-test/suite/roles/create_and_grant_role.result b/mysql-test/suite/roles/create_and_grant_role.result
index 883ae44397d..2a676115a2d 100644
--- a/mysql-test/suite/roles/create_and_grant_role.result
+++ b/mysql-test/suite/roles/create_and_grant_role.result
@@ -13,14 +13,14 @@ Host User Role Admin_option
localhost root r1 Y
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT 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'
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `r1`
+GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
drop role r1;
select * from mysql.roles_mapping;
Host User Role Admin_option
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index 0a83262add1..30911265436 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -38,9 +38,9 @@ connect c1, localhost, foo,,mysqltest1;
connection c1;
show grants;
Grants for foo@localhost
-GRANT role4 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT CREATE VIEW ON `mysqltest1`.* TO 'foo'@'localhost'
+GRANT `role4` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT CREATE VIEW ON `mysqltest1`.* TO `foo`@`localhost`
select * from test.v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from test.v2;
@@ -622,13 +622,13 @@ prepare stmt1 from 'grant select on *.* to utest';
execute stmt1;
show grants for utest;
Grants for utest@%
-GRANT SELECT ON *.* TO 'utest'@'%'
+GRANT SELECT ON *.* TO `utest`@`%`
drop user utest;
create role utest;
execute stmt1;
show grants for utest;
Grants for utest
-GRANT SELECT ON *.* TO 'utest'
+GRANT SELECT ON *.* TO `utest`
drop role utest;
#
# MDEV-13676: Field "create Procedure" is NULL, even if the the user
diff --git a/mysql-test/suite/roles/drop_routines.result b/mysql-test/suite/roles/drop_routines.result
index 11eda3a290f..7facb9fd1c9 100644
--- a/mysql-test/suite/roles/drop_routines.result
+++ b/mysql-test/suite/roles/drop_routines.result
@@ -7,15 +7,15 @@ grant r3 to r2;
grant r1 to u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
grant SELECT on *.* to u1;
grant INSERT on mysql.* to r1;
grant DELETE on mysql.roles_mapping to r2;
@@ -33,30 +33,30 @@ revoke execute on procedure mysql.test_proc from r2;
ERROR 42000: There is no such grant defined for user 'r2' on host '' on routine 'test_proc'
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r3` TO `r2`
show grants for r3;
Grants for r3
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r3'
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r3`
drop function mysql.test_func;
drop procedure mysql.test_proc;
create function mysql.test_func (s CHAR(20))
@@ -64,11 +64,11 @@ returns CHAR(50) DETERMINISTIC
return concat('Test string: ',s);
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r3` TO `r2`
connect u1,localhost,u1,,;
select mysql.test_func("none");
ERROR 42000: execute command denied to user 'u1'@'%' for routine 'mysql.test_func'
diff --git a/mysql-test/suite/roles/flush_roles-17898.result b/mysql-test/suite/roles/flush_roles-17898.result
index ae8fb0a27d2..970c0d12195 100644
--- a/mysql-test/suite/roles/flush_roles-17898.result
+++ b/mysql-test/suite/roles/flush_roles-17898.result
@@ -24,15 +24,15 @@ grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
Grants for u1@localhost
-GRANT r1 TO 'u1'@'localhost'
-GRANT USAGE ON *.* TO 'u1'@'localhost'
+GRANT `r1` TO `u1`@`localhost`
+GRANT USAGE ON *.* TO `u1`@`localhost`
show grants for r1;
Grants for r1
-GRANT r2 TO 'r1'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT SELECT ON `test`.* TO 'r2'
-GRANT SELECT ON `m_`.* TO 'r2'
+GRANT `r2` TO `r1`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT SELECT ON `test`.* TO `r2`
+GRANT SELECT ON `m_`.* TO `r2`
drop user u1@localhost;
drop role r1, r2;
insert mysql.db select * from db_copy;
diff --git a/mysql-test/suite/roles/grant-5771.result b/mysql-test/suite/roles/grant-5771.result
index 87797d8b9a4..14e033f4c29 100644
--- a/mysql-test/suite/roles/grant-5771.result
+++ b/mysql-test/suite/roles/grant-5771.result
@@ -21,13 +21,13 @@ show tables in mysqltest2;
Tables_in_mysqltest2
show grants;
Grants for foo@localhost
-GRANT r2 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT r1 TO 'r2'
-GRANT USAGE ON *.* TO 'r2'
-GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'r2'
-GRANT USAGE ON *.* TO 'r1'
-GRANT ALL PRIVILEGES ON `mysqltest1`.* TO 'r1'
+GRANT `r2` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT `r1` TO `r2`
+GRANT USAGE ON *.* TO `r2`
+GRANT ALL PRIVILEGES ON `mysqltest2`.* TO `r2`
+GRANT USAGE ON *.* TO `r1`
+GRANT ALL PRIVILEGES ON `mysqltest1`.* TO `r1`
connection default;
drop user foo@localhost;
drop role r1;
diff --git a/mysql-test/suite/roles/grant_empty.result b/mysql-test/suite/roles/grant_empty.result
index 3316c755b9f..2e4542993ba 100644
--- a/mysql-test/suite/roles/grant_empty.result
+++ b/mysql-test/suite/roles/grant_empty.result
@@ -9,8 +9,8 @@ current_user
@localhost
show grants;
Grants for @localhost
-GRANT r1 TO ''@'localhost'
-GRANT USAGE ON *.* TO ''@'localhost'
+GRANT `r1` TO ``@`localhost`
+GRANT USAGE ON *.* TO ``@`localhost`
connection default;
drop role r1;
drop user ''@localhost;
diff --git a/mysql-test/suite/roles/grant_proxy-5526.result b/mysql-test/suite/roles/grant_proxy-5526.result
index 7921969299a..8bfa8e3929c 100644
--- a/mysql-test/suite/roles/grant_proxy-5526.result
+++ b/mysql-test/suite/roles/grant_proxy-5526.result
@@ -3,7 +3,7 @@ create user user;
grant proxy on r1 to user;
show grants for user;
Grants for user@%
-GRANT USAGE ON *.* TO 'user'@'%'
+GRANT USAGE ON *.* TO `user`@`%`
GRANT PROXY ON 'r1'@'%' TO 'user'@'%'
drop user user;
drop role r1;
diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result
index 436bec92a8f..e231a465317 100644
--- a/mysql-test/suite/roles/grant_revoke_current.result
+++ b/mysql-test/suite/roles/grant_revoke_current.result
@@ -14,30 +14,30 @@ r1
grant select on *.* to current_role;
show grants for current_role;
Grants for r1
-GRANT SELECT ON *.* TO 'r1'
-GRANT INSERT ON `test`.* TO 'r1'
+GRANT SELECT ON *.* TO `r1`
+GRANT INSERT ON `test`.* TO `r1`
revoke insert on test.* from current_role;
show grants for current_role;
Grants for r1
-GRANT SELECT ON *.* TO 'r1'
+GRANT SELECT ON *.* TO `r1`
revoke all, grant option from current_role;
show grants for current_role;
Grants for r1
-GRANT USAGE ON *.* TO '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 `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 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 `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'
+GRANT USAGE ON *.* TO `r1`
set password='';
update mysql.user set plugin='';
drop role r1;
diff --git a/mysql-test/suite/roles/ip-6401.result b/mysql-test/suite/roles/ip-6401.result
index 1afd649636e..723916f9211 100644
--- a/mysql-test/suite/roles/ip-6401.result
+++ b/mysql-test/suite/roles/ip-6401.result
@@ -4,8 +4,8 @@ grant r1 to foo@'127.0.0.1';
connect con1,127.0.0.1,foo,,;
show grants;
Grants for foo@127.0.0.1
-GRANT r1 TO 'foo'@'127.0.0.1'
-GRANT USAGE ON *.* TO 'foo'@'127.0.0.1'
+GRANT `r1` TO `foo`@`127.0.0.1`
+GRANT USAGE ON *.* TO `foo`@`127.0.0.1`
set role r1;
select * from information_schema.enabled_roles;
ROLE_NAME
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.result b/mysql-test/suite/roles/prepare_stmt_with_role.result
index 0352502c35c..ecd662c7d3e 100644
--- a/mysql-test/suite/roles/prepare_stmt_with_role.result
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.result
@@ -17,8 +17,8 @@ user host is_role
developers Y
SHOW GRANTS;
Grants for root@localhost
-GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT `developers` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
# Test reexecution.
EXECUTE stmtCreateRole;
@@ -40,8 +40,8 @@ Host User Role Admin_option
localhost root developers Y
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT developers TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `developers` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Test revoking a role.
#
@@ -52,16 +52,16 @@ EXECUTE stmtRevokeRole;
ERROR HY000: Cannot revoke role 'developers' from: 'test_user'@'%'
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
EXECUTE stmtGrantRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT developers TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `developers` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Now drop the role.
#
@@ -78,11 +78,11 @@ SELECT * FROM mysql.roles_mapping;
Host User Role Admin_option
SHOW GRANTS;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Test reexecution.
#
@@ -96,12 +96,12 @@ Host User Role Admin_option
localhost root developers Y
SHOW GRANTS;
Grants for root@localhost
-GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT `developers` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
EXECUTE stmtDropRole;
# Cleanup.
DROP USER test_user;
diff --git a/mysql-test/suite/roles/rebuild_role_grants.result b/mysql-test/suite/roles/rebuild_role_grants.result
index 1068be9bc01..f8297d91024 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.result
+++ b/mysql-test/suite/roles/rebuild_role_grants.result
@@ -3,16 +3,16 @@ create user u1;
grant r1 to u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
create user u2;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
show grants for u2;
Grants for u2@%
-GRANT USAGE ON *.* TO 'u2'@'%'
+GRANT USAGE ON *.* TO `u2`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
% u1 r1 N
@@ -22,7 +22,7 @@ revoke r1 from u1;
ERROR HY000: Cannot revoke role 'r1' from: 'u1'@'%'
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root r1 Y
@@ -30,8 +30,8 @@ grant r1 to u1;
grant r1 to u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
% u1 r1 N
@@ -39,7 +39,7 @@ localhost root r1 Y
drop role r1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
create role r1;
diff --git a/mysql-test/suite/roles/recursive.result b/mysql-test/suite/roles/recursive.result
index 897577ba2ff..0d45a0e03d0 100644
--- a/mysql-test/suite/roles/recursive.result
+++ b/mysql-test/suite/roles/recursive.result
@@ -26,8 +26,8 @@ ERROR HY000: Cannot grant role 'role10' to: 'role2'
connect foo, localhost, foo;
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT role10 TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT `role10` TO `foo`@`localhost`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@localhost role10 NO NO
@@ -56,27 +56,27 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON *.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -114,28 +114,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
@@ -157,28 +157,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
@@ -202,28 +202,28 @@ count(concat(User))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
@@ -236,29 +236,29 @@ count(concat(User,Host))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO 'role3'
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO `role3`
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
diff --git a/mysql-test/suite/roles/recursive_dbug.result b/mysql-test/suite/roles/recursive_dbug.result
index cec461be4a2..417602c5c60 100644
--- a/mysql-test/suite/roles/recursive_dbug.result
+++ b/mysql-test/suite/roles/recursive_dbug.result
@@ -30,8 +30,8 @@ ERROR HY000: Cannot grant role 'role10' to: 'role2'
connect foo, localhost, foo;
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT role10 TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT `role10` TO `foo`@`localhost`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@localhost role10 NO NO
@@ -70,27 +70,27 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON *.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -138,28 +138,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
@@ -191,28 +191,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
@@ -246,28 +246,28 @@ count(concat(User))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
@@ -285,29 +285,29 @@ count(concat(User,Host))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO 'role3'
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO `role3`
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
diff --git a/mysql-test/suite/roles/revoke_all.result b/mysql-test/suite/roles/revoke_all.result
index 7e72b5bc766..864cc57a830 100644
--- a/mysql-test/suite/roles/revoke_all.result
+++ b/mysql-test/suite/roles/revoke_all.result
@@ -10,18 +10,18 @@ grant r1 to u1;
grant r4 to r1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
+GRANT `r4` TO `r3`
grant SELECT on *.* to u1;
grant INSERT on mysql.* to r1;
grant DELETE on mysql.roles_mapping to r2;
@@ -38,146 +38,146 @@ grant execute on procedure mysql.test_proc to r3;
grant execute on mysql.* to r4;
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
+GRANT `r4` TO `r3`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r3`
show grants for r3;
Grants for r3
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r4 TO 'r3'
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r4` TO `r3`
show grants for r4;
Grants for r4
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT USAGE ON *.* TO 'r4'
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r4;
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
+GRANT `r4` TO `r3`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r3`
show grants for r3;
Grants for r3
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r4 TO 'r3'
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r4` TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r3;
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r3` TO `r2`
show grants for r3;
Grants for r3
-GRANT USAGE ON *.* TO 'r3'
+GRANT USAGE ON *.* TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r2;
show grants for r1;
Grants for r1
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r4 TO 'r1'
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r4` TO `r1`
show grants for r2;
Grants for r2
-GRANT USAGE ON *.* TO 'r2'
+GRANT USAGE ON *.* TO `r2`
show grants for r3;
Grants for r3
-GRANT USAGE ON *.* TO 'r3'
+GRANT USAGE ON *.* TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r1;
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
show grants for r2;
Grants for r2
-GRANT USAGE ON *.* TO 'r2'
+GRANT USAGE ON *.* TO `r2`
show grants for r3;
Grants for r3
-GRANT USAGE ON *.* TO 'r3'
+GRANT USAGE ON *.* TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
drop function mysql.test_func;
drop procedure mysql.test_proc;
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
drop role r1, r2, r3, r4;
drop user u1;
diff --git a/mysql-test/suite/roles/role_case_sensitive-10744.result b/mysql-test/suite/roles/role_case_sensitive-10744.result
index b898310e83c..05ac5c95e31 100644
--- a/mysql-test/suite/roles/role_case_sensitive-10744.result
+++ b/mysql-test/suite/roles/role_case_sensitive-10744.result
@@ -21,8 +21,8 @@ grant select on secret_db.* to test_role;
grant test_role to test_user;
show grants for test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `test_role` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Now test the UPPER case role.
#
@@ -30,9 +30,9 @@ grant test_ROLE to test_user;
grant insert on secret_db.t1 to test_ROLE;
show grants for test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
-GRANT test_ROLE TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `test_role` TO `test_user`@`%`
+GRANT `test_ROLE` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
connect test_user,localhost,test_user;
#
# Test users privileges when interacting with those roles;
diff --git a/mysql-test/suite/roles/rpl_definer.result b/mysql-test/suite/roles/rpl_definer.result
index 2d10dc6cd7a..185b17fd51b 100644
--- a/mysql-test/suite/roles/rpl_definer.result
+++ b/mysql-test/suite/roles/rpl_definer.result
@@ -7,14 +7,14 @@ grant role2 to role1;
set role role1;
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-GRANT EXECUTE ON `test`.* TO 'role2'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE ON `test`.* TO `role2`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT role1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'role1'
-GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT `role1` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `role1`
+GRANT `role2` TO `root`@`localhost` WITH ADMIN OPTION
create definer=current_user procedure pcu() select current_user;
create definer=root@localhost procedure pu() select "root@localhost";
create definer=current_role procedure pcr() select current_role;
@@ -39,14 +39,14 @@ connection slave;
set role role1;
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-GRANT EXECUTE ON `test`.* TO 'role2'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE ON `test`.* TO `role2`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT role1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'role1'
-GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT `role1` TO `root`@`localhost` WITH ADMIN OPTION
+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 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
diff --git a/mysql-test/suite/roles/set_and_drop.result b/mysql-test/suite/roles/set_and_drop.result
index 2d3e675ebd0..87ccad2b447 100644
--- a/mysql-test/suite/roles/set_and_drop.result
+++ b/mysql-test/suite/roles/set_and_drop.result
@@ -56,9 +56,9 @@ drop role role2;
connection foo;
show grants;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
+GRANT `role1` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role1`
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -112,7 +112,7 @@ select a from mysqltest1.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'
+GRANT USAGE ON *.* TO `foo`@`localhost`
select * from information_schema.enabled_roles;
ROLE_NAME
NULL
diff --git a/mysql-test/suite/roles/set_default_role_clear.result b/mysql-test/suite/roles/set_default_role_clear.result
index 7f54b5eabcc..56e9662154c 100644
--- a/mysql-test/suite/roles/set_default_role_clear.result
+++ b/mysql-test/suite/roles/set_default_role_clear.result
@@ -4,8 +4,8 @@ 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'
+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'
@@ -14,9 +14,9 @@ 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'
+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
diff --git a/mysql-test/suite/roles/set_default_role_for.result b/mysql-test/suite/roles/set_default_role_for.result
index b55ca49c680..a3cd896ee84 100644
--- a/mysql-test/suite/roles/set_default_role_for.result
+++ b/mysql-test/suite/roles/set_default_role_for.result
@@ -18,9 +18,9 @@ ERROR OP000: User `user_a@localhost` has not been granted role `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'
+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
@@ -39,9 +39,9 @@ set default role role_b for current_user;
ERROR OP000: User `user_a@localhost` has not been granted role `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'
+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 ignore into mysql.user (user, host) values ('someuser', 'somehost');
@@ -53,9 +53,9 @@ 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'
+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;
diff --git a/mysql-test/suite/roles/set_default_role_invalid.result b/mysql-test/suite/roles/set_default_role_invalid.result
index 74d517b7c8f..9ebe3069b4c 100644
--- a/mysql-test/suite/roles/set_default_role_invalid.result
+++ b/mysql-test/suite/roles/set_default_role_invalid.result
@@ -5,8 +5,8 @@ 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'
+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;
@@ -21,9 +21,9 @@ 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'
+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
@@ -67,10 +67,10 @@ GRANT SELECT ON mysql.* TO b;
# Change user b (session 1: select_priv)
SHOW GRANTS FOR b;
Grants for b@%
-GRANT r1 TO 'b'@'%'
-GRANT r2 TO 'b'@'%'
-GRANT USAGE ON *.* TO 'b'@'%'
-GRANT SELECT ON `mysql`.* TO 'b'@'%'
+GRANT `r1` TO `b`@`%`
+GRANT `r2` TO `b`@`%`
+GRANT USAGE ON *.* TO `b`@`%`
+GRANT SELECT ON `mysql`.* TO `b`@`%`
SET DEFAULT ROLE r1 FOR a;
ERROR 42000: Access denied for user 'b'@'%' to database 'mysql'
SELECT CURRENT_ROLE;
@@ -92,10 +92,10 @@ GRANT UPDATE ON mysql.* TO b;
# Change user b
SHOW GRANTS FOR b;
Grants for b@%
-GRANT r1 TO 'b'@'%'
-GRANT r2 TO 'b'@'%'
-GRANT USAGE ON *.* TO 'b'@'%'
-GRANT SELECT, UPDATE ON `mysql`.* TO 'b'@'%'
+GRANT `r1` TO `b`@`%`
+GRANT `r2` TO `b`@`%`
+GRANT USAGE ON *.* TO `b`@`%`
+GRANT SELECT, UPDATE ON `mysql`.* TO `b`@`%`
SET DEFAULT ROLE r1 FOR a;
ERROR OP000: User `a@%` has not been granted role `r1`
SET DEFAULT ROLE invalid_role;
diff --git a/mysql-test/suite/roles/set_default_role_new_connection.result b/mysql-test/suite/roles/set_default_role_new_connection.result
index a59ecbd75f7..03575e8aa8a 100644
--- a/mysql-test/suite/roles/set_default_role_new_connection.result
+++ b/mysql-test/suite/roles/set_default_role_new_connection.result
@@ -5,8 +5,8 @@ grant test_role to test_user@localhost;
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO '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;
@@ -20,9 +20,9 @@ test_user localhost test_role
connect c1, localhost, test_user,,;
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'
+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
@@ -35,8 +35,8 @@ test_user localhost
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO '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'
disconnect c1;
@@ -48,9 +48,9 @@ set default role test_role for test_user@localhost;
connect c1, localhost, test_user,,;
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'
+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
diff --git a/mysql-test/suite/roles/set_role-13655.result b/mysql-test/suite/roles/set_role-13655.result
index c30e4115953..9da16c1dd51 100644
--- a/mysql-test/suite/roles/set_role-13655.result
+++ b/mysql-test/suite/roles/set_role-13655.result
@@ -18,10 +18,10 @@ create role admin;
grant simple to admin;
show grants for admin;
Grants for admin
-GRANT simple TO 'admin'
-GRANT USAGE ON *.* TO 'admin'
-GRANT USAGE ON *.* TO 'simple'
-GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
+GRANT `simple` TO `admin`
+GRANT USAGE ON *.* TO `admin`
+GRANT USAGE ON *.* TO `simple`
+GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO `simple`
#
# Finally, we give the admin all the available privileges for the db.
#
@@ -37,13 +37,13 @@ ERROR 42000: Access denied for user 'foo'@'%' to database 't'
set role admin;
show grants;
Grants for foo@%
-GRANT admin TO 'foo'@'%'
-GRANT USAGE ON *.* TO 'foo'@'%'
-GRANT simple TO 'admin'
-GRANT USAGE ON *.* TO 'admin'
-GRANT ALL PRIVILEGES ON `t`.* TO 'admin'
-GRANT USAGE ON *.* TO 'simple'
-GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
+GRANT `admin` TO `foo`@`%`
+GRANT USAGE ON *.* TO `foo`@`%`
+GRANT `simple` TO `admin`
+GRANT USAGE ON *.* TO `admin`
+GRANT ALL PRIVILEGES ON `t`.* TO `admin`
+GRANT USAGE ON *.* TO `simple`
+GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO `simple`
create database t;
drop database t;
connection default;
diff --git a/mysql-test/suite/roles/set_role-9614.result b/mysql-test/suite/roles/set_role-9614.result
index 37f6db070c0..7085d2287e2 100644
--- a/mysql-test/suite/roles/set_role-9614.result
+++ b/mysql-test/suite/roles/set_role-9614.result
@@ -35,16 +35,16 @@ GRANT `client` TO `usertestjohn`@`%`;
#
SHOW GRANTS FOR `john`@`%`;
Grants for john@%
-GRANT client TO 'john'@'%'
-GRANT USAGE ON *.* TO 'john'@'%'
+GRANT `client` TO `john`@`%`
+GRANT USAGE ON *.* TO `john`@`%`
SHOW GRANTS FOR `usertestjohn`@`%`;
Grants for usertestjohn@%
-GRANT client TO 'usertestjohn'@'%'
-GRANT USAGE ON *.* TO 'usertestjohn'@'%'
+GRANT `client` TO `usertestjohn`@`%`
+GRANT USAGE ON *.* TO `usertestjohn`@`%`
SHOW GRANTS FOR `client`;
Grants for client
-GRANT USAGE ON *.* TO 'client'
-GRANT SELECT ON `bug_db`.`t0` TO 'client'
+GRANT USAGE ON *.* TO `client`
+GRANT SELECT ON `bug_db`.`t0` TO `client`
show databases;
Database
bug_db
@@ -84,10 +84,10 @@ information_schema
test
show grants;
Grants for usertestjohn@%
-GRANT client TO 'usertestjohn'@'%'
-GRANT USAGE ON *.* TO 'usertestjohn'@'%'
-GRANT USAGE ON *.* TO 'client'
-GRANT SELECT ON `bug_db`.`t0` TO 'client'
+GRANT `client` TO `usertestjohn`@`%`
+GRANT USAGE ON *.* TO `usertestjohn`@`%`
+GRANT USAGE ON *.* TO `client`
+GRANT SELECT ON `bug_db`.`t0` TO `client`
use bug_db;
#
# Cleanup
diff --git a/mysql-test/suite/roles/set_role-database-recursive.result b/mysql-test/suite/roles/set_role-database-recursive.result
index 479e553c3d1..c919a800220 100644
--- a/mysql-test/suite/roles/set_role-database-recursive.result
+++ b/mysql-test/suite/roles/set_role-database-recursive.result
@@ -67,17 +67,17 @@ set role test_role1;
delete from mysql.user where user='no such user';
show grants;
Grants for test_user@localhost
-GRANT DELETE ON `mysql`.* TO 'test_role4'
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role3'
-GRANT USAGE ON *.* TO 'test_role4'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role2 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_role2'
-GRANT test_role4 TO 'test_role3'
+GRANT DELETE ON `mysql`.* TO `test_role4`
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role3`
+GRANT USAGE ON *.* TO `test_role4`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
+GRANT `test_role2` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_role2`
+GRANT `test_role4` TO `test_role3`
drop user test_user@localhost;
drop role test_role1, test_role2, test_role3, test_role4;
diff --git a/mysql-test/suite/roles/set_role-multiple-role.result b/mysql-test/suite/roles/set_role-multiple-role.result
index fca53b4d645..2ddd1e8a510 100644
--- a/mysql-test/suite/roles/set_role-multiple-role.result
+++ b/mysql-test/suite/roles/set_role-multiple-role.result
@@ -25,14 +25,14 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `r_crt` TO `test_user`@`localhost`
+GRANT `r_del` TO `test_user`@`localhost`
+GRANT `r_drp` TO `test_user`@`localhost`
+GRANT `r_ins` TO `test_user`@`localhost`
+GRANT `r_rld` TO `test_user`@`localhost`
+GRANT `r_sel` TO `test_user`@`localhost`
+GRANT `r_upd` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -42,15 +42,15 @@ current_user() current_role()
test_user@localhost r_sel
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'r_sel'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO `r_sel`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `r_crt` TO `test_user`@`localhost`
+GRANT `r_del` TO `test_user`@`localhost`
+GRANT `r_drp` TO `test_user`@`localhost`
+GRANT `r_ins` TO `test_user`@`localhost`
+GRANT `r_rld` TO `test_user`@`localhost`
+GRANT `r_sel` TO `test_user`@`localhost`
+GRANT `r_upd` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root r_crt Y
@@ -73,15 +73,15 @@ current_user() current_role()
test_user@localhost r_ins
show grants;
Grants for test_user@localhost
-GRANT INSERT ON *.* TO 'r_ins'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
+GRANT INSERT ON *.* TO `r_ins`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `r_crt` TO `test_user`@`localhost`
+GRANT `r_del` TO `test_user`@`localhost`
+GRANT `r_drp` TO `test_user`@`localhost`
+GRANT `r_ins` TO `test_user`@`localhost`
+GRANT `r_rld` TO `test_user`@`localhost`
+GRANT `r_sel` TO `test_user`@`localhost`
+GRANT `r_upd` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
insert into mysql.roles_mapping values ('', 'r_sel', 'r_rld', 'N');
diff --git a/mysql-test/suite/roles/set_role-recursive.result b/mysql-test/suite/roles/set_role-recursive.result
index b0d79377183..d9fb3f11849 100644
--- a/mysql-test/suite/roles/set_role-recursive.result
+++ b/mysql-test/suite/roles/set_role-recursive.result
@@ -16,17 +16,17 @@ 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 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
+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 Delete_history_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 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 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
+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 Delete_history_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 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;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -36,35 +36,35 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping where Host='';
Host User Role Admin_option
test_role1 test_role2 N
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
set role test_role2;
ERROR OP000: User `test_user@localhost` has not been granted role `test_role2`
select current_user(), current_role();
@@ -72,43 +72,43 @@ current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
set role test_role1;
select current_user(), current_role();
current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping where Host='';
Host User Role Admin_option
test_role1 test_role2 N
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
delete from mysql.user where user='test_role1';
diff --git a/mysql-test/suite/roles/set_role-routine-simple.result b/mysql-test/suite/roles/set_role-routine-simple.result
index 3e17a78ad77..2df370b273d 100644
--- a/mysql-test/suite/roles/set_role-routine-simple.result
+++ b/mysql-test/suite/roles/set_role-routine-simple.result
@@ -31,9 +31,9 @@ grant execute on procedure mysql.test_proc to test_role2;
grant execute on mysql.* to test_role3;
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_user`@`localhost`
use mysql;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
select current_user(), current_role();
@@ -53,23 +53,23 @@ test_func('AABBCCDD')
Test string: AABBCCDD
show grants;
Grants for test_user@localhost
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'test_role2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `test_role2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
+GRANT `test_role3` TO `test_user`@`localhost`
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_user`@`localhost`
call test_proc(@a);
ERROR 42000: execute command denied to user 'test_user'@'localhost' for routine 'mysql.test_proc'
SELECT test_func('AABBCCDD');
@@ -80,11 +80,11 @@ current_user() current_role()
test_user@localhost test_role3
show grants;
Grants for test_user@localhost
-GRANT EXECUTE ON `mysql`.* TO 'test_role3'
-GRANT USAGE ON *.* TO 'test_role3'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT EXECUTE ON `mysql`.* TO `test_role3`
+GRANT USAGE ON *.* TO `test_role3`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_user`@`localhost`
call test_proc(@a);
SELECT @a;
@a
diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result
index 29b176776e7..af237113bb3 100644
--- a/mysql-test/suite/roles/set_role-simple.result
+++ b/mysql-test/suite/roles/set_role-simple.result
@@ -11,14 +11,14 @@ 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 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
+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 Delete_history_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 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;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -28,9 +28,9 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root test_role1 Y
@@ -52,7 +52,7 @@ current_user
user1@%
show grants;
Grants for user1@%
-GRANT USAGE ON *.* TO 'user1'@'%'
+GRANT USAGE ON *.* TO `user1`@`%`
set role none;
connection default;
drop user user1;
diff --git a/mysql-test/suite/roles/set_role-table-column-priv.result b/mysql-test/suite/roles/set_role-table-column-priv.result
index 721bd3039a3..738b3313bb2 100644
--- a/mysql-test/suite/roles/set_role-table-column-priv.result
+++ b/mysql-test/suite/roles/set_role-table-column-priv.result
@@ -19,8 +19,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -30,12 +30,12 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for column 'Host' in table 'roles_mapping'
select Role from mysql.roles_mapping;
@@ -46,12 +46,12 @@ test_role2
test_role2
show grants;
Grants for test_user@localhost
-GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
use mysql;
set role none;
select current_user(), current_role();
diff --git a/mysql-test/suite/roles/set_role-table-simple.result b/mysql-test/suite/roles/set_role-table-simple.result
index f5688dbe62e..dcd0914db8d 100644
--- a/mysql-test/suite/roles/set_role-table-simple.result
+++ b/mysql-test/suite/roles/set_role-table-simple.result
@@ -19,8 +19,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -30,12 +30,12 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping;
Host User Role Admin_option
test_role1 test_role2 N
@@ -44,12 +44,12 @@ localhost root test_role2 Y
localhost test_user test_role1 N
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
use mysql;
set role none;
select current_user(), current_role();
diff --git a/mysql-test/suite/roles/show_create_database-10463.result b/mysql-test/suite/roles/show_create_database-10463.result
index a9b376a891f..7bebc954840 100644
--- a/mysql-test/suite/roles/show_create_database-10463.result
+++ b/mysql-test/suite/roles/show_create_database-10463.result
@@ -16,7 +16,7 @@ test
show create database db;
ERROR 42000: Access denied for user 'beep'@'localhost' to database 'db'
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
table_schema table_name
set role r1;
show databases;
@@ -28,7 +28,7 @@ show create database db;
Database Create Database
db CREATE DATABASE `db` /*!40100 DEFAULT CHARACTER SET latin1 */
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
table_schema table_name
db t1
db t2
@@ -45,7 +45,7 @@ test
show create database db;
ERROR 42000: Access denied for user 'beep2'@'localhost' to database 'db'
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
table_schema table_name
set role r2;
show databases;
@@ -57,7 +57,7 @@ show create database db;
Database Create Database
db CREATE DATABASE `db` /*!40100 DEFAULT CHARACTER SET latin1 */
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
table_schema table_name
db t1
db t2
diff --git a/mysql-test/suite/roles/show_create_database-10463.test b/mysql-test/suite/roles/show_create_database-10463.test
index f3df72081fa..b1eaaf5ff5a 100644
--- a/mysql-test/suite/roles/show_create_database-10463.test
+++ b/mysql-test/suite/roles/show_create_database-10463.test
@@ -17,13 +17,13 @@ show databases;
--error ER_DBACCESS_DENIED_ERROR
show create database db;
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
set role r1;
show databases;
show create database db;
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
connection default;
@@ -37,14 +37,14 @@ show databases;
--error ER_DBACCESS_DENIED_ERROR
show create database db;
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
set role r2;
show databases;
show create database db;
select table_schema, table_name from information_schema.tables
-where table_schema = 'db';
+where table_schema = 'db' order by table_name;
connection default;
diff --git a/mysql-test/suite/roles/show_grants.result b/mysql-test/suite/roles/show_grants.result
index 5d46b038cf8..634fab34131 100644
--- a/mysql-test/suite/roles/show_grants.result
+++ b/mysql-test/suite/roles/show_grants.result
@@ -34,9 +34,9 @@ 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'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -50,13 +50,13 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
+GRANT `test_role2` TO `test_user`@`localhost`
set role none;
select * from information_schema.enabled_roles;
ROLE_NAME
@@ -66,28 +66,28 @@ current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_user@localhost;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_role1;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
show grants for test_role2;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
show grants for CURRENT_USER;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_USER();
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_ROLE;
ERROR 42000: There is no such grant defined for user 'test_user' on host 'localhost'
show grants for CURRENT_ROLE();
@@ -101,44 +101,44 @@ current_user() current_role()
test_user@localhost test_role2
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_user@localhost;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_role1;
Grants for test_role1
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT `test_role2` TO `test_role1`
show grants for test_role2;
Grants for test_role2
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
show grants for CURRENT_USER;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_USER();
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_ROLE;
Grants for test_role2
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
show grants for CURRENT_ROLE();
Grants for test_role2
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role2;
drop role test_role1;
diff --git a/mysql-test/suite/roles/show_grants_replicated.result b/mysql-test/suite/roles/show_grants_replicated.result
index cb9df65dbbd..f635aa0827e 100644
--- a/mysql-test/suite/roles/show_grants_replicated.result
+++ b/mysql-test/suite/roles/show_grants_replicated.result
@@ -6,10 +6,10 @@ 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'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
#
connection slave;
#
@@ -27,30 +27,30 @@ root@localhost r1 YES NO
# Check show grants for the new user.
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO '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'
+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'
+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 `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'
+GRANT USAGE ON *.* TO `r1`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
connection master;
drop role r1;
drop user u1;
diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def
index 62320ad027c..acdd3afcf9c 100644
--- a/mysql-test/suite/rpl/disabled.def
+++ b/mysql-test/suite/rpl/disabled.def
@@ -15,4 +15,5 @@ rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fa
rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition with archive table
rpl_row_binlog_max_cache_size : MDEV-11092
rpl_row_index_choice : MDEV-11666
+rpl_semi_sync_after_sync : fails after MDEV-16172
rpl_slave_grp_exec: MDEV-10514
diff --git a/mysql-test/suite/rpl/include/check_type.inc b/mysql-test/suite/rpl/include/check_type.inc
new file mode 100644
index 00000000000..baba7a21e86
--- /dev/null
+++ b/mysql-test/suite/rpl/include/check_type.inc
@@ -0,0 +1,70 @@
+# Helper file to perform one insert of a value into a table with
+# different types on master and slave. The file will insert the
+# result into the type_conversions table *on the slave* to get a
+# summary of failing and succeeding tests.
+
+# Input:
+# $source_type Type on the master
+# $target_type Type on the slave
+# $source_value Value on the master (inserted into the table)
+# $target_value Value on the slave (expected value in the table
+# on the slave)
+# $can_convert True if conversion shall work, false if it
+# shall generate an error
+# $engine_type The storage engine to be used for storing table
+# on both master and slave
+
+if (!$engine_type)
+{
+ # Use the default storage engine
+ let $engine_type=`SELECT @@storage_engine`;
+}
+
+connection master;
+disable_warnings;
+DROP TABLE IF EXISTS t1;
+enable_warnings;
+if ($source_temp_format)
+{
+ --eval SET @@global.mysql56_temporal_format= $source_temp_format
+}
+eval CREATE TABLE t1(
+ pk INT NOT NULL PRIMARY KEY,
+ a $source_type
+) ENGINE=$engine_type;
+sync_slave_with_master;
+if ($target_temp_format)
+{
+ --eval SET @@global.mysql56_temporal_format= $source_temp_format
+}
+eval ALTER TABLE t1 MODIFY a $target_type;
+
+connection master;
+eval INSERT INTO t1 VALUES(1, $source_value);
+if ($can_convert) {
+ sync_slave_with_master;
+ eval SELECT a = $target_value into @compare FROM t1;
+ eval INSERT INTO type_conversions SET
+ Source = "$source_type",
+ Target = "$target_type",
+ Flags = @@slave_type_conversions,
+ On_Master = $source_value,
+ Expected = $target_value,
+ Compare = @compare;
+ UPDATE type_conversions
+ SET On_Slave = (SELECT a FROM t1)
+ WHERE TestNo = LAST_INSERT_ID();
+}
+if (!$can_convert) {
+ connection slave;
+ wait_for_slave_to_stop;
+ let $error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+ eval INSERT INTO type_conversions SET
+ Source = "$source_type",
+ Target = "$target_type",
+ Flags = @@slave_type_conversions,
+ On_Master = $source_value,
+ Error = "$error";
+ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
+ START SLAVE;
+}
diff --git a/mysql-test/suite/rpl/include/create_recursive_construct.inc b/mysql-test/suite/rpl/include/create_recursive_construct.inc
new file mode 100644
index 00000000000..4a094a68340
--- /dev/null
+++ b/mysql-test/suite/rpl/include/create_recursive_construct.inc
@@ -0,0 +1,405 @@
+# ==== Purpose ====
+#
+# Creates a stored routine, stored function, trigger, view, or
+# prepared statement (commonly referred to as "recursive construct")
+# that invokes a given unsafe statement.
+#
+# Then, it invokes the created recursive construct several times:
+#
+# - With SQL_LOG_BIN = 1 and binlog_format = STATEMENT, to verify
+# that it gives a warning.
+#
+# - With SQL_LOG_BIN = 0 and binlog_format = STATEMENT, to verify that
+# there is no warning and nothing is logged.
+#
+# - With SQL_LOG_BIN = 1 and binlog_format = MIXED, to verify that it
+# writes row events to the binlog.
+#
+# - In some cases, the recursive construct can be invoked so that it
+# has no side-effects but returns a value that may be
+# nondeterministic. An example is a function that returns UUID().
+# The function does not have side effects but its a return value
+# that may differ on slave. Such statements are invoked so that
+# the return value is discarded (e.g., SELECT func()), with
+# SQL_LOG_BIN = 1 and binlog_format = STATEMENT. In this case, no
+# warning should be given and nothing should be written to the
+# binlog.
+#
+# This is an auxiliary file particularly targeted to being used by the
+# test binlog_unsafe. In this context, the purpose is to check how
+# warnings for unsafe statements are propagated in recursive
+# constructs.
+#
+# The statement to invoke ("input") is described using mtr variables,
+# and the resulting recursive construct ("output") is stored in mtr
+# variables in a similar fashion. To create several levels of nested
+# recursive constructs, source this file once, then copy the values of
+# appropriate output variables to the input variables, and then source
+# this file again.
+#
+#
+# ==== Usage ====
+#
+# See binlog_unsafe for an example of how to use this file.
+#
+# let $CRC_ARG_level= <level>;
+# let $CRC_ARG_type= <type>;
+# let $CRC_ARG_stmt_sidef= <stmt>;
+# let $CRC_ARG_value= <stmt>;
+# let $CRC_ARG_sel_retval= <stmt>;
+# let $CRC_ARG_sel_sidef= <stmt>;
+# let $CRC_ARG_desc= <desc>;
+# source suite/rpl/include/create_recursive_construct.inc;
+# let $my_stmt_sidef= $CRC_RET_stmt_sidef;
+# let $my_value= $CRC_RET_value;
+# let $my_sel_sidef= $CRC_RET_sel_sidef;
+# let $my_sel_retval= $CRC_RET_sel_retval;
+# let $my_drop= $CRC_RET_drop;
+# let $my_is_toplevel= $CRC_RET_top_is_toplevel;
+# let $my_desc= $CRC_RET_desc;
+#
+# $CRC_ARG_* are used as input parameters (arguments) to this file:
+#
+# $CRC_ARG_level is the recursion depth: 1 for the innermost
+# statement created, 2 for a statement that invokes a statement on
+# level 1, etc.
+#
+# $CRC_ARG_type is an integer from 0 to 6, indicating what type of
+# statement shall be created:
+# 0 - Create a stored function where the return value depends on
+# the value of the given statement.
+# 1 - Create a stored function that invokes the given statement as
+# a side-effect but may not return a value that depends on it.
+# 2 - Create a stored routine that invokes the given statement.
+# 3 - Create a trigger (on table trigger_table_$CRC_ARG_level) that
+# invokes the given statement.
+# 4 - Create a view that returns a value that depends on the value
+# of the given statement.
+# 5 - Create a view that invokes the given statement but may return
+# a value that does not depend on it.
+# 6 - Create a prepared statement that invokes the given statement.
+#
+# $CRC_ARG_stmt_sidef is the statement to invoke. It should be a
+# statement that can be invoked on its own (not sub-statement),
+# which causes something unsafe to be written to the binlog.
+#
+# $CRC_ARG_value is a sub-statement holding the value of the given
+# statement. Can be empty if the given statement does not have a
+# value. Typically, this is non-empty if the given statement is a
+# function call or user variable, but not if it is a stored routine
+# call, INSERT, SELECT, etc (because none of them has a value).
+# $CRC_ARG_value is used only when $CRC_ARG_type=6.
+#
+# $CRC_ARG_sel_sidef is a SELECT sub-statement that invokes the
+# statement as a side-effect, but returns a result set that may not
+# depend on the statement. Can be empty if the statement cannot
+# produce a result set from a SELECT. $CRC_ARG_sel_sidef is used
+# only if $CRC_ARG_type=2
+#
+# $CRC_ARG_sel_retval is a SELECT sub-statement that does not have
+# side-effects, but returns a result set that depends on the unsafe
+# statement. Can be empty if the statement cannot be invoked from a
+# SELECT. $CRC_ARG_sel_retval is used only if $CRC_ARG_type=3.
+#
+# $CRC_ARG_desc is a human-readable description of the statement to
+# invoke.
+#
+# $CRC_RET_* are used as output parameters (return values) of this
+# file:
+#
+# $CRC_RET_stmt_sidef is a statement invoking the resulting recursive
+# construct.
+#
+# $CRC_RET_value is a sub-statement invoking the resulting recursive
+# construct and returning the value of the recursive construct.
+# This is the empty string if the resulting recursive construct does
+# not have a value. In particular, this is non-empty only if
+# $CRC_ARG_value=7.
+#
+# $CRC_RET_sel_sidef is a SELECT sub-statement that invokes the
+# resulting recursive construct as a side-effect but where the
+# result set may not depend on the recursive construct. This is the
+# empty string if the recursive construct cannot be invoked from a
+# SELECT. In particular, this is non-empty only if $CRC_ARG_value=6
+# or $CRC_ARG_value=2.
+#
+# $CRC_RET_sel_retval is a SELECT sub-statement that does not have
+# side-effects, but returns a result set depending on the unsafe
+# statement. This is the empty string if the recursive construct
+# cannot produce a result set from a SELECT. In particular, this is
+# non-empty only if $CRC_ARG_value=7 or $CRC_ARG_value=3.
+#
+# $CRC_RET_drop is a statement that drops the created object. I.e.,
+# it is one of 'DROP FUNCTION <func>', 'DROP PROCEDURE <proc>', etc.
+#
+# $CRC_RET_top_is_toplevel is 0 normally, or 1 if the resulting
+# recursive construct can only be called from a top-level statement.
+# In particular, this is 1 only when $CRC_ARG_value=1, because
+# prepared statements cannot be invoked from other recursive
+# constructs.
+#
+# $CRC_RET_desc is a text string that describes the invokation of
+# the recursive construct in a human-readable fashion.
+#
+# Assumptions
+#
+# Before sourcing this file with $CRC_ARG_level=X, you need to
+# create three tables: tX, taX and trigger_table_X. These are used
+# as auxiliary tables.
+
+
+#--echo debug: >>>>ENTER create_recursive_construct
+#--echo debug: level=$CRC_ARG_level
+#--echo debug: type=$CRC_ARG_type
+#--echo debug: stmt_sidef=$CRC_ARG_stmt_sidef
+#--echo debug: value=$CRC_ARG_value
+#--echo debug: sel_retval=$CRC_ARG_sel_retval
+#--echo debug: sel_sidef=$CRC_ARG_sel_sidef
+
+--let $CRC_RET_stmt_sidef=
+--let $CRC_RET_value=
+--let $CRC_RET_sel_retval=
+--let $CRC_RET_sel_sidef=
+--let $CRC_RET_drop=
+--let $CRC_RET_is_toplevel= 1
+--let $CRC_RET_desc=
+--let $CRC_name=
+--let $CRC_create=
+
+######## func_retval ########
+# if inside if in lieu of AND operand
+if ($CRC_ARG_type == 0) {
+ if ($CRC_ARG_value) {
+ # It will be safe to call this function and discard the return
+ # value, but it will be unsafe to use return value (e.g., in
+ # INSERT...SELECT).
+ --let $CRC_name= func_retval_$CRC_ARG_level
+ --let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); RETURN $CRC_ARG_value; END
+ --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_level VALUES ($CRC_name())
+ --let $CRC_RET_value= $CRC_name()
+ --let $CRC_RET_sel_sidef=
+ --let $CRC_RET_sel_retval= SELECT $CRC_name()
+ --let $CRC_RET_drop= DROP FUNCTION $CRC_name
+ --let $CRC_RET_is_toplevel= 0
+ --let $CRC_RET_desc= function $CRC_name returning value from $CRC_ARG_desc
+ }
+}
+
+######## func_sidef ########
+if ($CRC_ARG_type == 1) {
+ # It will be unsafe to call func even if you discard return value.
+ --let $CRC_name= func_sidef_$CRC_ARG_level
+ --let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; RETURN 0; END
+ --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_level SELECT $CRC_name()
+ --let $CRC_RET_value=
+ --let $CRC_RET_sel_retval=
+ --let $CRC_RET_sel_sidef= SELECT $CRC_name()
+ --let $CRC_RET_drop= DROP FUNCTION $CRC_name
+ --let $CRC_RET_is_toplevel= 0
+ --let $CRC_RET_desc= function $CRC_name invoking $CRC_ARG_desc
+}
+
+######## proc ########
+if ($CRC_ARG_type == 2) {
+ # It will be unsafe to call this procedure.
+ --let $CRC_name= proc_$CRC_ARG_level
+ --let $CRC_create= CREATE PROCEDURE $CRC_name() BEGIN $CRC_ARG_stmt_sidef; INSERT INTO ta$CRC_ARG_level VALUES (47); END
+ --let $CRC_RET_stmt_sidef= CALL $CRC_name()
+ --let $CRC_RET_value=
+ --let $CRC_RET_sel_retval=
+ --let $CRC_RET_sel_sidef=
+ --let $CRC_RET_drop= DROP PROCEDURE $CRC_name
+ --let $CRC_RET_is_toplevel= 0
+ --let $CRC_RET_desc= procedure $CRC_name invoking $CRC_ARG_desc
+}
+
+######## trig ########
+if ($CRC_ARG_type == 3) {
+ # It will be unsafe to invoke this trigger.
+ --let $CRC_name= trig_$CRC_ARG_level
+ --let $CRC_create= CREATE TRIGGER $CRC_name BEFORE INSERT ON trigger_table_$CRC_ARG_level FOR EACH ROW BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; END
+ --let $CRC_RET_stmt_sidef= INSERT INTO trigger_table_$CRC_ARG_level VALUES (1)
+ --let $CRC_RET_value=
+ --let $CRC_RET_sel_retval=
+ --let $CRC_RET_sel_sidef=
+ --let $CRC_RET_drop= DROP TRIGGER $CRC_name
+ --let $CRC_RET_is_toplevel= 0
+ --let $CRC_RET_desc= trigger $CRC_name invoking $CRC_ARG_desc
+}
+
+######## view_retval ########
+if ($CRC_ARG_type == 4) {
+ if ($CRC_ARG_sel_retval) {
+ # It will be safe to select from this view if you discard the result
+ # set, but unsafe to use result set (e.g., in INSERT..SELECT).
+ --let $CRC_name= view_retval_$CRC_ARG_level
+ --let $CRC_create= CREATE VIEW $CRC_name AS $CRC_ARG_sel_retval
+ --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_LEVEL SELECT * FROM $CRC_name
+ --let $CRC_RET_value=
+ --let $CRC_RET_sel_retval= SELECT * FROM $CRC_name
+ --let $CRC_RET_sel_sidef=
+ --let $CRC_RET_drop= DROP VIEW $CRC_name
+ --let $CRC_RET_is_toplevel= 0
+ --let $CRC_RET_desc= view $CRC_name returning value from $CRC_ARG_desc
+ }
+}
+
+######## view_sidef ########
+if ($CRC_ARG_type == 5) {
+ if ($CRC_ARG_sel_sidef) {
+ # It will be unsafe to select from this view, even if you discard
+ # the return value.
+ --let $CRC_name= view_sidef_$CRC_ARG_level
+ --let $CRC_create= CREATE VIEW $CRC_name AS $CRC_ARG_sel_sidef
+ --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_level SELECT * FROM $CRC_name
+ --let $CRC_RET_value=
+ --let $CRC_RET_sel_retval=
+ --let $CRC_RET_sel_sidef= SELECT * FROM $CRC_name
+ --let $CRC_RET_drop= DROP VIEW $CRC_name
+ --let $CRC_RET_is_toplevel= 0
+ --let $CRC_RET_desc= view $CRC_name invoking $CRC_ARG_desc
+ }
+}
+
+######## prep ########
+if ($CRC_ARG_type == 6) {
+ # It will be unsafe to execute this prepared statement
+ --let $CRC_name= prep_$CRC_ARG_level
+ --let $CRC_create= PREPARE $CRC_name FROM "$CRC_ARG_stmt_sidef"
+ --let $CRC_RET_stmt_sidef= EXECUTE $CRC_name
+ --let $CRC_RET_value=
+ --let $CRC_RET_sel_retval=
+ --let $CRC_RET_sel_sidef=
+ --let $CRC_RET_drop= DROP PREPARE $CRC_name
+ --let $CRC_RET_is_toplevel= 1
+ --let $CRC_RET_desc= prepared statement $CRC_name invoking $CRC_ARG_desc
+}
+
+######## no recursive construct: just return the given statement ########
+if ($CRC_ARG_type == 7) {
+ # CRC_ARG_type=7 is a special case. We just set $CRC_RET_x =
+ # $CRC_ARG_x. This way, the $CRC_ARG_stmt gets executed directly
+ # (below). In binlog_unsafe.test, it is used to invoke the unsafe
+ # statement created in the outermost loop directly, without
+ # enclosing it in a recursive construct.
+ --let $CRC_RET_stmt_sidef= $CRC_ARG_stmt_sidef
+ --let $CRC_RET_value= $CRC_ARG_value
+ --let $CRC_RET_sel_retval= $CRC_ARG_sel_retval
+ --let $CRC_RET_sel_sidef= $CRC_ARG_sel_sidef
+ --let $CRC_RET_drop=
+ --let $CRC_RET_is_toplevel= 1
+ --let $CRC_RET_desc= $CRC_ARG_desc
+}
+
+######## execute! ########
+if ($CRC_RET_stmt_sidef) {
+ --echo
+ --echo Invoking $CRC_RET_desc.
+ if ($CRC_create) {
+ --disable_ps_protocol
+ --eval $CRC_create
+ --enable_ps_protocol
+ }
+
+ --echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings.
+ --eval $CRC_RET_stmt_sidef
+ --let $n_warnings= `SHOW COUNT(*) WARNINGS`
+ if ($n_warnings != $CRC_ARG_expected_number_of_warnings) {
+ --echo ******** Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. ********
+ SHOW WARNINGS;
+ SHOW BINLOG EVENTS;
+ --die Wrong number of warnings.
+ }
+
+ # These queries are run without query log, to make result file more
+ # readable. Debug info is only printed if something abnormal
+ # happens.
+ --disable_query_log
+
+ --echo * SQL_LOG_BIN = 0: expect nothing logged and no warning.
+ SET SQL_LOG_BIN = 0;
+ RESET MASTER;
+ --eval $CRC_RET_stmt_sidef
+ --let $n_warnings= `SHOW COUNT(*) WARNINGS`
+ if ($n_warnings) {
+ --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ********
+ SHOW WARNINGS;
+ SHOW BINLOG EVENTS;
+ --die Wrong number of warnings.
+ }
+ # There should be no events after format description, Gtid list, and binlog checkpoint.
+ --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 4)
+ if ($binlog_event != No such row) {
+ --enable_query_log
+ --echo ******** Failure! Something was written to the binlog despite SQL_LOG_BIN=0 ********
+ SHOW BINLOG EVENTS;
+ --die Binlog not empty
+ }
+ SET SQL_LOG_BIN = 1;
+
+ --echo * binlog_format = MIXED: expect row events in binlog and no warning.
+ SET binlog_format = MIXED;
+ RESET MASTER;
+ --eval $CRC_RET_stmt_sidef
+ --let $n_warnings= `SHOW COUNT(*) WARNINGS`
+ if ($n_warnings) {
+ --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ********
+ SHOW WARNINGS;
+ SHOW BINLOG EVENTS;
+ --die Warnings printed
+ }
+ --let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 6)
+ # The first event is format_description, the second is Gtid list, the
+ # third is Binlog_checkpoint, the fourth Gtid, and the fifth should be
+ # our Query for 'INSERT DELAYED' unsafe_type 3, which is safe after
+ # the fix of bug#54579.
+ if (`SELECT $unsafe_type = 3 AND '$event_type' != 'Query'`) {
+ --enable_query_log
+ --echo ******** Failure! Event number 5 was a '$event_type', not a 'Query'. ********
+ SHOW BINLOG EVENTS;
+ --die Wrong events in binlog.
+ }
+ # The first event is format_description, the second is Gtid list,
+ # the third is Binlog_checkpoint, the fourth is Query_event('BEGIN'),
+ # the fifth is Annotate_rows, and the sixth should be our Table_map
+ # for unsafe statement.
+ if (`SELECT $unsafe_type != 3 AND '$event_type' != 'Table_map'`) {
+ --enable_query_log
+ --echo ******** Failure! Event number 6 was a '$event_type', not a 'Table_map'. ********
+ SHOW BINLOG EVENTS;
+ --die Wrong events in binlog.
+ }
+ SET binlog_format = STATEMENT;
+
+ --enable_query_log
+}
+
+# Invoke created object, discarding the return value. This should not
+# give any warning.
+if ($CRC_RET_sel_retval) {
+ --echo * Invoke statement so that return value is dicarded: expect no warning.
+ --disable_result_log
+ --eval $CRC_RET_sel_retval
+ --enable_result_log
+
+ # Currently, due to a bug, we do get warnings here, so we don't
+ # fail. When the bug is fixed, we should execute the following.
+
+ #--let $n_warnings= `SHOW COUNT(*) WARNINGS`
+ #if ($n_warnings) {
+ # --enable_query_log
+ # --echo Failure! Expected 0 warnings, got $n_warnings warnings.
+ # SHOW WARNINGS;
+ # SHOW BINLOG EVENTS;
+ # --die Wrong number of warnings.
+ #}
+}
+
+#--echo debug: <<<<EXIT create_recursive_construct
+#--echo debug: stmt_sidef=$CRC_RET_stmt_sidef
+#--echo debug: value=$CRC_RET_value
+#--echo debug: sel_retval=$CRC_RET_sel_retval
+#--echo debug: sel_sidef=$CRC_RET_sel_sidef
+#--echo debug: drop=$CRC_RET_drop
+#--echo debug: is_toplevel=$CRC_RET_is_toplevel
+#--echo debug: desc=$CRC_RET_desc
diff --git a/mysql-test/suite/rpl/include/delayed_slave_wait_on_query.inc b/mysql-test/suite/rpl/include/delayed_slave_wait_on_query.inc
new file mode 100644
index 00000000000..0aa4c05b75a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/delayed_slave_wait_on_query.inc
@@ -0,0 +1,55 @@
+# ==== Purpose ====
+#
+# Auxiliary file used by rpl_delayed_slave.test. This assumes that an
+# 'INSERT INTO t1...' query has been executed on the master. It does
+# this:
+#
+# - After half the delay, check the status. It should be delaying and
+# the query should not have executed.
+#
+# - After one and a half delay, check the status. It should not be
+# delaying and the query should be executed.
+#
+#
+# ==== Usage ====
+#
+# --let $query_number= 4
+# --source suite/rpl/include/delayed_slave_wait_on_query.inc
+#
+# Parameters:
+# $query_number
+# The value of the 'b' column in t1 for the row inserted by the query
+# we are waiting for.
+
+connection master;
+
+--echo [on slave]
+--let $slave_timeout= $time1
+--source include/sync_slave_io_with_master.inc
+--echo # sleep 1*T
+--sleep $time1
+
+--let $assert_text= Query $query_number should not be executed
+--let $assert_cond= MAX(b) < $query_number FROM t1
+--source include/rpl_assert.inc
+
+--let $assert_text= Status should be 'Waiting until MASTER_DELAY...'
+--let $assert_cond= "[SHOW SLAVE STATUS, Slave_SQL_Running_State, 1]" LIKE "Waiting until MASTER_DELAY%"
+--source include/rpl_assert.inc
+
+--echo # sleep 1*T
+--sleep $time1
+
+--echo # sync with master (with timeout 1*T)
+--source include/sync_with_master.inc
+
+--let $assert_text= Query $query_number should be executed
+--let $assert_cond= MAX(b) = $query_number FROM t1
+--source include/rpl_assert.inc
+
+--let $assert_text= Status should be 'Has read all relay log...'
+--let $assert_cond= "[SHOW SLAVE STATUS, Slave_SQL_Running_State, 1]" LIKE "Slave has read all relay log%"
+--source include/rpl_assert.inc
+
+
+--source include/check_slave_is_running.inc
diff --git a/mysql-test/suite/rpl/include/multisource.inc b/mysql-test/suite/rpl/include/multisource.inc
new file mode 100644
index 00000000000..bbdf373f794
--- /dev/null
+++ b/mysql-test/suite/rpl/include/multisource.inc
@@ -0,0 +1,304 @@
+#
+# This include file is used by more than one test suite
+# (currently multisource and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --source suite/rpl/include/multisource.inc
+#
+# By default, the script expects the length of the 2nd binary log to be
+# $binlog_start_pos + length(Gtid_list event) + 2 x length(Binlog_checkpoint event)
+# Some tests can have specific configuration which would change it,
+
+#
+# Test basic replication functionality
+# in multi-source setup
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/binlog_start_pos.inc
+--let $rpl_server_count= 0
+
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+# MDEV-3984: crash/read of freed memory when changing master with named connection
+# This fails after adding the new master 'abc', check we do not free twice.
+--error ER_RELAY_LOG_INIT
+change master 'abc' to relay_log_file='';
+# This fails before adding the new master, check that we do free it.
+--error ER_WRONG_ARGUMENTS
+change master 'abc2' to master_host='';
+
+
+# Start replication from the first master
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'master1' to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+
+start slave 'master1';
+set default_master_connection = 'master1';
+--source include/wait_for_slave_to_start.inc
+
+--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+# Here and further: add an extra check on SQL thread status
+# as the normal sync is not always enough
+--source include/wait_for_sql_thread_read_all.inc
+
+# each of the 3 commands should produce
+# 'master1' status
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW SLAVE 'master1' STATUS
+--echo #
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--source include/show_slave_status.inc
+--let $slave_name=
+
+--echo #
+--echo # Checking SHOW SLAVE STATUS
+--echo #
+--source include/show_slave_status.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+
+# Check that replication actually works
+
+--connection master1
+
+--disable_warnings
+drop database if exists db1;
+--enable_warnings
+create database db1;
+use db1;
+create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+insert into t1 (f1) values ('one'),('two');
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--sorted_result
+select * from db1.t1;
+
+--let $datadir = `SELECT @@datadir`
+
+--echo # List of relay log files in the datadir
+--list_files $datadir mysqld-relay-bin-master1.*
+
+# Check that relay logs are recognizable
+
+let binlog_start=4;
+let binlog_file=;
+source include/show_relaylog_events.inc;
+let binlog_file= mysqld-relay-bin-master1.000002;
+source include/show_relaylog_events.inc;
+
+# Try to configure connection with the same name again,
+# should get an error because the slave is running
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+--error ER_SLAVE_MUST_STOP
+eval change master 'master1' to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+# Try to configure using the default connection name
+# (which is 'master1' at the moment),
+# again, should get an error
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+--error ER_SLAVE_MUST_STOP
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+# Try to configure a connection with the same master
+# using a different name, should get a conflict
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+--error ER_CONNECTION_ALREADY_EXISTS
+eval change master 'master2' to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root';
+
+
+# Set up a proper 'default' connection to master2
+
+set default_master_connection = '';
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+start slave;
+--source include/wait_for_slave_to_start.inc
+
+--source include/wait_for_sql_thread_read_all.inc
+
+# See both connections in the same status output
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+# Check that replication from two servers actually works
+
+--connection master1
+
+insert into t1 (f1) values ('three');
+--save_master_pos
+
+--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+
+--disable_warnings
+drop database if exists db2;
+--enable_warnings
+create database db2;
+use db2;
+create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
+begin;
+insert into t1 (f1) values (1),(2);
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--connection master2
+--save_master_pos
+
+--connection slave
+--sync_with_master 0
+--sorted_result
+select * from db1.t1;
+select * from db2.t1;
+
+--connection master2
+commit;
+--save_master_pos
+
+--connection slave
+--sync_with_master 0
+--sorted_result
+select * from db2.t1;
+
+# Flush and purge logs on one master,
+# make sure slaves don't get confused
+
+--connection master1
+flush logs;
+--source include/wait_for_binlog_checkpoint.inc
+--save_master_pos
+--connection slave
+--sync_with_master 0, 'master1'
+
+--connection master1
+purge binary logs to 'master-bin.000002';
+# Additional events: 43 (Gtid_list) + 2 x 44 (Binlog_checkpoint) = 131
+let filesize=`select $binlog_start_pos+131`;
+--replace_result $filesize filesize
+show binary logs;
+insert into t1 (f1) values ('four');
+create table db1.t3 (f1 int) engine=InnoDB;
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--source include/wait_for_sql_thread_read_all.inc
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+--sorted_result
+select * from db1.t1;
+
+# This should show relay log events for the default master
+# (the one with the empty name)
+let binlog_file=;
+source include/show_relaylog_events.inc;
+let binlog_file= mysqld-relay-bin.000002;
+source include/show_relaylog_events.inc;
+
+# Make sure we don't lose control over replication connections
+# after reconnecting to the slave
+
+--disconnect slave
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+stop slave io_thread;
+show status like 'Slave_running';
+set default_master_connection = 'master1';
+show status like 'Slave_running';
+
+# Cleanup
+
+drop database db1;
+drop database db2;
+
+--source include/reset_master_slave.inc
+--disconnect slave
+
+--connection master1
+drop database db1;
+--source include/reset_master_slave.inc
+--disconnect master1
+
+--connection master2
+drop database db2;
+--source include/reset_master_slave.inc
+--disconnect master2
+
diff --git a/mysql-test/suite/rpl/include/rpl_EE_err.test b/mysql-test/suite/rpl/include/rpl_EE_err.test
new file mode 100644
index 00000000000..0b3fec1f605
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_EE_err.test
@@ -0,0 +1,23 @@
+# The test is not relevant when testing replication of error codes for
+# statements that are not replicated. The test below could be changed
+# to rely on the replication of error codes for statements that are not
+# replicated row-based.
+#
+# See if an EE_ error in one event of the master's binlog stops replication
+# (it should not: in this configuration the EE_ error is probably not
+# critical). Example: you do a DROP TABLE on a table which has no MYI file
+# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
+# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
+####################################
+#"REQUIREMENT: A master DROP TABLE on a table with non-existing MYI
+# file must be correctly replicated to the slave"
+####################################
+-- source include/master-slave.inc
+
+eval create table t1 (a int) engine=$engine_type;
+flush tables;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t1.MYI ;
+drop table if exists t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_auto_increment.test b/mysql-test/suite/rpl/include/rpl_auto_increment.test
new file mode 100644
index 00000000000..67286c37258
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_auto_increment.test
@@ -0,0 +1,317 @@
+#
+# Test of auto_increment with offset
+#
+-- 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;
+insert into t1 values (NULL,1),(NULL,2),(NULL,3);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2;
+insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
+delete from t1 where b=4;
+insert into t1 values (NULL,5),(NULL,6);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+
+drop table t1;
+
+set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10;
+show variables like "auto_inc%";
+
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL);
+insert into t1 values (250),(NULL);
+select * from t1;
+insert into t1 values (1000);
+set @@insert_id=400;
+insert into t1 values(NULL),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+#
+# Same test with innodb (as the innodb code is a bit different)
+#
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL);
+insert into t1 values (250),(NULL);
+select * from t1;
+insert into t1 values (1000);
+set @@insert_id=400;
+insert into t1 values(NULL),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL),(NULL);
+insert into t1 values (500),(NULL),(502),(NULL),(NULL);
+select * from t1;
+set @@insert_id=600;
+--error ER_DUP_ENTRY
+insert into t1 values(600),(NULL),(NULL);
+set @@insert_id=600;
+insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+#
+# Test that auto-increment works when slave has rows in the table
+#
+set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1;
+
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
+
+sync_slave_with_master;
+insert into t1 values(2),(12),(22),(32),(42);
+connection master;
+
+insert into t1 values (NULL),(NULL);
+insert into t1 values (3),(NULL),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+
+# Test for BUG#20524 "auto_increment_* not observed when inserting
+# a too large value". When an autogenerated value was bigger than the
+# maximum possible value of the field, it was truncated to that max
+# possible value, without being "rounded down" to still honour
+# auto_increment_* variables.
+
+connection master;
+drop table t1;
+create table t1 (a tinyint not null auto_increment primary key) engine=myisam;
+insert into t1 values(103);
+set auto_increment_increment=11;
+set auto_increment_offset=4;
+insert into t1 values(null);
+insert into t1 values(null);
+--error 167
+insert into t1 values(null);
+select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
+
+# same but with a larger value
+create table t2 (a tinyint unsigned not null auto_increment primary key) engine=myisam;
+set auto_increment_increment=10;
+set auto_increment_offset=1;
+set insert_id=1000;
+insert into t2 values(10);
+--error 167
+insert into t2 values(null);
+select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;
+
+# An offset so big that even first value does not fit
+create table t3 like t1;
+set auto_increment_increment=1000;
+set auto_increment_offset=700;
+--error 167
+insert into t3 values(null);
+select * from t3 order by a;
+sync_slave_with_master;
+select * from t1 order by a;
+select * from t2 order by a;
+select * from t3 order by a;
+
+connection master;
+
+drop table t1,t2,t3;
+sync_slave_with_master;
+
+#
+# BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
+#
+connection master;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+
+sync_slave_with_master;
+show create table t1;
+
+connection master;
+drop table t1;
+
+#
+# BUG#45999 Row based replication fails when auto_increment field = 0.
+# Store engine of Slaves auto-generates new sequence numbers for
+# auto_increment fields if the values of them are 0. There is an inconsistency
+# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat
+#
+source include/rpl_reset.inc;
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine_type;
+eval CREATE TABLE t2 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine_type2;
+SET SQL_MODE='';
+# Value of the id will be 1;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t2 VALUES(NULL);
+SELECT * FROM t1;
+SELECT * FROM t2;
+# Value of the id will be 2;
+INSERT INTO t1 VALUES();
+INSERT INTO t2 VALUES();
+SELECT * FROM t1;
+SELECT * FROM t2;
+# Value of the id will be 3. The master treats 0 as NULL or empty because
+# NO_AUTO_VALUE_ON_ZERO is not assign to SQL_MODE.
+INSERT INTO t1 VALUES(0);
+INSERT INTO t2 VALUES(0);
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+# Value of the id will be 0. The master does not treat 0 as NULL or empty
+# because NO_AUTO_VALUE_ON_ZERO has assigned to SQL_MODE.
+INSERT INTO t1 VALUES(0);
+INSERT INTO t2 VALUES(0);
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+INSERT INTO t1 VALUES(4);
+INSERT INTO t2 VALUES(4);
+FLUSH LOGS;
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+sync_slave_with_master;
+
+connection master;
+let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL test
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+
+# End cleanup
+--connection master
+DROP TABLE t1;
+DROP TABLE t2;
+SET SQL_MODE='';
+sync_slave_with_master;
+
+#
+# Bug#54201: "SET INSERT_ID" event must be ignored if corresponding event is
+# ignored.
+#
+connection master;
+
+CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam;
+# -slave.opt has --replicate-ignore-table=test.t_ignored1
+CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+call mtr.add_suppression("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");
+sync_slave_with_master;
+
+connection slave;
+
+CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+INSERT INTO slave_only VALUES(NULL);
+CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL);
+
+connection master;
+
+INSERT INTO t_ignored1 VALUES(NULL);
+INSERT INTO t1 VALUES('s');
+UPDATE t1 SET s='s1';
+
+# With Bug#54201, slave stops with duplicate key error here due to trigger
+# using the insert_id from insert on master into t1_ignored1
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1;
+
+connection master;
+CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+sync_slave_with_master;
+
+connection slave;
+STOP SLAVE;
+# Ignore the next INSERT into t_ignored2 and the INSERT_ID event just before it.
+SET GLOBAL sql_slave_skip_counter = 2;
+START SLAVE;
+
+connection master;
+INSERT INTO t_ignored2 VALUES(NULL);
+UPDATE t1 SET s='s2';
+sync_slave_with_master;
+
+connection slave;
+SELECT * FROM t1;
+SHOW TABLES LIKE 't\_ignored_';
+SELECT * FROM t_ignored2;
+DROP TABLE slave_only;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t_ignored1;
+DROP TABLE t_ignored2;
+
+#
+# BUG#56662
+# The test verifies if the assertion of "next_insert_id == 0"
+# will fail in ha_external_lock() function.
+#
+connection master;
+CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
+
+BEGIN;
+--echo # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
+--echo # zero to fill the auto_increment field.
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+INSERT INTO t1(id,data) VALUES(0,2);
+--echo # Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
+--echo # affect the execution of the transaction on slave.
+SET SQL_MODE=0;
+COMMIT;
+SELECT * FROM t1;
+sync_slave_with_master;
+SELECT * FROM t1;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_auto_increment_insert_view.test b/mysql-test/suite/rpl/include/rpl_auto_increment_insert_view.test
new file mode 100644
index 00000000000..30b25955ecb
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_auto_increment_insert_view.test
@@ -0,0 +1,43 @@
+#
+# This test verifies if inserting data into view that invokes a
+# trigger will make the autoinc values become inconsistent on
+# master and slave.
+#
+connection master;
+CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
+CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
+CREATE TABLE t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
+eval create trigger tr16 $insert_action on t1 for each row insert into t3(a) values(new.c1);
+eval create trigger tr17 $insert_action on t2 for each row insert into t3(a) values(new.c2);
+begin;
+INSERT INTO t1(c1) VALUES (11), (12);
+INSERT INTO t2(c2) VALUES (13), (14);
+
+CREATE VIEW v16 AS SELECT c1, c2 FROM t1, t2;
+
+INSERT INTO v16(c1) VALUES (15),(16);
+INSERT INTO v16(c2) VALUES (17),(18);
+
+connection master1;
+INSERT INTO v16(c1) VALUES (19),(20);
+INSERT INTO v16(c2) VALUES (21),(22);
+
+connection master;
+INSERT INTO v16(c1) VALUES (23), (24);
+INSERT INTO v16(c1) VALUES (25), (26);
+commit;
+sync_slave_with_master;
+--echo #Test if the results are consistent on master and slave
+--echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
+let $diff_tables= master:t3, slave:t3;
+source include/diff_tables.inc;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP VIEW v16;
+sync_slave_with_master;
+
+
+
diff --git a/mysql-test/suite/rpl/include/rpl_auto_increment_invoke_trigger.test b/mysql-test/suite/rpl/include/rpl_auto_increment_invoke_trigger.test
new file mode 100644
index 00000000000..f93d435349f
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_auto_increment_invoke_trigger.test
@@ -0,0 +1,79 @@
+#
+# This test verifies if concurrent transactions that invoke a
+# trigger that inserts more than one values into one or more
+# tables with an auto_increment column will make the autoinc
+# values become inconsistent on master and slave.
+#
+
+connection master;
+create table t1(a int, b int) engine=innodb;
+create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
+eval create trigger tr1 $trigger_action on t1 for each row insert into t2(a) values(6);
+
+create table t3(a int, b int) engine=innodb;
+create table t4(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
+create table t5(a int) engine=innodb;
+delimiter |;
+eval create trigger tr2 $trigger_action on t3 for each row begin
+ insert into t4(a) values(f1_insert_triggered());
+ insert into t4(a) values(f1_insert_triggered());
+ insert into t5(a) values(8);
+end |
+delimiter ;|
+
+create table t6(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
+delimiter //;
+CREATE FUNCTION f1_insert_triggered() RETURNS INTEGER
+BEGIN
+ INSERT INTO t6(a) values(2),(3);
+ RETURN 1;
+END//
+delimiter ;//
+
+begin;
+let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+insert into t1(a,b) values(1,1),(2,1);
+insert into t3(a,b) values(1,1),(2,1);
+update t1 set a = a + 5 where b = 1;
+update t3 set a = a + 5 where b = 1;
+delete from t1 where b = 1;
+delete from t3 where b = 1;
+
+connection master1;
+#The default autocommit is set to 1, so the statement is auto committed
+insert into t2(a) values(3);
+insert into t4(a) values(3);
+
+connection master;
+commit;
+insert into t1(a,b) values(4,2);
+insert into t3(a,b) values(4,2);
+update t1 set a = a + 5 where b = 2;
+update t3 set a = a + 5 where b = 2;
+delete from t1 where b = 2;
+delete from t3 where b = 2;
+--echo # To verify if insert/update in an autoinc column causes statement to be logged in row format
+source include/show_binlog_events.inc;
+commit;
+
+connection master;
+sync_slave_with_master;
+--echo #Test if the results are consistent on master and slave
+--echo #for 'INVOKES A TRIGGER with $trigger_action action'
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+let $diff_tables= master:t4, slave:t4;
+source include/diff_tables.inc;
+let $diff_tables= master:t6, slave:t6;
+source include/diff_tables.inc;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+DROP TABLE t5;
+DROP TABLE t6;
+DROP FUNCTION f1_insert_triggered;
+sync_slave_with_master;
+
diff --git a/mysql-test/suite/rpl/include/rpl_autoinc_func_invokes_trigger.test b/mysql-test/suite/rpl/include/rpl_autoinc_func_invokes_trigger.test
new file mode 100644
index 00000000000..d7c26ea42f1
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_autoinc_func_invokes_trigger.test
@@ -0,0 +1,55 @@
+#
+# This test verifies if concurrent transactions that call a
+# function which invokes a 'after/before insert action' trigger
+# that inserts more than one values into a table with autoinc
+# column will make the autoinc values become inconsistent on
+# master and slave.
+#
+
+connection master;
+create table t1(a int) engine=innodb;
+create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
+create table t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
+delimiter |;
+CREATE FUNCTION f1_two_inserts_trigger() RETURNS INTEGER
+BEGIN
+ INSERT INTO t2(a) values(2),(3);
+ INSERT INTO t2(a) values(2),(3);
+ RETURN 1;
+END |
+eval create trigger tr11 $insert_action on t2 for each row begin
+ insert into t3(a) values(new.a);
+ insert into t3(a) values(new.a);
+end |
+delimiter ;|
+begin;
+let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+insert into t1(a) values(f1_two_inserts_trigger());
+
+connection master1;
+#The default autocommit is set to 1, so the statement is auto committed
+insert into t2(a) values(4),(5);
+
+connection master;
+commit;
+insert into t1(a) values(f1_two_inserts_trigger());
+--echo # To verify if insert/update in an autoinc column causes statement to be logged in row format
+source include/show_binlog_events.inc;
+commit;
+
+connection master;
+sync_slave_with_master;
+--echo #Test if the results are consistent on master and slave
+--echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action'
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+let $diff_tables= master:t3, slave:t3;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1;
+drop table t2;
+drop table t3;
+drop function f1_two_inserts_trigger;
+sync_slave_with_master;
+
diff --git a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc b/mysql-test/suite/rpl/include/rpl_binlog_errors.inc
new file mode 100644
index 00000000000..bf92736a2af
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_binlog_errors.inc
@@ -0,0 +1,438 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let $binlog_limit= X[,Y] # optional
+#
+# Semantics of the value is the same as in include/show_binlog_events.inc
+# which the script calls as a part of the test flow.
+# The goal is to print the event demonstrating the triggered error,
+# so normally Y should be 1 (print the exact event only);
+# however, depending on test-specific server options, the offset X
+# can be different.
+#
+
+# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
+# when generating new name.
+#
+# WHY
+# ===
+#
+# We want to check whether error is reported or not when
+# new_file_impl fails (this may happen when rotation is not
+# possible because there is some problem finding an
+# unique filename).
+#
+# HOW
+# ===
+#
+# Test cases are documented inline.
+
+-- source include/have_innodb.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+-- echo #######################################################################
+-- echo ####################### PART 1: MASTER TESTS ##########################
+-- echo #######################################################################
+
+
+### ACTION: stopping slave as it is not needed for the first part of
+### the test
+
+-- connection slave
+-- source include/stop_slave.inc
+-- connection master
+
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not use master-bin for logging");
+
+SET @old_debug= @@global.debug_dbug;
+
+### ACTION: create a large file (> 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check binlog errors in its vacinity
+-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
+
+### ACTION: create a small file (< 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check for absence of binlog errors
+### when file loading this file does not force flushing and
+### rotating the binary log
+-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
+
+RESET MASTER;
+
+-- echo ###################### TEST #1
+
+### ASSERTION: no problem flushing logs (should show two binlogs)
+FLUSH LOGS;
+-- echo # assert: must show two binlogs
+-- source include/show_binary_logs.inc
+
+-- echo ###################### TEST #2
+
+### ASSERTION: check that FLUSH LOGS actually fails and reports
+### failure back to the user if find_uniq_filename fails
+### (should show just one binlog)
+
+RESET MASTER;
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+-- echo # assert: must show one binlog
+-- source include/show_binary_logs.inc
+
+### ACTION: clean up and move to next test
+SET @@global.debug_dbug=@old_debug;
+RESET MASTER;
+
+-- echo ###################### TEST #3
+
+### ACTION: create some tables (t1, t2, t4) and insert some values in
+### table t1
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+
+### ASSERTION: we force rotation of the binary log because it exceeds
+### the max_binlog_size option (should show two binary
+### logs)
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# shows two binary logs
+-- echo # assert: must show two binlog
+-- source include/show_binary_logs.inc
+
+# clean up the table and the binlog to be used in next part of test
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #4
+
+### ASSERTION: load the big file into a transactional table and check
+### that it reports error. The table will contain the
+### changes performed despite the fact that it reported an
+### error.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #5
+
+### ASSERTION: load the small file into a transactional table and
+### check that it succeeds
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #6
+
+### ASSERTION: check that even if one is using a transactional table
+### and explicit transactions (no autocommit) if rotation
+### fails we get the error. Transaction is not rolledback
+### because rotation happens after the commit.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+INSERT INTO t2 VALUES ('muse');
+-- error ER_NO_UNIQUE_LOGFILE
+COMMIT;
+
+### ACTION: Show the contents of the table after the test
+-- echo # assert: must show three entries
+SELECT count(*) FROM t2;
+
+### ACTION: clean up and move to the next test
+SET AUTOCOMMIT= 1;
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #7
+
+### ASSERTION: check that on a non-transactional table, if rotation
+### fails then an error is reported and an incident event
+### is written to the current binary log.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+
+# Disable logging Annotate_rows events to preserve events count.
+let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
+SET @@binlog_annotate_row_events= 0;
+
+SELECT count(*) FROM t4;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+
+-- echo ### check that the incident event is written to the current log
+SET @@global.debug_dbug=@old_debug;
+if (!$binlog_limit)
+{
+ -- let $binlog_limit= 4,1
+}
+-- source include/show_binlog_events.inc
+
+# clean up and move to next test
+DELETE FROM t4;
+
+--disable_query_log
+eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
+--enable_query_log
+
+RESET MASTER;
+
+-- echo ###################### TEST #8
+
+### ASSERTION: check that statements end up in error but they succeed
+### on changing the data.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- echo # must show 0 entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+-- error ER_NO_UNIQUE_LOGFILE
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+
+-- echo # INFO: Count(*) Before Offending DELETEs
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+-- echo # assert: must show 4 entries
+SELECT count(*) FROM t2;
+
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t4;
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t2;
+
+-- echo # INFO: Count(*) After Offending DELETEs
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+# remove fault injection
+SET @@global.debug_dbug=@old_debug;
+
+-- echo ###################### TEST #9
+
+### ASSERTION: check that if we disable binlogging, then statements
+### succeed.
+SET @@global.debug_dbug="d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+-- echo # assert: must show four entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+DELETE FROM t2;
+DELETE FROM t4;
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+SET SQL_LOG_BIN=1;
+SET @@global.debug_dbug=@old_debug;
+
+-- echo ###################### TEST #10
+
+### ASSERTION: check that error is reported if there is a failure
+### while registering the index file and the binary log
+### file or failure to write the rotate event.
+
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not use .*");
+
+RESET MASTER;
+SHOW WARNINGS;
+
+# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
+SET @@global.debug_dbug="d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET @@global.debug_dbug=@old_debug;
+
+-- error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+flush tables;
+
+-- echo ###################### TEST #11
+
+### ASSERTION: check that error is reported if there is a failure
+### while opening the index file and the binary log file or
+### failure to write the rotate event.
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
+SET @@global.debug_dbug="d,fault_injection_openning_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET @@global.debug_dbug=@old_debug;
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+flush tables;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+-- echo ###################### TEST #12
+
+### ASSERTION: check that error is reported if there is a failure
+### while writing the rotate event when creating a new log
+### file.
+
+# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
+SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event";
+-- error ER_ERROR_ON_WRITE
+FLUSH LOGS;
+SET @@global.debug_dbug=@old_debug;
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+flush tables;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+## clean up
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+
+# restart slave again
+-- connection slave
+-- source include/start_slave.inc
+-- connection master
+
+-- echo #######################################################################
+-- echo ####################### PART 2: SLAVE TESTS ###########################
+-- echo #######################################################################
+
+### setup
+--source include/rpl_reset.inc
+-- connection slave
+
+# slave suppressions
+
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not use .*");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+-- echo ###################### TEST #13
+
+#### ASSERTION: check against unique log filename error
+-- let $io_thd_injection_fault_flag= error_unique_log_filename
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #14
+
+#### ASSERTION: check against rotate failing
+-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #15
+
+#### ASSERTION: check against relay log open failure
+-- let $io_thd_injection_fault_flag= fault_injection_registering_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #16
+
+#### ASSERTION: check against relay log index open failure
+-- let $io_thd_injection_fault_flag= fault_injection_openning_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+### clean up
+-- source include/stop_slave_sql.inc
+RESET SLAVE;
+RESET MASTER;
+--remove_file $load_file
+--remove_file $load_file2
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test
new file mode 100644
index 00000000000..0f46b00f683
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test
@@ -0,0 +1,452 @@
+########################################################################################
+# This test verifies if the binlog is not corrupted when the cache buffer is not
+# big enough to accommodate the changes and is divided in five steps:
+#
+# 1 - Single Statements:
+# 1.1 - Single statement on transactional table.
+# 1.2 - Single statement on non-transactional table.
+# 1.3 - Single statement on both transactional and non-transactional tables.
+# In both 1.2 and 1.3, an incident event is logged to notify the user that the
+# master and slave are diverging.
+#
+# 2 - Transactions ended by an implicit commit.
+#
+# 3 - Transactions ended by a COMMIT.
+#
+# 4 - Transactions ended by a ROLLBACK.
+#
+# 5 - Transactions with a failing statement that updates a non-transactional
+# table. In this case, a failure means that the statement does not get into
+# the cache and an incident event is logged to notify the user that the master
+# and slave are diverging.
+#
+########################################################################################
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
+let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
+let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1);
+let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1);
+
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+disconnect master;
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
+CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
+CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
+CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
+
+let $data = `select concat('"', repeat('a',2000), '"')`;
+
+--echo ########################################################################################
+--echo # 1 - SINGLE STATEMENT
+--echo ########################################################################################
+
+connection master;
+
+--echo *** Single statement on transactional table ***
+--disable_query_log
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+eval INSERT INTO t1 (a, data) VALUES (1,
+ CONCAT($data, $data, $data, $data, $data));
+--enable_query_log
+
+--echo *** Single statement on non-transactional table ***
+--disable_query_log
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+eval INSERT INTO t2 (a, data) VALUES (2,
+ CONCAT($data, $data, $data, $data, $data, $data));
+--enable_query_log
+
+# Incident event
+# 1590=ER_SLAVE_INCIDENT
+--let $slave_sql_errno= 1590
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--disable_query_log
+eval INSERT INTO t1 (a, data) VALUES (3, $data);
+eval INSERT INTO t1 (a, data) VALUES (4, $data);
+eval INSERT INTO t1 (a, data) VALUES (5, $data);
+eval INSERT INTO t2 (a, data) VALUES (3, $data);
+eval INSERT INTO t2 (a, data) VALUES (4, $data);
+eval INSERT INTO t2 (a, data) VALUES (5, $data);
+--enable_query_log
+
+--echo *** Single statement on both transactional and non-transactional tables. ***
+--disable_query_log
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data),
+ t1.data = CONCAT($data, $data, $data, $data);
+--enable_query_log
+
+# 1590=ER_SLAVE_INCIDENT
+--let $slave_sql_errno= 1590
+--let $slave_skip_counter= `SELECT IF(@@binlog_format = 'ROW', 2, 1)`
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################################
+--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL
+--echo ########################################################################################
+
+connection master;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+set default_storage_engine=innodb;
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (1, $data);
+--eval INSERT INTO t1 (a, data) VALUES (2, $data);
+--eval INSERT INTO t1 (a, data) VALUES (3, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (4, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (5, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (6, $data);
+--enable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (7, 's');
+--eval INSERT INTO t2 (a, data) VALUES (8, 's');
+--eval INSERT INTO t1 (a, data) VALUES (9, 's');
+
+ALTER TABLE t3 ADD COLUMN d int;
+
+--disable_query_log
+--eval INSERT INTO t2 (a, data) VALUES (10, $data);
+--eval INSERT INTO t2 (a, data) VALUES (11, $data);
+--eval INSERT INTO t2 (a, data) VALUES (12, $data);
+--eval INSERT INTO t2 (a, data) VALUES (13, $data);
+--enable_query_log
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (14, $data);
+--eval INSERT INTO t1 (a, data) VALUES (15, $data);
+--eval INSERT INTO t1 (a, data) VALUES (16, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (17, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (18, $data);
+--enable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (19, 's');
+--eval INSERT INTO t2 (a, data) VALUES (20, 's');
+--eval INSERT INTO t1 (a, data) VALUES (21, 's');
+
+if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
+{
+ CREATE TABLE t4 SELECT * FROM t1;
+}
+if (`SELECT @@binlog_format = 'ROW'`)
+{
+ --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+ CREATE TABLE t4 SELECT * FROM t1;
+}
+
+--disable_query_log
+--eval INSERT INTO t2 (a, data) VALUES (15, $data);
+--enable_query_log
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (22, $data);
+--eval INSERT INTO t1 (a, data) VALUES (23, $data);
+--eval INSERT INTO t1 (a, data) VALUES (24, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (25, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (26, $data);
+--enable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (27, 's');
+--eval INSERT INTO t2 (a, data) VALUES (28, 's');
+--eval INSERT INTO t1 (a, data) VALUES (29, 's');
+
+CREATE TABLE t5 (a int);
+
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################################
+--echo # 3 - BEGIN - COMMIT
+--echo ########################################################################################
+
+connection master;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (1, $data);
+--eval INSERT INTO t1 (a, data) VALUES (2, $data);
+--eval INSERT INTO t1 (a, data) VALUES (3, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (4, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (5, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (6, $data);
+--eval INSERT INTO t1 (a, data) VALUES (7, 's');
+--eval INSERT INTO t2 (a, data) VALUES (8, 's');
+--eval INSERT INTO t1 (a, data) VALUES (9, 's');
+--enable_query_log
+COMMIT;
+
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################################
+--echo # 4 - BEGIN - ROLLBACK
+--echo ########################################################################################
+
+connection master;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (1, $data);
+--eval INSERT INTO t1 (a, data) VALUES (2, $data);
+--eval INSERT INTO t1 (a, data) VALUES (3, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (4, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (5, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (6, $data);
+--eval INSERT INTO t1 (a, data) VALUES (7, 's');
+--eval INSERT INTO t2 (a, data) VALUES (8, 's');
+--eval INSERT INTO t1 (a, data) VALUES (9, 's');
+--enable_query_log
+ROLLBACK;
+
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################################
+--echo # 5 - PROCEDURE
+--echo ########################################################################################
+
+connection master;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+
+DELIMITER //;
+
+CREATE PROCEDURE p1(pd VARCHAR(30000))
+BEGIN
+ INSERT INTO t1 (a, data) VALUES (1, pd);
+ INSERT INTO t1 (a, data) VALUES (2, pd);
+ INSERT INTO t1 (a, data) VALUES (3, pd);
+ INSERT INTO t1 (a, data) VALUES (4, pd);
+ INSERT INTO t1 (a, data) VALUES (5, 's');
+END//
+
+DELIMITER ;//
+
+TRUNCATE TABLE t1;
+
+--disable_query_log
+eval CALL p1($data);
+--enable_query_log
+
+TRUNCATE TABLE t1;
+
+BEGIN;
+--disable_query_log
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+eval CALL p1($data);
+--enable_query_log
+COMMIT;
+
+TRUNCATE TABLE t1;
+
+BEGIN;
+--disable_query_log
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+eval CALL p1($data);
+--enable_query_log
+ROLLBACK;
+
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################################
+--echo # 6 - XID
+--echo ########################################################################################
+
+connection master;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (1, $data);
+--eval INSERT INTO t1 (a, data) VALUES (2, $data);
+--eval INSERT INTO t1 (a, data) VALUES (3, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (4, $data);
+SAVEPOINT sv;
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (5, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (6, $data);
+--enable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (7, 's');
+--eval INSERT INTO t2 (a, data) VALUES (8, 's');
+--eval INSERT INTO t1 (a, data) VALUES (9, 's');
+ROLLBACK TO sv;
+COMMIT;
+
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################################
+--echo # 7 - NON-TRANS TABLE
+--echo ########################################################################################
+
+connection master;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (1, $data);
+--eval INSERT INTO t1 (a, data) VALUES (2, $data);
+--eval INSERT INTO t2 (a, data) VALUES (3, $data);
+--eval INSERT INTO t1 (a, data) VALUES (4, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (5, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (6, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (7, $data);
+--eval UPDATE t2 SET data= CONCAT($data, $data);
+--enable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (8, 's');
+--eval INSERT INTO t1 (a, data) VALUES (9, 's');
+--eval INSERT INTO t2 (a, data) VALUES (10, 's');
+--eval INSERT INTO t1 (a, data) VALUES (11, 's');
+COMMIT;
+
+BEGIN;
+--disable_query_log
+--eval INSERT INTO t1 (a, data) VALUES (15, $data);
+--eval INSERT INTO t1 (a, data) VALUES (16, $data);
+--eval INSERT INTO t2 (a, data) VALUES (17, $data);
+--eval INSERT INTO t1 (a, data) VALUES (18, $data);
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
+--eval INSERT INTO t1 (a, data) VALUES (19, $data);
+--enable_query_log
+COMMIT;
+
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################
+--echo # 8 - Bug#55375(Regression Bug) Transaction bigger than
+--echo # max_binlog_cache_size crashes slave
+--echo ########################################################################
+
+--echo # [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+
+source include/stop_slave.inc;
+source include/start_slave.inc;
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
+
+connection master;
+TRUNCATE t1;
+
+sync_slave_with_master;
+--let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+connection master;
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+--replace_result $old_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
+--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
+--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
+disconnect master;
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
+--let $n=128
+BEGIN;
+--disable_query_log
+--echo Repeat statement 'INSERT INTO t1 VALUES(\$n, repeat("a", 32))' $n times
+while ($n)
+{
+ --eval INSERT INTO t1 VALUES ($n, repeat("a", 32))
+ --dec $n
+}
+--enable_query_log
+COMMIT;
+
+--connection slave
+--let $slave_sql_errno= 1197
+if (`SELECT @@binlog_format = 'ROW'`)
+{
+ --let $slave_sql_errno= 1534
+}
+source include/wait_for_slave_sql_error.inc;
+
+SELECT count(*) FROM t1;
+source include/show_binlog_events.inc;
+
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+--replace_result $old_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
+--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
+--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
+
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+SELECT count(*) FROM t1;
+
+--echo ########################################################################################
+--echo # CLEAN
+--echo ########################################################################################
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+# t4 exists only if binlog_format!=row, so so a warning is generated
+# if binog_format=row
+--disable_warnings
+DROP TABLE IF EXISTS t4;
+--enable_warnings
+DROP TABLE t5;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/rpl/include/rpl_blackhole.test b/mysql-test/suite/rpl/include/rpl_blackhole.test
new file mode 100644
index 00000000000..6e7102b4203
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_blackhole.test
@@ -0,0 +1,30 @@
+# Check replication of one statement assuming that the engine on the
+# slave is a blackhole engine.
+
+# Input:
+# $statement Statement to evaluate, it is assumed to change t1
+
+# 1. Evaluate statement on master, it is assumed to change t1
+# 2. Wait for statement to be processed on slave
+# 3. SELECT from table t1 to see what was written
+# 4. Compare position on slave before executing statement and after
+# executing statement. If difference is >0, then something was
+# written to the binary log on the slave.
+
+# On Connection Slave
+let $before = query_get_value("SHOW MASTER STATUS", Position, 1);
+
+connection master;
+eval $statement;
+
+sync_slave_with_master;
+--echo # Expect 0
+SELECT COUNT(*) FROM t1;
+let $after = query_get_value("SHOW MASTER STATUS", Position, 1);
+let $something_written = `select $after - $before != 0`;
+if ($something_written) {
+ --echo >>> Something was written to binary log <<<
+}
+if (!$something_written) {
+ --echo >>> Nothing was written to binary log <<<
+}
diff --git a/mysql-test/suite/rpl/include/rpl_blackhole_basic.test b/mysql-test/suite/rpl/include/rpl_blackhole_basic.test
new file mode 100644
index 00000000000..c315906d47b
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_blackhole_basic.test
@@ -0,0 +1,97 @@
+# PURPOSE. Test that blackhole works with replication in all three
+# modes: STATEMENT, MIXED, and ROW.
+#
+# METHOD. We start by creating a table on the master and then change
+# the engine to use blackhole on the slave.
+#
+# After insert/update/delete of one or more rows, the test the
+# proceeds to check that replication is running after replicating an
+# change, that the blackhole engine does not contain anything (which
+# is just a check that the correct engine is used), and that something
+# is written to the binary log.
+#
+# Whe check INSERT, UPDATE, and DELETE statement for tables with no
+# key (forcing a range search on the slave), primary keys (using a
+# primary key lookup), and index/key with multiple matches (forcing an
+# index search).
+
+# We start with no primary key
+CREATE TABLE t1 (a INT, b INT, c INT);
+CREATE TABLE t2 (a INT, b INT, c INT);
+
+sync_slave_with_master;
+ALTER TABLE t1 ENGINE=BLACKHOLE;
+
+connection master;
+INSERT INTO t2 VALUES (1,9,1), (2,9,2), (3,9,3), (4,9,4);
+sync_slave_with_master;
+
+# Test insert, no primary key
+let $statement = INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4);
+source include/rpl_blackhole.test;
+
+# Test update, no primary key
+let $statement = UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 1;
+source include/rpl_blackhole.test;
+
+# Test delete, no primary key
+let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 1;
+source include/rpl_blackhole.test;
+
+# Test INSERT-SELECT into Blackhole, no primary key
+let $statement = INSERT INTO t1 SELECT * FROM t2;
+source include/rpl_blackhole.test;
+
+#
+# The MASTER has MyISAM as the engine for both tables. The SLAVE has Blackhole
+# on t1 (transactional engine) and MyISAM on t2 (non-transactional engine).
+#
+# In MIXED mode, the command "INSERT INTO t2 SELECT * FROM t1" is logged as
+# statement on the master. On the slave, it is tagged as unsafe because the
+# statement mixes both transactional and non-transactional engines and as such
+# its changes are logged as rows. However, due to the nature of the blackhole
+# engine, no rows are returned and thus any chain replication would make the
+# next master on the chain diverge.
+#
+# Fo this reason, we have disabled the statement.
+#
+# Test INSERT-SELECT from Blackhole, no primary key
+# let $statement = INSERT INTO t2 SELECT * FROM t1;
+# source include/rpl_blackhole.test;
+#
+
+connection master;
+ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b);
+sync_slave_with_master;
+
+# Test insert, primary key
+let $statement = INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4);
+source include/rpl_blackhole.test;
+
+# Test update, primary key
+let $statement = UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 2;
+source include/rpl_blackhole.test;
+
+# Test delete, primary key
+let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 2;
+source include/rpl_blackhole.test;
+
+connection master;
+ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a);
+sync_slave_with_master;
+
+# Test insert, key
+let $statement = INSERT INTO t1 VALUES (1,3,1),(2,3,2),(3,3,3),(4,3,4);
+source include/rpl_blackhole.test;
+
+# Test update, key
+let $statement = UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 3;
+source include/rpl_blackhole.test;
+
+# Test delete, key
+let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
+source include/rpl_blackhole.test;
+
+connection master;
+DROP TABLE t1,t2;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc b/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc
new file mode 100644
index 00000000000..7dfef023947
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc
@@ -0,0 +1,83 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# Bug#11747416 : 32228 A disk full makes binary log corrupt.
+#
+#
+# The test demonstrates reading from binlog error propagation to slave
+# and reporting there.
+# Conditions for the bug include a crash at time of the last event to
+# the binlog was written partly. With the fixes the event is not sent out
+# any longer, but rather the dump thread sends out a sound error message.
+#
+# Crash is not simulated. A binlog with partly written event in its end is installed
+# and replication is started from it.
+#
+
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--connection slave
+# Make sure the slave is stopped while we are messing with master.
+# Otherwise we get occasional failures as the slave manages to re-connect
+# to the newly started master and we get extra events applied, causing
+# conflicts.
+--source include/stop_slave.inc
+
+--connection master
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+# evidence of the partial binlog
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+
+--connection slave
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+reset slave;
+start slave;
+
+# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+--let $slave_param=Last_IO_Errno
+--let $slave_param_value=1236
+--source include/wait_for_slave_param.inc
+
+--let $slave_field_result_replace= / at [0-9]*/ at XXX/
+--let $status_items= Last_IO_Errno, Last_IO_Error
+--source include/show_slave_status.inc
+
+#
+# Cleanup
+#
+
+--connection master
+reset master;
+
+--connection slave
+stop slave;
+reset slave;
+# Table was created from binlog, it may not be created if SQL thread is running
+# slowly and IO thread reaches incident before SQL thread applies it.
+--disable_warnings
+drop table if exists t;
+--enable_warnings
+reset master;
+
+--echo End of the tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_charset.test b/mysql-test/suite/rpl/include/rpl_charset.test
new file mode 100644
index 00000000000..e67122cbb4c
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_charset.test
@@ -0,0 +1,148 @@
+# Replication of character sets.
+# This test will fail if the server/client does not support enough charsets.
+
+source include/master-slave.inc;
+set timestamp=1000000000;
+
+create database mysqltest2 character set latin2;
+set @@character_set_server=latin5;
+create database mysqltest3;
+show create database mysqltest2;
+show create database mysqltest3;
+sync_slave_with_master;
+show create database mysqltest2;
+show create database mysqltest3;
+
+connection master;
+set @@collation_server=armscii8_bin;
+drop database mysqltest3;
+create database mysqltest3;
+show create database mysqltest3;
+sync_slave_with_master;
+show create database mysqltest3;
+
+connection master;
+use mysqltest2;
+create table t1 (a int auto_increment primary key, b varchar(100));
+set character_set_client=cp850, collation_connection=latin2_croatian_ci;
+insert into t1 (b) values(@@character_set_server);
+insert into t1 (b) values(@@collation_server);
+# character_set_database and collation_database are not tested as they
+# needn't be replicated (Bar said in Jan 2005).
+insert into t1 (b) values(@@character_set_client);
+# collation_client does not exist
+insert into t1 (b) values(@@character_set_connection);
+insert into t1 (b) values(@@collation_connection);
+select * from t1 order by a;
+sync_slave_with_master;
+select * from mysqltest2.t1 order by a;
+
+connection master;
+set character_set_client=latin1, collation_connection=latin1_german1_ci;
+truncate table t1;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+set collation_connection=latin1_german2_ci;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+select * from t1 order by a;
+sync_slave_with_master;
+select * from mysqltest2.t1 order by a;
+
+# Presently charset info is not logged with LOAD DATA but it will
+# change in Jan 2005 when Dmitri pushes his new LOAD DATA,
+# before 5.0.3 goes out. When done, LOAD DATA INFILE should be tested
+# here.
+
+# See if user var is prefixed with collation in binlog and replicated well.
+# Note: replication of user variables is broken as far as derivation is
+# concerned. That's because when we store a user variable in the binlog,
+# we lose its derivation. So later on the slave, it's impossible to
+# know if the collation was explicit or not, so we use DERIVATION_NONE,
+# which provokes error messages (like 'Illegal mix of collation') when
+# we replay the master's INSERT/etc statements.
+connection master;
+set @a= _cp850 'Müller' collate cp850_general_ci;
+truncate table t1;
+insert into t1 (b) values(collation(@a));
+select * from t1 order by a;
+sync_slave_with_master;
+select * from mysqltest2.t1 order by a;
+
+connection master;
+drop database mysqltest2;
+drop database mysqltest3;
+sync_slave_with_master;
+
+# Check that we can change global.collation_server (since 5.0.3)
+
+set global character_set_server=latin2;
+set global character_set_server=latin1; # back
+connection master;
+set global character_set_server=latin2;
+set global character_set_server=latin1; # back
+
+# Test of wrong character set numbers;
+error 1115;
+set character_set_client=9999999;
+error 1273;
+set collation_server=9999998;
+
+# This one was contributed by Sergey Petrunia (BUG#3943)
+
+use test;
+CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
+SET CHARACTER_SET_CLIENT=koi8r,
+ CHARACTER_SET_CONNECTION=cp1251,
+ CHARACTER_SET_RESULTS=koi8r;
+INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
+select hex(c1), hex(c2) from t1;
+sync_slave_with_master;
+select hex(c1), hex(c2) from t1;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+#
+# BUG#6676: Derivation of variables must be correct on slave
+#
+connection master;
+eval create table `t1` (
+ `pk` varchar(10) not null default '',
+ primary key (`pk`)
+) engine=$engine_type default charset=latin1;
+set @p=_latin1 'test';
+update t1 set pk='test' where pk=@p;
+drop table t1;
+
+# End of 4.1 tests
+
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+
+--echo #
+--echo # MDEV-12685 Oracle-compatible function CHR()
+--echo #
+
+connection master;
+CREATE DATABASE db1 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;
+USE db1;
+CREATE TABLE t1 AS SELECT CHR(0x60);
+sync_slave_with_master;
+SHOW CREATE TABLE db1.t1;
+connection master;
+USE test;
+DROP DATABASE db1;
+sync_slave_with_master;
+
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_checksum.inc b/mysql-test/suite/rpl/include/rpl_checksum.inc
new file mode 100644
index 00000000000..17a986dc308
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_checksum.inc
@@ -0,0 +1,335 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# WL2540 replication events checksum
+# Testing configuration parameters
+
+--source include/have_debug.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
+call mtr.add_suppression('Replication event checksum verification failed');
+# due to C failure simulation
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
+
+# A. read/write access to the global vars:
+# binlog_checksum master_verify_checksum slave_sql_verify_checksum
+
+connection master;
+
+set @master_save_binlog_checksum= @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+
+select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.binlog_checksum as 'no session var';
+
+select @@global.master_verify_checksum as 'must be zero because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.master_verify_checksum as 'no session var';
+
+connection slave;
+
+set @slave_save_binlog_checksum= @@global.binlog_checksum;
+set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
+
+select @@global.slave_sql_verify_checksum as 'must be one because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.slave_sql_verify_checksum as 'no session var';
+
+connection master;
+
+source include/show_binary_logs.inc;
+set @@global.binlog_checksum = NONE;
+select @@global.binlog_checksum;
+--echo *** must be rotations seen ***
+source include/show_binary_logs.inc;
+
+set @@global.binlog_checksum = default;
+select @@global.binlog_checksum;
+
+# testing lack of side-effects in non-effective update of binlog_checksum:
+set @@global.binlog_checksum = CRC32;
+select @@global.binlog_checksum;
+set @@global.binlog_checksum = CRC32;
+
+set @@global.master_verify_checksum = 0;
+set @@global.master_verify_checksum = default;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.binlog_checksum = ADLER32;
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.master_verify_checksum = 2; # the var is of bool type
+
+connection slave;
+
+set @@global.slave_sql_verify_checksum = 0;
+set @@global.slave_sql_verify_checksum = default;
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
+
+#
+# B. Old Slave to New master conditions
+#
+# while master does not send a checksum-ed binlog the Old Slave can
+# work with the New Master
+
+connection master;
+
+set @@global.binlog_checksum = NONE;
+create table t1 (a int);
+
+# testing that binlog rotation preserves opt_binlog_checksum value
+flush logs;
+flush logs;
+-- source include/wait_for_binlog_checkpoint.inc
+flush logs;
+
+sync_slave_with_master;
+#connection slave;
+# checking that rotation on the slave side leaves slave stable
+flush logs;
+flush logs;
+flush logs;
+select count(*) as zero from t1;
+
+source include/stop_slave.inc;
+
+connection master;
+set @@global.binlog_checksum = CRC32;
+-- source include/wait_for_binlog_checkpoint.inc
+insert into t1 values (1) /* will not be applied on slave due to simulation */;
+
+# instruction to the dump thread
+
+connection slave;
+set @saved_dbug = @@global.debug_dbug;
+set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
+start slave;
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+source include/wait_for_slave_io_error.inc;
+
+select count(*) as zero from t1;
+
+set @@global.debug_dbug = @saved_dbug;
+
+connection slave;
+source include/start_slave.inc;
+
+#
+# C. checksum failure simulations
+#
+
+# C1. Failure by a client thread
+connection master;
+set @@global.master_verify_checksum = 1;
+set @save_dbug = @@session.debug_dbug;
+set @@session.debug_dbug='d,simulate_checksum_test_failure';
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+SET debug_dbug= @save_dbug;
+set @@global.master_verify_checksum = default;
+
+#connection master;
+sync_slave_with_master;
+
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+create table t2 (a int);
+let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+
+# C2. Failure by IO thread
+# instruction to io thread
+set @saved_dbug = @@global.debug_dbug;
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+start slave io_thread;
+# When the checksum error is detected, the slave sets error code 1913
+# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
+# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
+# So we usually get 1595, but it is occasionally possible to get 1913.
+--let $slave_io_errno= 1595,1913
+--let $show_slave_io_error= 0
+source include/wait_for_slave_io_error.inc;
+set @@global.debug_dbug = @saved_dbug;
+
+# to make IO thread re-read it again w/o the failure
+start slave io_thread;
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= $pos_master;
+source include/wait_for_slave_param.inc;
+
+# C3. Failure by SQL thread
+# instruction to sql thread;
+set @@global.slave_sql_verify_checksum = 1;
+
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+
+start slave sql_thread;
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+source include/wait_for_slave_sql_error.inc;
+
+# resuming SQL thread to parse out the event w/o the failure
+
+set @@global.debug_dbug = @saved_dbug;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be zero' from t2;
+
+#
+# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
+# random value on binlog_checksum on both master and slave
+#
+connection slave;
+stop slave;
+reset slave;
+
+# randomize slave server's own checksum policy
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+flush logs;
+
+connection master;
+set @@global.binlog_checksum= CRC32;
+reset master;
+flush logs;
+create table t3 (a int, b char(5));
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be zero' from t3;
+source include/stop_slave.inc;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+
+connection master;
+flush logs;
+reset master;
+insert into t3 value (1, @@global.binlog_checksum);
+
+connection slave;
+source include/start_slave.inc;
+flush logs;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be one' from t3;
+
+connection master;
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+insert into t3 value (1, @@global.binlog_checksum);
+sync_slave_with_master;
+
+#connection slave;
+
+#clean-up
+
+connection master;
+drop table t1, t2, t3;
+set @@global.binlog_checksum = @master_save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+
+#
+# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
+#
+# Sanity check that verifies that no assertions are triggered because
+# of old FD events (generated by versions prior to server released with
+# checksums feature)
+#
+# There is no need for query log, if something wrong this should trigger
+# an assertion
+
+--disable_query_log
+
+BINLOG '
+MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
+';
+
+--enable_query_log
+
+#connection slave;
+sync_slave_with_master;
+
+
+--echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
+
+--connection master
+
+--source include/wait_for_binlog_checkpoint.inc
+CREATE TABLE t4 (a INT PRIMARY KEY);
+INSERT INTO t4 VALUES (1);
+
+SET sql_log_bin=0;
+CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
+SET sql_log_bin=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET debug_dbug= '+d,binlog_inject_new_name_error';
+--error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+SET debug_dbug= @old_dbug;
+
+INSERT INTO t4 VALUES (2);
+
+--connection slave
+--let $slave_sql_errno= 1590
+--source include/wait_for_slave_sql_error.inc
+
+# Search the error log for the error message.
+# The bug was that 4 garbage bytes were output in the middle of the error
+# message; by searching for a pattern that spans that location, we can
+# catch the error.
+let $log_error_= `SELECT @@GLOBAL.log_error`;
+if(!$log_error_)
+{
+ # MySQL Server on windows is started with --console and thus
+ # does not know the location of its .err log, use default location
+ let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
+}
+--let SEARCH_FILE= $log_error_
+--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
+--source include/search_pattern_in_file.inc
+
+SELECT * FROM t4 ORDER BY a;
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+
+--connection master
+--save_master_pos
+
+--connection slave
+--sync_with_master
+SELECT * FROM t4 ORDER BY a;
+
+
+--connection slave
+set @@global.binlog_checksum = @slave_save_binlog_checksum;
+set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
+
+--echo End of tests
+
+--connection master
+DROP TABLE t4;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_checksum_cache.inc b/mysql-test/suite/rpl/include/rpl_checksum_cache.inc
new file mode 100644
index 00000000000..e04f618b81e
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_checksum_cache.inc
@@ -0,0 +1,261 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+
+--disable_warnings
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
+--enable_warnings
+
+connection master;
+set @save_binlog_cache_size = @@global.binlog_cache_size;
+set @save_binlog_checksum = @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+set @@global.binlog_cache_size = 4096;
+set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 1;
+
+# restart slave to force the dump thread to verify events (on master side)
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
+
+#
+# Testing a critical part of checksum handling dealing with transaction cache.
+# The cache's buffer size is set to be less than the transaction's footprint
+# in binlog.
+#
+# To verify combined buffer-by-buffer read out of the file and fixing crc per event
+# there are the following parts:
+#
+# 1. the event size is much less than the cache's buffer
+# 2. the event size is bigger than the cache's buffer
+# 3. the event size if approximately the same as the cache's buffer
+# 4. all in above
+
+#
+# 1. the event size is much less than the cache's buffer
+#
+
+flush status;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# parameter to ensure the test slightly varies binlog content
+# between different invocations
+#
+let $deviation_size=32;
+eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+
+delimiter |;
+create procedure test.p_init (n int, size int)
+begin
+ while n > 0 do
+ select round(RAND() * size) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t1 values(n, @data );
+ set n= n-1;
+ end while;
+end|
+
+delimiter ;|
+
+let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
+
+begin;
+--disable_warnings
+# todo: check if it is really so.
+#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
+eval call test.p_init($1, $deviation_size);
+--enable_warnings
+commit;
+
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t1, slave:test.t1;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t1;
+commit;
+
+sync_slave_with_master;
+
+
+#
+# 2. the event size is bigger than the cache's buffer
+#
+connection master;
+
+flush status;
+let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
+let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
+let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
+
+eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
+let $1=100;
+--disable_query_log
+begin;
+while ($1)
+{
+ eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t2 set data = @data;
+ dec $1;
+}
+commit;
+--enable_query_log
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t2, slave:test.t2;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t2;
+commit;
+
+sync_slave_with_master;
+
+#
+# 3. the event size if approximately the same as the cache's buffer
+#
+
+connection master;
+
+flush status;
+let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
+let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
+let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
+
+eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
+
+let $1= 300;
+--disable_query_log
+begin;
+while ($1)
+{
+ eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
+ insert into t3 set data= repeat('a', @act_size);
+ dec $1;
+}
+commit;
+--enable_query_log
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t3, slave:test.t3;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t3;
+commit;
+
+sync_slave_with_master;
+
+
+#
+# 4. all in above
+#
+
+connection master;
+flush status;
+
+delimiter |;
+eval create procedure test.p1 (n int)
+begin
+ while n > 0 do
+ case (select (round(rand()*100) % 3) + 1)
+ when 1 then
+ select round(RAND() * $deviation_size) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t1 values(n, @data);
+ when 2 then
+ begin
+ select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
+ insert into t2 set data=repeat('a', @act_size);
+ end;
+ when 3 then
+ begin
+ select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
+ insert into t3 set data= repeat('a', @act_size);
+ end;
+ end case;
+ set n= n-1;
+ end while;
+end|
+delimiter ;|
+
+let $1= 1000;
+set autocommit= 0;
+begin;
+--disable_warnings
+eval call test.p1($1);
+--enable_warnings
+commit;
+
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t1, slave:test.t1;
+source include/diff_tables.inc;
+
+let $diff_tables=master:test.t2, slave:test.t2;
+source include/diff_tables.inc;
+
+let $diff_tables=master:test.t3, slave:test.t3;
+source include/diff_tables.inc;
+
+
+connection master;
+
+begin;
+delete from t1;
+delete from t2;
+delete from t3;
+commit;
+
+drop table t1, t2, t3;
+set @@global.binlog_cache_size = @save_binlog_cache_size;
+set @@global.binlog_checksum = @save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+drop procedure test.p_init;
+drop procedure test.p1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_commit_after_flush.test b/mysql-test/suite/rpl/include/rpl_commit_after_flush.test
new file mode 100644
index 00000000000..7de4f421c35
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_commit_after_flush.test
@@ -0,0 +1,14 @@
+eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
+
+begin;
+insert into t1 values(1);
+flush tables with read lock;
+commit;
+sync_slave_with_master;
+# cleanup
+connection master;
+unlock tables;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/include/rpl_conflicts.test b/mysql-test/suite/rpl/include/rpl_conflicts.test
new file mode 100644
index 00000000000..a8c796af50c
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_conflicts.test
@@ -0,0 +1,170 @@
+# ==== Purpose ====
+#
+# Test that slave behaves well in some conflict situations. The
+# following are tested:
+#
+# - The slave SQL thread sees an 'INSERT' of a row with a key that
+# already exists in the table;
+#
+# - The slave SQL thread sees a 'DELETE' of a row that does not
+# exist in the table.
+#
+# In statement-logging mode, the first conflict type causes the slave
+# to stop with an error and the second conflict is ignored.
+#
+# In row-logging mode, the slave behavior depends the value of
+# @@slave_exec_mode on the slave: if @@slave_exec_mode is IDEMPOTENT,
+# the slave should ignore the conflicting statement and continue
+# normally. If @@slave_exec_mode is STRICT, the slave should stop
+# with an error.
+#
+# This test was previously named rpl_stm_mystery22/rpl_row_mystery22.
+#
+#
+# ==== Method ====
+#
+# Create a table on master and slave, insert a row on slave, and
+# insert the same row on master.
+#
+# Create a table on master and slave, insert a row on master with
+# binlogging turned off, and remove the row on master with binlogging
+# turned on.
+#
+#
+# ==== Related bugs ====
+#
+# BUG#31552: Replication breaks when deleting rows from out-of-sync table without PK
+# BUG#31609: Not all RBR slave errors reported as errors
+#
+# Bug in this test case:
+# BUG#37718: rpl.rpl_stm_mystery22 fails sporadically on pushbuild
+#
+#
+# ==== Usage ====
+#
+# This file assumes the following:
+#
+# - The test language variable $slave_is_idempotent is set to 1 if the
+# slave is expected to stop on duplicate key errors (i.e., if the
+# binlog is in statement mode or
+# @@global.slave_exec_mode=STRICT). It is set to 0 otherwise.
+#
+# - Replication has been initialized by include/master-slave.inc
+#
+# - The test adds a suppression for the following warning:
+# Slave: Can't find record in 't1' error.* 1032
+
+
+--echo ==== Initialize ====
+
+connection master;
+CREATE TABLE t1(a INT PRIMARY KEY);
+sync_slave_with_master;
+
+
+--echo ==== Test: SQL thread sees 'INSERT' of existing key ====
+
+--echo ---- Prepare slave so that it will get duplicate key error ----
+# This row will be in the way of the row inserted by master.
+INSERT INTO t1 VALUES (1);
+
+--echo ---- Insert rows on master ----
+connection master;
+# Insert the same row on master
+INSERT INTO t1 VALUES (1);
+save_master_pos;
+SELECT * FROM t1;
+
+connection slave;
+
+# If we are statement-logging or if slave_exec_mode=STRICT, we now
+# expect to see an error on the slave. Otherwise (i.e., we are
+# row-logging and slave_exec_mode=IDEMPOTENT), we expect that the
+# duplicate row is ignored by the slave and replication continues.
+if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRICT'`) {
+ --echo ---- Wait until slave stops with an error ----
+ # Wait until the slave tries to run the query, fails with duplicate
+ # key error, and stops the SQL thread.
+ let $slave_sql_errno= 1062; # ER_DUP_ENTRY
+ source include/wait_for_slave_sql_error.inc;
+
+ --let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+ --replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
+ --disable_query_log
+ --eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
+ --enable_query_log
+ call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* error.* 1062");
+
+ SELECT * FROM t1;
+
+ --echo ---- Resolve the conflict on the slave and restart SQL thread ----
+ DELETE FROM t1 WHERE a = 1;
+ START SLAVE SQL_THREAD;
+ source include/wait_for_slave_sql_to_start.inc;
+}
+
+--echo ---- Sync slave and verify that there is no error ----
+sync_with_master;
+let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+--echo Last_SQL_Error = '$err' (expected no error)
+SELECT * FROM t1;
+
+
+--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
+
+--echo ---- On master, insert two rows, the second with binlogging off ----
+connection master;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+
+sync_slave_with_master;
+DELETE FROM t1 WHERE a = 1;
+
+--echo ---- On master, remove the row that does not exist on slave ----
+connection master;
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+save_master_pos;
+
+connection slave;
+
+# If we are row-logging and slave_exec_mode is STRICT, we now expect
+# an error since the row to delete does not exist on slave. Otherwise
+# (i.e., either we are statement-logging or slave_exec_mode is
+# IDEMPOTENT), the absence of the row to delete is ignored and
+# replication continues.
+if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) {
+ --echo ---- Wait until slave stops with an error ----
+ call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., error.* 1032");
+ let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
+ source include/wait_for_slave_sql_error.inc;
+
+ --let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+ --replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
+ --disable_query_log
+ --eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
+ --enable_query_log
+
+ SELECT * FROM t1;
+
+ --echo ---- Resolve the conflict on the slave and restart SQL thread ----
+ INSERT INTO t1 VALUES (1);
+ START SLAVE SQL_THREAD;
+ source include/wait_for_slave_sql_to_start.inc;
+}
+
+--echo ---- Sync slave and verify that there is no error ----
+# The slave should sync ok, and SHOW SLAVE STATUS should give no
+# error.
+sync_with_master;
+let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+--echo Last_SQL_Error = $err (expected no error)
+SELECT * FROM t1;
+
+
+--echo ==== Clean up ====
+
+connection master;
+DROP TABLE t1;
+
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/include/rpl_corruption.inc b/mysql-test/suite/rpl/include/rpl_corruption.inc
new file mode 100644
index 00000000000..c7a913af9d7
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_corruption.inc
@@ -0,0 +1,175 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+############################################################
+# Purpose: WL#5064 Testing with corrupted events.
+# The test emulates the corruption at the vary stages
+# of replication:
+# - in binlog file
+# - in network
+# - in relay log
+############################################################
+
+#
+# The tests intensively utilize @@global.debug. Note,
+# Bug#11765758 - 58754,
+# @@global.debug is read by the slave threads through dbug-interface.
+# Hence, before a client thread set @@global.debug we have to ensure that:
+# (a) the slave threads are stopped, or (b) the slave threads are in
+# sync and waiting.
+
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+# Block legal errors for MTR
+call mtr.add_suppression('Found invalid event in binary log');
+call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
+call mtr.add_suppression('event read from binlog did not pass crc check');
+call mtr.add_suppression('Replication event checksum verification failed');
+call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
+call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
+
+SET @old_master_verify_checksum = @@master_verify_checksum;
+
+# Creating test table/data and set corruption position for testing
+--echo # 1. Creating test table/data and set corruption position for testing
+--connection master
+--echo * insert/update/delete rows in table t1 *
+# Corruption algorithm modifies only the first event and
+# then will be reset. To avoid checking always the first event
+# from binlog (usually it is FD) we randomly execute different
+# statements and set position for corruption inside events.
+
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
+--disable_query_log
+let $i=`SELECT 3+CEILING(10*RAND())`;
+let $j=1;
+let $pos=0;
+while ($i) {
+ eval INSERT INTO t1 VALUES ($j, 'a', NULL);
+ if (`SELECT RAND() > 0.7`)
+ {
+ eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
+ }
+ if (`SELECT RAND() > 0.8`)
+ {
+ eval DELETE FROM t1 WHERE a = $j;
+ }
+ if (!$pos) {
+ let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+ --sync_slave_with_master
+ --source include/stop_slave.inc
+ --disable_query_log
+ --connection master
+ }
+ dec $i;
+ inc $j;
+}
+--enable_query_log
+
+
+# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
+--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
+SET @saved_dbug = @@global.debug_dbug;
+SET @@global.debug_dbug="d,corrupt_read_log_event_char";
+--echo SHOW BINLOG EVENTS;
+--disable_query_log
+send_eval SHOW BINLOG EVENTS FROM $pos;
+--enable_query_log
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+reap;
+
+SET @@global.debug_dbug=@saved_dbug;
+
+# Emulate corruption on master with crc checking on master
+--echo # 3. Master read a corrupted event from binlog and send the error to slave
+
+# We have a rare but nasty potential race here: if the dump thread on
+# the master for the _old_ slave connection has not yet discovered
+# that the slave has disconnected, we will inject the corrupt event on
+# the wrong connection, and the test will fail
+# (+d,corrupt_read_log_event2 corrupts only one event).
+# So kill any lingering dump thread (we need to kill; otherwise dump thread
+# could manage to send all events down the socket before seeing it close, and
+# hang forever waiting for new binlog events to be created).
+let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
+if ($id)
+{
+ --disable_query_log
+ --error 0,1094
+ eval kill $id;
+ --enable_query_log
+}
+let $wait_condition=
+ SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
+--source include/wait_condition.inc
+
+SET @@global.debug_dbug="d,corrupt_read_log_event2_set";
+--connection slave
+START SLAVE IO_THREAD;
+let $slave_io_errno= 1236;
+--let $slave_timeout= 10
+--source include/wait_for_slave_io_error.inc
+--connection master
+SET @@global.debug_dbug=@saved_dbug;
+
+# Emulate corruption on master without crc checking on master
+--echo # 4. Master read a corrupted event from binlog and send it to slave
+--connection master
+SET GLOBAL master_verify_checksum=0;
+SET @@global.debug_dbug="d,corrupt_read_log_event2_set";
+--connection slave
+START SLAVE IO_THREAD;
+# When the checksum error is detected, the slave sets error code 1743
+# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
+# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
+# So we usually get 1595, but it is occasionally possible to get 1743.
+let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
+--source include/wait_for_slave_io_error.inc
+--connection master
+SET @@global.debug_dbug=@saved_dbug;
+SET GLOBAL master_verify_checksum=1;
+
+# Emulate corruption in network
+--echo # 5. Slave. Corruption in network
+--connection slave
+SET @saved_dbug_slave = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug="d,corrupt_queue_event";
+START SLAVE IO_THREAD;
+let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
+--source include/wait_for_slave_io_error.inc
+SET @@global.debug_dbug=@saved_dbug_slave;
+
+# Emulate corruption in relay log
+--echo # 6. Slave. Corruption in relay log
+
+SET @@global.debug_dbug="d,corrupt_read_log_event_char";
+
+START SLAVE SQL_THREAD;
+let $slave_sql_errno= 1593;
+--source include/wait_for_slave_sql_error.inc
+
+SET @@global.debug_dbug=@saved_dbug_slave;
+
+# Start normal replication and compare same table on master
+# and slave
+--echo # 7. Seek diff for tables on master and slave
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+let $diff_tables= master:test.t1, slave:test.t1;
+--source include/diff_tables.inc
+
+# Clean up
+--echo # 8. Clean up
+--connection master
+set @@global.debug_dbug = @saved_dbug;
+SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
+DROP TABLE t1;
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_ddl.test b/mysql-test/suite/rpl/include/rpl_ddl.test
new file mode 100644
index 00000000000..e3083a7f3ae
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_ddl.test
@@ -0,0 +1,531 @@
+################# suite/rpl/include/rpl_ddl.test ########################
+# #
+# DDL statements (sometimes with implicit COMMIT) and other stuff #
+# executed on the master and it's propagation into the slave. #
+# #
+# The variables #
+# $engine_type -- storage engine to be tested/used for the #
+# permanent tables within the master #
+# $temp_engine_type -- storage engine which supports TEMPORARY #
+# tables <> $engine_type #
+# $temp_engine_type must point to an all #
+# time available storage engine #
+# 2007-02 MySQL 5.1 MyISAM and MEMORY only #
+# $show_binlog -- print binlog entries #
+# 0 - no (default) + fits to the file with #
+# results #
+# 1 - yes (important for debugging) #
+# This variable is used within #
+# include/rpl_stmt_seq.inc. #
+# $manipulate -- Manipulation of the binary logs #
+# 0 - do nothing #
+# 1 - so that the output of SHOW BINLOG #
+# EVENTS IN <current log> contains only #
+# commands of the current test sequence #
+# This is especially useful, if the #
+# $show_binlog is set to 1 and many #
+# subtest are executed. #
+# This variable is used within #
+# include/rpl_stmt_seq.inc. #
+# have to be set before sourcing this script. #
+# #
+# General assumption about the ideal replication behaviour: #
+# Whatever on the master is executed the content of the slave must #
+# be in sync with it. #
+# #
+# Tests of special interest: #
+# a) Which DDL commands cause an implicit COMMIT ? #
+# This is also of interest outside of replication. #
+# b) Transactions modifying table content ending with #
+# - explicit COMMIT or ROLLBACK #
+# - implicit COMMIT because the connection to the master #
+# executed a corresponding DDL statement or runs in #
+# AUTOCOMMIT mode #
+# - something similar to "implicit COMMIT" if the storage #
+# engine (master) is not transactional #
+# c) Command which change no data like SELECT or SHOW #
+# They do not change anything within the master but #
+# this must be also valid for the slave. #
+# #
+#######################################################################
+
+# Last update:
+# 2007-02-12 ML: - slave needs AUTOCOMMIT = 1, because we want to check only
+# the propagation of actions of the master connection.
+# - replace comments via SQL by "--echo ..."
+# - remove some bugs within the testscripts
+# - remove the use of include/rpl_stmt_seq2.inc
+#
+#
+# NOTES:
+# 2006-11-15 Lars: Matthias (ML) is the "owner" of this test case.
+# So, please get him to review it whenever you want to
+# do changes to it.
+#
+# PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
+#
+# Typical test architecture (--> include/rpl_stmt_seq.inc)
+# --------------------------------------------------------
+# 1. Master (no AUTOCOMMIT!): INSERT INTO mysqltest1.t1 without commit
+# 2. Master and slave: Check the content of mysqltest1.t1
+# 3. Master (no AUTOCOMMIT!): EXECUTE the statement to be tested
+# 4. Master and slave: Check the content of mysqltest1.t1
+# 5. Master (no AUTOCOMMIT!): ROLLBACK
+# 6. Master and slave: Check the content of mysqltest1.t1
+# If the previous into mysqltest1.t1 inserted row is visible,
+# than the statement to be tested caused an explicit COMMIT
+# (statement = COMMIT) or an implicit COMMIT (example CREATE TABLE).
+# If the previous into mysqltest1.t1 inserted row is not visible,
+# than the statement to be tested caused either an explicit ROLLBACK
+# (statement = ROLLBACK), an implicit ROLLBACK (deadlock etc. but
+# not tested here) or it does not cause any transaction end.
+# 7. Flush the logs
+#
+# Some rules:
+# -----------
+# 1. Any use of mysqltest1.t1 within the statement to be tested must be
+# avoided if possible. The only known exception is around LOCK TABLE.
+#
+# 2. The test logics needs for
+# master connection: AUTOCOMMIT = 0
+# slave connection: AUTOCOMMIT = 1
+# The master connection is the actor and the slave connection is
+# only an observer. I.e. the slave connection must not influence
+# the activities of master connection.
+#
+# 3. !All! objects to be dropped, renamed, altered ... must be created
+# before the tests start.
+# --> less switching of AUTOCOMMIT mode on master side.
+#
+# 4. Never use a test object, which was direct or indirect affected by a
+# preceding test sequence again.
+# If one preceding test sequence hits a (sometimes not visible,
+# because the sql error code of the statement might be 0) bug
+# and these rules are ignored, a following test sequence might earn ugly
+# effects like failing 'sync_slave_with_master', crashes of the slave or
+# abort of the test case etc.. This means during analysis the first look
+# points into a totally wrong area.
+# Except table mysqltest1.t1 where ONLY DML is allowed.
+#
+# 5. This file is used in several tests (t/rpl_ddl_<whatever>.test).
+# Please be aware that every change of the current file affects
+# the results of these tests.
+#
+# ML: Some maybe banal hints:
+# 1. The fact that we have here a master - slave replication does
+# not cause that many general MySQL properties do not apply.
+# Example:
+# The connection to the slave is just a simple session and not a however
+# magic working "copy" of the master session or something similar.
+# - TEMPORARY TABLES and @variables are session specific
+# - the slave session cannot see these things of the master.
+# 2. The slave connection must not call sync_slave_with_master.
+# 3. SHOW STATUS SLAVE must be run within the slave connection.
+# 4. Testcase analysis becomes much more comfortable if
+# $show_binlog within include/rpl_stmt_seq.inc is set to 1.
+#
+
+###############################################################
+# 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;
+
+connection master;
+SET AUTOCOMMIT = 1;
+#
+# 2. CREATE all objects needed
+# working database is mysqltest1
+# working table (transactional!) is mysqltest1.t1
+#
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+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.
+sync_slave_with_master;
+connection slave;
+if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA = 'mysqltest1' AND TABLE_NAME = 't1' AND ENGINE <> 'MyISAM'`)
+{
+ skip This test needs on slave side: InnoDB disabled, default engine: MyISAM;
+}
+connection master;
+INSERT INTO mysqltest1.t1 SET f1= 0;
+eval CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=$engine_type;
+CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
+eval CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=$engine_type;
+INSERT INTO mysqltest1.t7 SET f1= 0;
+eval CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type;
+
+#
+# 3. master sessions: never do AUTOCOMMIT
+# slave sessions: do AUTOCOMMIT
+#
+SET AUTOCOMMIT = 0;
+use mysqltest1;
+sync_slave_with_master;
+connection slave;
+SET AUTOCOMMIT = 1;
+use mysqltest1;
+connection master;
+
+
+# We don't want to abort the whole test if one statement sent
+# to the server gets an error, because the following test
+# sequences are nearly independend of the previous statements.
+--disable_abort_on_error
+
+###############################################################
+# Banal case: commands which should never commit
+# Just for checking if the test sequence is usable
+###############################################################
+
+let $my_stmt= SELECT 1;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= SELECT COUNT(*) FROM t1;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Banal case: (explicit) COMMIT and ROLLBACK
+# Just for checking if the test sequence is usable
+###############################################################
+
+let $my_stmt= COMMIT;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= ROLLBACK;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Cases with commands very similar to COMMIT
+###############################################################
+
+let $my_stmt= SET AUTOCOMMIT=1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SET AUTOCOMMIT=0;
+
+let $my_stmt= START TRANSACTION;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= BEGIN;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Cases with (BASE) TABLES and (UPDATABLE) VIEWs
+###############################################################
+
+let $my_stmt= DROP TABLE mysqltest1.t2;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TABLES LIKE 't2';
+connection slave;
+SHOW TABLES LIKE 't2';
+connection master;
+
+let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+SHOW TABLES LIKE 't23';
+connection slave;
+SHOW TABLES LIKE 't23';
+connection master;
+
+let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TABLES LIKE 't20';
+connection slave;
+SHOW TABLES LIKE 't20';
+connection master;
+
+let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+describe mysqltest1.t4;
+connection slave;
+describe mysqltest1.t4;
+connection master;
+
+let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+let $engine='';
+let $eng_type='';
+
+let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=$temp_engine_type;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= TRUNCATE TABLE mysqltest1.t7;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT * FROM mysqltest1.t7;
+sync_slave_with_master;
+connection slave;
+SELECT * FROM mysqltest1.t7;
+connection master;
+
+###############################################################
+# Cases with LOCK/UNLOCK
+###############################################################
+
+# Attention:
+# We have to LOCK mysqltest1.t1 here, though it violates the testing
+# philosophy.
+# Mysql response in case without previous LOCK TABLES mysqltest1.t1
+# is:
+# SELECT MAX(...) FROM mysqltest1.t1 is
+# ERROR HY000: Table 't1' was not locked with LOCK TABLES
+let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+UNLOCK TABLES;
+
+# No prior locking
+let $my_stmt= UNLOCK TABLES;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+# With prior read locking
+# Attention:
+# This subtest generates an error since the rpl_stmt_seq.inc
+# tries to insert into t1.
+LOCK TABLES mysqltest1.t1 READ;
+let $my_stmt= UNLOCK TABLES;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+# With prior write locking
+LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
+let $my_stmt= UNLOCK TABLES;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Cases with INDEXES
+###############################################################
+
+let $my_stmt= DROP INDEX my_idx6 ON mysqltest1.t6;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW INDEX FROM mysqltest1.t6;
+connection slave;
+SHOW INDEX FROM mysqltest1.t6;
+connection master;
+
+let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW INDEX FROM mysqltest1.t5;
+connection slave;
+SHOW INDEX FROM mysqltest1.t5;
+connection master;
+
+###############################################################
+# Cases with DATABASE
+###############################################################
+
+let $my_stmt= DROP DATABASE mysqltest2;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW DATABASES LIKE "mysqltest2";
+connection slave;
+SHOW DATABASES LIKE "mysqltest2";
+connection master;
+
+let $my_stmt= CREATE DATABASE mysqltest3;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW DATABASES LIKE "mysqltest3";
+connection slave;
+SHOW DATABASES LIKE "mysqltest3";
+connection master;
+
+# End of 4.1 tests
+
+###############################################################
+# Cases with STORED PROCEDUREs
+###############################################################
+let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection slave;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+let $my_stmt= ALTER PROCEDURE p1 COMMENT "I have been altered";
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection slave;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+let $my_stmt= DROP PROCEDURE p1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection slave;
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+###############################################################
+# Cases with VIEWs
+###############################################################
+let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW CREATE VIEW v1;
+connection slave;
+SHOW CREATE VIEW v1;
+connection master;
+
+let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW CREATE VIEW v1;
+connection slave;
+SHOW CREATE VIEW v1;
+connection master;
+
+let $my_stmt= DROP VIEW IF EXISTS v1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--error 1146
+SHOW CREATE VIEW v1;
+connection slave;
+--error 1146
+SHOW CREATE VIEW v1;
+connection master;
+
+###############################################################
+# Cases with TRIGGERs
+###############################################################
+let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--replace_column 6 #
+SHOW TRIGGERS;
+connection slave;
+--replace_column 6 #
+SHOW TRIGGERS;
+connection master;
+
+let $my_stmt= DROP TRIGGER trg1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TRIGGERS;
+connection slave;
+SHOW TRIGGERS;
+connection master;
+
+###############################################################
+# Cases with USERs
+###############################################################
+let $my_stmt= CREATE USER user1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'user1';
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'user1';
+connection master;
+
+let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection master;
+
+let $my_stmt= DROP USER rename1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'rename1';
+
+###############################################################
+# Cleanup
+###############################################################
+use test;
+connection master;
+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/suite/rpl/include/rpl_deadlock.test b/mysql-test/suite/rpl/include/rpl_deadlock.test
new file mode 100644
index 00000000000..e9191d5fcd8
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_deadlock.test
@@ -0,0 +1,142 @@
+# See if slave restarts the transaction after failing on an InnoDB deadlock error.
+
+# Note: testing what happens when too many retries is possible, but
+# needs large waits when running with --debug, so we don't do it.
+# The same way, this test may not test what is expected when run
+# under Valgrind, timings are too short then (with --valgrind I
+# (Guilhem) have seen the test manage to provoke lock wait timeout
+# error but not deadlock error; that is ok as code deals with the two
+# errors in exactly the same way.
+
+--source include/master-slave.inc
+
+# 0) Prepare tables and data
+--echo *** Prepare tables and data ***
+
+connection master;
+eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE t2 (a INT) ENGINE=$engine_type;
+eval CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
+sync_slave_with_master;
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+SHOW CREATE TABLE t3;
+SHOW VARIABLES LIKE 'slave_transaction_retries';
+--source include/stop_slave.inc
+
+connection master;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+# We make a long transaction here
+INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
+INSERT INTO t3 VALUES (3);
+COMMIT;
+save_master_pos;
+# Save BEGIN event into variable
+let $master_pos_begin= query_get_value(SHOW BINLOG EVENTS, Pos, 10);
+--echo
+
+# 1) Test deadlock
+# Block slave SQL thread, wait retries of transaction, unlock slave before lock timeout
+--echo *** Test deadlock ***
+
+connection slave;
+BEGIN;
+SELECT * FROM t1 FOR UPDATE;
+# Save variable 'Slave_retried_transactions' before deadlock
+let $slave_retried_transactions= query_get_value(SHOW GLOBAL STATUS LIKE 'Slave_retried_transactions', Value, 1);
+# Run the START SLAVE in a separate connection. Otherwise it terminates
+# the SELECT FOR UPDATE transaction (START SLAVE does implicit COMMIT!).
+connection slave1;
+START SLAVE;
+# Wait until SQL thread blocked: variable 'Slave_retried_transactions' will incremented
+let $status_var= Slave_retried_transactions;
+let $status_var_value= $slave_retried_transactions;
+let $status_type= GLOBAL;
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+connection slave;
+SELECT COUNT(*) FROM t2;
+COMMIT;
+sync_with_master;
+
+# Check the data
+SELECT * FROM t1;
+SELECT * FROM t3;
+# Check that no error is reported
+source include/check_slave_is_running.inc;
+--echo
+
+# 2) Test lock wait timeout
+# Block slave and wait lock timeout error
+--echo *** Test lock wait timeout ***
+
+connection slave;
+--source include/stop_slave.inc
+DELETE FROM t2;
+# Set slave position to the BEGIN log event
+--replace_result $master_pos_begin <master_pos_begin>
+eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
+BEGIN;
+# Hold lock
+SELECT * FROM t1 FOR UPDATE;
+# Wait until slave stopped with error 'Lock wait timeout exceeded'
+connection slave1;
+START SLAVE;
+let $slave_sql_errno= 1205;
+--source include/wait_for_slave_sql_error.inc
+connection slave;
+SELECT COUNT(*) FROM t2;
+COMMIT;
+--source include/start_slave.inc
+sync_with_master;
+# Check data from tables
+SELECT * FROM t1;
+SELECT * FROM t3;
+# Check that no error is reported
+source include/check_slave_is_running.inc;
+--echo
+
+# 3) Test lock wait timeout and purged relay log
+# Set max_relay_log_size=0, block slave and wait lock timeout error.
+# Restart slave and check that no erros appear
+--echo *** Test lock wait timeout and purged relay logs ***
+
+connection slave;
+SET @my_max_relay_log_size= @@global.max_relay_log_size;
+SET global max_relay_log_size=0;
+--source include/stop_slave.inc
+DELETE FROM t2;
+# Set slave position to the BEGIN log event
+--replace_result $master_pos_begin <master_pos_begin>
+eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
+BEGIN;
+# Hold lock
+SELECT * FROM t1 FOR UPDATE;
+# Wait until slave stopped with error 'Lock wait timeout exceeded'
+connection slave1;
+START SLAVE;
+let $slave_sql_errno= 1205;
+--source include/wait_for_slave_sql_error.inc
+connection slave;
+SELECT COUNT(*) FROM t2;
+COMMIT;
+--source include/start_slave.inc
+sync_with_master;
+# Check data from tables
+SELECT * FROM t1;
+SELECT * FROM t3;
+# Check that no error is reported
+source include/check_slave_is_running.inc;
+--echo
+
+# Clean up
+--echo *** Clean up ***
+connection master;
+DROP TABLE t1,t2,t3;
+sync_slave_with_master;
+SET global max_relay_log_size= @my_max_relay_log_size;
+
+--echo End of 5.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_delete_no_where.test b/mysql-test/suite/rpl/include/rpl_delete_no_where.test
new file mode 100644
index 00000000000..914bedc6b67
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_delete_no_where.test
@@ -0,0 +1,17 @@
+# Test to see if a DELETE which triggers a fast deletion of all rows
+# (not internally row-per-row but more like a TRUNCATE, MyISAM
+# supports that), is replicated (BUG#13576).
+
+eval create table t1 (a int, b int) engine=$engine_type;
+insert into t1 values(1,1);
+sync_slave_with_master;
+select * from t1;
+connection master;
+delete from t1;
+sync_slave_with_master;
+select * from t1;
+
+# cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc
new file mode 100644
index 00000000000..a7ee54658f8
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc
@@ -0,0 +1,1047 @@
+--source include/have_innodb.inc
+--disable_abort_on_error
+
+if (`SELECT HEX(@commands) = HEX('configure')`)
+{
+ connection master;
+
+ #
+ # Index that is used as an Id to tables that trigger errors.
+ #
+ --let $tt_error_counter=0
+ --let $nt_error_counter=0
+
+ #
+ # Creates a T-table that is never dropped.
+ #
+ --eval CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb
+
+ #
+ # Creates a N-table that is never dropped.
+ #
+ --eval CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam
+
+ #
+ # Creates a T-table that is never dropped.
+ #
+ --eval CREATE TABLE tt_error_1 ( id INT, PRIMARY KEY (id) ) ENGINE = Innodb
+
+ #
+ # Creates a N-table that is never dropped.
+ #
+ --eval CREATE TABLE nt_error_1 ( id INT, PRIMARY KEY (id) ) ENGINE = MyIsam
+
+ #
+ # Creates a T-table that is never dropped.
+ #
+ --eval CREATE TABLE tt_error_2 ( id INT, PRIMARY KEY (id) ) ENGINE = Innodb
+
+ #
+ # Creates a N-table that is never dropped.
+ #
+ --eval CREATE TABLE nt_error_2 ( id INT, PRIMARY KEY (id) ) ENGINE = MyIsam
+
+ #
+ # Create a trigger nt_error_2 --> tt_error_2
+ #
+ DELIMITER |;
+ CREATE TRIGGER tr_i_nt_2_to_tt_2 AFTER INSERT ON nt_error_2 FOR EACH ROW
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ INSERT INTO tt_error_2(id) VALUES (NEW.id);
+ END|
+ DELIMITER ;|
+
+ #
+ # Creates a Temporary N-table that is never dropped.
+ #
+ --eval CREATE TEMPORARY TABLE nt_tmp_xx_1 ( id INT ) ENGINE = MyIsam
+
+ #
+ # Creates a Temporary N-table that is never dropped.
+ #
+ --eval CREATE TEMPORARY TABLE tt_tmp_xx_1 ( id INT ) ENGINE = Innodb
+
+ #
+ # In what follows, we create a set of tables that are used
+ # throughout this test case. The number of tables to be
+ # created is give by the variable $tot_table.
+ #
+ #
+ # Creates Temporay N-tables that are automatically dropped and recreated
+ # when a command ends.
+ #
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n
+ --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam
+ --disable_query_log
+ --eval SET @check_temp='$available_n_temp'
+ --enable_query_log
+ #
+ # Updates the $available_n_temp that keeps track of the created
+ # temporary N-tables.
+ #
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_n_temp= $available_n_temp,nt_tmp_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_n_temp= nt_tmp_$n
+ }
+ --dec $n
+ }
+
+ #
+ # Creates Temporay T-tables that are automatically dropped and recreated
+ # when a command ends.
+ #
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n
+ --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb
+ --disable_query_log
+ --eval SET @check_temp='$available_t_temp'
+ --enable_query_log
+ #
+ # Updates the $available_t_temp that keeps track of the created
+ # temporary T-tables.
+ #
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_t_temp= $available_t_temp,tt_tmp_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_t_temp= tt_tmp_$n
+ }
+ --dec $n
+ }
+
+ #
+ # Creates N-tables that are automatically dropped and recreated
+ # when a command ends.
+ #
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TABLE IF EXISTS nt_$n
+ --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam
+ --disable_query_log
+ --eval SET @check_temp='$available_n'
+ --enable_query_log
+ #
+ # Updates the $available_n that keeps track of the created
+ # N-tables.
+ #
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_n= $available_n,nt_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_n= nt_$n
+ }
+ --dec $n
+ }
+
+ #
+ # Creates T-tables that are automatically dropped and recreated
+ # when a command ends.
+ #
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TABLE IF EXISTS tt_$n
+ --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb
+ --disable_query_log
+ --eval SET @check_temp='$available_t'
+ --enable_query_log
+ #
+ # Updates the $available_t that keeps track of the created
+ # T-tables.
+ #
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_t= $available_t,tt_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_t= tt_$n
+ }
+ --dec $n
+ }
+
+ --let $dropped_t_temp=
+ --let $dropped_n_temp=
+
+ --let $dropped_t=
+ --let $dropped_n=
+
+ let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+
+ SET @commands= '';
+}
+
+#
+# Drops tables and synchronizes master and slave.
+#
+
+if (`SELECT HEX(@commands) = HEX('clean')`)
+{
+ connection master;
+
+ DROP TABLE IF EXISTS tt_xx_1;
+
+ DROP TABLE IF EXISTS nt_xx_1;
+
+ DROP TABLE IF EXISTS tt_error_1;
+
+ DROP TABLE IF EXISTS nt_error_1;
+
+ DROP TABLE IF EXISTS tt_error_2;
+
+ DROP TABLE IF EXISTS nt_error_2;
+
+ DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1;
+ DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1;
+
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TABLE IF EXISTS nt_$n
+ --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n
+ --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n
+ --dec $n
+ }
+
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TABLE IF EXISTS tt_$n
+ --dec $n
+ }
+
+ sync_slave_with_master;
+
+ SET @commands= '';
+}
+
+#
+# This is the core of the test is responsible for processing
+# the following commands:
+#
+# B - Begin
+# C - Commit
+# R - Rollback
+#
+#
+# T - Inserts a row into a T-table
+# N-Temp - Inserts a row into a temporary N-table.
+#
+#
+# T-SELECT-N-Temp - Selects from a temporary N-table and inserts
+# into a T-table.
+# N-SELECT-N-Temp - Selects from a temporary N-table and inserts
+# into a N-table.
+# T-SELECT-T-Temp - Selects from a temporary T-table and inserts
+# into a T-table.
+# N-SELECT-T-Temp - Selects from a temporary T-table and inserts
+# into a N-table.
+#
+#
+# Create-N-Temp - Creates a temporary N-table if a temporary N-table
+# was dropped before
+# Create-T-Temp - Creates a temporary T-table if a temporary T-table
+# was dropped before
+#
+#
+# Drop-Temp-T-Temp - Drops a temporary T-table if there is any
+# Drop-Temp-N-Temp - Drops a temporary N-table if there is any
+# Drop-Temp-TN-Temp - Drops both a temporary T-table and N-table if there
+# is any
+# Drop-Temp-TT-Temp - Drops two temporary T-tables if there is any
+# Drop-Temp-NN-Temp - Drops two temporary N-tables if there is any
+# Drop-Temp-Xe-Temp - Tries to drop a temporary table that does not exist
+# Drop-Temp-NXe-Temp - Drops a temporary N-table if there is any and
+# a temporary table that does not exist
+# Drop-Temp-TXe-Temp - Drops a temporary T-table if there is any and
+# a temporary table that does not exist
+#
+#
+# Drop-Temp-If-Xe-Temp - Tries to drop a temporary table that does not exist
+# Drop-Temp-If-TXe-Temp - Drops a temporary T-table if there is any and
+# a temporary table that does not exist
+#
+#
+# Drop-T - Drops a T-table if there is any
+# Drop-N - Drops a N-table if there is any
+# Drop-Xe - Tries to drop a table that does not exist
+# Drop-TXe - Drops a T-table if there is any and a table that does
+# not exist
+# Drop-NXe - Drops a N-table if there is any and a table that does
+# not exist
+# Drop-TN - Drops both a T-table and N-table if there is any
+# Drop-TT - Drops two T-tables if there is any
+# Drop-NN - Drops two N-tables if there is any
+# Drop-N-TN-Temp - Drops a N-table and both a temporary T-table and
+# N-table if there is any
+#
+#
+# Drop-If-Xe - Tries to drop a table that does not exist
+# Drop-If-TXe - Drops a T-table if there is any and a table that does
+# not exist
+# Drop-If-NXe - Drops a N-table if there is any and a table that does
+# not exist
+#
+while (`SELECT HEX(@commands) != HEX('')`)
+{
+ --disable_query_log
+ SET @command= SUBSTRING_INDEX(@commands, ' ', 1);
+ let $command= `SELECT @command`;
+ --eval SET @check_commands= '$commands'
+ if (`SELECT HEX(@check_commands) = HEX('''')`)
+ {
+ let $commands= `SELECT @commands`;
+ }
+
+ if (`SELECT HEX(@command) = HEX('B')`)
+ {
+ --enable_query_log
+ eval BEGIN;
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('T')`)
+ {
+ --enable_query_log
+ eval INSERT INTO tt_xx_1() VALUES (1);
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('N')`)
+ {
+ --enable_query_log
+ eval INSERT INTO nt_xx_1() VALUES (1);
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Te')`)
+ {
+ --enable_query_log
+ --inc $tt_error_counter
+ eval INSERT INTO tt_error_1() VALUES ($tt_error_counter), ($tt_error_counter);
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Ne')`)
+ {
+ --enable_query_log
+ --inc $nt_error_counter
+ eval INSERT INTO nt_error_1() VALUES ($nt_error_counter), ($nt_error_counter);
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('NeT-trig')`)
+ {
+ --enable_query_log
+ --inc $nt_error_counter
+ eval INSERT INTO nt_error_1() VALUES ($nt_error_counter), ($nt_error_counter);
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('N-Temp')`)
+ {
+ --enable_query_log
+ eval INSERT INTO nt_tmp_xx_1() VALUES (1);
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('N-SELECT-N-Temp')`)
+ {
+ --enable_query_log
+ eval INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1;
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('N-SELECT-T-Temp')`)
+ {
+ --enable_query_log
+ eval INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1;
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('T-SELECT-N-Temp')`)
+ {
+ --enable_query_log
+ eval INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1;
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('T-SELECT-T-Temp')`)
+ {
+ --enable_query_log
+ eval INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1;
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Create-N-Temp') || HEX(@command) = HEX('Create-T-Temp')`)
+ {
+ if (`SELECT HEX(@command) = HEX('Create-N-Temp')`)
+ {
+ --let $dropped_temp=$dropped_n_temp
+ --let $available_temp=$available_n_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Create-T-Temp')`)
+ {
+ --let $dropped_temp=$dropped_t_temp
+ --let $available_temp=$available_t_temp
+ }
+
+ --eval SET @check_temp='$dropped_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1);
+ let $table=`SELECT @temp`;
+ --eval SET @check_temp='$available_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_temp= $available_temp,$table
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_temp= $table
+ }
+ --eval SET @check_temp='$dropped_temp'
+ --eval SET @table_temp='$table'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $dropped_temp= `SELECT @check_temp`
+
+ if (`SELECT HEX(@command) = HEX('Create-N-Temp')`)
+ {
+ --enable_query_log
+ --eval CREATE TEMPORARY TABLE $table ( id INT ) engine= MyIsam
+ --disable_query_log
+
+ --let $available_n_temp= $available_temp
+ --let $dropped_n_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Create-T-Temp')`)
+ {
+ --enable_query_log
+ --eval CREATE TEMPORARY TABLE $table ( id INT ) engine= Innodb
+ --disable_query_log
+
+ --let $available_t_temp= $available_temp
+ --let $dropped_t_temp= $dropped_temp
+ }
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp') || HEX(@command) = HEX('Drop-Temp-T-Temp') || HEX(@command) = HEX('Drop-T') || HEX(@command) = HEX('Drop-N')`)
+ {
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp')`)
+ {
+ --let $dropped_temp=$dropped_n_temp
+ --let $available_temp=$available_n_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-T-Temp')`)
+ {
+ --let $dropped_temp=$dropped_t_temp
+ --let $available_temp=$available_t_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-N')`)
+ {
+ --let $dropped_temp=$dropped_n
+ --let $available_temp=$available_n
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-T')`)
+ {
+ --let $dropped_temp=$dropped_t
+ --let $available_temp=$available_t
+ }
+
+ --eval SET @check_temp='$available_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1);
+ let $table=`SELECT @temp`;
+ --eval SET @check_temp='$dropped_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $dropped_temp= $dropped_temp,$table
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $dropped_temp= $table
+ }
+ --eval SET @check_temp='$available_temp'
+ --eval SET @table_temp='$table'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_temp= `SELECT @check_temp`
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table
+ --disable_query_log
+
+ --let $available_n_temp= $available_temp
+ --let $dropped_n_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-T-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table
+ --disable_query_log
+
+ --let $available_t_temp= $available_temp
+ --let $dropped_t_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-N')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table
+ --disable_query_log
+
+ --let $available_n= $available_temp
+ --let $dropped_n= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-T')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table
+ --disable_query_log
+
+ --let $available_t= $available_temp
+ --let $dropped_t= $dropped_temp
+ }
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-Xe-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE tt_xx_1
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-If-Xe-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE IF EXISTS tt_xx_1
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Xe')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE xx_1
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-If-Xe')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE IF EXISTS xx_1
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp') || HEX(@command) = HEX('Drop-Temp-TXe-Temp') || HEX(@command) = HEX('Drop-NXe') || HEX(@command) = HEX('Drop-TXe') || HEX(@command) = HEX('Drop-Temp-If-NXe-Temp') || HEX(@command) = HEX('Drop-Temp-If-TXe-Temp') || HEX(@command) = HEX('Drop-If-NXe') || HEX(@command) = HEX('Drop-If-TXe')`)
+ {
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp') || HEX(@command) = HEX('Drop-Temp-If-NXe-Temp')`)
+ {
+ --let $dropped_temp=$dropped_n_temp
+ --let $available_temp=$available_n_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-TXe-Temp') || HEX(@command) = HEX('Drop-Temp-If-TXe-Temp')`)
+ {
+ --let $dropped_temp=$dropped_t_temp
+ --let $available_temp=$available_t_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-NXe') || HEX(@command) = HEX('Drop-If-NXe')`)
+ {
+ --let $dropped_temp=$dropped_n
+ --let $available_temp=$available_n
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-TXe') || HEX(@command) = HEX('Drop-If-TXe')`)
+ {
+ --let $dropped_temp=$dropped_t
+ --let $available_temp=$available_t
+ }
+
+ --eval SET @check_temp='$available_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1);
+ let $table=`SELECT @temp`;
+ --eval SET @check_temp='$dropped_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $dropped_temp= $dropped_temp,$table
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $dropped_n_temp= $table
+ }
+ --eval SET @check_temp='$available_temp'
+ --eval SET @table_temp='$table'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_temp= `SELECT @check_temp`
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table, tt_1
+ --disable_query_log
+
+ --let $available_n_temp= $available_temp
+ --let $dropped_n_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-If-NXe-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE IF EXISTS $table, tt_1
+ --disable_query_log
+
+ --let $available_n_temp= $available_temp
+ --let $dropped_n_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-TXe-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table, tt_1
+ --disable_query_log
+
+ --let $available_t_temp= $available_temp
+ --let $dropped_t_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-If-TXe-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE IF EXISTS $table, tt_1
+ --disable_query_log
+
+ --let $available_t_temp= $available_temp
+ --let $dropped_t_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-NXe')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table, xx_1
+ --disable_query_log
+
+ --let $available_n= $available_temp
+ --let $dropped_n= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-If-NXe')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE IF EXISTS $table, xx_1
+ --disable_query_log
+
+ --let $available_n= $available_temp
+ --let $dropped_n= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-TXe')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table, xx_1
+ --disable_query_log
+
+ --let $available_t= $available_temp
+ --let $dropped_t= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-If-TXe')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE IF EXISTS $table, xx_1
+ --disable_query_log
+
+ --let $available_t= $available_temp
+ --let $dropped_t= $dropped_temp
+ }
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp') || HEX(@command) = HEX('Drop-Temp-TT-Temp') || HEX(@command) = HEX('Drop-NN') || HEX(@command) = HEX('Drop-TT')`)
+ {
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp')`)
+ {
+ --let $dropped_temp=$dropped_n_temp
+ --let $available_temp=$available_n_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-TT-Temp')`)
+ {
+ --let $dropped_temp=$dropped_t_temp
+ --let $available_temp=$available_t_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-NN')`)
+ {
+ --let $dropped_temp=$dropped_n
+ --let $available_temp=$available_n
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-TT')`)
+ {
+ --let $dropped_temp=$dropped_t
+ --let $available_temp=$available_t
+ }
+
+ --eval SET @check_temp='$available_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $n= 2
+ while (`SELECT HEX(@check_temp) != HEX('') && $n != 0`)
+ {
+ SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1);
+ let $table=`SELECT @temp`;
+ --eval SET @check_temp='$dropped_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $dropped_temp= $dropped_temp,$table
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $dropped_temp= $table
+ }
+ if ($n == 1)
+ {
+ --let $table_1= $table
+ }
+ if ($n == 2)
+ {
+ --let $table_2= $table
+ }
+
+ --dec $n
+ --eval SET @check_temp='$available_temp'
+ --eval SET @table_temp='$table'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_temp= `SELECT @check_temp`
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp') && $n = 0`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table_1, $table_2
+ --disable_query_log
+
+ --let $available_n_temp= $available_temp
+ --let $dropped_n_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-TT-Temp') && $n= 0`)
+ {
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table_1, $table_2
+ --disable_query_log
+
+ --let $available_t_temp= $available_temp
+ --let $dropped_t_temp= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-NN') && $n = 0`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table_1, $table_2
+ --disable_query_log
+
+ --let $available_n= $available_temp
+ --let $dropped_n= $dropped_temp
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-TT') && $n= 0`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table_1, $table_2
+ --disable_query_log
+
+ --let $available_t= $available_temp
+ --let $dropped_t= $dropped_temp
+ }
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-Temp-TN-Temp')`)
+ {
+ --eval SET @check_temp_t='$available_t_temp'
+ --eval SET @check_temp_n='$available_n_temp'
+ if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('')`)
+ {
+ SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',', 1);
+ let $table_t=`SELECT @temp_t`;
+ --eval SET @check_temp_t='$dropped_t_temp'
+ if (`SELECT HEX(@check_temp_t) != HEX('')`)
+ {
+ --let $dropped_t_temp= $dropped_t_temp,$table_t
+ }
+ if (`SELECT HEX(@check_temp_t) = HEX('')`)
+ {
+ --let $dropped_t_temp= $table_t
+ }
+ --eval SET @check_temp='$available_t_temp'
+ --eval SET @table_temp='$table_t'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_t_temp= `SELECT @check_temp`
+
+ SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',', 1);
+ let $table_n=`SELECT @temp_n`;
+ --eval SET @check_temp_n='$dropped_n_temp'
+ if (`SELECT HEX(@check_temp_n) != HEX('')`)
+ {
+ --let $dropped_n_temp= $dropped_n_temp,$table_n
+ }
+ if (`SELECT HEX(@check_temp_n) = HEX('')`)
+ {
+ --let $dropped_n_temp= $table_n
+ }
+ --eval SET @check_temp='$available_n_temp'
+ --eval SET @table_temp='$table_n'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_n_temp= `SELECT @check_temp`
+
+ --enable_query_log
+ --eval DROP TEMPORARY TABLE $table_t, $table_n
+ --disable_query_log
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-TN')`)
+ {
+ --eval SET @check_temp_t='$available_t'
+ --eval SET @check_temp_n='$available_n'
+ if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('')`)
+ {
+ SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',', 1);
+ let $table_t=`SELECT @temp_t`;
+ --eval SET @check_temp_t='$dropped_t'
+ if (`SELECT HEX(@check_temp_t) != HEX('')`)
+ {
+ --let $dropped_t= $dropped_t,$table_t
+ }
+ if (`SELECT HEX(@check_temp_t) = HEX('')`)
+ {
+ --let $dropped_t= $table_t
+ }
+ --eval SET @check_temp='$available_t'
+ --eval SET @table_temp='$table_t'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_t= `SELECT @check_temp`
+
+ SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',', 1);
+ let $table_n=`SELECT @temp_n`;
+ --eval SET @check_temp_n='$dropped_n'
+ if (`SELECT HEX(@check_temp_n) != HEX('')`)
+ {
+ --let $dropped_n= $dropped_n,$table_n
+ }
+ if (`SELECT HEX(@check_temp_n) = HEX('')`)
+ {
+ --let $dropped_n= $table_n
+ }
+ --eval SET @check_temp='$available_n'
+ --eval SET @table_temp='$table_n'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_t= `SELECT @check_temp`
+
+ --enable_query_log
+ --eval DROP TABLE $table_t, $table_n
+ --disable_query_log
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp') || HEX(@command) = HEX('Drop-TN-Temp')`)
+ {
+ --eval SET @check_temp_t='$available_t_temp'
+ --eval SET @check_temp_n='$available_n_temp'
+ if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp')`)
+ {
+ --eval SET @check_n='$available_n'
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-TN-Temp')`)
+ {
+ #
+ # Just to be possible to go through the next if...
+ #
+ --eval SET @check_n='...'
+ }
+ if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('') && HEX(@check_n) != HEX('')`)
+ {
+ SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',', 1);
+ let $table_temp_t=`SELECT @temp_t`;
+ --eval SET @check_temp_t='$dropped_t_temp'
+ if (`SELECT HEX(@check_temp_t) != HEX('')`)
+ {
+ --let $dropped_t_temp= $dropped_t_temp,$table_temp_t
+ }
+ if (`SELECT HEX(@check_temp_t) = HEX('')`)
+ {
+ --let $dropped_t_temp= $table_temp_t
+ }
+ --eval SET @check_temp='$available_t_temp'
+ --eval SET @table_temp='$table_temp_t'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_t_temp= `SELECT @check_temp`
+
+ SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',', 1);
+ let $table_temp_n=`SELECT @temp_n`;
+ --eval SET @check_temp_n='$dropped_n_temp'
+ if (`SELECT HEX(@check_temp_n) != HEX('')`)
+ {
+ --let $dropped_n_temp= $dropped_n_temp,$table_temp_n
+ }
+ if (`SELECT HEX(@check_temp_n) = HEX('')`)
+ {
+ --let $dropped_n_temp= $table_temp_n
+ }
+ --eval SET @check_temp='$available_n_temp'
+ --eval SET @table_temp='$table_temp_n'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_n_temp= `SELECT @check_temp`
+
+ if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp')`)
+ {
+ SET @temp_n= SUBSTRING_INDEX(@check_n, ',', 1);
+ let $table_n=`SELECT @temp_n`;
+ --eval SET @check_n='$dropped_n'
+ if (`SELECT HEX(@check_n) != HEX('')`)
+ {
+ --let $dropped_n= $dropped_n,$table_n
+ }
+ if (`SELECT HEX(@check_n) = HEX('')`)
+ {
+ --let $dropped_n= $table_n
+ }
+ --eval SET @check_temp='$available_n'
+ --eval SET @table_temp='$table_n'
+ SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2));
+ --let $available_n= `SELECT @check_temp`
+
+ --enable_query_log
+ --eval DROP TABLE $table_temp_t, $table_temp_n, $table_n
+ --disable_query_log
+ }
+ if (`SELECT HEX(@command) = HEX('Drop-TN-Temp')`)
+ {
+ --enable_query_log
+ --eval DROP TABLE $table_temp_t, $table_temp_n
+ --disable_query_log
+ }
+ }
+ }
+
+ if (`SELECT HEX(@command) = HEX('C')`)
+ {
+ --enable_query_log
+ --error 0, ER_GET_ERRMSG
+ eval COMMIT;
+ --disable_query_log
+ }
+
+ if (`SELECT HEX(@command) = HEX('R')`)
+ {
+ --enable_query_log
+ --error 0, ER_GET_ERRMSG
+ --replace_column 2 #
+ eval ROLLBACK;
+ --disable_query_log
+ }
+
+ SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1));
+ if (`SELECT HEX(@commands) = HEX('')`)
+ {
+ let $binlog_start= $pos_trans_command;
+ --echo -b-b-b-b-b-b-b-b-b-b-b- >> $commands << -b-b-b-b-b-b-b-b-b-b-b-
+ # Use other connection because include/show_binlog_events.inc
+ # executes SELECT UUID(), which switches to row-logging when
+ # binlog_format=mixed, if there are open temporary tables. This is
+ # due to BUG#13692513.
+ --connection server_1
+ --source include/show_binlog_events.inc
+ --connection master
+ --echo -e-e-e-e-e-e-e-e-e-e-e- >> $commands << -e-e-e-e-e-e-e-e-e-e-e-
+ --echo
+
+ --disable_warnings
+ --let $available_n_temp=
+ --let $dropped_n_temp=
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n
+ --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam
+ --eval SET @check_temp='$available_n_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_n_temp= $available_n_temp,nt_tmp_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_n_temp= nt_tmp_$n
+ }
+ --dec $n
+ }
+
+ --let $available_t_temp=
+ --let $dropped_t_temp=
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n
+ --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb
+ --eval SET @check_temp='$available_t_temp'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_t_temp= $available_t_temp,tt_tmp_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_t_temp= tt_tmp_$n
+ }
+ --dec $n
+ }
+
+ --let $available_t=
+ --let $dropped_t=
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TABLE IF EXISTS tt_$n
+ --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb
+ --eval SET @check_temp='$available_t'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_t= $available_t,tt_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_t= tt_$n
+ }
+ --dec $n
+ }
+
+ --let $available_n=
+ --let $dropped_n=
+ --let $n= $tot_table
+ while ($n)
+ {
+ --eval DROP TABLE IF EXISTS nt_$n
+ --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam
+ --eval SET @check_temp='$available_n'
+ if (`SELECT HEX(@check_temp) != HEX('')`)
+ {
+ --let $available_n= $available_n,nt_$n
+ }
+ if (`SELECT HEX(@check_temp) = HEX('')`)
+ {
+ --let $available_n= nt_$n
+ }
+ --dec $n
+ }
+ --enable_warnings
+
+ let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+ let $commands= '';
+ }
+ --enable_query_log
+}
diff --git a/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test
new file mode 100644
index 00000000000..456419803db
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test
@@ -0,0 +1,506 @@
+###############################################################################
+# In this test case, we check how changes to temporary tables are written
+# to the binary log.
+#
+#
+# B - Begin
+# C - Commit
+# R - Rollback
+#
+#
+# T - Inserts a row into a T-table
+#
+#
+# T-SELECT-N-Temp - Selects from a temporary N-table and inserts
+# into a T-table.
+# N-SELECT-N-Temp - Selects from a temporary N-table and inserts
+# into a N-table.
+# T-SELECT-T-Temp - Selects from a temporary T-table and inserts
+# into a T-table.
+# N-SELECT-T-Temp - Selects from a temporary T-table and inserts
+# into a N-table.
+
+# Create-N-Temp - Creates a temporary N-table if a temporary N-table
+# was dropped before
+# Create-T-Temp - Creates a temporary T-table if a temporary T-table
+# was dropped before
+#
+#
+# Drop-Temp-T-Temp - Drops a temporary T-table if there is any
+# Drop-Temp-N-Temp - Drops a temporary N-table if there is any
+# Drop-Temp-TN-Temp - Drops both a temporary T-table and N-table if there
+# is any
+# Drop-Temp-TT-Temp - Drops two temporary T-tables if there is any
+# Drop-Temp-NN-Temp - Drops two temporary N-tables if there is any
+#
+# Note: MDEV-20091: DROP TEMPORARY TABLE IF EXISTS statements will be written
+# to binlog only if the corresponding temporary table exists.
+#
+# Drop-Temp-Xe-Temp - Tries to drop a temporary table that does not exist
+# Drop-Temp-NXe-Temp - Drops a temporary N-table if there is any and
+# a temporary table that does not exist
+# Drop-Temp-TXe-Temp - Drops a temporary T-table if there is any and
+# a temporary table that does not exist
+#
+#
+# Drop-Temp-If-Xe-Temp - Tries to drop a temporary table that does not exist
+# Drop-Temp-If-TXe-Temp - Drops a temporary T-table if there is any and
+# a temporary table that does not exist
+#
+#
+# Drop-T - Drops a T-table if there is any
+# Drop-N - Drops a N-table if there is any
+# Drop-Xe - Tries to drop a table that does not exist
+# Drop-TXe - Drops a T-table if there is any and a table that does
+# not exist
+# Drop-NXe - Drops a N-table if there is any and a table that does
+# not exist
+# Drop-TN - Drops both a T-table and N-table if there is any
+# Drop-TT - Drops two T-tables if there is any
+# Drop-NN - Drops two N-tables if there is any
+# Drop-N-TN-Temp - Drops a N-table and both a temporary T-table and
+# N-table if there is any
+#
+#
+# Drop-If-Xe - Tries to drop a table that does not exist
+# Drop-If-TXe - Drops a T-table if there is any and a table that does
+# not exist
+#
+#
+# This test uses the commands available at:
+# suite/rpl/include/rpl_drop_create_temp_table.inc
+#
+###############################################################################
+
+
+--echo #########################################################################
+--echo # CONFIGURATION
+--echo #########################################################################
+
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+
+--let $tot_table= 2
+SET @commands= 'configure';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo #########################################################################
+--echo # 1 - Tables dropped by "DROP TEMPORARY TABLE"
+--echo #########################################################################
+connection master;
+
+--echo
+--echo #
+--echo #1) Generates in the binlog what follows:
+--echo #
+SET @commands= 'Drop-Temp-T-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-N-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-Xe-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-If-Xe-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-TXe-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-If-TXe-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-NXe-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-If-NXe-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-TN-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-TT-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-NN-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo
+--echo #
+--echo #2) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B T Drop-Temp-T-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-Xe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-Xe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-TXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-NXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TN-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TT-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp Ne C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp NeT-trig C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo
+--echo #
+--echo #3) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B T Drop-Temp-T-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-Xe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-Xe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-TXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-NXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TN-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TT-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp Ne R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp NeT-trig R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo #########################################################################
+--echo # 2 - Tables dropped by "DROP TABLE"
+--echo #########################################################################
+connection master;
+
+--echo
+--echo #
+--echo #1) Generates in the binlog what follows:
+--echo #
+SET @commands= 'Drop-T';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-N';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Xe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-If-Xe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-TXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-If-TXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-NXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-If-NXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-TN';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-TT';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-NN';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-N-TN-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-TN-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo
+--echo #
+--echo #2) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B T Drop-T';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-N';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Xe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-If-Xe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-TXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-If-TXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-NXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-If-NXe';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-TN';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-TT';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-NN';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-N-TN-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-TN-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo #########################################################################
+--echo # 3 - CREATE TEMPORARY TABLE
+--echo #########################################################################
+connection master;
+
+--echo
+--echo #
+--echo #1) Generates in the binlog what follows:
+--echo #
+SET @commands= 'Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo
+--echo #
+--echo #2) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo
+--echo #
+--echo #3) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo #########################################################################
+--echo # 4 - CHANGING TEMPORARY TABLES
+--echo #########################################################################
+connection master;
+
+--echo
+--echo #
+--echo #1) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp Ne C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo
+--echo
+--echo #
+--echo #2) Generates in the binlog what follows:
+--echo #
+SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp Ne R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo ###################################################################################
+--echo # CHECK CONSISTENCY
+--echo ###################################################################################
+connection master;
+sync_slave_with_master;
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+if (`select @@session.binlog_format != 'STATEMENT'`)
+{
+ --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-master.sql
+ --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-slave.sql
+ # uncomment when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y from mysql-5.6 is merged
+ #--diff_files $MYSQLD_DATADIR/test-temporary-master.sql $MYSQLD_DATADIR/test-temporary-slave.sql
+}
+
+--echo #########################################################################
+--echo # CLEAN
+--echo #########################################################################
+SET @commands= 'clean';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_master.test b/mysql-test/suite/rpl/include/rpl_extra_col_master.test
new file mode 100644
index 00000000000..02645a577f5
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_extra_col_master.test
@@ -0,0 +1,1023 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+# engine inspecific sourced part
+#############################################################
+
+#
+# Setup differently defined tables on master and slave
+#
+
+# Def on master: t (f_1 type_m_1,... f_s type_m_s, f_s1, f_m)
+# Def on slave: t (f_1 type_s_1,... f_s type_s_s)
+# where type_mi,type_si (0 < i-1 <s1) pairs are compatible types (WL#3228)
+# Arbitrary paramaters of the test are:
+# 1. the tables type
+# 2. the types of the extra master's column f_s1,..., f_m
+# 3. the numbers of common columns `s'
+# 4. and extra columns `m' are par
+#
+# optionally
+#
+# 5. vary the common columns type within compatible ranges.
+
+#
+# constant size column type:
+
+#BIGINT
+#BLOB
+#DATE
+#DATETIME
+#FLOAT
+#INT, INTEGER
+#LONGBLOB
+#LONGTEXT
+#MEDIUMBLOB
+#MEDIUMINT
+#MEDIUMTEXT
+#REAL
+#SMALLINT
+#TEXT
+#TIME
+#TIMESTAMP
+#TINYBLOB
+#TINYINT
+#TINYTEXT
+#YEAR
+
+# variable size column types:
+
+#BINARY(M)
+#BIT(M)
+#CHAR(M)
+#DECIMAL(M,D)
+#DOUBLE[P]
+#ENUM
+#FLOAT(p)
+#NUMERIC(M,D)
+#SET
+#VARBINARY(M)
+#VARCHAR(M)
+#
+
+--let $_saved_conn= $CURRENT_CONNECTION
+
+let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`;
+--echo
+--echo ***********************************************************
+--echo ***********************************************************
+--echo ***************** Start of Testing ************************
+--echo ***********************************************************
+--echo ***********************************************************
+--echo * This test format == $binformat and engine == $engine_type
+--echo ***********************************************************
+--echo ***********************************************************
+--echo
+--echo ***** Testing more columns on the Master *****
+--echo
+connection master;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST',
+ f7 INT DEFAULT '0',
+ f8 TEXT,
+ f9 LONGBLOB,
+ f10 BIT(63),
+ f11 VARBINARY(64))ENGINE=$engine_type;
+--echo
+--echo * Alter Table on Slave and drop columns f5 through f11 *
+--echo
+sync_slave_with_master;
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+--echo
+--echo * Insert data in Master then update and delete some rows*
+--echo
+connection master;
+let $j= 50;
+--disable_query_log
+while ($j)
+{
+ eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2,
+ 'got stolen from the paradise',
+ 'very fat blob', b'01010101010101',
+ 0x123456);
+ dec $j;
+}
+let $j= 30;
+while ($j)
+{
+ eval update t1 set f4= 'next' where f1=$j;
+ dec $j;
+ dec $j;
+ eval delete from t1 where f1=$j;
+ dec $j;
+}
+--enable_query_log
+
+--echo * Select count and 20 rows from Master *
+--echo
+SELECT COUNT(*) FROM t1;
+--echo
+SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
+ hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
+
+#connection slave;
+
+--disable_query_log
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
+call mtr.add_suppression("Slave.*Can.t DROP COLUMN .c7.; check that .* exists.* error.* 1091");
+call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* error.* 1054");
+call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* error.* 1072");
+call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* error.* 1677");
+--enable_query_log
+
+sync_slave_with_master;
+--echo
+--echo * Select count and 20 rows from Slave *
+--echo
+SELECT COUNT(*) FROM t1;
+--echo
+SELECT * FROM t1 ORDER BY f3 LIMIT 20;
+
+--source include/check_slave_is_running.inc
+
+### Altering table def scenario
+--echo
+--echo ***** Testing Altering table def scenario *****
+--echo
+
+connection master;
+
+ eval CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 DOUBLE DEFAULT '2.00',
+ f6 ENUM('a', 'b', 'c') default 'a',
+ f7 DECIMAL(17,9) default '1000.00',
+ f8 MEDIUMBLOB,
+ f9 NUMERIC(6,2) default '2000.00',
+ f10 VARCHAR(1024),
+ f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ f12 SET('a', 'b', 'c') default 'b')
+ ENGINE=$engine_type;
+--echo
+ eval CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 DOUBLE DEFAULT '2.00',
+ f6 ENUM('a', 'b', 'c') default 'a',
+ f8 MEDIUMBLOB,
+ f10 VARCHAR(1024),
+ f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ f12 SET('a', 'b', 'c') default 'b')
+ ENGINE=$engine_type;
+
+--echo
+# no ENUM and SET
+ eval CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 DOUBLE DEFAULT '2.00',
+ f6 DECIMAL(17,9) default '1000.00',
+ f7 MEDIUMBLOB,
+ f8 NUMERIC(6,2) default '2000.00',
+ f9 VARCHAR(1024),
+ f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ f11 CHAR(255))
+ ENGINE=$engine_type;
+
+--echo
+ eval CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+
+ /* extra */
+
+ f5 BIGINT,
+ f6 BLOB,
+ f7 DATE,
+ f8 DATETIME,
+ f9 FLOAT,
+ f10 INT,
+ f11 LONGBLOB,
+ f12 LONGTEXT,
+ f13 MEDIUMBLOB,
+ f14 MEDIUMINT,
+ f15 MEDIUMTEXT,
+ f16 REAL,
+ f17 SMALLINT,
+ f18 TEXT,
+ f19 TIME,
+ f20 TIMESTAMP,
+ f21 TINYBLOB,
+ f22 TINYINT,
+ f23 TINYTEXT,
+ f24 YEAR,
+ f25 BINARY(255),
+ f26 BIT(64),
+ f27 CHAR(255),
+ f28 DECIMAL(30,7),
+ f29 DOUBLE,
+ f30 ENUM ('a','b', 'c') default 'a',
+ f31 FLOAT,
+ f32 NUMERIC(17,9),
+ f33 SET ('a', 'b', 'c') default 'b',
+ f34 VARBINARY(1025),
+ f35 VARCHAR(257)
+ ) ENGINE=$engine_type;
+--echo
+--echo ** Alter tables on slave and drop columns **
+--echo
+#connection slave;
+ sync_slave_with_master;
+ alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
+f12;
+ alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
+ alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+ alter table t31
+ drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
+ drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
+ drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
+ drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
+ drop f33, drop f34, drop f35;
+
+--echo
+--echo ** Insert Data into Master **
+connection master;
+ INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
+some var char';
+ INSERT into t2 values (2, 2, 2, 'second',
+ 2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
+'01234567', 'c'),
+ (3, 3, 3, 'third',
+ 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
+'01234567', 'c');
+ INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
+ INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
+binary data';
+ INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
+ insert ignore into t31 set f1=1, f2=1, f3=2, f4='second',
+ f9=2.2, f10='seven samurai', f28=222.222, f35='222';
+ insert ignore into t31 values (1, 1, 3, 'third',
+ /* f5 BIGINT, */ 333333333333333333333333,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ 'three times three'
+ );
+
+ insert ignore into t31 values (1, 1, 4, 'fourth',
+ /* f5 BIGINT, */ 333333333333333333333333,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ 'three times three'
+ ),
+ (1, 1, 5, 'fifth',
+ /* f5 BIGINT, */ 333333333333333333333333,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ 'three times three'
+ ),
+ (1, 1, 6, 'sixth',
+ /* f5 BIGINT, */ NULL,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ NULL
+ );
+--echo
+--echo ** Sync slave with master **
+--echo ** Do selects from tables **
+--echo
+#connection slave;
+ sync_slave_with_master;
+
+ select * from t1 order by f3;
+ select * from t2 order by f1;
+ select * from t3 order by f1;
+ select * from t4 order by f1;
+ select * from t31 order by f3;
+
+connection master;
+--echo
+--echo ** Do updates master **
+--echo
+ update t31 set f5=555555555555555 where f3=6;
+ update t31 set f2=2 where f3=2;
+ update t31 set f1=NULL where f3=1;
+ update ignore t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+
+--echo
+--echo ** Delete from Master **
+--echo
+
+ delete from t1;
+ delete from t2;
+ delete from t3;
+ delete from t4;
+ delete from t31;
+
+#connection slave;
+ sync_slave_with_master;
+ select * from t31;
+
+--echo
+--echo ** Check slave status **
+--echo
+--source include/check_slave_is_running.inc
+
+#### Clean Up ####
+
+connection master;
+--disable_warnings
+--disable_query_log
+ DROP TABLE t1,t2,t3,t4,t31;
+
+######################################################
+#connection slave;
+ sync_slave_with_master;
+--enable_query_log
+--enable_warnings
+--echo
+--echo ****************************************
+--echo * columns in master at middle of table *
+--echo * Expect: Proper error message *
+--echo ****************************************
+--echo
+--echo ** Stop and Reset Slave **
+--echo
+STOP SLAVE;
+RESET SLAVE;
+--echo
+--echo ** create table slave side **
+eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo ** Connect to master and create table **
+--echo
+--connection master
+eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+ c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
+ (2,@b1,DEFAULT,'JOE',DEFAULT),
+ (3,@b1,DEFAULT,'QA',DEFAULT);
+
+--echo
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+--echo
+connection slave;
+# 1677 = ER_SLAVE_CONVERSION_FAILED
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo
+--echo *** Drop t10 ***
+connection master;
+DROP TABLE t10;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+--echo
+--echo *********************************************
+--echo * More columns in master at middle of table *
+--echo * Expect: Proper error message *
+--echo *********************************************
+--echo
+--echo *** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+
+eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t11 on Master ***
+connection master;
+eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
+ (2,@b1,'Testing is cool','JOE',DEFAULT),
+ (3,@b1,DEFAULT,'QA',DEFAULT);
+
+--echo
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+--echo
+connection slave;
+# 1677 = ER_SLAVE_CONVERSION_FAILED
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo
+--echo *** Drop t11 ***
+connection master;
+DROP TABLE t11;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+--echo
+--echo *********************************************
+--echo * More columns in master at middle of table *
+--echo * Expect: This one should pass blob-text *
+--echo *********************************************
+--echo
+--echo *** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t12 on Master ***
+connection master;
+eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',DEFAULT,DEFAULT),
+ (3,@b1,'QA',DEFAULT,DEFAULT);
+--echo
+SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
+
+--echo
+--echo *** Select on Slave ***
+sync_slave_with_master;
+SELECT a,hex(b),c FROM t12 ORDER BY a;
+
+--echo
+--echo *** Drop t12 ***
+connection master;
+DROP TABLE t12;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+--echo
+--echo ****************************************************
+--echo * - Alter Master adding columns at middle of table *
+--echo * Expect: columns added *
+--echo ****************************************************
+--echo
+--echo
+--echo *** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t14 on Master ***
+connection master;
+eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+--echo
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
+--echo
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
+
+--echo
+--echo *** Select on Slave ****
+sync_slave_with_master;
+SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+
+####################################################
+--echo
+--echo ****************************************************
+--echo * - Alter Master Dropping columns from the middle. *
+--echo * Expect: columns dropped *
+--echo ****************************************************
+--echo
+--echo *** connect to master and drop columns ***
+connection master;
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c7;
+--echo
+--echo *** Select from Master ***
+SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
+--echo
+
+--echo ************
+--echo * Bug30415 *
+--echo ************
+# Uncomment below once fixed
+
+#--echo *** Select from Slave ***
+#sync_slave_with_master;
+#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+
+# Bug30415
+# Remove below once fixed
+#***************************
+connection slave;
+# 1091 = ER_CANT_DROP_FIELD_OR_KEY
+--let $slave_sql_errno= 1091
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+#***************************
+
+STOP SLAVE;
+RESET SLAVE;
+
+--echo
+--echo *** Drop t14 ***
+DROP TABLE t14;
+
+connection master;
+DROP TABLE t14;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+#################################################
+--echo
+--echo *************************************************
+--echo * - Alter Master adding columns at end of table *
+--echo * Expect: Error 1054 *
+--echo *************************************************
+--echo
+--echo *** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t15 on Master ***
+connection master;
+eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
+ (2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
+ (3,@b1,'QA',DEFAULT,DEFAULT,3.00);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
+
+--echo
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1054 ***
+--echo ********************************************
+--echo
+connection slave;
+# 1054 = ER_BAD_FIELD_ERROR
+--let $slave_sql_errno= 1054
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE;
+RESET SLAVE;
+
+--echo
+--echo *** Drop t15 ***
+DROP TABLE t15;
+
+connection master;
+DROP TABLE t15;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+####################################################
+--echo
+--echo ************************************************
+--echo * - Create index on Master column not on slave *
+--echo * Expect:Warning *
+--echo ************************************************
+--echo
+--echo *** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t16 on Master ***
+connection master;
+eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Create Index and Data Insert ***
+connection master;
+CREATE INDEX part_of_c6 ON t16 (c6);
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',2,DEFAULT),
+ (3,@b1,'QA',3,DEFAULT);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
+
+# Uncomment the below when bug 30434 is patched
+
+#--echo *** Select on Slave ****
+#sync_slave_with_master;
+#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1;
+#
+#--echo *** Drop t16 ***
+#connection master;
+#DROP TABLE t16;
+#sync_slave_with_master;
+
+# Remove the below when bug 30434 is patched
+#*******************************************
+--echo
+--echo *****************
+--echo *** BUG 30434 ***
+--echo *****************
+--echo
+connection slave;
+# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
+--let $slave_sql_errno= 1072
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE;
+RESET SLAVE;
+
+--echo
+--echo *** Drop t16 ***
+DROP TABLE t16;
+
+connection master;
+DROP TABLE t16;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+#*******************************************
+
+####################################################
+--echo
+--echo *****************************************************
+--echo * - Delete rows using column on Master not on slave *
+--echo * Expect: Rows Deleted *
+--echo *****************************************************
+--echo
+--echo *** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t17 on Master ***
+connection master;
+eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',2,DEFAULT),
+ (3,@b1,'QA',3,DEFAULT);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+
+--echo
+--echo ** Select * from Slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+
+--echo
+--echo ** Delete from master **
+connection master;
+DELETE FROM t17 WHERE c6 = 3;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+
+--echo
+--echo ** Check slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+
+
+connection master;
+DROP TABLE t17;
+sync_slave_with_master;
+--echo
+
+####################################################
+--echo
+--echo *****************************************************
+--echo * - Update row using column on Master not on slave *
+--echo * Expect: Rows updated *
+--echo *****************************************************
+--echo
+--echo ** Bug30674 **
+--echo
+--echo *** Create t18 on slave ***
+--echo
+
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t18 on Master ***
+connection master;
+eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',2,DEFAULT),
+ (3,@b1,'QA',3,DEFAULT);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+
+--echo
+--echo ** Select * from Slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+
+--echo
+--echo ** update from master **
+connection master;
+UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
+
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+
+--echo
+--echo ** Check slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+
+connection master;
+DROP TABLE t18;
+sync_slave_with_master;
+--echo
+
+####################################################
+--echo
+--echo *****************************************************
+--echo * - Insert UUID column on Master not on slave *
+--echo * Expect: Rows inserted *
+--echo *****************************************************
+--echo
+--echo *** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t5 on Master ***
+connection master;
+eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 LONG,
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
+ (2,@b1,'JOE',UUID(),DEFAULT),
+ (3,@b1,'QA',UUID(),DEFAULT);
+--replace_column 4 UUID 5 TIME
+SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
+
+--echo
+--echo ** Select * from Slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
+
+connection master;
+DROP TABLE t5;
+sync_slave_with_master;
+
+--connection $_saved_conn
diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
new file mode 100644
index 00000000000..a58fa85a72d
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
@@ -0,0 +1,913 @@
+#################################################
+# Purpose: To test having extra columns on the slave.
+##################################################
+
+# Some tests in here requre partitioning
+-- source include/have_partition.inc
+
+#################################################
+############ Different Table Def Test ###########
+#################################################
+# Purpose: To have different table def on the #
+# master and slave. Most of these tests#
+# should stop the slave. #
+#################################################
+
+call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677");
+
+--echo **** Diff Table Def Start ****
+
+##############################################
+### Try to replicate w/ PK on diff columns ###
+### Should Stop Slave ###
+##############################################
+
+sync_slave_with_master;
+STOP SLAVE;
+RESET SLAVE;
+
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+
+eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(4) DEFAULT 'TEST')
+ ENGINE=$engine_type;
+
+--echo *** Create t1 on Master ***
+connection master;
+eval CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+ ) ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+
+--echo *** Select from slave ***
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+
+--echo *** Drop t1 ***
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+############################################
+### Try to replicate CHAR(10) to CHAR(5) ###
+### Should Stop Slave or truncate value ###
+############################################
+
+## BUG22086
+--echo *** Create t2 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t2 on Master ***
+connection master;
+eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE;
+RESET SLAVE;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+--echo *** Drop t2 ***
+connection master;
+DROP TABLE t2;
+sync_slave_with_master;
+
+####################################
+### Try to replicate BLOB to INT ###
+### Should Stop Slave ###
+####################################
+--echo *** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t3 on Master ***
+connection master;
+eval CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t3 ***
+connection master;
+DROP TABLE t3;
+sync_slave_with_master;
+
+#####################################################
+# Columns with different types, more columns at end #
+# Expect: proper error message (wrong types) #
+#####################################################
+
+--echo *** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t4 on Master ***
+connection master;
+eval CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+ (30000.22,4,'QA TESTING');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t4 ***
+connection master;
+DROP TABLE t4;
+sync_slave_with_master;
+
+#######################################################
+# Columns with different types, same number of colums #
+# Expect: Proper error message #
+#######################################################
+
+--echo *** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+ c FLOAT, d INT, e DOUBLE,
+ f DECIMAL(8,2))ENGINE=$engine_type;
+
+--echo *** Create t5 on Master ***
+connection master;
+eval CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+ c DECIMAL(8,2), d BIT, e BLOB,
+ f FLOAT) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+ (2,'JOE',300.01,0,'b2b2',1.0000009);
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t5 ***
+connection master;
+DROP TABLE t5;
+sync_slave_with_master;
+
+#######################################################
+################## Continued ##########################
+#######################################################
+# Columns with different types, same number of colums #
+# Expect: Proper error message #
+#######################################################
+
+--echo *** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+ c FLOAT, d INT)ENGINE=$engine_type;
+
+--echo *** Create t6 on Master ***
+connection master;
+eval CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+ c DECIMAL(8,2), d BIT
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+ (2,'JOE',300.01,0);
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+--echo *** Drop t6 ***
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+
+connection master;
+DROP TABLE t6;
+--sync_slave_with_master
+
+
+--echo **** Diff Table Def End ****
+
+#######################################
+#### Extra Column on Slave Testing ####
+#######################################
+# Purpose: To test extra colums on the#
+# Slave #
+#######################################
+
+--echo **** Extra Colums Start ****
+
+##########################################
+# More columns in slave at end of table, #
+# added columns have default values #
+# Expect: it should work, default values #
+# should be used #
+##########################################
+
+--echo *** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+ e CHAR(20) DEFAULT 'Extra Column Testing')
+ ENGINE=$engine_type;
+
+--echo *** Create t7 on Master ***
+connection master;
+eval CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+
+--echo *** Select from slave ***
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a;
+
+--echo *** Drop t7 ***
+connection master;
+DROP TABLE t7;
+sync_slave_with_master;
+
+###########################################
+# More columns in slave at end of table, #
+# added columns do not have default values#
+# Expect: Proper error message #
+###########################################
+# NOTE: This should fail but currently #
+# works. BUG#22101 #
+###########################################
+--echo *** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+ e INT)ENGINE=$engine_type;
+
+--echo *** Create t8 on Master ***
+connection master;
+eval CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+### Uncomment once bug is fixed
+
+#connection slave;
+#--let $slave_sql_errno= SOMETHING
+#--let $slave_skip_counter= 2
+#--let $show_slave_sql_error= 1
+#--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t8 ***
+connection master;
+DROP TABLE t8;
+sync_slave_with_master;
+
+###########################################
+############# Continued ###################
+# More columns in slave at end of table, #
+# added columns do not have default values#
+# Expect: Proper error message #
+###########################################
+# Bug#22234, Bug#23907 Extra Slave Col is not
+# erroring on extra col with no default values.
+###############################################################
+# Error reaction is up to sql_mode of the slave sql (bug#38173)
+#--echo *** Create t9 on slave ***
+ STOP SLAVE;
+ RESET SLAVE;
+ eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ ON UPDATE CURRENT_TIMESTAMP,
+ e INT NOT NULL,
+ f text not null,
+ g text,
+ h blob not null,
+ i blob) ENGINE=$engine_type;
+
+ --echo *** Create t9 on Master ***
+ connection master;
+ eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+ RESET MASTER;
+
+ --echo *** Start Slave ***
+ connection slave;
+ START SLAVE;
+
+ --echo *** Master Data Insert ***
+ connection master;
+ set @b1 = 'b1b1b1b1';
+
+ set @b1 = concat(@b1,@b1);
+ INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+ # the test would stop slave if @@sql_mode for the sql thread
+ # was set to strict. Otherwise, as with this tests setup,
+ # the implicit defaults will be inserted into fields even though
+ # they are declared without DEFAULT clause.
+
+ sync_slave_with_master;
+ select * from t9;
+
+ # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
+ # and add/restore waiting for stop test
+
+ #--let $slave_sql_errno= SOMETHING
+ #--let $slave_skip_counter= 2
+ #--let $show_slave_sql_error= 1
+ #--source include/wait_for_slave_sql_error_and_skip.inc
+
+ #--echo *** Drop t9 ***
+ connection master;
+ DROP TABLE t9;
+ sync_slave_with_master;
+
+############################################
+# More columns in slave at middle of table #
+# Expect: Proper error message #
+############################################
+--echo *** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+ c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t10 on Master ***
+connection master;
+eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t10 ***
+connection master;
+DROP TABLE t10;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+# More columns in slave at middle of table #
+# Expect: Proper error message #
+############################################
+--echo *** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t11 on Master ***
+connection master;
+eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t11 ***
+connection master;
+DROP TABLE t11;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+# More columns in slave at middle of table #
+# Expect: This one should pass blob-text #
+############################################
+--echo *** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t12 on Master ***
+connection master;
+eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+
+--echo *** Select on Slave ***
+sync_slave_with_master;
+SELECT * FROM t12 ORDER BY a;
+
+--echo *** Drop t12 ***
+connection master;
+DROP TABLE t12;
+sync_slave_with_master;
+
+--echo **** Extra Colums End ****
+
+###############################
+# BUG#22177 CURRENT_TIMESTAMP #
+# Sould work with ^ #
+###############################
+--echo *** BUG 22177 Start ***
+--echo *** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+ d INT DEFAULT '1',
+ e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t13 on Master ***
+connection master;
+eval CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t13 ORDER BY a;
+
+--echo *** Drop t13 ***
+connection master;
+DROP TABLE t13;
+sync_slave_with_master;
+
+--echo *** 22117 END ***
+
+##############################
+# ALTER MASTER TABLE TESTING #
+##############################
+
+--echo *** Alter Master Table Testing Start ***
+
+####################################################
+# - Alter Master adding columns at middle of table #
+# Expect: columns added #
+####################################################
+
+--echo *** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t14 on Master ***
+connection master;
+eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+ (2,2.00,'This Test Should work',@b1,'JOE'),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t14 ORDER BY c1;
+
+####################################################
+# - Alter Master drop column at end of table #
+# Expect: column dropped #
+####################################################
+
+--echo *** Create t14a on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t14a on Master ***
+connection master;
+eval CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
+ (2,@b1,'JOE'),
+ (3,@b1,'QA');
+
+SELECT * FROM t14a ORDER BY c1;
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14a ORDER BY c1;
+STOP SLAVE;
+RESET SLAVE;
+
+--echo *** Master Drop c5 ***
+connection master;
+ALTER TABLE t14a DROP COLUMN c5;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t14a () VALUES(4,@b1),
+ (5,@b1),
+ (6,@b1);
+SELECT * FROM t14a ORDER BY c1;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14a ORDER BY c1;
+
+--connection master
+DROP TABLE t14a;
+--sync_slave_with_master
+
+####################################################
+# - Alter Master Dropping columns from the middle. #
+# Expect: columns dropped #
+####################################################
+
+--echo *** connect to master and drop columns ***
+connection master;
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+--echo *** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+
+--echo *** Select from Slave ***
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14 ORDER BY c1;
+
+--echo *** Drop t14 ***
+connection master;
+DROP TABLE t14;
+sync_slave_with_master;
+
+##############################################################
+# - Alter Master adding columns that already exist on slave. #
+# Expect: proper error message #
+##############################################################
+
+--echo *** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t15 on Master ***
+connection master;
+eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5)) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535");
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+ (2,2.00,'This Test Should work',@b1,'JOE'),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** Add column on master that is a Extra on Slave ***
+connection master;
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1060 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1060
+--let $slave_skip_counter= 1
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Try to insert in master ****
+connection master;
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+
+#SHOW BINLOG EVENTS;
+
+--echo *** Try to select from slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** DROP TABLE t15 ***
+connection master;
+DROP TABLE t15;
+sync_slave_with_master;
+
+####################################
+# - Alter Master and ADD PARTITION #
+# Expect:? #
+####################################
+
+--echo *** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t16 on Master ***
+connection master;
+eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5))ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+ (2,2.00,'This Test Should work',@b1,'JOE'),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t16 ORDER BY c1;
+
+--echo *** Add Partition on master ***
+connection master;
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+
+--echo *** Show table on Slave ****
+sync_slave_with_master;
+SHOW CREATE TABLE t16;
+
+--echo *** DROP TABLE t16 ***
+connection master;
+DROP TABLE t16;
+sync_slave_with_master;
+
+--echo *** Alter Master End ***
+
+############################################
+### Try to replicate BIGINT to SMALLINT ###
+### Should Stop Slave ###
+############################################
+
+--echo *** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t17 on Master ***
+connection master;
+eval CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo ** DROP table t17 ***
+connection master;
+DROP TABLE t17;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_failed_optimize.test b/mysql-test/suite/rpl/include/rpl_failed_optimize.test
new file mode 100644
index 00000000000..af048aeb92a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_failed_optimize.test
@@ -0,0 +1,28 @@
+-- source include/master-slave.inc
+
+#
+# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log"
+# Replication should work when when OPTIMIZE TABLE is
+# executed on a non-existing table.
+#
+# Due to patch for BUG#989, checking that an OPTIMIZE
+# that fails due to a lock wait timeout on an InnoDB table
+# is not valid anymore, as an mdl lock is hit before,
+# thence no timeout occurs, but instead a deadlock.
+#
+
+
+eval CREATE TABLE t1 ( a int ) ENGINE=$engine_type;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+
+connection master1;
+OPTIMIZE TABLE non_existing;
+sync_slave_with_master;
+
+connection master;
+select * from t1;
+commit;
+drop table t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_flsh_tbls.test b/mysql-test/suite/rpl/include/rpl_flsh_tbls.test
new file mode 100644
index 00000000000..a8cec3d2a1a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_flsh_tbls.test
@@ -0,0 +1,66 @@
+# depends on the binlog output
+# Test of replicating FLUSH TABLES to make
+# RENAME TABLE work with MERGE tables on the slave.
+# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
+#
+
+source include/master-slave.inc;
+
+let $SERVER_VERSION=`select version()`;
+
+create table t1 (a int) ENGINE=MyISAM;
+insert into t1 values (10);
+create table t2 (a int) ENGINE=MyISAM;
+create table t3 (a int) engine=merge union(t1);
+create table t4 (a int);
+# We force the slave to open t3 (because we want to try confusing him) with this :
+insert into t4 select * from t3;
+--let $rename_event_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+rename table t1 to t5, t2 to t1;
+# RENAME may have confused the master (this is a known bug): so FLUSH tables,
+# first don't write it to the binlog, to test the NO_WRITE_TO_BINLOG keyword.
+flush no_write_to_binlog tables;
+# Check that it's not in the binlog.
+let $binlog_start= $rename_event_pos;
+source include/show_binlog_events.inc;
+# Check that the master is not confused.
+select * from t3;
+# This FLUSH should go into the binlog to not confuse the slave.
+flush tables;
+# Check that it's in the binlog.
+let $wait_binlog_event= flush tables;
+source include/wait_for_binlog_event.inc;
+
+sync_slave_with_master;
+# Check that the slave is not confused.
+select * from t3;
+# Note that all this confusion may cause warnings 'table xx is open on rename'
+# in the .err files; these are not fatal and are not reported by mysql-test-run.
+stop slave;
+source include/wait_for_slave_to_stop.inc;
+
+connection master;
+drop table t1;
+
+connection slave;
+flush tables with read lock;
+start slave;
+
+# The IO thread will not be able to read the GTID because of flush tables
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= Preparing;
+source include/wait_for_slave_param.inc;
+
+--source include/wait_for_slave_sql_to_start.inc
+--error 1192
+stop slave;
+
+# Cleanup
+unlock tables;
+
+connection master;
+drop table t3, t4, t5;
+
+# End of 4.1 tests
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
new file mode 100644
index 00000000000..181759283e2
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
@@ -0,0 +1,83 @@
+#
+# BUG#45214
+# The common part of the "rpl_get_master_version_and_clock" test.
+# Restart slave under network disconnection between slave and master
+# following the steps:
+# 0 - Set DEBUG_SYNC_ACTION to wait
+# before call mysql_real_query(...) function in get_master_version_and_clock(...)
+# function and hang here
+# 1 - activate a sync-point through the $dbug_sync_point argument of the test
+# 2 - shutdown master server for simulating network disconnection
+# 3 - signal to the IO thread through $debug_sync_action to unhold from the sync-point
+# 4 - check if the slave I/O thread tries to reconnect to master.
+#
+# Note: make sure to initialize the $debug_sync_action and $dbug_sync_point
+# before calling the test script.
+#
+# Pattern of usage:
+#
+# The caller test supplies the DBUG_EXECUTE_IF name
+#
+# let $dbug_sync_point = 'dbug_execute_if_name';
+#
+# as well as the action list for DEBUG_SYNC
+#
+# let $debug_sync_action= 'now signal signal_name';
+#
+# The $dbug_sync_point becomes the value of @@global.debug generating
+# a newly started IO-slave thread's session value.
+# Notice incremental operations to add and remove dbug_execute_if_name
+# from the global variable allows propagation more dbug arguments
+# out of mtr.
+# The action list is to fire at proper time according to test logics
+# (see pp 0-4 above).
+#
+
+connection slave;
+if (!$debug_sync_action)
+{
+ --die Cannot continue. Please set value for debug_sync_action.
+}
+
+# Restart slave
+--source include/stop_slave.inc
+SET @old_dbug = @@global.debug_dbug;
+eval SET @@global.debug_dbug= "d,$dbug_sync_point";
+
+--source include/start_slave.inc
+--echo slave is going to hang in get_master_version_and_clock
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--echo slave is unblocked
+
+eval SET DEBUG_SYNC=$debug_sync_action;
+
+# Show slave last IO errno
+connection slave;
+--echo Check network error happened here
+# '2013' CR_SERVER_LOST
+# '2003' CR_CONN_HOST_ERROR
+# '2002' CR_CONNECTION_ERROR
+# '2006' CR_SERVER_GONE_ERROR
+# '1053' ER_SERVER_SHUTDOWN
+let $slave_io_errno= 1053, 2002, 2003, 2006, 2013;
+--let $slave_io_error_is_nonfatal= 1
+source include/wait_for_slave_io_error.inc;
+
+# deactivate the sync point of get_master_version_and_clock()
+# now to avoid restarting IO-thread to re-enter it.
+# There will be a new IO thread forked out with its @@session.debug
+# unset.
+set @@global.debug_dbug= @old_dbug;
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+# We don't source include/wait_for_slave_io_to_start.inc, because the
+# IO thread has an error and wait_for_slave_io_to_start.inc fails if
+# the IO thread has an error.
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Yes
+--source include/wait_for_slave_param.inc
diff --git a/mysql-test/suite/rpl/include/rpl_gtid_basic.inc b/mysql-test/suite/rpl/include/rpl_gtid_basic.inc
new file mode 100644
index 00000000000..68a5d05ffe9
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_gtid_basic.inc
@@ -0,0 +1,572 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--let $rpl_topology=1->2->3->4
+--source include/rpl_init.inc
+
+# Set up a 4-deep replication topology, then test various fail-overs
+# using GTID.
+#
+# A -> B -> C -> D
+
+connection server_1;
+--source include/wait_for_binlog_checkpoint.inc
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "m1");
+INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+INSERT INTO t2 VALUES (1, "i1");
+BEGIN;
+INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
+INSERT INTO t2 VALUES (4, "i4");
+COMMIT;
+save_master_pos;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
+--echo *** GTID position should be non-empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
+connection server_2;
+sync_with_master;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be the same as on server_1 ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+save_master_pos;
+
+connection server_3;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+save_master_pos;
+
+connection server_4;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+
+--echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
+connection server_4;
+--source include/stop_slave.inc
+
+connection server_1;
+INSERT INTO t1 VALUES (5, "m1a");
+INSERT INTO t2 VALUES (5, "i1a");
+save_master_pos;
+
+connection server_4;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now move B to D (C is still replicating from B) ***
+connection server_2;
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+
+connection server_4;
+UPDATE t2 SET b="j1a" WHERE a=5;
+save_master_pos;
+
+connection server_2;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now move C to D, after letting it fall a little behind ***
+connection server_3;
+--source include/stop_slave.inc
+
+connection server_1;
+INSERT INTO t2 VALUES (6, "i6b");
+INSERT INTO t2 VALUES (7, "i7b");
+--source include/save_master_gtid.inc
+
+connection server_3;
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now change everything back to what it was, to make rpl_end.inc happy
+# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
+connection server_2;
+# We need to sync up server_2 before switching. If it happened to have reached
+# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
+# server_1, which is (deliberately) missing that transaction.
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
+--source include/start_slave.inc
+--source include/wait_for_slave_to_start.inc
+
+connection server_3;
+--source include/stop_slave.inc
+--replace_result $SLAVE_MYPORT SLAVE_MYPORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+connection server_4;
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
+--source include/start_slave.inc
+
+connection server_1;
+DROP TABLE t1,t2;
+--source include/save_master_gtid.inc
+
+--echo *** A few more checks for BINLOG_GTID_POS function ***
+--let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS();
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a');
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a',1,NULL);
+SELECT BINLOG_GTID_POS(1,'a');
+SELECT BINLOG_GTID_POS(NULL,NULL);
+SELECT BINLOG_GTID_POS('',1);
+SELECT BINLOG_GTID_POS('a',1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
+
+
+--echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+
+--connection server_1
+SET @old_state= @@GLOBAL.gtid_binlog_state;
+
+--error ER_BINLOG_MUST_BE_EMPTY
+SET GLOBAL gtid_binlog_state = '';
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = '';
+FLUSH LOGS;
+--source include/show_binary_logs.inc
+SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000001
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+#SELECT @@GLOBAL.gtid_binlog_pos;
+#SELECT @@GLOBAL.gtid_binlog_state;
+--error ER_BINLOG_MUST_BE_EMPTY
+SET GLOBAL gtid_binlog_state = @old_state;
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = @old_state;
+
+# Check that slave can reconnect again, despite the RESET MASTER, as we
+# restored the state.
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SET gtid_seq_no=100;
+INSERT INTO t1 VALUES (1);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+# We cannot just use sync_with_master as we've done RESET MASTER, so
+# slave old-style position is wrong.
+# So sync on gtid position instead.
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1;
+# Check that the IO gtid position in SHOW SLAVE STATUS is also correct.
+--let $status_items= Gtid_IO_Pos
+--source include/show_slave_status.inc
+
+--echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
+
+--connection server_1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+
+--connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SELECT @@last_gtid;
+SET gtid_seq_no=110;
+SELECT @@last_gtid;
+BEGIN;
+SELECT @@last_gtid;
+INSERT INTO t1 VALUES (2);
+SELECT @@last_gtid;
+COMMIT;
+SELECT @@last_gtid;
+--let $pos= `SELECT @@gtid_binlog_pos`
+
+--connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+eval SET @pos= '$pos';
+# Check NULL argument.
+SELECT master_gtid_wait(NULL);
+# Check empty argument returns immediately.
+SELECT master_gtid_wait('', NULL);
+# Check this gets counted
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_time';
+# Let's check that we get a timeout
+SELECT master_gtid_wait(@pos, 0.5);
+SELECT * FROM t1 ORDER BY a;
+# Now actually wait until the slave reaches the position
+send SELECT master_gtid_wait(@pos);
+
+--connection server_2
+--source include/start_slave.inc
+
+--connection s1
+reap;
+SELECT * FROM t1 ORDER BY a;
+
+# Test waiting on a domain that does not exist yet.
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id= 1;
+INSERT INTO t1 VALUES (3);
+--let $pos= `SELECT @@gtid_binlog_pos`
+
+--connection s1
+--replace_result $pos POS
+eval SET @pos= '$pos';
+SELECT master_gtid_wait(@pos, 0);
+SELECT * FROM t1 WHERE a >= 3;
+send SELECT master_gtid_wait(@pos, -1);
+
+--connection server_2
+--source include/start_slave.inc
+
+--connection s1
+reap;
+SELECT * FROM t1 WHERE a >= 3;
+# Waiting for only part of the position.
+SELECT master_gtid_wait('1-1-1', 0);
+
+# Now test a lot of parallel master_gtid_wait() calls, completing in different
+# order, and some of which time out or get killed on the way.
+
+--connection s1
+send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
+
+--connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+# This will time out. No event 0-1-1000 exists
+send SELECT master_gtid_wait('0-1-1000', 0.5);
+
+--connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+# This one we will kill
+--let $kill1_id= `SELECT connection_id()`
+send SELECT master_gtid_wait('0-1-2000');
+
+--connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-10');
+
+--connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-6', 1);
+
+# This one we will kill also.
+--connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+--let $kill2_id= `SELECT connection_id()`
+send SELECT master_gtid_wait('2-1-5');
+
+--connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-10');
+
+--connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
+
+--connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-2');
+
+--connection server_2
+# This one completes immediately.
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SELECT master_gtid_wait('1-1-1');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
+--replace_result $wait_time MASTER_GTID_WAIT_TIME
+eval SET @a= $wait_time;
+SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
+ AS Master_gtid_wait_time_as_expected;
+
+
+--connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('0-1-109');
+
+--connection server_2
+# This one should time out.
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SELECT master_gtid_wait('2-1-2', 0.5);
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
+--replace_result $wait_time MASTER_GTID_WAIT_TIME
+eval SET @a= $wait_time;
+# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling
+# and timer inaccuracies could introduce significant jitter. So allow a
+# generous interval.
+SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
+
+--replace_result $kill1_id KILL_ID
+eval KILL QUERY $kill1_id;
+--connection s3
+--error ER_QUERY_INTERRUPTED
+reap;
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=2;
+INSERT INTO t1 VALUES (4);
+
+--connection s9
+reap;
+
+--connection server_2
+--replace_result $kill2_id KILL_ID
+eval KILL CONNECTION $kill2_id;
+
+--connection s6
+--error 2013,ER_CONNECTION_KILLED
+reap;
+
+--connection server_1
+SET gtid_domain_id=1;
+SET gtid_seq_no=4;
+INSERT INTO t1 VALUES (5);
+SET gtid_domain_id=2;
+SET gtid_seq_no=5;
+INSERT INTO t1 VALUES (6);
+
+--connection s8
+reap;
+--connection s1
+reap;
+--connection s2
+reap;
+--connection s5
+reap;
+--connection s10
+reap;
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=10;
+INSERT INTO t1 VALUES (7);
+
+--connection s4
+reap;
+--connection s7
+reap;
+
+
+--echo *** Test gtid_slave_pos when used with GTID ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1000;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1010;
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 2;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1020;
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 3;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1030;
+# Disable logging Annotate_rows events to preserve events count.
+let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
+SET @@binlog_annotate_row_events= 0;
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 5;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=3;
+SET gtid_seq_no=100;
+CREATE TABLE t2 (a INT PRIMARY KEY);
+DROP TABLE t2;
+SET gtid_domain_id=2;
+SET gtid_seq_no=1040;
+INSERT INTO t1 VALUES (20);
+--save_master_pos
+
+--connection server_2
+SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
+SET GLOBAL slave_ddl_exec_mode=STRICT;
+SET sql_slave_skip_counter=1;
+START SLAVE UNTIL master_gtid_pos="3-1-100";
+--let $master_pos=3-1-100
+--source include/sync_with_master_gtid.inc
+--source include/wait_for_slave_to_stop.inc
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t2;
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+# Start the slave again, it should fail on the DROP TABLE as the table is not there.
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
+SET sql_log_bin=1;
+START SLAVE;
+--let $slave_sql_errno=1051
+--source include/wait_for_slave_sql_error.inc
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter=2;
+--source include/start_slave.inc
+--sync_with_master
+
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+SET GLOBAL slave_ddl_exec_mode= @saved_mode;
+
+
+--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+
+# Create an out-of-order binlog on server 2.
+# Let server 3 replicate to an out-of-order point, stop it, restart it,
+# and check that it replicates correctly despite the out-of-order.
+
+--connection server_1
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (31);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (32);
+
+--connection server_1
+INSERT INTO t1 VALUES (33);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--sync_with_master
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (34);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--save_master_pos
+
+--connection server_4
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
+# Clean up.
+--connection server_1
+DROP TABLE t1;
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_implicit_commit_binlog.test b/mysql-test/suite/rpl/include/rpl_implicit_commit_binlog.test
new file mode 100644
index 00000000000..20c79ed4b3b
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_implicit_commit_binlog.test
@@ -0,0 +1,145 @@
+################################################################################
+# In this test case, we verify if some DDL statements implicitly commit a
+# transaction and are written directly to the binary log without going
+# through either the Statement- or Transactional-Cache.
+#
+# As any statement that goes through a cache is written to the binary log
+# wrapped in a BEGIN...COMMIT, we proceed as follows:
+#
+# - create a transaction and insert some values into a transactional table.
+# - execute a DDL statement that is supposed to implicitly commit the previous
+# transaction.
+# - Check in the binary log for a COMMIT mark which is supposed to be written
+# before the DDL statement.
+# - Check in the binary log if the DDL is not wrapped by a BEGIN..COMMIT.
+#
+# For further details, please, read WL#2687 and WL#5072.
+################################################################################
+
+--echo #########################################################################
+--echo # CONFIGURATION
+--echo #########################################################################
+connection master;
+
+eval CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = $engine;
+eval CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = $engine;
+eval CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;
+
+INSERT INTO tt_1(ddl_case) VALUES(0);
+INSERT INTO tt_2(ddl_case) VALUES(0);
+
+--echo #########################################################################
+--echo # CHECK IMPLICT COMMIT
+--echo #########################################################################
+SET AUTOCOMMIT= 0;
+
+INSERT INTO tt_1(ddl_case) VALUES (43);
+replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB;
+eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
+INSERT INTO tt_1(ddl_case) VALUES (42);
+DROP FUNCTION myfunc_int;
+INSERT INTO tt_1(ddl_case) VALUES (41);
+LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
+INSERT INTO tt_1(ddl_case) VALUES (40);
+LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
+INSERT INTO tt_1(ddl_case) VALUES (39);
+ANALYZE TABLE nt_1;
+INSERT INTO tt_1(ddl_case) VALUES (38);
+CHECK TABLE nt_1;
+INSERT INTO tt_1(ddl_case) VALUES (37);
+OPTIMIZE TABLE nt_1;
+INSERT INTO tt_1(ddl_case) VALUES (36);
+REPAIR TABLE nt_1;
+INSERT INTO tt_1(ddl_case) VALUES (35);
+LOCK TABLES tt_1 WRITE;
+INSERT INTO tt_1(ddl_case) VALUES (34);
+UNLOCK TABLES;
+INSERT INTO tt_1(ddl_case) VALUES (33);
+CREATE USER 'user'@'localhost';
+INSERT INTO tt_1(ddl_case) VALUES (32);
+GRANT ALL ON *.* TO 'user'@'localhost';
+INSERT INTO tt_1(ddl_case) VALUES (31);
+SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
+INSERT INTO tt_1(ddl_case) VALUES (30);
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
+INSERT INTO tt_1(ddl_case) VALUES (29);
+RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
+INSERT INTO tt_1(ddl_case) VALUES (28);
+DROP USER 'user_new'@'localhost';
+INSERT INTO tt_1(ddl_case) VALUES (27);
+CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
+INSERT INTO tt_1(ddl_case) VALUES (26);
+ALTER EVENT evt COMMENT 'evt';
+INSERT INTO tt_1(ddl_case) VALUES (25);
+DROP EVENT evt;
+INSERT INTO tt_1(ddl_case) VALUES (24);
+CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
+INSERT INTO tt_1(ddl_case) VALUES (23);
+DROP TRIGGER tr;
+INSERT INTO tt_1(ddl_case) VALUES (22);
+CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
+INSERT INTO tt_1(ddl_case) VALUES (21);
+ALTER FUNCTION fc COMMENT 'fc';
+INSERT INTO tt_1(ddl_case) VALUES (20);
+DROP FUNCTION fc;
+INSERT INTO tt_1(ddl_case) VALUES (19);
+CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
+INSERT INTO tt_1(ddl_case) VALUES (18);
+ALTER PROCEDURE pc COMMENT 'pc';
+INSERT INTO tt_1(ddl_case) VALUES (17);
+DROP PROCEDURE pc;
+INSERT INTO tt_1(ddl_case) VALUES (16);
+CREATE VIEW v AS SELECT * FROM tt_1;
+INSERT INTO tt_1(ddl_case) VALUES (15);
+ALTER VIEW v AS SELECT * FROM tt_1;
+INSERT INTO tt_1(ddl_case) VALUES (14);
+DROP VIEW v;
+INSERT INTO tt_1(ddl_case) VALUES (13);
+CREATE INDEX ix ON tt_1(ddl_case);
+INSERT INTO tt_1(ddl_case) VALUES (12);
+DROP INDEX ix ON tt_1;
+INSERT INTO tt_1(ddl_case) VALUES (11);
+CREATE TEMPORARY TABLE tt_xx (a int);
+INSERT INTO tt_1(ddl_case) VALUES (10);
+ALTER TABLE tt_xx ADD COLUMN (b int);
+INSERT INTO tt_1(ddl_case) VALUES (9);
+ALTER TABLE tt_xx RENAME new_tt_xx;
+INSERT INTO tt_1(ddl_case) VALUES (8);
+DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
+INSERT INTO tt_1(ddl_case) VALUES (7);
+CREATE TABLE tt_xx (a int);
+INSERT INTO tt_1(ddl_case) VALUES (6);
+ALTER TABLE tt_xx ADD COLUMN (b int);
+INSERT INTO tt_1(ddl_case) VALUES (5);
+RENAME TABLE tt_xx TO new_tt_xx;
+INSERT INTO tt_1(ddl_case) VALUES (4);
+TRUNCATE TABLE new_tt_xx;
+INSERT INTO tt_1(ddl_case) VALUES (3);
+DROP TABLE IF EXISTS tt_xx, new_tt_xx;
+INSERT INTO tt_1(ddl_case) VALUES (2);
+CREATE DATABASE db;
+INSERT INTO tt_1(ddl_case) VALUES (1);
+DROP DATABASE IF EXISTS db;
+
+source include/show_binlog_events.inc;
+
+SET AUTOCOMMIT= 1;
+
+--echo ###################################################################################
+--echo # CHECK CONSISTENCY
+--echo ###################################################################################
+--sync_slave_with_master
+
+--let $diff_tables= master:tt_1,slave:tt_1
+--source include/diff_tables.inc
+
+--echo ###################################################################################
+--echo # CLEAN
+--echo ###################################################################################
+connection master;
+
+DROP TABLE tt_1;
+DROP TABLE tt_2;
+DROP TABLE nt_1;
+
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_incident.inc b/mysql-test/suite/rpl/include/rpl_incident.inc
new file mode 100644
index 00000000000..75d28d6a6c6
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_incident.inc
@@ -0,0 +1,61 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+SET @old_binlog_checksum=@@binlog_checksum;
+SET GLOBAL BINLOG_CHECKSUM=none;
+connection slave;
+SET @old_binlog_checksum=@@binlog_checksum;
+SET GLOBAL BINLOG_CHECKSUM=none;
+connection master;
+
+--echo **** On Master ****
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+
+set @saved_dbug = @@global.debug_dbug;
+SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
+
+# This will generate an incident log event and store it in the binary
+# log before the replace statement.
+REPLACE INTO t1 VALUES (4);
+--save_master_pos
+SELECT * FROM t1;
+
+set @@global.debug_dbug = @saved_dbug;
+
+connection slave;
+# Wait until SQL thread stops with error LOST_EVENT on master
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
+let $slave_sql_errno= 1590;
+let $show_slave_sql_error= 1;
+source include/wait_for_slave_sql_error.inc;
+
+# The 4 should not be inserted into the table, since the incident log
+# event should have stop the slave.
+--echo **** On Slave ****
+SELECT * FROM t1;
+
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+--sync_with_master
+
+# Now, we should have inserted the row into the table and the slave
+# should be running. We should also have rotated to a new binary log.
+
+SELECT * FROM t1;
+source include/check_slave_is_running.inc;
+
+connection master;
+SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
+DROP TABLE t1;
+--sync_slave_with_master
+SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc b/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
new file mode 100644
index 00000000000..46673ea4764
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
@@ -0,0 +1,96 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+######################################################################
+# Some errors that cause the slave SQL thread to stop are not shown in
+# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
+# is only in the server's error log.
+#
+# Two failures and their respective reporting are verified:
+#
+# 1 - Failures during slave thread initialization
+# 2 - Failures while processing queries passed through the init_slave
+# option.
+#
+# In order to check the first type of failure, we inject a fault in the
+# SQL/IO Threads through SET GLOBAL debug.
+#
+# To check the second type, we set @@global.init_slave to an invalid
+# command thus preventing the initialization of the SQL Thread.
+#
+# Obs:
+# 1 - Note that testing failures while initializing the relay log position
+# is hard as the same function is called before the code reaches the point
+# that we want to test.
+#
+# 2 - This test does not target failures that are reported while applying
+# events such as duplicate keys, errors while reading the relay-log.bin*,
+# etc. Such errors are already checked on other tests.
+######################################################################
+
+######################################################################
+# Configuring the Environment
+######################################################################
+source include/have_debug.inc;
+source include/have_log_bin.inc;
+source include/master-slave.inc;
+
+connection slave;
+
+--disable_warnings
+stop slave;
+--enable_warnings
+reset slave;
+
+######################################################################
+# Injecting faults in the threads' initialization
+######################################################################
+connection slave;
+
+# Set debug flags on slave to force errors to occur
+set @saved_dbug = @@global.debug_dbug;
+SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
+
+start slave;
+
+#
+# slave is going to stop because of emulated failures
+# but there won't be any crashes nor asserts hit.
+#
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+call mtr.add_suppression("Failed during slave.* thread initialization");
+
+set @@global.debug_dbug = @saved_dbug;
+
+######################################################################
+# Injecting faults in the init_slave option
+######################################################################
+connection slave;
+
+reset slave;
+
+SET GLOBAL init_slave= "garbage";
+
+start slave;
+# 1064 = ER_PARSE_ERROR
+--let $slave_sql_errno= 1064
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+######################################################################
+# Clean up
+######################################################################
+SET GLOBAL init_slave= "";
+
+# Clean up Last_SQL_Error
+--source include/stop_slave_io.inc
+RESET SLAVE;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_innodb.test b/mysql-test/suite/rpl/include/rpl_innodb.test
new file mode 100644
index 00000000000..2fb1a1c5c79
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_innodb.test
@@ -0,0 +1,171 @@
+#
+# Bug#11401: Load data infile 'REPLACE INTO' fails on slave.
+#
+connection master;
+CREATE TABLE t4 (
+ id INT(5) unsigned NOT NULL auto_increment,
+ name varchar(15) NOT NULL default '',
+ number varchar(35) NOT NULL default 'default',
+ PRIMARY KEY (id),
+ UNIQUE KEY unique_rec (name,number)
+) ENGINE=InnoDB;
+
+--disable_warnings
+LOAD DATA
+ INFILE '../../std_data/loaddata_pair.dat'
+ REPLACE INTO TABLE t4
+ (name,number);
+--enable_warnings
+SELECT * FROM t4;
+
+sync_slave_with_master;
+SELECT * FROM t4;
+
+connection master;
+--disable_warnings
+LOAD DATA
+ INFILE '../../std_data/loaddata_pair.dat'
+ REPLACE INTO TABLE t4
+ (name,number);
+--enable_warnings
+SELECT * FROM t4;
+
+sync_slave_with_master;
+SELECT * FROM t4;
+
+connection master;
+--disable_query_log
+DROP TABLE t4;
+--enable_query_log
+sync_slave_with_master;
+connection master;
+
+# End of 4.1 tests
+
+#
+# Bug #26418: Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK
+# on master
+#
+#Note Matthias: to be merged to rpl_ddl.test
+
+FLUSH LOGS;
+sync_slave_with_master;
+FLUSH LOGS;
+connection master;
+let $engine_type= "InnoDB";
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
+
+CREATE DATABASE mysqltest1;
+CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
+eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
+SET AUTOCOMMIT = 0;
+
+sync_slave_with_master;
+connection slave;
+
+# We want to verify that the following transactions are written to the
+# binlog, despite the transaction is rolled back. (They should be
+# written to the binlog since they contain non-transactional DROP
+# TEMPORARY TABLE). To see that, we use the auxiliary table t1, which
+# is transactional (InnoDB) on master and MyISAM on slave. t1 should
+# be transactional on master so that the insert into t1 does not cause
+# the transaction to be logged. Since t1 is non-transactional on
+# slave, the change will not be rolled back, so the inserted rows will
+# stay in t1 and we can verify that the transaction was replicated.
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
+SHOW CREATE TABLE mysqltest1.t1;
+
+connection master;
+INSERT INTO mysqltest1.t1 SET f1= 1;
+DROP TEMPORARY TABLE mysqltest1.tmp;
+ROLLBACK;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp;
+--echo ######### Must return no rows here #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+
+INSERT INTO mysqltest1.t1 SET f1= 2;
+CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
+ROLLBACK;
+--replace_result MyISAM InnoDB
+SHOW CREATE TABLE mysqltest1.tmp2;
+--echo ######### Must return no rows here #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+
+sync_slave_with_master;
+connection slave;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp2;
+--echo ######### t1 has two rows here: the transaction not rolled back since t1 uses MyISAM #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+FLUSH LOGS;
+
+connection master;
+FLUSH LOGS;
+DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
+DROP DATABASE mysqltest1;
+
+--echo End of 5.1 tests
+
+--echo #
+--echo # Bug#39675 rename tables on innodb tables with pending
+--echo # transactions causes slave data issue.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE TABLE t1 (
+ id INT PRIMARY KEY auto_increment,
+ b INT DEFAULT NULL
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+ id INT PRIMARY KEY auto_increment,
+ b INT DEFAULT NULL
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (b) VALUES (1),(2),(3);
+
+BEGIN;
+INSERT INTO t1(b) VALUES (4);
+
+connection master1;
+--send RENAME TABLE t1 TO t3, t2 TO t1;
+
+connection master;
+# Need to wait until RENAME is received
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE info = "RENAME TABLE t1 TO t3, t2 TO t1" and
+ state = "Waiting for table metadata lock";
+--source include/wait_condition.inc
+
+COMMIT;
+
+connection master1;
+--reap
+
+connection master;
+SELECT * FROM t1;
+SELECT * FROM t3;
+
+sync_slave_with_master;
+
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t3;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t3;
+
+--echo End of 6.0 tests
diff --git a/mysql-test/suite/rpl/include/rpl_insert_delayed.test b/mysql-test/suite/rpl/include/rpl_insert_delayed.test
new file mode 100644
index 00000000000..1a9c4a1163c
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_insert_delayed.test
@@ -0,0 +1,163 @@
+# The two bugs below (BUG#25507 and BUG#26116) existed only in
+# statement-based binlogging; we test that now they are fixed;
+# we also test that mixed and row-based binlogging work too,
+# for completeness.
+
+connection master;
+--disable_warnings
+CREATE SCHEMA IF NOT EXISTS mysqlslap;
+USE mysqlslap;
+--enable_warnings
+
+#
+# BUG#25507 "multi-row insert delayed + auto increment causes
+# duplicate key entries on slave";
+# happened only in statement-based binlogging.
+#
+
+CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
+let $query = "INSERT DELAYED INTO t1 VALUES (null, 'Dr. No'), (null, 'From Russia With Love'), (null, 'Goldfinger'), (null, 'Thunderball'), (null, 'You Only Live Twice')";
+--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";"
+
+FLUSH TABLE t1; # another way to be sure INSERT DELAYED has inserted
+SELECT COUNT(*) FROM t1;
+# when bug existed slave failed below ("duplicate key" error at random INSERT)
+sync_slave_with_master;
+use mysqlslap;
+SELECT COUNT(*) FROM t1;
+
+#
+# BUG#26116 "If multi-row INSERT DELAYED has errors,
+# statement-based binlogging breaks";
+# happened only in statement-based binlogging.
+#
+
+connection master;
+truncate table t1;
+# first scenario: duplicate on first row
+insert delayed into t1 values(10, "my name");
+flush table t1;
+if (`SELECT @@global.binlog_format = 'STATEMENT'`)
+{
+ # statement below will be converted to non-delayed INSERT and so
+ # will stop at first error, guaranteeing replication.
+ --error ER_DUP_ENTRY
+ insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
+}
+if (`SELECT @@global.binlog_format != 'STATEMENT'`)
+{
+ insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
+}
+flush table t1;
+select * from t1;
+sync_slave_with_master;
+# when bug existed in statement-based binlogging, t1 on slave had
+# different content from on master
+select * from t1;
+
+# second scenario: duplicate on second row
+connection master;
+delete from t1 where id!=10;
+if (`SELECT @@global.binlog_format = 'STATEMENT'`)
+{
+ # statement below will be converted to non-delayed INSERT and so
+ # will be binlogged with its ER_DUP_ENTRY error code, guaranteeing
+ # replication (slave will hit the same error code and so be fine).
+ --error ER_DUP_ENTRY
+ insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
+}
+if (`SELECT @@global.binlog_format != 'STATEMENT'`)
+{
+ insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
+}
+flush table t1; # to wait for INSERT DELAYED to be done
+select * from t1;
+sync_slave_with_master;
+# when bug existed in statement-based binlogging, query was binlogged
+# with error_code=0 so slave stopped
+select * from t1;
+
+# clean up
+connection master;
+USE test;
+DROP SCHEMA mysqlslap;
+sync_slave_with_master;
+use test;
+connection master;
+
+#
+# Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but
+# on the slave
+#
+if (`SELECT @@global.binlog_format = 'STATEMENT'`)
+{
+ #flush the logs before the test
+ connection slave;
+ FLUSH LOGS;
+ source include/wait_for_binlog_checkpoint.inc;
+ connection master;
+ FLUSH LOGS;
+ source include/wait_for_binlog_checkpoint.inc;
+}
+
+CREATE TABLE t1(a int, UNIQUE(a));
+--let $_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+--disable_warnings
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+--enable_warnings
+flush table t1; # to wait for INSERT DELAYED to be done
+if (`SELECT @@global.binlog_format = 'STATEMENT'`)
+{
+ #must show two INSERT DELAYED
+ --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+ # The first INSERT DELAYED
+ --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 2)
+ --echo $stmt
+
+# The second INSERT DELAYED statement is the 3 item if two INSERT DELAYED are
+# handled together
+ --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 3)
+
+# The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are
+# handled separately
+ if ($stmt == COMMIT)
+ {
+ --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5)
+ }
+ --echo $stmt
+}
+select * from t1;
+
+sync_slave_with_master;
+echo On slave;
+if (`SELECT @@global.binlog_format = 'STATEMENT'`)
+{
+ #must show two INSERT DELAYED
+ --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+ # The show_binlog_events.inc already skips format_description, gtid list, and
+ # one binlog checkpoint events. Skip three more, second binlog checkpoint,
+ # Gtid, and CREATE TABLE, so we start at the first DML event
+ --let $binlog_limit= 3,6
+ --source include/show_binlog_events.inc
+}
+select * from t1;
+
+
+# clean up
+connection master;
+drop table t1;
+sync_slave_with_master;
+if (`SELECT @@global.binlog_format = 'STATEMENT'`)
+{
+ #flush the logs after the test
+ FLUSH LOGS;
+ connection master;
+ FLUSH LOGS;
+}
+connection master;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/suite/rpl/include/rpl_insert_id.test b/mysql-test/suite/rpl/include/rpl_insert_id.test
new file mode 100644
index 00000000000..32d861bd45a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_insert_id.test
@@ -0,0 +1,559 @@
+###########################################################
+# See if queries that use both auto_increment and LAST_INSERT_ID()
+# are replicated well
+############################################################
+# REQUIREMENT
+# Auto increment should work for a table with an auto_increment
+# column and index but without primary key.
+##############################################################
+
+--echo #
+--echo # Setup
+--echo #
+
+--echo #
+--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
+--echo # are replicated well
+--echo #
+--echo # We also check how the foreign_key_check variable is replicated
+--echo #
+
+-- source include/master-slave.inc
+#should work for both SBR and RBR
+
+--disable_query_log
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--connection slave
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+
+# If concurrent inserts are on, it is not guaranteed that the rows
+# inserted by INSERT are immediately accessible by SELECT in another
+# thread. This would cause problems near the line 'connection master1'
+# below. So we turn off concurrent inserts.
+connection master;
+SET @old_concurrent_insert= @@global.concurrent_insert;
+SET @@global.concurrent_insert= 0;
+
+connection master;
+eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
+eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
+insert into t1 values (1),(2),(3);
+insert into t1 values (null);
+insert into t2 values (null,last_insert_id());
+sync_slave_with_master;
+select * from t1 ORDER BY a;
+select * from t2 ORDER BY b;
+connection master;
+#check if multi-line inserts,
+#which set last_insert_id to the first id inserted,
+#are replicated the same way
+drop table t1;
+drop table t2;
+--disable_warnings
+eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
+eval create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=$engine_type;
+--enable_warnings
+SET FOREIGN_KEY_CHECKS=0;
+insert into t1 values (10);
+insert into t1 values (null),(null),(null);
+insert into t2 values (5,0);
+insert into t2 values (null,last_insert_id());
+SET FOREIGN_KEY_CHECKS=1;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+connection master;
+
+--echo #
+--echo # check if INSERT SELECT in auto_increment is well replicated (bug #490)
+--echo #
+
+drop table t2;
+drop table t1;
+eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
+eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
+insert into t1 values (10);
+insert into t1 values (null),(null),(null);
+insert into t2 values (5,0);
+--disable_warnings ONCE
+insert into t2 (c) select * from t1 ORDER BY a;
+select * from t2 ORDER BY b;
+sync_slave_with_master;
+select * from t1 ORDER BY a;
+select * from t2 ORDER BY b;
+connection master;
+drop table t1;
+drop table t2;
+sync_slave_with_master;
+
+--echo #
+--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
+--echo # FOREIGN_KEY_CHECKS
+--echo #
+
+connection master;
+SET TIMESTAMP=1000000000;
+eval CREATE TABLE t1 ( a INT UNIQUE ) engine=$engine_type;
+SET FOREIGN_KEY_CHECKS=0;
+# Duplicate Key Errors
+--error 1022, ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1),(1);
+sync_slave_with_master;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+--echo #
+--echo # Bug#14553: NULL in WHERE resets LAST_INSERT_ID
+--echo #
+
+connection master;
+set @@session.sql_auto_is_null=1;
+eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
+eval create table t2(a int) engine=$engine_type;
+insert into t1 (a) values (null);
+--disable_warnings
+insert into t2 (a) select a from t1 where a is null;
+insert into t2 (a) select a from t1 where a is null;
+--enable_warnings
+select * from t2;
+sync_slave_with_master;
+connection slave;
+select * from t2;
+connection master;
+drop table t1;
+drop table t2;
+
+--echo #
+--echo # End of 4.1 tests
+--echo #
+
+--echo #
+--echo # BUG#15728: LAST_INSERT_ID function inside a stored function returns 0
+--echo #
+--echo # The solution is not to reset last_insert_id on enter to sub-statement.
+--echo #
+
+connection master;
+--disable_warnings
+drop function if exists bug15728;
+drop function if exists bug15728_insert;
+drop table if exists t1, t2;
+--enable_warnings
+
+eval create table t1 (
+ id int not null auto_increment,
+ last_id int,
+ primary key (id)
+) engine=$engine_type;
+create function bug15728() returns int(11)
+ return last_insert_id();
+
+insert into t1 (last_id) values (0);
+insert into t1 (last_id) values (last_insert_id());
+insert into t1 (last_id) values (bug15728());
+
+# Check that nested call replicates too.
+eval create table t2 (
+ id int not null auto_increment,
+ last_id int,
+ primary key (id)
+) engine=$engine_type;
+delimiter |;
+create function bug15728_insert() returns int(11) modifies sql data
+begin
+ insert into t2 (last_id) values (bug15728());
+ return bug15728();
+end|
+create trigger t1_bi before insert on t1 for each row
+begin
+ declare res int;
+ select bug15728_insert() into res;
+ set NEW.last_id = res;
+end|
+delimiter ;|
+
+--disable_warnings ONCE
+insert into t1 (last_id) values (0);
+
+drop trigger t1_bi;
+
+# Check that nested call doesn't affect outer context.
+select last_insert_id();
+--disable_warnings ONCE
+select bug15728_insert();
+select last_insert_id();
+insert into t1 (last_id) values (bug15728());
+# This should be exactly one greater than in the previous call.
+select last_insert_id();
+
+# BUG#20339 - stored procedure using LAST_INSERT_ID() does not
+# replicate statement-based
+--disable_warnings ONCE
+drop procedure if exists foo;
+delimiter |;
+create procedure foo()
+begin
+ declare res int;
+ insert into t2 (last_id) values (bug15728());
+ insert into t1 (last_id) values (bug15728());
+end|
+delimiter ;|
+call foo();
+
+select * from t1;
+select * from t2;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+connection master;
+
+drop function bug15728;
+drop function bug15728_insert;
+drop table t1,t2;
+drop procedure foo;
+
+# test of BUG#20188 REPLACE or ON DUPLICATE KEY UPDATE in
+# auto_increment breaks binlog
+
+eval create table t1 (n int primary key auto_increment not null,
+ b int, unique(b)) engine=$engine_type;
+
+# First, test that we do not call restore_auto_increment() too early
+# in write_record():
+set sql_log_bin=0;
+insert into t1 values(null,100);
+replace into t1 values(null,50),(null,100),(null,150);
+select * from t1 order by n;
+truncate table t1;
+set sql_log_bin=1;
+
+insert into t1 values(null,100);
+select * from t1 order by n;
+sync_slave_with_master;
+# make slave's table autoinc counter bigger
+insert into t1 values(null,200),(null,300);
+delete from t1 where b <> 100;
+# check that slave's table content is identical to master
+select * from t1 order by n;
+# only the auto_inc counter differs.
+
+connection master;
+replace into t1 values(null,100),(null,350);
+select * from t1 order by n;
+sync_slave_with_master;
+select * from t1 order by n;
+
+# Same test as for REPLACE, but for ON DUPLICATE KEY UPDATE
+
+# We first check that if we update a row using a value larger than the
+# table's counter, the counter for next row is bigger than the
+# after-value of the updated row.
+connection master;
+--disable_warnings ONCE
+insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000;
+select * from t1 order by n;
+sync_slave_with_master;
+select * from t1 order by n;
+
+# and now test for the bug:
+connection master;
+drop table t1;
+eval create table t1 (n int primary key auto_increment not null,
+ b int, unique(b)) engine=$engine_type;
+insert into t1 values(null,100);
+select * from t1 order by n;
+sync_slave_with_master;
+insert into t1 values(null,200),(null,300);
+delete from t1 where b <> 100;
+select * from t1 order by n;
+
+connection master;
+--disable_warnings ONCE
+insert into t1 values(null,100),(null,350) on duplicate key update n=2;
+select * from t1 order by n;
+sync_slave_with_master;
+select * from t1 order by n;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+#
+# BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
+#
+
+connection master;
+# testcase with INSERT VALUES
+eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
+ UNIQUE(b)) ENGINE=$engine_type;
+--disable_warnings ONCE
+INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
+SELECT * FROM t1 ORDER BY a;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+connection master;
+drop table t1;
+
+# tescase with INSERT SELECT
+eval CREATE TABLE t1 (
+ id bigint(20) unsigned NOT NULL auto_increment,
+ field_1 int(10) unsigned NOT NULL,
+ field_2 varchar(255) NOT NULL,
+ field_3 varchar(255) NOT NULL,
+ PRIMARY KEY (id),
+ UNIQUE KEY field_1 (field_1, field_2)
+) ENGINE=$engine_type;
+eval CREATE TABLE t2 (
+ field_a int(10) unsigned NOT NULL,
+ field_b varchar(255) NOT NULL,
+ field_c varchar(255) NOT NULL
+) ENGINE=$engine_type;
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
+# Updating table t1 based on values from table t2
+--disable_warnings
+INSERT INTO t1 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c;
+--enable_warnings
+# Inserting new record into t2
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
+# Updating t1 again
+--disable_warnings
+INSERT INTO t1 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c;
+--enable_warnings
+SELECT * FROM t1 ORDER BY id;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY id;
+connection master;
+drop table t1, t2;
+
+#
+# BUG#20339: stored procedure using LAST_INSERT_ID() does not
+# replicate statement-based.
+#
+# There is another version of the test for bug#20339 above that is
+# actually originates in 5.1, and this is the version that is merged
+# from 5.0.
+#
+connection master;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+# Reset result of LAST_INSERT_ID().
+SELECT LAST_INSERT_ID(0);
+
+eval CREATE TABLE t1 (
+ id INT NOT NULL DEFAULT 0,
+ last_id INT,
+ PRIMARY KEY (id)
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ id INT NOT NULL AUTO_INCREMENT,
+ last_id INT,
+ PRIMARY KEY (id)
+) ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+ INSERT INTO t2 (last_id) VALUES (LAST_INSERT_ID());
+ INSERT INTO t1 (last_id) VALUES (LAST_INSERT_ID());
+END|
+delimiter ;|
+
+CALL p1();
+SELECT * FROM t1 ORDER BY id;
+SELECT * FROM t2 ORDER BY id;
+
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY id;
+SELECT * FROM t2 ORDER BY id;
+
+connection master;
+
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
+
+
+#
+# BUG#21726: Incorrect result with multiple invocations of
+# LAST_INSERT_ID
+#
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+ i INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ j INT DEFAULT 0
+) ENGINE=$engine_type;
+eval CREATE TABLE t2 (i INT) ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+ INSERT INTO t1 (i) VALUES (NULL);
+ INSERT INTO t2 (i) VALUES (LAST_INSERT_ID());
+ INSERT INTO t1 (i) VALUES (NULL), (NULL);
+ INSERT INTO t2 (i) VALUES (LAST_INSERT_ID());
+END |
+
+CREATE FUNCTION f1() RETURNS INT MODIFIES SQL DATA
+BEGIN
+ INSERT INTO t1 (i) VALUES (NULL);
+ INSERT INTO t2 (i) VALUES (LAST_INSERT_ID());
+ INSERT INTO t1 (i) VALUES (NULL), (NULL);
+ INSERT INTO t2 (i) VALUES (LAST_INSERT_ID());
+ RETURN 0;
+END |
+
+CREATE FUNCTION f2() RETURNS INT NOT DETERMINISTIC
+ RETURN LAST_INSERT_ID() |
+
+CREATE FUNCTION f3() RETURNS INT MODIFIES SQL DATA
+BEGIN
+ INSERT INTO t2 (i) VALUES (LAST_INSERT_ID());
+ RETURN 0;
+END |
+delimiter ;|
+
+INSERT INTO t1 VALUES (NULL, -1);
+CALL p1();
+--disable_warnings ONCE
+SELECT f1();
+INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
+ (NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
+INSERT INTO t1 VALUES (NULL, f2());
+# Test replication of substitution "IS NULL" -> "= LAST_INSERT_ID".
+INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
+UPDATE t1 SET j= -1 WHERE i IS NULL;
+
+# Test statement-based replication of function calls.
+INSERT INTO t1 (i) VALUES (NULL);
+
+# Here, we rely on having set @@concurrent_insert= 0 (see comment at
+# the top of this file).
+connection master1;
+INSERT INTO t1 (i) VALUES (NULL);
+
+connection master;
+SELECT f3();
+
+SELECT * FROM t1 ORDER BY i;
+SELECT * FROM t2 ORDER BY i;
+
+sync_slave_with_master;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP FUNCTION f3;
+DROP TABLE t1, t2;
+
+
+sync_slave_with_master;
+
+--echo #
+--echo # End of 5.0 tests
+--echo #
+
+# Tests in this file are tightly bound together. Recreate t2.
+connection master;
+eval create table t2 (
+ id int not null auto_increment,
+ last_id int,
+ primary key (id)
+) engine=$engine_type;
+
+
+# Test for BUG#20341 "stored function inserting into one
+# auto_increment puts bad data in slave"
+
+connection master;
+truncate table t2;
+# no auto_increment
+eval create table t1 (id tinyint primary key) engine=$engine_type;
+
+delimiter |;
+create function insid() returns int
+begin
+ insert into t2 (last_id) values (0);
+ return 0;
+end|
+delimiter ;|
+set sql_log_bin=0;
+insert into t2 (id) values(1),(2),(3);
+delete from t2;
+set sql_log_bin=1;
+#inside SELECT, then inside INSERT
+--disable_warnings ONCE
+select insid();
+set sql_log_bin=0;
+insert into t2 (id) values(5),(6),(7);
+delete from t2 where id>=5;
+set sql_log_bin=1;
+--disable_warnings ONCE
+insert into t1 select insid();
+select * from t1 order by id;
+select * from t2 order by id;
+
+sync_slave_with_master;
+select * from t1 order by id;
+select * from t2 order by id;
+
+connection master;
+drop table t1;
+drop function insid;
+
+truncate table t2;
+eval create table t1 (n int primary key auto_increment not null,
+ b int, unique(b)) engine=$engine_type;
+delimiter |;
+create procedure foo()
+begin
+ insert into t1 values(null,10);
+ insert ignore into t1 values(null,10);
+ insert ignore into t1 values(null,10);
+ insert into t2 values(null,3);
+end|
+delimiter ;|
+--disable_warnings ONCE
+call foo();
+select * from t1 order by n;
+select * from t2 order by id;
+
+sync_slave_with_master;
+select * from t1 order by n;
+select * from t2 order by id;
+
+connection master;
+drop table t1, t2;
+drop procedure foo;
+SET @@global.concurrent_insert= @old_concurrent_insert;
+set @@session.sql_auto_is_null=default;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_insert_id_pk.test b/mysql-test/suite/rpl/include/rpl_insert_id_pk.test
new file mode 100644
index 00000000000..f6152180e7a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_insert_id_pk.test
@@ -0,0 +1,83 @@
+###########################################################
+# See if queries that use both auto_increment and LAST_INSERT_ID()
+# are replicated well
+############################################################
+# REQUIREMENT
+# Auto increment should work for a table with auto_increment column
+# and primary key.
+##############################################################
+
+# We also check how the foreign_key_check variable is replicated
+
+-- source include/master-slave.inc
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+
+#should work for both SBR and RBR
+
+create table t1(a int auto_increment, primary key(a));
+create table t2(b int auto_increment, c int, primary key(b));
+insert into t1 values (1),(2),(3);
+insert into t1 values (null);
+insert into t2 values (null,last_insert_id());
+sync_slave_with_master;
+select * from t1 ORDER BY a;
+select * from t2 ORDER BY b;
+connection master;
+#check if multi-line inserts,
+#which set last_insert_id to the first id inserted,
+#are replicated the same way
+drop table t1;
+drop table t2;
+--disable_warnings
+eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
+eval create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=$engine_type;
+--enable_warnings
+SET FOREIGN_KEY_CHECKS=0;
+insert into t1 values (10);
+insert into t1 values (null),(null),(null);
+insert into t2 values (5,0);
+insert into t2 values (null,last_insert_id());
+SET FOREIGN_KEY_CHECKS=1;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+connection master;
+
+# check if INSERT SELECT in auto_increment is well replicated (bug #490)
+
+drop table t2;
+drop table t1;
+create table t1(a int auto_increment, primary key(a));
+create table t2(b int auto_increment, c int, primary key(b));
+insert into t1 values (10);
+insert into t1 values (null),(null),(null);
+insert into t2 values (5,0);
+--disable_warnings ONCE
+insert into t2 (c) select * from t1 ORDER BY a;
+select * from t2 ORDER BY b;
+sync_slave_with_master;
+select * from t1 ORDER BY a;
+select * from t2 ORDER BY b;
+connection master;
+drop table t1;
+drop table t2;
+sync_slave_with_master;
+
+#
+# Bug#8412: Error codes reported in binary log for CHARACTER SET,
+# FOREIGN_KEY_CHECKS
+#
+connection master;
+SET TIMESTAMP=1000000000;
+CREATE TABLE t1 ( a INT UNIQUE );
+SET FOREIGN_KEY_CHECKS=0;
+# Duplicate Key Errors codes
+--error 1022, ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1),(1);
+sync_slave_with_master;
+connection master;
+drop table t1;
+
+# End of 4.1 tests
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_insert_ignore.test b/mysql-test/suite/rpl/include/rpl_insert_ignore.test
new file mode 100644
index 00000000000..f422ef35f8c
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_insert_ignore.test
@@ -0,0 +1,121 @@
+# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB"
+# The bug was that if on master, INSERT IGNORE ignored some
+# rows, and the table was InnoDB with auto_inc column, then on slave
+# some rows received an auto_inc bigger than on master.
+# Slave needs to be started with --innodb to store table in InnoDB.
+# Same test for MyISAM (which had no bug).
+
+--connection master
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned,
+ unique (b)
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned, # to force INSERT SELECT to have a certain order
+ b int unsigned
+) ENGINE=$engine_type;
+
+
+INSERT INTO t1 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 4);
+
+# An alternation of values which will conflict in t1 and will not.
+
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 5);
+INSERT INTO t2 VALUES (4, 3);
+INSERT INTO t2 VALUES (5, 4);
+INSERT INTO t2 VALUES (6, 6);
+--disable_warnings ONCE
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+--let $assert_cond= COUNT(*) = 6 FROM t1
+--let $assert_text= Count of elements in t1 should be 6.
+--source include/assert.inc
+
+# Compare master and slave
+--sync_slave_with_master
+--let $diff_tables= master:test.t1 , slave:test.t1
+--source include/diff_tables.inc
+
+# BUG#59338 Inconsistency in binlog for statements that don't change any rows STATEMENT SBR
+# An insert ignore that does not update anything must be written to the binary log in SBR
+# and MIXED modes. We check this property by counting occurrences in t1 before and after
+# the insert and comparing the binlog positions. The count should be the same in both points
+# and the statement should be in the binary log.
+--connection master
+--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
+--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
+--let $statement_file=INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a
+--disable_warnings ONCE
+--eval $statement_file
+
+--let $assert_cond= COUNT(*) = 6 FROM t1
+--let $assert_text= Count of elements in t1 should be 6.
+--source include/assert.inc
+
+if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`)
+{
+ --let $binlog_position_cmp= =
+ --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`)
+{
+ --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 2, 1\', Info, 1]\' LIKE \'%$statement_file\'
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+
+--source include/assert.inc
+
+# An insert duplicate that does not update anything must be written to the binary
+# log in SBR and MIXED modes. We check this property by summing a before and after
+# the update and comparing the binlog positions. The sum should be the same at both
+# points and the statement should be in the binary log.
+--disable_warnings
+DROP TABLE t1;
+DROP TABLE t2;
+--enable_warnings
+eval CREATE TABLE t1 (
+ a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a INT UNSIGNED
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
+--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
+--let $statement_file=INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a
+--disable_warnings ONCE
+--eval $statement_file
+
+--let $assert_cond= SUM(a) = 1 FROM t1
+--let $assert_text= Sum of elements in t1 should be 1.
+--source include/assert.inc
+
+if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`)
+{
+ --let $binlog_position_cmp= =
+ --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`)
+{
+ --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\'
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+--source include/assert.inc
+
+
+# Clean up
+--connection master
+drop table t1, t2;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/include/rpl_loaddata.test b/mysql-test/suite/rpl/include/rpl_loaddata.test
new file mode 100644
index 00000000000..f0933c1023f
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_loaddata.test
@@ -0,0 +1,247 @@
+# See if replication of a "LOAD DATA in an autoincrement column"
+# Honours autoincrement values
+# i.e. if the master and slave have the same sequence
+#
+# check replication of load data for temporary tables with additional
+# parameters
+#
+# check if duplicate entries trigger an error (they should unless IGNORE or
+# REPLACE was used on the master) (bug 571).
+#
+# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
+# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
+
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+--disable_query_log
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+select last_insert_id();
+create table t1(a int not null auto_increment, b int, primary key(a) );
+eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
+# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
+select last_insert_id();
+
+create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
+eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
+
+create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
+--disable_warnings
+insert into t3 select * from t2;
+--enable_warnings
+
+sync_slave_with_master;
+
+select * from t1;
+select * from t3;
+
+connection master;
+
+drop table t1;
+drop table t2;
+drop table t3;
+create table t1(a int, b int, unique(b));
+
+sync_slave_with_master;
+
+# See if slave stops when there's a duplicate entry for key error in LOAD DATA
+
+insert into t1 values(1,10);
+
+connection master;
+eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
+
+save_master_pos;
+connection slave;
+# 1062 = ER_DUP_ENTRY
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062");
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0");
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
+# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
+# takes us directly to the end of the relay log).
+
+sync_with_master;
+--source include/check_slave_no_error.inc
+
+# Trigger error again to test CHANGE MASTER
+
+connection master;
+set sql_log_bin=0;
+delete from t1;
+set sql_log_bin=1;
+eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
+save_master_pos;
+connection slave;
+# The SQL slave thread should be stopped now.
+# Exec_Master_Log_Pos should point to the start of Execute event
+# for last load data.
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
+--source include/stop_slave_io.inc
+change master to master_user='test';
+change master to master_user='root';
+--source include/check_slave_no_error.inc
+
+# Trigger error again to test RESET SLAVE
+
+set global sql_slave_skip_counter=1;
+start slave;
+sync_with_master;
+connection master;
+set sql_log_bin=0;
+delete from t1;
+set sql_log_bin=1;
+eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
+save_master_pos;
+connection slave;
+# The SQL slave thread should be stopped now.
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
+stop slave;
+reset slave;
+--source include/check_slave_no_error.inc
+
+# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
+
+connection master;
+reset master;
+eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
+unique(day)) engine=$engine_type; # no transactions
+--error ER_DUP_ENTRY
+eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
+terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
+'\n##\n' starting by '>' ignore 1 lines;
+select * from t2;
+save_master_pos;
+connection slave;
+start slave;
+sync_with_master;
+select * from t2;
+
+# verify that if no error on slave, this is an error
+
+alter table t2 drop key day;
+connection master;
+delete from t2;
+--error ER_DUP_ENTRY
+eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
+terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
+'\n##\n' starting by '>' ignore 1 lines;
+connection slave;
+
+if (`SELECT @@global.binlog_format != 'ROW'`)
+{
+ # Query causes error on master but not on slave. This causes the slave to
+ # stop with error code 0 (which is wrong: see BUG#57287)
+ --let $slave_sql_errno= 0
+ --source include/wait_for_slave_sql_error.inc
+ drop table t1, t2;
+}
+connection master;
+drop table t1, t2;
+
+# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+
+--error ER_DUP_ENTRY
+eval LOAD DATA $lock_option INFILE "../../std_data/words.dat" INTO TABLE t1;
+
+DROP TABLE t1;
+
+# BUG#48297: Schema name is ignored when LOAD DATA is written into binlog,
+# replication aborts
+-- let $rpl_only_running_threads= 1
+-- source include/rpl_reset.inc
+
+-- let $db1= b48297_db1
+-- let $db2= b42897_db2
+
+-- connection master
+
+-- disable_warnings
+-- eval drop database if exists $db1
+-- eval drop database if exists $db2
+-- enable_warnings
+
+-- eval create database $db1
+-- eval create database $db2
+
+-- eval use $db1
+-- eval CREATE TABLE t1 (c1 VARCHAR(256)) engine=$engine_type;
+
+-- eval use $db2
+
+-- echo ### assertion: works with cross-referenced database
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
+
+-- eval use $db1
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- echo ### assertion: works with fully qualified name on current database
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
+
+-- echo ### assertion: works without fully qualified name on current database
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
+
+-- echo ### create connection without default database
+connect (conn2,localhost,root,,*NO-ONE*);
+-- connection conn2
+-- echo ### assertion: works without stating the default database
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
+
+# We cannot disconnect right away because when inserting
+# concurrently in a MyISAM table, the server is sending an OK
+# to the client before updating the table state (where the
+# number of records is kept). See: BUG#37521 and BUG#29334.
+# So we need to wait, otherwise we would be having sporadic
+# failures as reported here: BUG#50451.
+
+# 12 = 3 rows per each LOAD DATA executed x 4
+-- let $count= 12
+-- let $table= $db1.t1
+--source include/wait_until_rows_count.inc
+
+-- disconnect conn2
+-- connection master
+
+-- sync_slave_with_master
+-- eval use $db1
+
+let $diff_tables= master:$db1.t1, slave:$db1.t1;
+source include/diff_tables.inc;
+
+-- connection master
+
+-- eval DROP DATABASE $db1
+-- eval DROP DATABASE $db2
+
+-- sync_slave_with_master
+
+# BUG#49479: LOAD DATA INFILE is binlogged without escaping field names
+-- source include/rpl_reset.inc
+-- connection master
+use test;
+CREATE TABLE t1 (`key` TEXT, `text` TEXT);
+
+LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
+SELECT * FROM t1;
+
+-- sync_slave_with_master
+-- connection master
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_loaddata_local.inc b/mysql-test/suite/rpl/include/rpl_loaddata_local.inc
new file mode 100644
index 00000000000..20962d74e98
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_loaddata_local.inc
@@ -0,0 +1,232 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# See if "LOAD DATA LOCAL INFILE" is well replicated
+# (LOAD DATA LOCAL INFILE is not written to the binlog
+# the same way as LOAD DATA INFILE : Append_blocks are smaller).
+# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
+# - the loaded file was not written entirely to the master's binlog,
+# only the first 4KB, 8KB or 16KB usually.
+# - the loaded file's first line was not written entirely to the
+# master's binlog (1st char was absent)
+source include/master-slave.inc;
+
+create table t1(a int);
+let $1=10000;
+disable_query_log;
+set SQL_LOG_BIN=0;
+while ($1)
+{
+ insert into t1 values(1);
+ dec $1;
+}
+set SQL_LOG_BIN=1;
+enable_query_log;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+#This will generate a 20KB file, now test LOAD DATA LOCAL
+truncate table t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+sync_slave_with_master;
+select a,count(*) from t1 group by a;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+
+#
+# Now let us test how well we replicate LOAD DATA LOCAL in situation when
+# we met duplicates in tables to which we are adding rows.
+# (It supposed that LOAD DATA LOCAL ignores such errors)
+#
+connection master;
+create table t1(a int);
+insert into t1 values (1), (2), (2), (3);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+SELECT * FROM t1 ORDER BY a;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+
+#
+# Bug22504 load data infile sql statement in replication architecture get error
+#
+--echo ==== Bug22504 Initialize ====
+
+--connection master
+
+SET sql_mode='ignore_space';
+CREATE TABLE t1(a int);
+insert into t1 values (1), (2), (3), (4);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+SELECT * FROM t1 ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+--echo ==== Clean up ====
+
+connection master;
+DROP TABLE t1;
+
+sync_slave_with_master;
+
+--echo
+--echo Bug #43746:
+--echo "return wrong query string when parse 'load data infile' sql statement"
+--echo
+
+connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
+SELECT @@SESSION.sql_mode INTO @old_mode;
+
+SET sql_mode='ignore_space';
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1;
+TRUNCATE TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD/* look mum, with comments in weird places! */DATA/* oh hai */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/* we are */INTO/* from the internets */TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO */ TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO TABLE */ t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA /*!10000 LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE */ t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!10000 INTO*/TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
+
+SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
+
+sync_slave_with_master;
+
+--echo
+--echo Bug #59267:
+--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
+--echo
+
+connection master;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+
+SELECT 'Master', COUNT(*) FROM t1;
+
+--sync_slave_with_master
+SELECT 'Slave', COUNT(*) FROM t1;
+
+# cleanup
+connection master;
+
+--remove_file $MYSQLD_DATADIR/bug43746.sql
+--remove_file $MYSQLD_DATADIR/bug59267.sql
+
+DROP TABLE t1;
+SET SESSION sql_mode=@old_mode;
+
+sync_slave_with_master;
+
+connection master;
+
+--echo
+--echo Bug #60580/#11902767:
+--echo "statement improperly replicated crashes slave sql thread"
+--echo
+
+connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+
+CREATE TABLE t3 AS SELECT * FROM t2;
+
+CREATE VIEW v1 AS SELECT * FROM t2
+ WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+
+SELECT * FROM t1;
+
+sleep 1;
+
+sync_slave_with_master;
+
+SELECT * FROM t1;
+
+--remove_file $MYSQLD_DATADIR/bug60580.csv
+
+connection master;
+
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+
+sync_slave_with_master;
+
+connection master;
+--source include/rpl_end.inc
+
+--echo # End of 5.1 tests
diff --git a/mysql-test/suite/rpl/include/rpl_loadfile.inc b/mysql-test/suite/rpl/include/rpl_loadfile.inc
new file mode 100644
index 00000000000..9cd64530690
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_loadfile.inc
@@ -0,0 +1,120 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the LOAD_FILE() in rbr #
+#############################################################################
+# Change Author: JBM
+# Change Date: 2006-01-16
+##########
+
+# Includes
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+
+-- source suite/rpl/include/rpl_loadfile.test
+
+# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
+#
+# DESCRIPTION
+#
+# Problem: when using load_file string function and mixed binlogging format
+# there was no switch to row based binlogging format. This leads
+# to scenarios on which the slave replicates the statement and it
+# will try to load the file from local file system, which in most
+# likely it will not exist.
+#
+# Solution:
+# Marking this function as unsafe for statement format, makes the
+# statement using it to be logged in row based format. As such, data
+# replicated from the master, becomes the content of the loaded file.
+# Consequently, the slave receives the necessary data to complete
+# the load_file instruction correctly.
+#
+# IMPLEMENTATION
+#
+# The test is implemented as follows:
+#
+# On Master,
+# i) write to file the desired content.
+# ii) create table and stored procedure with load_file
+# iii) stop slave
+# iii) execute load_file
+# iv) remove file
+#
+# On Slave,
+# v) start slave
+# vi) sync it with master so that it gets the updates from binlog (which
+# should have bin logged in row format).
+#
+# If the the binlog format does not change to row, then the assertion
+# done in the following step fails. This happens because tables differ
+# since the file does not exist anymore, meaning that when slave
+# attempts to execute LOAD_FILE statement it inserts NULL on table
+# instead of the same contents that the master loaded when it executed
+# the procedure (which was executed when file existed).
+#
+# vii) assert that the contents of master and slave
+# table are the same
+
+--source include/rpl_reset.inc
+
+connection master;
+let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT repeat('x',20) INTO OUTFILE '$file'
+
+disable_warnings;
+DROP TABLE IF EXISTS t1;
+enable_warnings;
+
+CREATE TABLE t1 (t text);
+DELIMITER |;
+CREATE PROCEDURE p(file varchar(4096))
+ BEGIN
+ INSERT INTO t1 VALUES (LOAD_FILE(file));
+ END|
+DELIMITER ;|
+
+# stop slave before issuing the load_file on master
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+
+# test: check that logging falls back to rbr.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval CALL p('$file')
+
+# test: remove the file from the filesystem and assert that slave still
+# gets the loaded file
+remove_file $file;
+
+# now that the file is removed it is safe (regarding what we want to test)
+# to start slave
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+# assertion: assert that the slave got the updates even
+# if the file was removed before the slave started,
+# meaning that contents were indeed transfered
+# through binlog (in row format)
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+# CLEAN UP
+--connection master
+DROP TABLE t1;
+DROP PROCEDURE p;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_loadfile.test b/mysql-test/suite/rpl/include/rpl_loadfile.test
new file mode 100644
index 00000000000..9073e5e3d9f
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_loadfile.test
@@ -0,0 +1,32 @@
+# Begin clean up test section
+--disable_warnings
+connection master;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+
+# Section 1 test
+
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
+delimiter |;
+create procedure test.p1()
+begin
+ INSERT INTO test.t1 VALUES(2,'test');
+ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
+end|
+delimiter ;|
+
+CALL test.p1();
+SELECT * FROM test.t1 ORDER BY blob_column;
+save_master_pos;
+sync_slave_with_master;
+connection slave;
+SELECT * FROM test.t1 ORDER BY blob_column;
+
+# Cleanup
+connection master;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_log.test b/mysql-test/suite/rpl/include/rpl_log.test
new file mode 100644
index 00000000000..f885602eaad
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_log.test
@@ -0,0 +1,151 @@
+# Requires statement logging
+
+# Clean up old slave's binlogs.
+# The slave is started with --log-slave-updates
+# and this test does SHOW BINLOG EVENTS on the slave's
+# binlog. But previous tests can influence the current test's
+# binlog (e.g. a temporary table in the previous test has not
+# been explicitly deleted, and at the beginning of the current
+# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
+# We wait for the slave to have written all he wants to the binlog
+# (otherwise RESET MASTER may come too early).
+sync_slave_with_master;
+source include/stop_slave.inc;
+--source include/wait_for_slave_to_stop.inc
+reset master;
+reset slave;
+start slave;
+--source include/wait_for_slave_to_start.inc
+
+let $VERSION=`select version()`;
+# Lets run this test in STRICT MODE (DROP TABLE is not DROP TABLE IF EXISTS)
+connection slave;
+set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode;
+set @@global.slave_ddl_exec_mode=STRICT;
+connection master;
+
+eval create table t1(n int not null auto_increment primary key)ENGINE=$engine_type;
+insert into t1 values (NULL);
+drop table t1;
+let $LOAD_FILE= ../../std_data/words.dat;
+if (!`SELECT length(load_file('$LOAD_FILE'))`){
+ let $LOAD_FILE= ../$LOAD_FILE;
+}
+eval create table t1 (word char(20) not null)ENGINE=$engine_type;
+--replace_result $LOAD_FILE LOAD_FILE
+eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
+select count(*) from t1;
+source include/show_binlog_events.inc;
+
+let $binlog_limit= 2;
+source include/show_binlog_events.inc;
+
+let $binlog_limit= 3;
+source include/show_binlog_events.inc;
+
+let $binlog_limit= 2,5;
+source include/show_binlog_events.inc;
+let $binlog_limit=;
+flush logs;
+--source include/wait_for_binlog_checkpoint.inc
+
+# We need an extra update before doing save_master_pos.
+# Otherwise, an unlikely scenario may occur:
+# * When the master's binlog_dump thread reads the end of master-bin.001,
+# it send the rotate event which is at this end, plus a fake rotate event
+# because it's starting to read a new binlog.
+# save_master_pos will record the position of the first of the two rotate
+# (because the fake one is not in the master's binlog anyway).
+# * Later the slave waits for the position of the first rotate event,
+# and it may quickly stop (in 'slave stop') without having received the fake
+# one.
+# So, depending on a few milliseconds, we end up with 2 rotate events in the
+# relay log or one, which influences the output of SHOW SLAVE STATUS, making
+# it not predictable and causing random test failures.
+# To make it predictable, we do a useless update now, but which has the
+# interest of making the slave catch both rotate events.
+
+let $skip_checkpoint_events=1;
+
+eval create table t3 (a int)ENGINE=$engine_type;
+
+# Sync slave and force it to start on another binary log
+
+#show rows of t1 on master
+connection master;
+select * from t1 order by 1 asc;
+
+sync_slave_with_master;
+
+#check t1 on slave to ensure whether it's identical with on master
+select * from t1 order by 1 asc;
+flush logs;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+connection master;
+
+# Create some entries for second log
+
+eval create table t2 (n int)ENGINE=$engine_type;
+insert into t2 values (1);
+source include/show_binlog_events.inc;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+source include/show_binlog_events.inc;
+
+--replace_column 2 #
+show binary logs;
+sync_slave_with_master;
+--replace_column 2 #
+show binary logs;
+
+let $binlog_file=;
+source include/show_binlog_events.inc;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+source include/show_binlog_events.inc;
+let $binlog_file=;
+
+source include/check_slave_is_running.inc;
+
+# Need to recode the following
+
+#show new master for slave with master_log_file='master-bin.000001' and master_log_pos=4 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.000001' and master_log_pos=79 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.000001' and master_log_pos=311 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.000002' and master_log_pos=4 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.000002' and master_log_pos=122 and master_server_id=1;
+
+--error 1220
+show binlog events in 'slave-bin.000005' from 4;
+
+connection master;
+
+# The table drops caused Cluster Replication wrapper to fail as event ID would never be the same.# Moving drops here.
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+#
+# Bug #6880: LAST_INSERT_ID() within a statement
+#
+
+# Reset binlog so that show binlog events will not show the tests
+# above.
+source include/rpl_reset.inc;
+connection master;
+
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+source include/show_binlog_events.inc;
+select * from t1;
+drop table t1;
+
+# End of 4.1 tests
+
+sync_slave_with_master;
+set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode;
+connection master;
diff --git a/mysql-test/suite/rpl/include/rpl_lower_case_table_names.test b/mysql-test/suite/rpl/include/rpl_lower_case_table_names.test
new file mode 100644
index 00000000000..fa48142ee91
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_lower_case_table_names.test
@@ -0,0 +1,141 @@
+# BUG#37656
+#
+# This test aims at checking whether lower_case_table_names=1 option works
+# for database names and table names.
+#
+# This test checks the following (when lower_case_table_names=1 is set on slave):
+# (i) creating a database on upper case on master results in lower case
+# database name on slave
+# (ii) creating tables with upper case names on master results in lower case
+# table names on slave
+# (iii) loading data infile into capitalized table name on master replicates to
+# lower case table name on slave
+# (iv) Propagating changes from upper case table names on into correspondent
+# lower case table names on slave works.
+
+
+# setup: create database and tables
+-- echo ******** [ MASTER ] ********
+-- let $dbname_upper= BUG_37656
+-- let $dbname_lower= `SELECT LOWER('$dbname_upper')`
+-- eval CREATE DATABASE $dbname_upper
+-- eval use $dbname_upper
+
+# assert: database names are in upper case in master and lower
+# case in slave
+-- eval show databases like '$dbname_upper'
+sync_slave_with_master;
+-- echo ******** [ SLAVE ] ********
+--eval show databases like '$dbname_lower'
+
+-- connection master
+-- echo ******** [ MASTER ] ********
+CREATE TABLE T1 (a int);
+-- eval CREATE TABLE T2 (b int) ENGINE=$engine
+CREATE TABLE T3 (txt TEXT);
+
+# assert: that tables exist on master with upper case names
+show tables;
+
+# assert: that tables exist on slave but with lower case names
+-- sync_slave_with_master
+-- echo ******** [ SLAVE ] ********
+-- eval use $dbname_lower
+show tables;
+
+# action: lets create t1 for asserting below that t1 does not get changes
+# from master (slave configured with --replicate-ignore-db=$dbname_lower.t1)
+CREATE TABLE t1 (a INT);
+
+# action: fill data into tables
+-- connection master
+-- echo ******** [ MASTER ] ********
+-- eval use $dbname_upper
+INSERT INTO T1 VALUES (1);
+INSERT INTO T2 VALUES (1);
+if (`SELECT @@session.binlog_format != 'ROW'`)
+{
+ -- eval LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE $dbname_upper.T3
+}
+
+if (`SELECT @@session.binlog_format = 'ROW'`)
+{
+ use test;
+ -- eval INSERT INTO $dbname_upper.T1 VALUES (2)
+ -- eval INSERT INTO $dbname_upper.T2 VALUES (2)
+ -- eval LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE $dbname_upper.T3
+}
+# assert: lower case tables on lower case database on slave
+# get updates from upper case tables on upper case
+# database on master
+-- sync_slave_with_master
+-- echo ******** [ SLAVE ] ********
+
+# assert: changes for slave's t1 were filterd out
+if (`SELECT count(*) != 0 FROM t1`)
+{
+ -- echo UNEXPECTED DATA on $dbname_lower.t1 as table is filtered by replicate-ignore-table rules
+}
+
+-- let $diff_tables=master:$dbname_upper.T2, slave:$dbname_lower.t2
+-- source include/diff_tables.inc
+
+-- let $diff_tables=master:$dbname_upper.T3, slave:$dbname_lower.t3
+-- source include/diff_tables.inc
+
+# clean up
+-- connection master
+-- echo ******** [ MASTER ] ********
+-- eval DROP DATABASE $dbname_upper
+-- sync_slave_with_master
+
+
+#
+# BUG#50653: drop procedure implicitely treats db name in a case sensitive way
+#
+
+-- connection master
+
+-- let $dbname= B50653
+-- let $procname= b50653_proc
+
+-- eval CREATE DATABASE $dbname
+-- eval USE $dbname
+-- eval CREATE PROCEDURE $procname() BEGIN SELECT 1; END
+
+if (`SELECT count(*) = 1 FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not created on MASTER
+}
+
+-- sync_slave_with_master
+if (`SELECT count(*) = 1 FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not created on SLAVE
+}
+
+-- connection master
+-- eval DROP PROCEDURE $procname
+
+if (`SELECT count(*) FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not dropped on MASTER
+}
+
+-- sync_slave_with_master
+if (`SELECT count(*) FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not dropped on SLAVE
+}
+
+-- let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
+if ($last_error)
+{
+ -- die UNEXPECTED SLAVE SQL error: $last_error
+}
+
+-- connection master
+-- eval DROP DATABASE $dbname
+-- sync_slave_with_master
+
+-- source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_max_relay_size.test b/mysql-test/suite/rpl/include/rpl_max_relay_size.test
new file mode 100644
index 00000000000..0fcff5ebe6c
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_max_relay_size.test
@@ -0,0 +1,118 @@
+# Test of options max_binlog_size and max_relay_log_size and
+# how they act (if max_relay_log_size == 0, use max_binlog_size
+# for relay logs too).
+# Test of manual relay log rotation with FLUSH LOGS.
+
+# Requires statement logging
+-- source include/master-slave.inc
+
+connection slave;
+stop slave;
+connection master;
+
+--echo #
+--echo # Generate a big enough master's binlog to cause relay log rotations
+--echo #
+
+create table t1 (a int);
+let $1=800;
+disable_query_log;
+begin;
+while ($1)
+{
+# eval means expand $ expressions
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+enable_query_log;
+drop table t1;
+save_master_pos;
+connection slave;
+reset slave;
+
+--echo #
+--echo # Test 1
+--echo #
+
+set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size;
+set global max_binlog_size=8192;
+set global max_relay_log_size=8192-1; # mapped to 4096
+select @@global.max_relay_log_size;
+start slave;
+sync_with_master;
+--source include/check_slave_is_running.inc
+
+--echo #
+--echo # Test 2
+--echo #
+
+stop slave;
+reset slave;
+set global max_relay_log_size=(5*4096);
+query_vertical select @@global.max_relay_log_size;
+start slave;
+sync_with_master;
+--source include/check_slave_is_running.inc
+
+--echo #
+--echo # Test 3: max_relay_log_size = 0
+--echo #
+
+stop slave;
+reset slave;
+set global max_relay_log_size=0;
+query_vertical select @@global.max_relay_log_size;
+start slave;
+sync_with_master;
+--source include/check_slave_is_running.inc
+
+--echo #
+--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
+--echo #
+
+stop slave;
+reset slave;
+# test of relay log rotation when the slave is stopped
+# (to make sure it does not crash).
+flush logs;
+
+--echo #
+--echo # Test 5
+--echo #
+
+reset slave;
+start slave;
+sync_with_master;
+# test of relay log rotation when the slave is started
+flush logs;
+# We have now easy way to be sure that the SQL thread has now deleted the
+# log we just closed. But a trick to achieve this is do an update on the master.
+connection master;
+create table t1 (a int);
+sync_slave_with_master;
+--source include/check_slave_is_running.inc
+
+--echo #
+--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
+--echo #
+
+flush logs;
+connection master;
+drop table t1;
+sync_slave_with_master;
+--source include/check_slave_is_running.inc
+
+connection master;
+# test that the absence of relay logs does not make a master crash
+flush logs;
+source include/show_master_status.inc;
+
+# Restore max_binlog_size
+connection slave;
+set global max_binlog_size= @my_max_binlog_size;
+set global max_relay_log_size= @my_max_relay_log_size;
+
+--echo #
+--echo # End of 4.1 tests
+--echo #
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_mixing_engines.inc b/mysql-test/suite/rpl/include/rpl_mixing_engines.inc
new file mode 100644
index 00000000000..c71c45a57c5
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_mixing_engines.inc
@@ -0,0 +1,637 @@
+# ==== Purpose ====
+#
+# This is an auxiliary file used by rpl_mixing_engines.test. It
+# executes SQL statements according to a format string, as specified in
+# rpl_mixing_engines.test. In addition, it accepts the special format
+# strings 'configure' and 'clean', used before and after everything else.
+#
+# ==== Usage ====
+#
+# --let $commands= command1 command2 ...
+# --let $database_name= name
+# [--let $verbose= 1]
+# --source include/rpl_mixing_engines.inc
+#
+# Parameters:
+#
+# $commands
+# Space-separated list of commands. See rpl_mixing_engines.test
+# for a list of all commands.
+#
+# $database_name
+# Name of database to use. If $commands is 'configure' or
+# 'clean', and the database name is not 'test', then the
+# database is created or dropped, respectively.
+#
+# $verbose
+# By default, show_binlog_events.inc is sourced after all
+# commands have been processed, showing the result of all
+# commands. If this flag is set, then show_binlog_events.inc is
+# also sourced once after each command, showing only the result
+# of that command.
+
+--echo rpl_mixing_engines.inc [commands=$commands]
+
+--let $rme_initial_commands= $commands
+
+if ($commands == 'configure')
+{
+ connection master;
+
+ --disable_query_log
+ if ($database_name != 'test')
+ {
+ --eval CREATE DATABASE $database_name
+ }
+ --eval use $database_name
+ --enable_query_log
+
+ eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+ eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+ eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+ eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+ eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+ eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+ eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
+ eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
+ eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
+ eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
+ eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
+ eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
+
+ INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
+
+ INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
+ INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
+
+ DELIMITER |;
+
+ CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+ INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+ END|
+
+ CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+ INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+ END|
+
+ CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+ INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+ RETURN "fc_i_tt_5_suc";
+ END|
+
+ CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+ INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+ RETURN "fc_i_nt_5_suc";
+ END|
+
+ CREATE FUNCTION fc_i_nt_3_tt_3_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= p_trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO nt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+
+ SELECT max(stmt_id) INTO in_stmt_id FROM tt_3 WHERE trans_id= p_trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO tt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+ RETURN "fc_i_nt_3_tt_3_suc";
+ END|
+
+ CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+ INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+ END|
+
+ CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+ INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+ END|
+
+ CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
+ INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+ INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+ END|
+
+ CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+ BEGIN
+ DECLARE in_stmt_id INTEGER;
+ SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
+ SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+ INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+ INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+ END|
+
+ DELIMITER ;|
+
+ let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+
+ let $trans_id= 7;
+ let $tb_id= 1;
+ let $stmt_id= 1;
+ --let $commands=
+ let $sn= 0;
+}
+
+if ($commands == 'clean')
+{
+ connection master;
+
+ --disable_query_log
+ --eval use $database_name
+ --enable_query_log
+
+ DROP TABLE tt_1;
+ DROP TABLE tt_2;
+ DROP TABLE tt_3;
+ DROP TABLE tt_4;
+ DROP TABLE tt_5;
+ DROP TABLE tt_6;
+
+ DROP TABLE nt_1;
+ DROP TABLE nt_2;
+ DROP TABLE nt_3;
+ DROP TABLE nt_4;
+ DROP TABLE nt_5;
+ DROP TABLE nt_6;
+
+ DROP PROCEDURE pc_i_tt_5_suc;
+ DROP PROCEDURE pc_i_nt_5_suc;
+ DROP FUNCTION fc_i_tt_5_suc;
+ DROP FUNCTION fc_i_nt_5_suc;
+ DROP FUNCTION fc_i_nt_3_tt_3_suc;
+
+ --disable_query_log
+ if ($database_name != 'test')
+ {
+ --eval DROP DATABASE $database_name
+ }
+ --enable_query_log
+
+ sync_slave_with_master;
+
+ --let $commands=
+}
+
+while ($commands != '')
+{
+ --disable_query_log
+ --eval use $database_name
+ --enable_query_log
+
+ --disable_query_log
+ --let $command= `SELECT SUBSTRING_INDEX('$commands', ' ', 1)`
+ if ($verbose)
+ {
+ --echo -b-b-b-b-b-b-b-b-b-b-b- >> $command << -b-b-b-b-b-b-b-b-b-b-b-
+ let $pos_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+ }
+ --enable_query_log
+ if ($command == 'B')
+ {
+ eval BEGIN;
+ }
+ if ($command == 'T')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'T-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'T-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval SELECT fc_i_tt_5_suc ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'T-proc')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval CALL pc_i_tt_5_suc ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'eT')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'Te')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'Te-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_5`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'Te-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id));
+ inc $stmt_id;
+ }
+ if ($command == 'N')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'N-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'N-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval SELECT fc_i_nt_5_suc ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'N-proc')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval CALL pc_i_nt_5_suc ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'eN')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'Ne')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'Ne-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_5`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'Ne-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
+ inc $stmt_id;
+ }
+ if ($command == 'tN')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1;
+ inc $stmt_id;
+ }
+ if ($command == 'tNe')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM tt_1;
+ inc $stmt_id;
+ }
+ if ($command == 'nT')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1;
+ inc $stmt_id;
+ }
+ if ($command == 'nTe')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_1`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM nt_1;
+ inc $stmt_id;
+ }
+ if ($command == 'NT')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval UPDATE nt_3, tt_3 SET nt_3.info= "new text $trans_id --> $stmt_id", tt_3.info= "new text $trans_id --> $stmt_id" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1;
+ inc $stmt_id;
+ }
+ if ($command == 'NT-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'NT-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_tt_5_suc($trans_id, $stmt_id));
+ inc $stmt_id;
+ }
+ if ($command == 'NeT-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_4`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_4 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'NeT-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from nt_5`;
+ let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id));
+ inc $stmt_id;
+ }
+ if ($command == 'TN')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval UPDATE tt_4, nt_4 SET tt_4.info= "new text $trans_id --> $stmt_id", nt_4.info= "new text $trans_id --> $stmt_id" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1;
+ inc $stmt_id;
+ }
+ if ($command == 'TN-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'TN-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_nt_5_suc($trans_id, $stmt_id));
+ inc $stmt_id;
+ }
+ if ($command == 'TeN-trig')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_3`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_3 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
+ inc $stmt_id;
+ }
+ if ($command == 'TeN-func')
+ {
+ #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
+ let $old_trans_id= `SELECT max(trans_id) from tt_5`;
+ let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`;
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
+ inc $stmt_id;
+ }
+ if ($command == 'set-T')
+ {
+ --eval SET @var= fc_i_tt_5_suc($trans_id, $stmt_id)
+ inc $stmt_id;
+ }
+ if ($command == 'set-N')
+ {
+ --eval SET @var= fc_i_nt_5_suc($trans_id, $stmt_id)
+ inc $stmt_id;
+ }
+ if ($command == 'set-NT')
+ {
+ --eval SET @var= fc_i_nt_3_tt_3_suc($trans_id, $stmt_id)
+ inc $stmt_id;
+ }
+ if ($command == 'CS-T->T')
+ {
+ --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM tt_1;
+ }
+ if ($command == 'CS-N->N')
+ {
+ --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;
+ }
+ if ($command == 'CS-T->N')
+ {
+ --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM nt_1;
+ }
+ if ($command == 'CS-N->T')
+ {
+ --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;
+ }
+ if ($command == 'CSe-T->T')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM tt_1;
+ }
+ if ($command == 'CSe-N->N')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;
+ }
+ if ($command == 'CSe-T->N')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM nt_1;
+ }
+ if ($command == 'CSe-N->T')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;
+ }
+ if ($command == 'CT')
+ {
+ --eval CREATE TEMPORARY TABLE tt_xx_$tb_id (a int) engine=$engine_type;
+ }
+ if ($command == 'IS-T<-N')
+ {
+ --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;
+ }
+ if ($command == 'ISe-T<-N')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;
+ }
+ if ($command == 'IS-N<-T')
+ {
+ --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;
+ }
+ if ($command == 'ISe-N<-T')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;
+ }
+ if ($command == 'IS-T<-T')
+ {
+ --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;
+ }
+ if ($command == 'ISe-T<-T')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;
+ }
+ if ($command == 'IS-N<-N')
+ {
+ --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;
+ }
+ if ($command == 'ISe-N<-N')
+ {
+ --error ER_DUP_ENTRY, ER_DUP_KEY
+ --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;
+ }
+ if ($command == 'trunc-CS-T')
+ {
+ eval TRUNCATE TABLE tt_xx_$tb_id;
+ }
+ if ($command == 'trunc-CS-N')
+ {
+ eval TRUNCATE TABLE nt_xx_$tb_id;
+ }
+ if ($command == 'trunc-CT')
+ {
+ eval TRUNCATE TABLE tt_xx_$tb_id;
+ }
+ if ($command == 'drop-CS')
+ {
+ --disable_warnings
+ eval DROP TABLE IF EXISTS tt_xx_$tb_id, nt_xx_$tb_id;
+ inc $tb_id;
+ --enable_warnings
+ }
+ if ($command == 'drop-CT')
+ {
+ --disable_warnings
+ eval DROP TEMPORARY TABLE IF EXISTS tt_xx_$tb_id;
+ inc $tb_id;
+ --enable_warnings
+ }
+ if ($command == 'C')
+ {
+ --error 0, ER_GET_ERRMSG
+ eval COMMIT;
+ }
+ if ($command == 'R')
+ {
+ --replace_column 2 #
+ --error 0, ER_GET_ERRMSG
+ eval ROLLBACK;
+ }
+ if ($command == 'Sn')
+ {
+ eval SAVEPOINT S_$sn;
+ --inc $sn
+ }
+ if ($command == 'Rn')
+ {
+ if ($sn)
+ {
+ --dec $sn
+ }
+ --replace_column 2 #
+ eval ROLLBACK TO S_$sn;
+ }
+ if ($command == 'Cn')
+ {
+ if ($sn)
+ {
+ --dec $sn
+ }
+ eval RELEASE SAVEPOINT S_$sn;
+ }
+ --disable_query_log
+ --let $commands= `SELECT LTRIM(SUBSTRING('$commands', LENGTH('$command') + 1))`
+ inc $stmt_id;
+
+ let $binlog_start= $pos_command;
+ if ($verbose)
+ {
+ # Use other connection because include/show_binlog_events.inc
+ # executes SELECT UUID(), which switches to row-logging when
+ # binlog_format=mixed, if there are open temporary tables. This is
+ # due to BUG#13692513.
+ --connection server_1
+ --source include/show_binlog_events.inc
+ --connection master
+ --echo -e-e-e-e-e-e-e-e-e-e-e- >> $command << -e-e-e-e-e-e-e-e-e-e-e-
+ }
+ if ($commands == '')
+ {
+ let $binlog_start= $pos_trans_command;
+ --echo -b-b-b-b-b-b-b-b-b-b-b- >> $rme_initial_commands << -b-b-b-b-b-b-b-b-b-b-b-
+ --connection server_1
+ --source include/show_binlog_events.inc
+ --connection master
+ --echo -e-e-e-e-e-e-e-e-e-e-e- >> $rme_initial_commands << -e-e-e-e-e-e-e-e-e-e-e-
+ --echo
+ let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+ let $stmt_id= 1;
+ inc $trans_id;
+ }
+}
+
+--let $commands= $rme_initial_commands
diff --git a/mysql-test/suite/rpl/include/rpl_mixing_engines.test b/mysql-test/suite/rpl/include/rpl_mixing_engines.test
new file mode 100644
index 00000000000..fd4663072b3
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_mixing_engines.test
@@ -0,0 +1,1816 @@
+################################################################################
+# - Introduction
+# This checks if transactions that mixes transactional and non-transactional
+# are correctly handled. There are several types of statements that require
+# attention because of their special behavior in transactions:
+#
+# * Non-transactional updates that take place inside a transaction present
+# problems for logging because (1) they are visible to other clients before
+# the transaction is committed, and (2) they are not rolled back even if the
+# transaction is rolled back. It is not always possible to log correctly in
+# statement format when both transactional and non-transactional tables are
+# 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
+#
+# * Statements that update temporary tables need special treatment since they
+# are not logged in row format.
+#
+# - Definitions
+#
+# To reason about logging different table types, we make some preliminary
+# definitions.
+#
+# * A table that has a transactional engine is called a T-table.
+#
+# * A table that has a non-transactional engine is called an N-table.
+#
+# * A statement makes an N-write if it makes any type of change to the server
+# state that will not be changed by a ROLLBACK.
+#
+# * Events are either appended to the Transaction Cache (TC) or to the
+# Statement Cache (SC) or written directly to the binlog.
+#
+# - Preliminary Rules
+#
+# The following preliminary rules are actually consequences of the principle
+# that statements shall be correctly logged when binlog_format=MIXED or ROW.
+# They also apply when binlog_format=STATEMENT: this makes statement format
+# work in many practical cases.
+#
+# * (Causality) If statement A is executed before statement B, and B is logged
+# in statement format, and B reads tables that A may modifies, then B shall be
+# logged after A.
+#
+# * (Durability) Events shall be written to the binary log at the moment they
+# take effect. In particular, changes to N-tables shall be written to the
+# binary log when they have been executed, and changes to T-tables shall be
+# written to the binary log on commit. If --sync-binlog has been specified,
+# then it suffices that events are be written to the binary log at the next
+# synchronization point.
+#
+# * (causality-precedence) If causality and durability cannot both be
+# fulfilled, then casuality is considered more important.
+#
+# - Rules for non-committing statements, except CREATE TEMPORARY TABLE...SELECT
+#
+# The preliminary rules above, together with the principles for logging format
+# , have been used to construct the following rules.
+#
+# CALL statements are unrolled, so that each statement executed by the stored
+# procedure is logged separately. (If a stored procedure A invokes a stored
+# procedure B, then B is unrolled recursively). In the following, we assume
+# that unrolling has already been done, and the word "statement" refers to a
+# non-CALL top-level statement or a non-CALL sub-statement.
+#
+# Let S be a logged statement that does not have an implicit commit, except
+# CREATE TEMPORARY TABLE...SELECT (This includes all "pure DML": INSERT,
+# UPDATE, DELETE, REPLACE, TRUNCATE, SELECT, DO, CALL, EXECUTE, LOAD DATA
+# INFILE, and BINLOG. It also includes CREATE TEMPORARY TABLE without SELECT,
+# and DROP TEMPORARY TABLE. CREATE TEMPORARY TABLE...SELECT is handled in the
+# next subsection).
+#
+# Before executing S, determine unsafeness:
+#
+# * If S either makes N-writes or reads from an N-table, and either S or a
+# previous statement in the same transaction reads or writes to a T-table,
+# then S is marked as unsafe.
+#
+# When logging S, determine where to log it by applying the following rules in
+# order:
+#
+# * If S is to be logged in statement format (i.e., if one of the following
+# holds: (1) STATEMENT; (2) MIXED and S is safe; (3) S is of DDL type, i.e.,
+# CREATE TEMPORARY TABLE):
+# 1. If S produces an error and does not do any N-write, do not log.
+# 2. Otherwise, if either S or any previous statement in the same
+# transaction reads or writes in any T-tables, log to TC.
+# 3. Otherwise, log to SC.
+#
+# * If S is to be logged in row format (i.e., if S is DML and one of the
+# following holds: (1) ROW; (2) MIXED and S is unsafe):
+# 1. Do not log row events that write to temporary tables.
+# 2. Log row events that write to non-temporary N-tables to SC.
+# 3. Log row events that write to non-temporary T-tables to TC, except
+# rows that are rolled back due to an error. (Note: if there is an error,
+# rows written to a T-table are kept if there are subsequent rows written
+# to an N-table.)
+#
+# * At the end of S, write BEGIN + SC + COMMIT to the binlog and clear the
+# SC.
+#
+# At end of transaction:
+#
+# * At COMMIT or implicit commit, where all XA tables in the transaction
+# succeed in the "prepare" phase:
+# 1. If the TC is non-empty, write BEGIN + TC + COMMIT to the binlog.
+# 2. If the TC is empty, do nothing.
+#
+# * At ROLLBACK; or at COMMIT or implicit commit where some XA table fails
+# in the "prepare" phase:
+# 1. If the TC contains any N-write, write BEGIN + TC + ROLLBACK to the
+# binlog.
+# 2. If the TC does not contain any N-write, do nothing.
+#
+# * At ROLLBACK TO SAVEPOINT:
+# 1. If the TC contains any N-write after the savepoint, write ROLLBACK TO
+# SAVEPOINT to the TC.
+# 2. Otherwise, clear the part of the TC that starts at the savepoint and
+# extends to the end of the TC. (Bug#47327 breaks this rule)
+#
+# * Clear the TC at the end of the transaction.
+#
+# - Rules for CREATE [TEMPORARY] TABLE...SELECT
+#
+# First, unsafeness is determined as above (R-unsafe-transaction). Then the
+# logging format is decided. Then the following rules apply.
+#
+# * If logging in statement format (i.e., one of the following holds: (1)
+# STATEMENT; (2) MIXED and statement is safe):
+# 1. If there is an error, do not write anything.
+# 2. If there is no error and the TEMPORARY keyword is used, write the
+# entire CREATE...SELECT statement to the TC.
+# 3. If there is no error and the TEMPORARY keyword is not used, write the
+# entire CREATE...SELECT directly to the binlog.
+#
+# * If logging in row format (i.e., one of the following holds: (1) ROW; (2)
+# MIXED and statement is unsafe):
+# 1. If the TEMPORARY keyword is used, do not write anything.
+# 2. If the TEMPORARY keyword is not used, write CREATE TABLE (without
+# select) + BEGIN + row events + COMMIT to the TC. If there is an error,
+# clear the TC; otherwise flush the TC to the binlog at the end of the
+# statement and then clear the TC. (Note: currently Bug#47899 breaks this
+# rule)
+#
+# - Rules for committing statements, except CREATE [TEMPORARY] TABLE...SELECT
+#
+# * All other statements that have a pre-commit are written directly to the
+# 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
+# by spaces. The following codes exist:
+#
+# - Define the scope of a transaction:
+# B - Begin.
+# C - Commit.
+# R - Rollback.
+# Sn - Savepoint Sn.
+# Rn - Rollback to Sn.
+#
+# - Change only T-Tables:
+# T - Updates a T-Table.
+# T-trig - Updates T-Tables through a trigger.
+# T-func - Updates T-Tables through a function.
+# T-proc - Updates T-Tables through a procedure.
+# eT - Fails while updating the first tuple in a T-Table.
+# Te - Fails while updating an n-tuple (n > 1) in a T-Table.
+# Te-trig - Fails while updating an n-tuple (n > 1) in a T-Table.
+# Te-func - Fails while updating an n-tuple (n > 1) in a T-Table.
+#
+# - Change only N-Tables
+# N - Updates a N-Table.
+# N-trig - Updates N-Tables through a trigger.
+# N-func - Updates N-Tables through a function.
+# N-proc - Updates N-Tables through a procedure.
+# eN - Fails while updating the first tuple in a N-Table.
+# Ne - Fails while updating an n-tuple (n > 1) in a N-Table.
+# Ne-trig - Fails while updating an n-tuple (n > 1) in a N-Table.
+# Ne-func - Fails while updating an n-tuple (n > 1) in a N-Table.
+#
+# - Read T-table and write N-table:
+# tN - Updates a N-Table
+# tNe - Fails while updating an n-tuple (n > 1) in a N-Table.
+#
+# - Read N-table and write T-table:
+# nT - Updates a T-Table.
+# nTe - Fails while updating an n-tuple (n > 1) in a T-Table.
+#
+# - Update both types of tables. First a N-Table and the a T-Table:
+# NT - Upates both types of tables through an update statement.
+# NT-trig - Updates both types of tables through a trigger.
+# NT-func - Updates both types of tables through a procedure.
+# NeT-trig - Fails while updating an n-tuple (n > 1) in a T-Table.
+# NeT-func - Fails while updating an n-tuple (n > 1) in a T-Table.
+#
+# - Update both types of tables. First a T-Table and the a N-Table:
+# TN - Upates both types of tables through an update statement.
+# TN-trig - Updates both types of tables through a trigger.
+# TN-func - Updates both types of tables through a procedure.
+# TeN-trig - Fails while updating an n-tuple (n > 1) in a N-Table.
+# TeN-func - Fails while updating an n-tuple (n > 1) in a N-Table.
+#
+# - This is CREATE...SELECT:
+# CS-T->T - Creates a T-table selecting from a T-table.
+# CS-N->N - Creates a N-table selecting from a N-table.
+# CS-T->N - Creates a T-table selecting form a N-table.
+# CS-N->T - Creates a N-table selecting from a T-table.
+# CSe-T->T - Fails while creating a T-table selecting from a T-table.
+# CSe-N->N - Fails while creating a N-table selecting from a N-table.
+# CSe-T->N - Fails while creating a T-table selecting from a a N-table.
+# CSe-N->T - Fails while creating a N-table selecting from a T-table.
+# drop-CS - Drops any of the tables previously created.
+# trunc-CS-T - Truncates a T-table previously created.
+# trunc-CS-N - Truncates a N-table previously created.
+# CT - Creates a temporary T-table.
+# drop-CT - Drops a temporary T-table.
+#
+# - This is INSERT...SELECT:
+# IS-T<-T - Inserts data from a T-table into a T-table.
+# IS-T<-N - Inserts data from a N-table into a T-table.
+# IS-N<-T - Inserts data from a T-table into a N-table.
+# IS-N<-N - Inserts data from a N-table into a N-table.
+# ISe-T<-T - Fails while inserting data from a T-table into a T-table.
+# ISe-T<-N - Fails while inserting data from a N-table into a T-table.
+# ISe-N<-T - Fails while inserting data from a T-table into a N-table.
+# ISe-N<-N - Fails while inserting data from a N-table into a N-table.
+#
+# For the CREATE...SELECT and INSERT...SELECT, the table names are defined based
+# on the variable $tb_id which is automatically incremented after each drop.
+# This indirectly means that two tables cannot co-exist unless we manually keep
+# the variable $tb_id.
+#
+# The format of the entries in the binlog depends on the mode and on the type
+# statements: S - statement and R - row. And when it is clear from the context
+# which statement is referred to, we sometimes use "M" to denote a "Mixed"
+# statement, i.e., one that accesses both a T-table and an N-table.
+#
+# For further details, please, read WL#2687 and WL#5072.
+################################################################################
+--echo #########################################################################
+--echo # CONFIGURATION
+--echo #########################################################################
+
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+--source include/big_test.inc
+
+--let $verbose= 1
+--let $commands= configure
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo #########################################################################
+--echo # 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
+--echo #########################################################################
+connection master;
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #1) Generates in the binlog what follows:
+--echo # --> STMT "B T C" entries, format S.
+--echo # --> ROW "B T C" entries, format R.
+--echo # --> MIXED "B T C" entries, format S.
+--echo #
+--let $commands= T
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= T-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= T-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= T-proc
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #1.e) Generates in the binlog what follows:
+--echo # --> STMT empty.
+--echo # --> ROW empty.
+--echo # --> MIXED empty.
+--echo #
+--let $commands= eT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= Te
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= Te-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= Te-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #2) Generates in the binlog what follows:
+--echo # --> STMT "B N C" entry, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format S.
+--echo #
+--let $commands= N
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= N-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= N-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= N-proc
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #2.e) Generates in the binlog what follows if a N-table is changed:
+--echo # --> STMT "B N C" entry, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format S.
+--echo #
+--let $commands= eN
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= Ne
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= Ne-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= Ne-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #3) Generates in the binlog what follows:
+--echo # --> STMT "B M C" entry if only N-Table is changed, format S.
+--echo # --> STMT "B M C" entries, format S.
+--echo # --> ROW "B N T B T C" entries, format R.
+--echo # --> MIXED "B N T B T C" entries, format R.
+--echo #
+--let $commands= tN
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= nT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= NT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= NT-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= NT-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= TN
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= TN-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= TN-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #3.e) Generates in the binlog what follows:
+--echo # --> STMT "B M C" entry if only N-Table is changed, format S.
+--echo # --> STMT "B M R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--let $commands= tNe
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= nTe
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= NeT-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= NeT-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= TeN-trig
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= TeN-func
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #4) Generates in the binlog what follows:
+--echo # --> STMT "B T T C" entries, format S.
+--echo # --> ROW "B T T C" entries, format R.
+--echo # --> MIXED "B T T C" entries, format S
+--echo #
+--let $commands= B T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #4.e) Generates in the binlog what follows:
+--echo # --> STMT "B T C" entries, format S.
+--echo # --> ROW "B T C" entries, format R.
+--echo # --> MIXED "B T C" entries, format S.
+--echo #
+--let $commands= B T eT C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Te C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Te-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Te-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B eT T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #5) Generates in the binlog what follows:
+--echo # --> STMT empty.
+--echo # --> ROW empty.
+--echo # --> MIXED empty.
+--echo #
+--let $commands= B T T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #5.e) Generates in the binlog what follows:
+--echo # --> STMT empty.
+--echo # --> ROW empty.
+--echo # --> MIXED empty.
+--echo #
+--let $commands= B T eT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Te R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Te-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Te-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B eT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #6) Generates in the binlog what follows:
+--echo # --> STMT "B N C B N C" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S.
+--echo #
+--let $commands= B N N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #6.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B N C B N C" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S.
+--echo #
+--let $commands= B N eN C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N Ne C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N Ne-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N Ne-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B eN N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Ne N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Ne-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Ne-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #7) Generates in the binlog what follows:
+--echo # --> STMT "B N C B N C" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S.
+--echo #
+--let $commands= B N N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #7.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B N C B N C" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S.
+--echo #
+--let $commands= B N eN R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N Ne R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N Ne-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N Ne-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B eN N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Ne N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Ne-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Ne-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #8) Generates in the binlog what follows:
+--echo # --> STMT "B T N C" entries, format S.
+--echo # --> ROW "B N C B T C" entries, format R.
+--echo # --> MIXED "B N C B T C" entries, format R in N and S in T.
+--echo #
+--let $commands= B T N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #8.e) Generates in the binlog what follows if T-* fails:
+--echo # --> STMT "B N C" entry, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo # Otherwise, what follows if N-* fails and a N-Table is changed:
+--echo # --> STMT "B T N C" entries, format S.
+--echo # --> ROW "B N C B T C" entries, format R.
+--echo # --> MIXED "B N C B T C" entries, format R in N and S in T.
+--echo #
+--let $commands= B eT N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T eN C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Ne C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #9) Generates in the binlog what follows:
+--echo # --> STMT "B T N R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo #
+--let $commands= B T N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-trig N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-func N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T-proc N-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #9.e) Generates in the binlog what follows if T* fails:
+--echo # --> STMT "B N C" entry, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo # Otherwise, what follows if N* fails and a N-Table is changed:
+--echo # --> STMT "B T N R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo #
+--let $commands= B eT N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B Te N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T eN R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Ne R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #10) Generates in the binlog:
+--echo # --> STMT "B N C B T C" entries, format S.
+--echo # --> ROW "B N C B T C" entries, format R.
+--echo # --> MIXED "B N C B T C" entries, format S.
+--echo #
+--let $commands= B N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T-proc C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #11) Generates in the binlog what follows:
+--echo # --> STMT "B N C" entries, format S.
+--echo # --> ROW "B N C" entries, format R.
+--echo # --> MIXED "B N C" entries, format S.
+--echo #
+
+--let $commands= B N T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-trig T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-func T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T-proc R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N-proc T-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #12) Generates in the binlog what follows:
+--echo # --> STMT "B M C B T C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M T C" entries, format S.
+--echo # --> ROW "B N C B T T C" entries, format R.
+--echo # --> MIXED "B N C B T T C" entries, format R in N/T and format S in T.
+--echo #
+--let $commands= B tN T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nT T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #12.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B M C B T C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M T C" entries, format S.
+--echo # --> ROW "B N C B T T C" entries, format R.
+--echo # --> MIXED "B N C B T T C" entries, format R in N/T and format S in T.
+ --echo #
+--let $commands= B tNe T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nTe T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-trig T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-func T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #13) "B M T R" generates in the binlog:
+--echo # --> STMT "B M C B T R" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M T R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo #
+--let $commands= B tN T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #13.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B M C B T R" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M T R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo #
+--let $commands= B tNe T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nTe T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-trig T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-func T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #14) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B T M C" entries, format S.
+--echo # --> ROW "B N C B T T C" entries, format R.
+--echo # --> MIXED "B N C B T T C" entries, format R in N/T and format S in T.
+--echo #
+--let $commands= B T tN C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T nT C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NT C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NT-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NT-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TN C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TN-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TN-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #14.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B T M C" entries, format S.
+--echo # --> ROW "B N C B T C" entry, format R.
+--echo # --> MIXED "B N C B T C" entry, format R.
+--echo #
+--let $commands= B T tNe C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T nTe C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NeT-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NeT-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TeN-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TeN-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #15) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B T M R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo #
+--let $commands= B T tN R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T nT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NT-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NT-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TN R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TN-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TN-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #15.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B T M R" entries, format S.
+--echo # --> ROW "B N C" entry, format R.
+--echo # --> MIXED "B N C" entry, format R.
+--echo #
+--let $commands= B T tNe R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T nTe R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NeT-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T NeT-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TeN-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T TeN-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #16) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M N C" entries, format S.
+--echo # --> ROW "B N C B N C B T C" entries, format R.
+--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> MIXED "B N C B N C B T C" entries, format R.
+--echo #
+--let $commands= B tN N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nT N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #16.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M N C" entries, format S.
+--echo # --> ROW "B N C B N C B T C" entries, format R.
+--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> MIXED "B N C B N C B T C" entries, format R.
+--echo #
+--let $commands= B tNe N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nTe N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-trig N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-func N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #17) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M N R" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> MIXED "B N C B N C" entries, format R.
+--echo #
+--let $commands= B tN N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nT N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NT-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TN-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #17.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B M N R" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S.
+--echo # --> MIXED "B N C B N C" entries, format R.
+--echo #
+--let $commands= B tNe N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B nTe N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B NeT-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-trig N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B TeN-func N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #18) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B N C B M C" entries, format S.
+--echo # --> ROW "B N C B N C B T C" entries, format R.
+--echo # --> MIXED "B N C B N C B T C" entries, format S in first N and format R in the other.
+--echo #
+
+--let $commands= B N tN C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N nT C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NT C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NT-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NT-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TN C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TN-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TN-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #18.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B N C B M C" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S in first N and format R in the other.
+--echo #
+--let $commands= B N tNe C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N nTe C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NeT-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NeT-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TeN-trig C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TeN-func C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #19) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B N C B M R" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S in first N and format R in the other.
+--echo #
+
+--let $commands= B N tN R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N nT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NT-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NT-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TN R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TN-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TN-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo
+--echo
+--echo
+--echo
+--echo #
+--echo #19.e) Generates in the binlog what follows if a N-Table is changed:
+--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S.
+--echo # --> STMT "B N C B M R" entries, format S.
+--echo # --> ROW "B N C B N C" entries, format R.
+--echo # --> MIXED "B N C B N C" entries, format S in first N and format R in the other.
+--echo #
+--let $commands= B N tNe R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N nTe R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NeT-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N NeT-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TeN-trig R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N TeN-func R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo ###################################################################################
+--echo # 2 - SAVEPOINT
+--echo ###################################################################################
+--let $commands= B T Sn T Rn C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N T Sn T Rn C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T N Sn T Rn C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Sn N T Rn C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--echo ###################################################################################
+--echo # 3 - CREATE TABLE...SELECT
+--echo ###################################################################################
+--let $commands= CSe-T->T CS-T->T drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CSe-N->N CS-N->N drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CSe-T->N CS-T->N drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CSe-N->T CS-N->T drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CSe-N->T CS-N->T drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CSe-N->T CS-N->T drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo ###################################################################################
+--echo # 4 - INSERT TABLE...SELECT
+--echo ###################################################################################
+
+--let $commands= CS-T->T
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B T IS-T<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B T ISe-T<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B IS-T<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B ISe-T<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CS-T->T
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B T IS-T<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B T ISe-T<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B IS-T<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-T B ISe-T<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CS-N->N
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B T IS-N<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B T ISe-N<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B IS-N<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B ISe-N<-T T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= CS-N->N
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B T IS-N<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B T ISe-N<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B IS-N<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= trunc-CS-N B ISe-N<-N T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CS
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo ###################################################################################
+--echo # 5 - ROLLBACK TEMPORARY TABLE
+--echo ###################################################################################
+--let $commands= B T CT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T Sn T CT Rn R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B T CT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B tN CT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B CT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B N CT T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= drop-CT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo ###################################################################################
+--echo # 5 - SET WITH ROW CHANGES
+--echo ###################################################################################
+--let $commands= set-T
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= set-N
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= set-NT
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-N set-T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-T set-N C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-N set-T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-T set-N R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-NT set-T C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-T set-NT C
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-NT set-T R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+--let $commands= B set-T set-NT R
+--source suite/rpl/include/rpl_mixing_engines.inc
+
+
+--echo ###################################################################################
+--echo # CHECK CONSISTENCY
+--echo ###################################################################################
+connection master;
+sync_slave_with_master;
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
+if (`select @@session.binlog_direct_non_transactional_updates = 0 || @@session.binlog_format != 'STATEMENT'`)
+{
+ --diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
+}
+
+--echo ###################################################################################
+--echo # CLEAN
+--echo ###################################################################################
+--let $commands= clean
+--source suite/rpl/include/rpl_mixing_engines.inc
diff --git a/mysql-test/suite/rpl/include/rpl_multi_query.test b/mysql-test/suite/rpl/include/rpl_multi_query.test
new file mode 100644
index 00000000000..ae2a3aa45d2
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_multi_query.test
@@ -0,0 +1,26 @@
+# Test for BUG#8436: verify that a multi-query (i.e. one query
+# containing several queries (assuming client has
+# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
+# one binlog event containing all queries)
+
+
+# PS doesn't support multi-statements
+--disable_ps_protocol
+-- source include/master-slave.inc
+create database mysqltest;
+
+delimiter /;
+create table mysqltest.t1 ( n int);
+insert into mysqltest.t1 values(1)/
+insert into mysqltest.t1 values(2);
+insert into mysqltest.t1 values(3);
+insert into mysqltest.t1 values(4);
+insert into mysqltest.t1 values(5)/
+delimiter ;/
+sync_slave_with_master;
+select * from mysqltest.t1;
+connection master;
+source include/show_binlog_events.inc;
+drop database mysqltest;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_multi_update.test b/mysql-test/suite/rpl/include/rpl_multi_update.test
new file mode 100644
index 00000000000..cdbdbc191d7
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_multi_update.test
@@ -0,0 +1,33 @@
+source include/master-slave.inc;
+
+call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+--disable_warnings ONCE
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--disable_warnings ONCE
+UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
+sync_slave_with_master;
+
+# End of 4.1 tests
+
+connection master;
+drop table t1, t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_multi_update2.test b/mysql-test/suite/rpl/include/rpl_multi_update2.test
new file mode 100644
index 00000000000..b85927a2aed
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_multi_update2.test
@@ -0,0 +1,63 @@
+# Let's verify that multi-update is not always skipped by slave if
+# some replicate-* rules exist.
+# (BUG#7011)
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+
+--disable_warnings ONCE
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--disable_warnings ONCE
+UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+#
+# BUG#13236 multi-update with subquery & --replicate-ignore-table
+#
+reset master;
+
+connection master;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (0);
+UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
+select * from t1;
+sync_slave_with_master;
+
+connection slave;
+select * from t1;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/include/rpl_multi_update3.test b/mysql-test/suite/rpl/include/rpl_multi_update3.test
new file mode 100644
index 00000000000..f7d4815e9e5
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_multi_update3.test
@@ -0,0 +1,223 @@
+##############################################################################
+#
+# Let's verify that multi-update with a subselect does not cause the slave to crash
+# (BUG#10442)
+#
+--disable_query_log
+SELECT '-------- Test for BUG#9361 --------' as "";
+--enable_query_log
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+
+--disable_warnings ONCE
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--disable_warnings ONCE
+UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+drop table t1,t2;
+
+##############################################################################
+#
+# Test for BUG#9361:
+# Subselects should work inside multi-updates
+#
+--disable_query_log
+SELECT '-------- Test 1 for BUG#9361 --------' as "";
+--enable_query_log
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ a1 char(30),
+ a2 int,
+ a3 int,
+ a4 char(30),
+ a5 char(30)
+);
+
+CREATE TABLE t2 (
+ b1 int,
+ b2 char(30)
+);
+
+# Insert one row per table
+INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
+INSERT INTO t2 VALUES (1, 'baz');
+
+# This should update the row in t1
+UPDATE t1 a, t2
+ SET a.a1 = 'No'
+ WHERE a.a2 =
+ (SELECT b1
+ FROM t2
+ WHERE b2 = 'baz')
+ AND a.a3 IS NULL
+ AND a.a4 = 'foo'
+ AND a.a5 = 'bar';
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t1, t2;
+
+##############################################################################
+#
+# Second test for BUG#9361
+#
+
+--disable_query_log
+SELECT '-------- Test 2 for BUG#9361 --------' as "";
+--enable_query_log
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE TABLE t1 (
+ i INT,
+ j INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+CREATE TABLE t2 (
+ i INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+CREATE TABLE t3 (
+ j INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+INSERT INTO t1 VALUES ( 1, 2,13,14,15);
+INSERT INTO t2 VALUES ( 1, 3,23,24,25);
+INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
+
+UPDATE t1 AS a
+INNER JOIN t2 AS b
+ ON a.i = b.i
+INNER JOIN t3 AS c
+ ON a.j = c.j AND b.k = c.k
+SET a.x = b.x,
+ a.y = b.y,
+ a.z = (
+ SELECT sum(z)
+ FROM t3
+ WHERE y = 34
+ )
+WHERE b.x = 23;
+
+sync_slave_with_master;
+connection slave;
+
+SELECT * FROM t1;
+
+connection master;
+DROP TABLE t1, t2, t3;
+
+##############################################################################
+#
+# BUG#12618
+#
+# TEST: Replication of a statement containing a join in a multi-update.
+
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1 (
+ idp int(11) NOT NULL default '0',
+ idpro int(11) default NULL,
+ price decimal(19,4) default NULL,
+ PRIMARY KEY (idp)
+);
+
+CREATE TABLE t2 (
+ idpro int(11) NOT NULL default '0',
+ price decimal(19,4) default NULL,
+ nbprice int(11) default NULL,
+ PRIMARY KEY (idpro)
+);
+
+INSERT INTO t1 VALUES
+ (1,1,'3.0000'),
+ (2,2,'1.0000'),
+ (3,1,'1.0000'),
+ (4,1,'4.0000'),
+ (5,3,'2.0000'),
+ (6,2,'4.0000');
+
+INSERT INTO t2 VALUES
+ (1,'0.0000',0),
+ (2,'0.0000',0),
+ (3,'0.0000',0);
+
+# This update sets t2 to the minimal prices for each product
+update
+ t2
+ join
+ ( select idpro, min(price) as min_price, count(*) as nbr_price
+ from t1
+ where idpro>0 and price>0
+ group by idpro
+ ) as table_price
+on t2.idpro = table_price.idpro
+set t2.price = table_price.min_price,
+ t2.nbprice = table_price.nbr_price;
+
+select "-- MASTER AFTER JOIN --" as "";
+select * from t1;
+select * from t2;
+
+sync_slave_with_master;
+
+select "-- SLAVE AFTER JOIN --" as "";
+select * from t1;
+select * from t2;
+
+connection master;
+DROP TABLE t1, t2;
+# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/include/rpl_not_null.test b/mysql-test/suite/rpl/include/rpl_not_null.test
new file mode 100644
index 00000000000..cbb6b787f11
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_not_null.test
@@ -0,0 +1,360 @@
+#################################################################################
+# This test checks if the replication between "null" fields to either "null"
+# fields or "not null" fields works properly. In the first case, the execution
+# should work fine. In the second case, it may fail according to the sql_mode
+# being used.
+#
+# The test is devided in three main parts:
+#
+# 1 - NULL --> NULL (no failures)
+# 2 - NULL --> NOT NULL ( sql-mode = STRICT and failures)
+# 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures)
+#
+#################################################################################
+connection master;
+
+SET SQL_LOG_BIN= 0;
+eval CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t3(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+
+connection slave;
+
+eval CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t3(`a` INT, `b` DATE DEFAULT '0000-00-00',
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+--echo ************* EXECUTION WITH INSERTS *************
+connection master;
+INSERT INTO t1(a,b,c) VALUES (1, null, 1);
+INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, 4);
+INSERT INTO t1(a) VALUES (5);
+
+INSERT INTO t2(a,b) VALUES (1, null);
+INSERT INTO t2(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t2(a) VALUES (3);
+
+INSERT INTO t3(a,b) VALUES (1, null);
+INSERT INTO t3(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t3(a) VALUES (3);
+
+INSERT INTO t4(a,b,c) VALUES (1, null, 1);
+INSERT INTO t4(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t4(a,b) VALUES (3, null);
+INSERT INTO t4(a,c) VALUES (4, 4);
+INSERT INTO t4(a) VALUES (5);
+
+--echo ************* SHOWING THE RESULT SETS WITH INSERTS *************
+sync_slave_with_master;
+
+--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+
+--echo TABLES t2 and t3 must be different.
+connection master;
+SELECT * FROM t3 ORDER BY a;
+connection slave;
+SELECT * FROM t3 ORDER BY a;
+connection master;
+SELECT * FROM t4 ORDER BY a;
+connection slave;
+SELECT * FROM t4 ORDER BY a;
+
+--echo ************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
+REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+UPDATE t1 set b= NULL, c= 300 where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
+
+--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+sync_slave_with_master;
+
+--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+--echo ************* CLEANING *************
+connection master;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+
+sync_slave_with_master;
+
+connection master;
+
+SET SQL_LOG_BIN= 0;
+eval CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= $engine;
+SET SQL_LOG_BIN= 1;
+
+connection slave;
+
+eval CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= $engine;
+
+--echo ************* EXECUTION WITH INSERTS *************
+connection master;
+INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
+INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, b'01');
+INSERT INTO t1(a) VALUES (5);
+
+--echo ************* SHOWING THE RESULT SETS WITH INSERTS *************
+--echo TABLES t1 and t2 must be different.
+sync_slave_with_master;
+connection master;
+SELECT a,b+0,c+0 FROM t1 ORDER BY a;
+connection slave;
+SELECT a,b+0,c+0 FROM t1 ORDER BY a;
+
+--echo ************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
+REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
+UPDATE t1 set b= NULL, c= b'00' where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
+
+--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
+sync_slave_with_master;
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+connection master;
+
+DROP TABLE t1;
+
+sync_slave_with_master;
+
+--echo ################################################################################
+--echo # NULL ---> NOT NULL (STRICT MODE)
+--echo # UNCOMMENT THIS AFTER FIXING BUG#43992
+--echo ################################################################################
+#connection slave;
+#SET GLOBAL sql_mode="TRADITIONAL";
+#
+#STOP SLAVE;
+#--source include/wait_for_slave_to_stop.inc
+#START SLAVE;
+#--source include/wait_for_slave_to_start.inc
+#
+#let $y=0;
+#while ($y < 6)
+#{
+# connection master;
+#
+# SET SQL_LOG_BIN= 0;
+# eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# SET SQL_LOG_BIN= 1;
+#
+# connection slave;
+#
+# eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+# `c` INT NOT NULL,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+# `c` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+# `c` INT DEFAULT 500,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+#
+# if ($y==0)
+# {
+# --echo ************* EXECUTION WITH INSERTS *************
+# connection master;
+# INSERT INTO t1(a) VALUES (1);
+# }
+#
+# if ($y==1)
+# {
+# --echo ************* EXECUTION WITH INSERTS *************
+# connection master;
+# INSERT INTO t1(a, b) VALUES (1, NULL);
+# }
+#
+# if ($y==2)
+# {
+# --echo ************* EXECUTION WITH UPDATES *************
+# connection master;
+# INSERT INTO t3(a, b) VALUES (1, 1);
+# INSERT INTO t3(a, b) VALUES (2, 1);
+# UPDATE t3 SET b = NULL where a= 1;
+# }
+#
+# if ($y==3)
+# {
+# --echo ************* EXECUTION WITH INSERTS/REPLACES *************
+# connection master;
+# REPLACE INTO t3(a, b) VALUES (1, null);
+# }
+#
+# if ($y==4)
+# {
+# --echo ************* EXECUTION WITH UPDATES/REPLACES *************
+# connection master;
+# INSERT INTO t3(a, b) VALUES (1, 1);
+# REPLACE INTO t3(a, b) VALUES (1, null);
+# }
+#
+# if ($y==5)
+# {
+# --echo ************* EXECUTION WITH MULTI-ROW INSERTS *************
+# connection master;
+#
+# SET SQL_LOG_BIN= 0;
+# INSERT INTO t2(a, b) VALUES (1, 1);
+# INSERT INTO t2(a, b) VALUES (2, 1);
+# INSERT INTO t2(a, b) VALUES (3, null);
+# INSERT INTO t2(a, b) VALUES (4, 1);
+# INSERT INTO t2(a, b) VALUES (5, 1);
+# SET SQL_LOG_BIN= 1;
+#
+# INSERT INTO t2 SELECT a + 10, b from t2;
+# --echo The statement below is just executed to stop processing
+# INSERT INTO t1(a) VALUES (1);
+# }
+#
+# --echo ************* SHOWING THE RESULT SETS *************
+# connection slave;
+# --source include/wait_for_slave_sql_to_stop.inc
+# connection master;
+# SELECT * FROM t1 ORDER BY a;
+# connection slave;
+# SELECT * FROM t1 ORDER BY a;
+# connection master;
+# SELECT * FROM t2 ORDER BY a;
+# connection slave;
+# SELECT * FROM t2 ORDER BY a;
+# connection master;
+# SELECT * FROM t3 ORDER BY a;
+# connection slave;
+# SELECT * FROM t3 ORDER BY a;
+# --source include/rpl_reset.inc
+#
+# connection master;
+#
+# DROP TABLE t1;
+# DROP TABLE t2;
+# DROP TABLE t3;
+#
+# sync_slave_with_master;
+#
+# inc $y;
+#}
+#connection slave;
+#SET GLOBAL sql_mode="";
+#
+#STOP SLAVE;
+#source include/wait_for_slave_to_stop.inc;
+#START SLAVE;
+#--source include/wait_for_slave_to_start.inc
+
+--echo ################################################################################
+--echo # NULL ---> NOT NULL (NON-STRICT MODE)
+--echo ################################################################################
+connection master;
+
+SET SQL_LOG_BIN= 0;
+eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+
+connection slave;
+
+eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT NOT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+--echo ************* EXECUTION WITH INSERTS *************
+connection master;
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(a, b) VALUES (2, NULL);
+INSERT INTO t1(a, b) VALUES (3, 1);
+
+INSERT INTO t2(a) VALUES (1);
+INSERT INTO t2(a, b) VALUES (2, NULL);
+INSERT INTO t2(a, b) VALUES (3, 1);
+
+INSERT INTO t3(a) VALUES (1);
+INSERT INTO t3(a, b) VALUES (2, NULL);
+INSERT INTO t3(a, b) VALUES (3, 1);
+INSERT INTO t3(a, b) VALUES (4, 1);
+REPLACE INTO t3(a, b) VALUES (5, null);
+
+REPLACE INTO t3(a, b) VALUES (3, null);
+UPDATE t3 SET b = NULL where a = 4;
+
+--echo ************* SHOWING THE RESULT SETS *************
+connection master;
+sync_slave_with_master;
+
+connection master;
+SELECT * FROM t1 ORDER BY a;
+connection slave;
+SELECT * FROM t1 ORDER BY a;
+connection master;
+SELECT * FROM t2 ORDER BY a;
+connection slave;
+SELECT * FROM t2 ORDER BY a;
+connection master;
+SELECT * FROM t3 ORDER BY a;
+connection slave;
+SELECT * FROM t3 ORDER BY a;
+
+connection master;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_packet.inc b/mysql-test/suite/rpl/include/rpl_packet.inc
new file mode 100644
index 00000000000..cbde486bcbb
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_packet.inc
@@ -0,0 +1,184 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# ==== Purpose ====
+#
+# Check replication protocol packet size handling
+#
+# ==== Related bugs ====
+# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
+# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
+# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
+
+# max-out size db name
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
+call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
+let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+disable_warnings;
+eval drop database if exists $db;
+enable_warnings;
+eval create database $db;
+
+connection master;
+let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
+let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
+let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
+SET @@global.max_allowed_packet=1024;
+SET @@global.net_buffer_length=1024;
+
+sync_slave_with_master;
+# Restart slave for setting to take effect
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+
+# alas, can't use eval here; if db name changed apply the change here
+connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
+
+connection master;
+select @@net_buffer_length, @@max_allowed_packet;
+
+create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+sync_slave_with_master;
+
+eval select count(*) from `$db`.`t1` /* must be 1 */;
+
+SHOW STATUS LIKE 'Slave_running';
+select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
+connection master;
+eval drop database $db;
+sync_slave_with_master;
+
+#
+# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+#
+# Check that a situation when the size of event on the master is greater than
+# max_allowed_packet on the slave does not lead to infinite re-transmits.
+
+connection master;
+
+# Change the max packet size on master
+
+SET @@global.max_allowed_packet=4096;
+SET @@global.net_buffer_length=4096;
+
+# Restart slave for new setting to take effect
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+connect (master, localhost, root);
+connection master;
+
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+
+
+#
+# Bug#42914: The slave I/O thread must stop after trying to read the above
+# event, However there is no Last_IO_Error report.
+#
+
+# The slave I/O thread must stop after trying to read the above event
+connection slave;
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# TODO: this is needed because of BUG#55790. Remove once that is fixed.
+--source include/stop_slave_sql.inc
+
+#
+# Bug#42914: On the master, if a binary log event is larger than
+# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
+# is sent to a slave when it requests a dump from the master, thus leading the
+# I/O thread to stop. However, there is no Last_IO_Error reported.
+#
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
+connection master;
+CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+sync_slave_with_master;
+
+connection master;
+INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+
+connection slave;
+# The slave I/O thread must stop after receiving
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# Remove the bad binlog and clear error status on slave.
+STOP SLAVE;
+RESET SLAVE;
+--connection master
+RESET MASTER;
+
+
+#
+# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
+#
+# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
+# BINLOG EVENTS was issued. To verify that this bug is fixed, we
+# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
+# never changes. We turn off the result log because we don't care
+# about the contents of the binlog.
+
+--disable_result_log
+SET @max_allowed_packet_0= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_1= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_2= @@session.max_allowed_packet;
+--enable_result_log
+if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
+{
+ --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
+ --source include/show_rpl_debug_info.inc
+ SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
+ --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
+}
+
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
+eval SET @@global.net_buffer_length= $old_net_buffer_length;
+eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
+
+# Clear Last_IO_Error
+RESET SLAVE;
+
+--source include/rpl_end.inc
+# End of tests
diff --git a/mysql-test/suite/rpl/include/rpl_parallel.inc b/mysql-test/suite/rpl/include/rpl_parallel.inc
new file mode 100644
index 00000000000..b88d2126d4d
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_parallel.inc
@@ -0,0 +1,2217 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+# Test various aspects of parallel replication.
+
+--connection server_2
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--error ER_SLAVE_MUST_STOP
+SET GLOBAL slave_parallel_threads=10;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+
+# Check that we do not spawn any worker threads when no slave is running.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+# Check that worker threads get spawned when slave starts.
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+# ... and that worker threads get removed when slave stops.
+--source include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+--source include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+--echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+# Block the table t1 to simulate a replicated query taking a long time.
+--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+LOCK TABLE t1 WRITE;
+
+--connection server_1
+SET gtid_domain_id=1;
+# This query will be blocked on the slave until UNLOCK TABLES.
+INSERT INTO t1 VALUES (2);
+SET gtid_domain_id=0;
+# These t2 queries can be replicated in parallel with the prior t1 query, as
+# they are in a separate replication domain.
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+BEGIN;
+INSERT INTO t2 VALUES (4);
+INSERT INTO t2 VALUES (5);
+COMMIT;
+INSERT INTO t2 VALUES (6);
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 6 FROM t2
+--source include/wait_condition.inc
+
+SELECT * FROM t2 ORDER by a;
+
+--connection con_temp1
+SELECT * FROM t1;
+UNLOCK TABLES;
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
+--source include/wait_condition.inc
+
+SELECT * FROM t1 ORDER BY a;
+
+
+--echo *** Test two transactions in different domains committed in opposite order on slave but in a single group commit. ***
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+# Use a stored function to inject a debug_sync into the appropriate THD.
+# The function does nothing on the master, and on the slave it injects the
+# desired debug_sync action(s).
+SET sql_log_bin=0;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format='statement';
+SET gtid_domain_id=1;
+INSERT INTO t2 VALUES (foo(10,
+ 'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1',
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'));
+
+--connection server_2
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+SET sql_log_bin=0;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+SET @old_format=@@GLOBAL.binlog_format;
+SET GLOBAL binlog_format=statement;
+# We need to restart all parallel threads for the new global setting to
+# be copied to the session-level values.
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+# First make sure the first insert is ready to commit, but not queued yet.
+SET debug_sync='now WAIT_FOR ready1';
+
+--connection server_1
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (foo(11,
+ 'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3',
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4'));
+SET gtid_domain_id=0;
+SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
+
+--connection server_2
+# Now wait for the second insert to queue itself as the leader, and then
+# wait for more commits to queue up.
+SET debug_sync='now WAIT_FOR ready3';
+SET debug_sync='now SIGNAL cont3';
+SET debug_sync='now WAIT_FOR ready4';
+# Now allow the first insert to queue up to participate in group commit.
+SET debug_sync='now SIGNAL cont1';
+SET debug_sync='now WAIT_FOR ready2';
+# Finally allow the second insert to proceed and do the group commit.
+SET debug_sync='now SIGNAL cont4';
+
+--let $wait_condition= SELECT COUNT(*) = 2 FROM t2 WHERE a >= 10
+--source include/wait_condition.inc
+SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
+# The two INSERT transactions should have been committed in opposite order,
+# but in the same group commit (seen by precense of cid=# in the SHOW
+# BINLOG output).
+--let $binlog_file= slave-bin.000002
+--source include/show_binlog_events.inc
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+
+# Restart all the slave parallel worker threads, to clear all debug_sync actions.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET debug_sync='RESET';
+--source include/start_slave.inc
+
+
+--echo *** Test that group-committed transactions on the master can replicate in parallel on the slave. ***
+--connection server_1
+SET debug_sync='RESET';
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+# Create some sentinel rows so that the rows inserted in parallel fall into
+# separate gaps and do not cause gap lock conflicts.
+INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
+--save_master_pos
+--connection server_2
+--sync_with_master
+
+# We want to test that the transactions can execute out-of-order on
+# the slave, but still end up committing in-order, and in a single
+# group commit.
+#
+# The idea is to group-commit three transactions together on the master:
+# A, B, and C. On the slave, C will execute the insert first, then A,
+# and then B. But B manages to complete before A has time to commit, so
+# all three end up committing together.
+#
+# So we start by setting up some row locks that will block transactions
+# A and B from executing, allowing C to run first.
+
+--connection con_temp1
+BEGIN;
+INSERT INTO t3 VALUES (2,102);
+--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+BEGIN;
+INSERT INTO t3 VALUES (4,104);
+
+# On the master, queue three INSERT transactions as a single group commit.
+--connect (con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (2, foo(12,
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connect (con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (4, foo(14,
+ 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connect (con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (6, foo(16,
+ 'group_commit_waiting_for_prior SIGNAL slave_queued3',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+SET debug_sync='RESET';
+
+--connection server_1
+SELECT * FROM t3 ORDER BY a;
+--let $binlog_file= master-bin.000002
+--source include/show_binlog_events.inc
+
+# First, wait until insert 3 is ready to queue up for group commit, but is
+# waiting for insert 2 to commit before it can do so itself.
+--connection server_2
+SET debug_sync='now WAIT_FOR slave_queued3';
+
+# Next, let insert 1 proceed, and allow it to queue up as the group commit
+# leader, but let it wait for insert 2 to also queue up before proceeding.
+--connection con_temp1
+ROLLBACK;
+--connection server_2
+SET debug_sync='now WAIT_FOR slave_queued1';
+
+# Now let insert 2 proceed and queue up.
+--connection con_temp2
+ROLLBACK;
+--connection server_2
+SET debug_sync='now WAIT_FOR slave_queued2';
+# And finally, we can let insert 1 proceed and do the group commit with all
+# three insert transactions together.
+SET debug_sync='now SIGNAL slave_cont1';
+
+# Wait for the commit to complete and check that all three transactions
+# group-committed together (will be seen in the binlog as all three having
+# cid=# on their GTID event).
+--let $wait_condition= SELECT COUNT(*) = 3 FROM t3 WHERE a IN (2,4,6)
+--source include/wait_condition.inc
+SELECT * FROM t3 ORDER BY a;
+--let $binlog_file= slave-bin.000003
+--source include/show_binlog_events.inc
+
+
+--echo *** Test STOP SLAVE in parallel mode ***
+--connection server_2
+--source include/stop_slave.inc
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+--connection server_1
+# Set up a couple of transactions. The first will be blocked halfway
+# through on a lock, and while it is blocked we initiate STOP SLAVE.
+# We then test that the halfway-initiated transaction is allowed to
+# complete, but no subsequent ones.
+# We have to use statement-based mode and set
+# binlog_direct_non_transactional_updates=0; otherwise the binlog will
+# be split into two event groups, one for the MyISAM part and one for the
+# InnoDB part.
+SET binlog_direct_non_transactional_updates=0;
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
+SET sql_log_bin=1;
+BEGIN;
+INSERT INTO t2 VALUES (20);
+--disable_warnings
+INSERT INTO t1 VALUES (20);
+--enable_warnings
+INSERT INTO t2 VALUES (21);
+INSERT INTO t3 VALUES (20, 20);
+COMMIT;
+INSERT INTO t3 VALUES(21, 21);
+INSERT INTO t3 VALUES(22, 22);
+SET binlog_format=@old_format;
+--save_master_pos
+
+# Start a connection that will block the replicated transaction halfway.
+--connection con_temp1
+BEGIN;
+INSERT INTO t2 VALUES (21);
+
+--connection server_2
+START SLAVE;
+# Wait for the MyISAM change to be visible, after which replication will wait
+# for con_temp1 to roll back.
+--let $wait_condition= SELECT COUNT(*) = 1 FROM t1 WHERE a=20
+--source include/wait_condition.inc
+
+--connection con_temp2
+# Initiate slave stop. It will have to wait for the current event group
+# to complete.
+# The dbug injection causes debug_sync to signal 'wait_for_done_waiting'
+# when the SQL driver thread is ready.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
+send STOP SLAVE;
+
+--connection con_temp1
+SET debug_sync='now WAIT_FOR wait_for_done_waiting';
+ROLLBACK;
+
+--connection con_temp2
+reap;
+SET GLOBAL debug_dbug=@old_dbug;
+SET debug_sync='RESET';
+
+--connection server_2
+--source include/wait_for_slave_to_stop.inc
+# We should see the first transaction applied, but not the two others.
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
+
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
+SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
+
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** Test killing slave threads at various wait points ***
+--echo *** 1. Test killing transaction waiting in commit for previous transaction to commit ***
+
+# Set up three transactions on the master that will be group-committed
+# together so they can be replicated in parallel on the slave.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (31, foo(31,
+ 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+ 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+# This insert is just so we can get T2 to wait while a query is running that we
+# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
+INSERT INTO t3 VALUES (32, foo(32,
+ 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+ ''));
+# This insert sets up debug_sync points so that T2 will tell when it is at its
+# wait point where we want to kill it - and when it has been killed.
+INSERT INTO t3 VALUES (33, foo(33,
+ 'group_commit_waiting_for_prior SIGNAL t2_waiting',
+ 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+send COMMIT;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp5
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (34, foo(34,
+ '',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Query execution was interrupted");
+CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
+CALL mtr.add_suppression("Slave: Connection was killed");
+SET sql_log_bin=1;
+# Wait until T2 is inside executing its insert of 32, then find it in SHOW
+# PROCESSLIST to know its thread id for KILL later.
+SET debug_sync='now WAIT_FOR t2_query';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(32%' AND INFO NOT LIKE '%LIKE%'`
+SET debug_sync='now SIGNAL t2_cont';
+
+# Wait until T2 has entered its wait for T1 to commit, and T1 has
+# progressed into its commit phase.
+SET debug_sync='now WAIT_FOR t1_ready';
+
+# Now kill the transaction T2.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+# Wait until T2 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t2_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+INSERT INTO t3 VALUES (39,0);
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** 2. Same as (1), but without restarting IO thread after kill of SQL threads ***
+
+# Set up three transactions on the master that will be group-committed
+# together so they can be replicated in parallel on the slave.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (41, foo(41,
+ 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+ 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+# This insert is just so we can get T2 to wait while a query is running that we
+# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
+INSERT INTO t3 VALUES (42, foo(42,
+ 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+ ''));
+# This insert sets up debug_sync points so that T2 will tell when it is at its
+# wait point where we want to kill it - and when it has been killed.
+INSERT INTO t3 VALUES (43, foo(43,
+ 'group_commit_waiting_for_prior SIGNAL t2_waiting',
+ 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+send COMMIT;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp5
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (44, foo(44,
+ '',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+# Wait until T2 is inside executing its insert of 42, then find it in SHOW
+# PROCESSLIST to know its thread id for KILL later.
+SET debug_sync='now WAIT_FOR t2_query';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(42%' AND INFO NOT LIKE '%LIKE%'`
+SET debug_sync='now SIGNAL t2_cont';
+
+# Wait until T2 has entered its wait for T1 to commit, and T1 has
+# progressed into its commit phase.
+SET debug_sync='now WAIT_FOR t1_ready';
+
+# Now kill the transaction T2.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+# Wait until T2 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t2_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+INSERT INTO t3 VALUES (49,0);
+--save_master_pos
+
+--connection server_2
+START SLAVE SQL_THREAD;
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** 3. Same as (2), but not using gtid mode ***
+
+--connection server_2
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=no;
+--source include/start_slave.inc
+
+--connection server_1
+# Set up three transactions on the master that will be group-committed
+# together so they can be replicated in parallel on the slave.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (51, foo(51,
+ 'commit_before_prepare_ordered WAIT_FOR t2_waiting',
+ 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+SET binlog_format=statement;
+BEGIN;
+# This insert is just so we can get T2 to wait while a query is running that we
+# can see in SHOW PROCESSLIST so we can get its thread_id to kill later.
+INSERT INTO t3 VALUES (52, foo(52,
+ 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont',
+ ''));
+# This insert sets up debug_sync points so that T2 will tell when it is at its
+# wait point where we want to kill it - and when it has been killed.
+INSERT INTO t3 VALUES (53, foo(53,
+ 'group_commit_waiting_for_prior SIGNAL t2_waiting',
+ 'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
+send COMMIT;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp5
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+SET binlog_format=statement;
+send INSERT INTO t3 VALUES (54, foo(54,
+ '',
+ ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+# Wait until T2 is inside executing its insert of 52, then find it in SHOW
+# PROCESSLIST to know its thread id for KILL later.
+SET debug_sync='now WAIT_FOR t2_query';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(52%' AND INFO NOT LIKE '%LIKE%'`
+SET debug_sync='now SIGNAL t2_cont';
+
+# Wait until T2 has entered its wait for T1 to commit, and T1 has
+# progressed into its commit phase.
+SET debug_sync='now WAIT_FOR t1_ready';
+
+# Now kill the transaction T2.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+# Wait until T2 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t2_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+INSERT INTO t3 VALUES (59,0);
+--save_master_pos
+
+--connection server_2
+START SLAVE SQL_THREAD;
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=4;
+--source include/start_slave.inc
+
+
+--echo *** 4. Test killing thread that is waiting to start transaction until previous transaction commits ***
+
+# We set up four transactions T1, T2, T3, and T4 on the master. T2, T3, and T4
+# can run in parallel with each other (same group commit and commit id),
+# but not in parallel with T1.
+#
+# We use four worker threads, each Ti will be queued on each their own
+# worker thread. We will delay T1 commit, T3 will wait for T1 to begin
+# commit before it can start. We will kill T3 during this wait, and
+# check that everything works correctly.
+#
+# It is rather tricky to get the correct thread id of the worker to kill.
+# We start by injecting four dummy transactions in a debug_sync-controlled
+# manner to be able to get known thread ids for the workers in a pool with
+# just 4 worker threads. Then we let in each of the real test transactions
+# T1-T4 one at a time in a way which allows us to know which transaction
+# ends up with which thread id.
+
+--connection server_1
+SET binlog_format=statement;
+SET gtid_domain_id=2;
+BEGIN;
+# This debug_sync will linger on and be used to control T4 later.
+INSERT INTO t3 VALUES (70, foo(70,
+ 'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', ''));
+INSERT INTO t3 VALUES (60, foo(60,
+ 'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d2_query';
+--let $d2_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(60%' AND INFO NOT LIKE '%LIKE%'`
+
+--connection server_1
+SET gtid_domain_id=1;
+BEGIN;
+# These debug_sync's will linger on and be used to control T3 later.
+INSERT INTO t3 VALUES (61, foo(61,
+ 'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting',
+ 'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed'));
+INSERT INTO t3 VALUES (62, foo(62,
+ 'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d1_query';
+--let $d1_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(62%' AND INFO NOT LIKE '%LIKE%'`
+
+--connection server_1
+SET gtid_domain_id=0;
+INSERT INTO t3 VALUES (63, foo(63,
+ 'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont'));
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d0_query';
+--let $d0_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(63%' AND INFO NOT LIKE '%LIKE%'`
+
+--connection server_1
+SET gtid_domain_id=3;
+BEGIN;
+# These debug_sync's will linger on and be used to control T2 later.
+INSERT INTO t3 VALUES (68, foo(68,
+ 'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', ''));
+INSERT INTO t3 VALUES (69, foo(69,
+ 'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2',
+ 'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont'));
+COMMIT;
+SET gtid_domain_id=0;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR d3_query';
+--let $d3_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(69%' AND INFO NOT LIKE '%LIKE%'`
+
+SET debug_sync='now SIGNAL d2_cont2';
+SET debug_sync='now WAIT_FOR d2_done';
+SET debug_sync='now SIGNAL d1_cont2';
+SET debug_sync='now WAIT_FOR d1_done';
+SET debug_sync='now SIGNAL d0_cont2';
+SET debug_sync='now WAIT_FOR d0_done';
+SET debug_sync='now SIGNAL d3_cont2';
+SET debug_sync='now WAIT_FOR d3_done';
+
+# Now prepare the real transactions T1, T2, T3, T4 on the master.
+
+--connection con_temp3
+# Create transaction T1.
+SET binlog_format=statement;
+INSERT INTO t3 VALUES (64, foo(64,
+ 'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', ''));
+
+# Create transaction T2, as a group commit leader on the master.
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2';
+send INSERT INTO t3 VALUES (65, foo(65, '', ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+
+--connection con_temp4
+# Create transaction T3, participating in T2's group commit.
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
+send INSERT INTO t3 VALUES (66, foo(66, '', ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued3';
+
+--connection con_temp5
+# Create transaction T4, participating in group commit with T2 and T3.
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4';
+send INSERT INTO t3 VALUES (67, foo(67, '', ''));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued4';
+SET debug_sync='now SIGNAL master_cont2';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+--connection con_temp5
+REAP;
+
+--connection server_1
+SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
+SET debug_sync='RESET';
+
+--connection server_2
+# Now we have the four transactions pending for replication on the slave.
+# Let them be queued for our three worker threads in a controlled fashion.
+# We put them at a stage where T1 is delayed and T3 is waiting for T1 to
+# commit before T3 can start. Then we kill T3.
+
+# Make the worker D0 free, and wait for T1 to be queued in it.
+SET debug_sync='now SIGNAL d0_cont';
+SET debug_sync='now WAIT_FOR t1_waiting';
+
+# Make the worker D3 free, and wait for T2 to be queued in it.
+SET debug_sync='now SIGNAL d3_cont';
+SET debug_sync='now WAIT_FOR t2_waiting';
+
+# Now release worker D1, and wait for T3 to be queued in it.
+# T3 will wait for T1 to commit before it can start.
+SET debug_sync='now SIGNAL d1_cont';
+SET debug_sync='now WAIT_FOR t3_waiting';
+
+# Release worker D2. Wait for T4 to be queued, so we are sure it has
+# received the debug_sync signal (else we might overwrite it with the
+# next debug_sync).
+SET debug_sync='now SIGNAL d2_cont';
+SET debug_sync='now WAIT_FOR t4_waiting';
+
+# Now we kill the waiting transaction T3 in worker D1.
+--replace_result $d1_thd_id THD_ID
+eval KILL $d1_thd_id;
+
+# Wait until T3 has reacted on the kill.
+SET debug_sync='now WAIT_FOR t3_killed';
+
+# Now we can allow T1 to proceed.
+SET debug_sync='now SIGNAL t1_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+# Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time
+# to commit or not before the stop. However, T1 should commit, and T3/T4 may
+# not have committed. (After slave restart we check that all become committed
+# eventually).
+SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a;
+
+# Now we have to disable the debug_sync statements, so they do not trigger
+# when the events are retried.
+SET debug_sync='RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_1
+UPDATE t3 SET b=b+1 WHERE a=60;
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
+# Restore the foo() function.
+SET sql_log_bin=0;
+DROP FUNCTION foo;
+--delimiter ||
+CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
+ RETURNS INT DETERMINISTIC
+ BEGIN
+ IF d1 != '' THEN
+ SET debug_sync = d1;
+ END IF;
+ IF d2 != '' THEN
+ SET debug_sync = d2;
+ END IF;
+ RETURN x;
+ END
+||
+--delimiter ;
+SET sql_log_bin=1;
+
+--connection server_2
+# Respawn all worker threads to clear any left-over debug_sync or other stuff.
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** 5. Test killing thread that is waiting for queue of max length to shorten ***
+
+# Find the thread id of the driver SQL thread that we want to kill.
+--let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'
+--source include/wait_condition.inc
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'`
+SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued;
+SET GLOBAL slave_parallel_max_queued=9000;
+
+--connection server_1
+--let bigstring= `SELECT REPEAT('x', 10000)`
+SET binlog_format=statement;
+# Create an event that will wait to be signalled.
+INSERT INTO t3 VALUES (80, foo(0,
+ 'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', ''));
+
+--connection server_2
+SET debug_sync='now WAIT_FOR query_waiting';
+# Inject that the SQL driver thread will signal `wait_queue_ready' to debug_sync
+# as it goes to wait for the event queue to become smaller than the value of
+# @@slave_parallel_max_queued.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max";
+
+--connection server_1
+--disable_query_log
+# Create an event that will fill up the queue.
+# The Xid event at the end of the event group will have to wait for the Query
+# event with the INSERT to drain so the queue becomes shorter. However that in
+# turn waits for the prior event group to continue.
+eval INSERT INTO t3 VALUES (81, LENGTH('$bigstring'));
+--enable_query_log
+SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
+
+--connection server_2
+SET debug_sync='now WAIT_FOR wait_queue_ready';
+
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+SET debug_sync='now WAIT_FOR wait_queue_killed';
+SET debug_sync='now SIGNAL query_cont';
+
+--let $slave_sql_errno= 1317,1927,1964
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_max_queued= @old_max_queued;
+
+--connection server_1
+INSERT INTO t3 VALUES (82,0);
+SET binlog_format=@old_format;
+--save_master_pos
+
+--connection server_2
+SET debug_sync='RESET';
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
+
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL binlog_format=@old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--echo *** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication ***
+
+--connection server_2
+# Use just two worker threads, so we are sure to get the rpl_group_info added
+# to the free list, which is what triggered the bug.
+--source include/stop_slave.inc
+SET GLOBAL replicate_ignore_table="test.t3";
+SET GLOBAL slave_parallel_threads=2;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t3 VALUES (100, rand());
+INSERT INTO t3 VALUES (101, rand());
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--connection server_1
+INSERT INTO t3 VALUES (102, rand());
+INSERT INTO t3 VALUES (103, rand());
+INSERT INTO t3 VALUES (104, rand());
+INSERT INTO t3 VALUES (105, rand());
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+SET GLOBAL replicate_ignore_table="";
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t3 VALUES (106, rand());
+INSERT INTO t3 VALUES (107, rand());
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--replace_column 2 #
+SELECT * FROM t3 WHERE a >= 100 ORDER BY a;
+
+
+--echo *** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t3 VALUES (110, 1);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+# Inject a duplicate key error.
+SET sql_log_bin=0;
+INSERT INTO t3 VALUES (111, 666);
+SET sql_log_bin=1;
+
+--connection server_1
+
+# Create a group commit with two inserts, the first one conflicts with a row on the slave
+--connect (con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send INSERT INTO t3 VALUES (111, 2);
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connect (con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send INSERT INTO t3 VALUES (112, 3);
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET debug_sync='RESET';
+--save_master_pos
+
+--connection server_2
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+--source include/wait_for_slave_sql_to_stop.inc
+# We should not see the row (112,3) here, it should be rolled back due to
+# error signal from the prior transaction.
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+SET sql_log_bin=0;
+DELETE FROM t3 WHERE a=111 AND b=666;
+SET sql_log_bin=1;
+START SLAVE SQL_THREAD;
+--sync_with_master
+SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
+
+
+--echo ***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts ***
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+
+# Create a group commit with UPDATE and DELETE, in that order.
+# The bug was that while the UPDATE's row lock does not block the DELETE, the
+# DELETE's gap lock _does_ block the UPDATE. This could cause a deadlock
+# on the slave.
+--connection con1
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send UPDATE t4 SET b=NULL WHERE a=6;
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 3;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET debug_sync='RESET';
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+--source include/stop_slave.inc
+
+SELECT * FROM t4 ORDER BY a;
+
+
+# Another example, this one with INSERT vs. DELETE
+--connection server_1
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+
+# Create a group commit with INSERT and DELETE, in that order.
+# The bug was that while the INSERT's insert intention lock does not block
+# the DELETE, the DELETE's gap lock _does_ block the INSERT. This could cause
+# a deadlock on the slave.
+--connection con1
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send INSERT INTO t4 VALUES (7, NULL);
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 3;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET debug_sync='RESET';
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+--source include/stop_slave.inc
+
+SELECT * FROM t4 ORDER BY a;
+
+
+# MDEV-6549, failing to update gtid_slave_pos for a transaction that was retried.
+# The problem was that when a transaction updates the mysql.gtid_slave_pos
+# table, it clears the flag that marks that there is a GTID position that
+# needs to be updated. Then, if the transaction got killed after that due
+# to a deadlock, the subsequent retry would fail to notice that the GTID needs
+# to be recorded in gtid_slave_pos.
+#
+# (In the original bug report, the symptom was an assertion; this was however
+# just a side effect of the missing update of gtid_slave_pos, which also
+# happened to cause a missing clear of OPTION_GTID_BEGIN).
+--connection server_1
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+
+# Create two transactions that can run in parallel on the slave but cause
+# a deadlock if the second runs before the first.
+--connection con1
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send UPDATE t4 SET b=NULL WHERE a=6;
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+# Must use statement-based binlogging. Otherwise the transaction will not be
+# binlogged at all, as it modifies no rows.
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format='statement';
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 1;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+--connection con2
+REAP;
+SET @old_format=@@GLOBAL.binlog_format;
+SET debug_sync='RESET';
+--save_master_pos
+--let $last_gtid= `SELECT @@last_gtid`
+
+--connection server_2
+# Disable the usual skip of gap locks for transactions that are run in
+# parallel, using DBUG. This allows the deadlock to occur, and this in turn
+# triggers a retry of the second transaction, and the code that was buggy and
+# caused the gtid_slave_pos update to be skipped in the retry.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with";
+--source include/start_slave.inc
+--sync_with_master
+SET GLOBAL debug_dbug=@old_dbug;
+
+SELECT * FROM t4 ORDER BY a;
+# Check that the GTID of the second transaction was correctly recorded in
+# gtid_slave_pos, in the variable as well as in the table.
+--replace_result $last_gtid GTID
+eval SET @last_gtid= '$last_gtid';
+SELECT IF(@@gtid_slave_pos LIKE CONCAT('%',@last_gtid,'%'), "GTID found ok",
+ CONCAT("GTID ", @last_gtid, " not found in gtid_slave_pos=", @@gtid_slave_pos))
+ AS result;
+SELECT "ROW FOUND" AS `Is the row found?`
+ FROM mysql.gtid_slave_pos
+ WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid;
+
+
+--echo *** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication ***
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET DEBUG_SYNC= 'RESET';
+--source include/start_slave.inc
+
+--connection server_1
+CREATE TABLE t5 (a INT PRIMARY KEY, b INT);
+INSERT INTO t5 VALUES (1,1);
+INSERT INTO t5 VALUES (2,2), (3,8);
+INSERT INTO t5 VALUES (4,16);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1);
+let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check;
+eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check;
+--enable_query_log
+
+--connection server_1
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1);
+let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check;
+eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check;
+--enable_query_log
+
+
+--echo *** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error ***
+
+--connection server_1
+CREATE TABLE t6 (a INT) ENGINE=MyISAM;
+CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1;
+
+--connection con1
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+--let $conid = `SELECT CONNECTION_ID()`
+SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont';
+send INSERT INTO t6 VALUES (1), (2), (3);
+
+--connection server_1
+SET debug_sync='now WAIT_FOR ready';
+--replace_result $conid CONID
+eval KILL QUERY $conid;
+SET debug_sync='now SIGNAL cont';
+
+--connection con1
+--error ER_QUERY_INTERRUPTED
+--reap
+SET binlog_format= @old_format;
+SET debug_sync='RESET';
+--let $after_error_gtid_pos= `SELECT @@gtid_binlog_pos`
+
+--connection server_1
+SET debug_sync='RESET';
+
+
+--connection server_2
+--let $slave_sql_errno= 1317
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE IO_THREAD;
+--replace_result $after_error_gtid_pos AFTER_ERROR_GTID_POS
+eval SET GLOBAL gtid_slave_pos= '$after_error_gtid_pos';
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t6 VALUES (4);
+SELECT * FROM t6 ORDER BY a;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t6 ORDER BY a;
+
+
+--echo *** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 ***
+
+--connection server_1
+INSERT INTO t2 VALUES (31);
+--let $gtid1= `SELECT @@LAST_GTID`
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= 0;
+--source include/start_slave.inc
+
+# Force a duplicate key error on the slave.
+SET sql_log_bin= 0;
+INSERT INTO t2 VALUES (32);
+SET sql_log_bin= 1;
+
+--connection server_1
+INSERT INTO t2 VALUES (32);
+--let $gtid2= `SELECT @@LAST_GTID`
+# Rotate the binlog; the bug is triggered when the master binlog file changes
+# after the event group that causes the duplicate key error.
+FLUSH LOGS;
+INSERT INTO t2 VALUES (33);
+INSERT INTO t2 VALUES (34);
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+--connection server_2
+--source include/stop_slave_io.inc
+SET GLOBAL slave_parallel_threads=10;
+START SLAVE;
+
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+# Note: IO thread is still running at this point.
+# The bug seems to have been that restarting the SQL thread after an error with
+# the IO thread still running, somehow picks up a later relay log position and
+# thus ends up skipping the failing event, rather than re-executing.
+
+START SLAVE SQL_THREAD;
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+
+# Skip the duplicate error, so we can proceed.
+--error ER_SLAVE_SKIP_NOT_IN_GTID
+SET sql_slave_skip_counter= 1;
+--source include/stop_slave_io.inc
+--disable_query_log
+eval SET GLOBAL gtid_slave_pos = REPLACE(@@gtid_slave_pos, "$gtid1", "$gtid2");
+--enable_query_log
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t2 WHERE a >= 30 ORDER BY a;
+
+
+--echo *** MDEV-6775: Wrong binlog order in parallel replication ***
+--connection server_1
+# A bit tricky bug to reproduce. On the master, we binlog in statement-mode
+# two transactions, an UPDATE followed by a DELETE. On the slave, we replicate
+# with binlog-mode set to ROW, which means the DELETE, which modifies no rows,
+# is not binlogged. Then we inject a wait in the group commit code on the
+# slave, shortly before the actual commit of the UPDATE. The bug was that the
+# DELETE could wake up from wait_for_prior_commit() before the commit of the
+# UPDATE. So the test could see the slave position updated to after DELETE,
+# while the UPDATE was still not visible.
+DELETE FROM t4;
+INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_binlog_commit_before_get_LOCK_log";
+SET @old_format=@@GLOBAL.binlog_format;
+SET GLOBAL binlog_format=ROW;
+# Re-spawn the worker threads to be sure they pick up the new binlog format
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+--connection con1
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+send UPDATE t4 SET b=NULL WHERE a=6;
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con2
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send DELETE FROM t4 WHERE b <= 3;
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con1
+REAP;
+SET binlog_format= @old_format;
+--connection con2
+REAP;
+SET binlog_format= @old_format;
+SET debug_sync='RESET';
+--save_master_pos
+SELECT * FROM t4 ORDER BY a;
+
+--connection server_2
+--source include/start_slave.inc
+SET debug_sync= 'now WAIT_FOR waiting';
+--sync_with_master
+SELECT * FROM t4 ORDER BY a;
+SET debug_sync= 'now SIGNAL cont';
+
+# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL binlog_format= @old_format;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave ***
+--connection server_1
+INSERT INTO t2 VALUES (40);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=no;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+# This DBUG injection causes a DEBUG_SYNC signal "scheduled_gtid_0_x_100" when
+# GTID 0-1-100 has been scheduled for and fetched by a worker thread.
+SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100";
+# This DBUG injection causes a DEBUG_SYNC signal "wait_for_done_waiting" when
+# STOP SLAVE has signalled all worker threads to stop.
+SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
+# Reset worker threads to make DBUG setting catch on.
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+
+
+--connection server_1
+# Setup some transaction for the slave to replicate.
+INSERT INTO t2 VALUES (41);
+INSERT INTO t2 VALUES (42);
+# Need to log the DELETE in statement format, so we can see it in processlist.
+SET @old_format= @@binlog_format;
+SET binlog_format= statement;
+DELETE FROM t2 WHERE a=40;
+SET binlog_format= @old_format;
+INSERT INTO t2 VALUES (43);
+INSERT INTO t2 VALUES (44);
+# Force the slave to switch to a new relay log file.
+FLUSH LOGS;
+INSERT INTO t2 VALUES (45);
+# Inject a GTID 0-1-100, which will trigger a DEBUG_SYNC signal when this
+# transaction has been fetched by a worker thread.
+SET gtid_seq_no=100;
+INSERT INTO t2 VALUES (46);
+--save_master_pos
+
+--connection con_temp2
+# Temporarily block the DELETE on a=40 from completing.
+BEGIN;
+SELECT * FROM t2 WHERE a=40 FOR UPDATE;
+
+
+--connection server_2
+--source include/start_slave.inc
+
+# Wait for a worker thread to start on the DELETE that will be blocked
+# temporarily by the SELECT FOR UPDATE.
+--let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%'
+--source include/wait_condition.inc
+
+# The DBUG injection set above will make the worker thread signal the following
+# debug_sync when the GTID 0-1-100 has been reached by a worker thread.
+# Thus, at this point, the SQL driver thread has reached the next
+# relay log file name, while a worker thread is still processing a
+# transaction in the previous relay log file, blocked on the SELECT FOR
+# UPDATE.
+SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100';
+# At this point, the SQL driver thread is in the new relay log file, while
+# the DELETE from the old relay log file is not yet complete. We will stop
+# the slave at this point. The bug was that the DELETE statement would
+# update the slave position to the _new_ relay log file name instead of
+# its own old file name. Thus, by stoping and restarting the slave at this
+# point, we would get an error at restart due to incorrect position. (If
+# we would let the slave catch up before stopping, the incorrect position
+# would be corrected by a later transaction).
+
+send STOP SLAVE;
+
+--connection con_temp2
+# Wait for STOP SLAVE to have proceeded sufficiently that it has signalled
+# all worker threads to stop; this ensures that we will stop after the DELETE
+# transaction (and not after a later transaction that might have been able
+# to set a fixed position).
+SET debug_sync= 'now WAIT_FOR wait_for_done_waiting';
+# Now release the row lock that was blocking the replication of DELETE.
+ROLLBACK;
+
+--connection server_2
+reap;
+--source include/wait_for_slave_sql_to_stop.inc
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+# Now restart the slave. With the bug present, this would start at an
+# incorrect relay log position, causing relay log read error (or if unlucky,
+# silently skip a number of events).
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET DEBUG_SYNC= 'RESET';
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7326 Server deadlock in connection with parallel replication ***
+# We use three transactions, each in a separate group commit.
+# T1 does mark_start_commit(), then gets a deadlock error.
+# T2 wakes up and starts running
+# T1 does unmark_start_commit()
+# T3 goes to wait for T2 to start its commit
+# T2 does mark_start_commit()
+# The bug was that at this point, T3 got deadlocked. Because T1 has unmarked(),
+# T3 did not yet see the count_committing_event_groups reach its target value
+# yet. But when T1 later re-did mark_start_commit(), it failed to send a wakeup
+# to T3.
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=3;
+SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
+--source include/start_slave.inc
+
+--connection server_1
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format= STATEMENT;
+# This debug_sync will linger on and be used to control T3 later.
+INSERT INTO t1 VALUES (foo(50,
+ "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
+ "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+--save_master_pos
+--connection server_2
+# Wait for the debug_sync point for T3 to be set. But let the preparation
+# transaction remain hanging, so that T1 and T2 will be scheduled for the
+# remaining two worker threads.
+SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+
+--connection server_1
+INSERT INTO t2 VALUES (foo(50,
+ "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
+ "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+--save_master_pos
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+# T1 has now done mark_start_commit(). It will later do a rollback and retry.
+
+--connection server_1
+# Use a MyISAM table for T2 and T3, so they do not trigger the
+# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event.
+INSERT INTO t1 VALUES (foo(51,
+ "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
+ "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
+# T2 has now started running, but has not yet done mark_start_commit()
+SET DEBUG_SYNC= "now SIGNAL t1_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+# T1 has now done unmark_start_commit() in preparation for its retry.
+
+--connection server_1
+INSERT INTO t1 VALUES (52);
+SET BINLOG_FORMAT= @old_format;
+SELECT * FROM t2 WHERE a>=50 ORDER BY a;
+SELECT * FROM t1 WHERE a>=50 ORDER BY a;
+
+--connection server_2
+# Let the preparation transaction complete, so that the same worker thread
+# can continue with the transaction T3.
+SET DEBUG_SYNC= "now SIGNAL prep_cont";
+SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
+# T3 has now gone to wait for T2 to start committing
+SET DEBUG_SYNC= "now SIGNAL t2_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
+# T2 has now done mark_start_commit().
+# Let things run, and check that T3 does not get deadlocked.
+SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+--sync_with_master
+
+--connection server_1
+--save_master_pos
+--connection server_2
+--sync_with_master
+SELECT * FROM t2 WHERE a>=50 ORDER BY a;
+SELECT * FROM t1 WHERE a>=50 ORDER BY a;
+SET DEBUG_SYNC="reset";
+
+# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7326 Server deadlock in connection with parallel replication ***
+# Similar to the previous test, but with T2 and T3 in the same GCO.
+# We use three transactions, T1 in one group commit and T2/T3 in another.
+# T1 does mark_start_commit(), then gets a deadlock error.
+# T2 wakes up and starts running
+# T1 does unmark_start_commit()
+# T3 goes to wait for T1 to start its commit
+# T2 does mark_start_commit()
+# The bug was that at this point, T3 got deadlocked. T2 increments the
+# count_committing_event_groups but does not signal T3, as they are in
+# the same GCO. Then later when T1 increments, it would also not signal
+# T3, because now the count_committing_event_groups is not equal to the
+# wait_count of T3 (it is one larger).
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=3;
+SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
+--source include/start_slave.inc
+
+--connection server_1
+SET @old_format= @@SESSION.binlog_format;
+SET binlog_format= STATEMENT;
+# This debug_sync will linger on and be used to control T3 later.
+INSERT INTO t1 VALUES (foo(60,
+ "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
+ "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+--save_master_pos
+--connection server_2
+# Wait for the debug_sync point for T3 to be set. But let the preparation
+# transaction remain hanging, so that T1 and T2 will be scheduled for the
+# remaining two worker threads.
+SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+
+--connection server_1
+INSERT INTO t2 VALUES (foo(60,
+ "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
+ "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+--save_master_pos
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+# T1 has now done mark_start_commit(). It will later do a rollback and retry.
+
+# Do T2 and T3 in a single group commit.
+# Use a MyISAM table for T2 and T3, so they do not trigger the
+# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event.
+--connection con_temp3
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
+SET binlog_format=statement;
+send INSERT INTO t1 VALUES (foo(61,
+ "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
+ "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued1';
+
+--connection con_temp4
+SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
+send INSERT INTO t6 VALUES (62);
+
+--connection server_1
+SET debug_sync='now WAIT_FOR master_queued2';
+SET debug_sync='now SIGNAL master_cont1';
+
+--connection con_temp3
+REAP;
+--connection con_temp4
+REAP;
+
+--connection server_1
+SET debug_sync='RESET';
+SET BINLOG_FORMAT= @old_format;
+SELECT * FROM t2 WHERE a>=60 ORDER BY a;
+SELECT * FROM t1 WHERE a>=60 ORDER BY a;
+SELECT * FROM t6 WHERE a>=60 ORDER BY a;
+
+--connection server_2
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
+# T2 has now started running, but has not yet done mark_start_commit()
+SET DEBUG_SYNC= "now SIGNAL t1_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+# T1 has now done unmark_start_commit() in preparation for its retry.
+
+--connection server_2
+# Let the preparation transaction complete, so that the same worker thread
+# can continue with the transaction T3.
+SET DEBUG_SYNC= "now SIGNAL prep_cont";
+SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
+# T3 has now gone to wait for T2 to start committing
+SET DEBUG_SYNC= "now SIGNAL t2_cont1";
+SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
+# T2 has now done mark_start_commit().
+# Let things run, and check that T3 does not get deadlocked.
+SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+--sync_with_master
+
+--connection server_1
+--save_master_pos
+--connection server_2
+--sync_with_master
+SELECT * FROM t2 WHERE a>=60 ORDER BY a;
+SELECT * FROM t1 WHERE a>=60 ORDER BY a;
+SELECT * FROM t6 WHERE a>=60 ORDER BY a;
+SET DEBUG_SYNC="reset";
+
+# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
+
+--connection server_1
+INSERT INTO t2 VALUES (101);
+INSERT INTO t2 VALUES (102);
+INSERT INTO t2 VALUES (103);
+INSERT INTO t2 VALUES (104);
+INSERT INTO t2 VALUES (105);
+# Inject a partial event group (missing XID at the end). The bug was that such
+# partial group was not handled appropriately, leading to server deadlock.
+SET gtid_seq_no=1000;
+INSERT INTO t2 VALUES (106);
+INSERT INTO t2 VALUES (107);
+INSERT INTO t2 VALUES (108);
+INSERT INTO t2 VALUES (109);
+INSERT INTO t2 VALUES (110);
+INSERT INTO t2 VALUES (111);
+INSERT INTO t2 VALUES (112);
+INSERT INTO t2 VALUES (113);
+INSERT INTO t2 VALUES (114);
+INSERT INTO t2 VALUES (115);
+INSERT INTO t2 VALUES (116);
+INSERT INTO t2 VALUES (117);
+INSERT INTO t2 VALUES (118);
+INSERT INTO t2 VALUES (119);
+INSERT INTO t2 VALUES (120);
+INSERT INTO t2 VALUES (121);
+INSERT INTO t2 VALUES (122);
+INSERT INTO t2 VALUES (123);
+INSERT INTO t2 VALUES (124);
+INSERT INTO t2 VALUES (125);
+INSERT INTO t2 VALUES (126);
+INSERT INTO t2 VALUES (127);
+INSERT INTO t2 VALUES (128);
+INSERT INTO t2 VALUES (129);
+INSERT INTO t2 VALUES (130);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+# The partial event group (a=106) should be rolled back and thus missing.
+SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+--echo *** MDEV-6676 - test syntax of @@slave_parallel_mode ***
+--connection server_2
+
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='aggressive';
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+SET GLOBAL slave_parallel_mode='conservative';
+--let $status_items= Parallel_Mode
+--source include/show_slave_status.inc
+
+
+--echo *** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
+--connection server_1
+INSERT INTO t2 VALUES (1040);
+--source include/save_master_gtid.inc
+
+--connection server_2
+SET GLOBAL slave_parallel_mode='none';
+# Test that we do not use parallel apply, by injecting an unconditional
+# crash in the parallel apply code.
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+
+--echo *** MDEV-6676 - test disabling domain-based parallel replication ***
+--connection server_1
+# Let's do a bunch of transactions that will conflict if run out-of-order in
+# domain-based parallel replication mode.
+SET gtid_domain_id = 1;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+DELETE FROM t2 WHERE a >= 1041;
+SET gtid_domain_id = 2;
+INSERT INTO t2 VALUES (1041);
+INSERT INTO t2 VALUES (1042);
+INSERT INTO t2 VALUES (1043);
+INSERT INTO t2 VALUES (1044);
+INSERT INTO t2 VALUES (1045);
+INSERT INTO t2 VALUES (1046);
+SET gtid_domain_id = 0;
+--source include/save_master_gtid.inc
+--connection server_2
+SET GLOBAL slave_parallel_mode=minimal;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
+
+--echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode='conservative';
+SET GLOBAL slave_parallel_threads=10;
+
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+
+--connection server_1
+# Inject two group commits. The bug was that ANALYZE TABLE would call
+# wakeup_subsequent_commits() too early, allowing the following transaction
+# in the same group to run ahead and binlog and free the GCO. Then we get
+# wrong binlog order and later access freed GCO, which causes lost wakeup
+# of following GCO and thus replication hang.
+# We injected a small sleep in ANALYZE to make the race easier to hit (this
+# can only cause false negatives in versions with the bug, not false positives,
+# so sleep is ok here. And it's in general not possible to trigger reliably
+# the race with debug_sync, since the bugfix makes the race impossible).
+
+SET @old_dbug_slave= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+# Group commit with cid=10000, two event groups.
+SET @commit_id= 10000;
+ANALYZE TABLE t2;
+INSERT INTO t3 VALUES (120, 0);
+
+# Group commit with cid=10001, one event group.
+SET @commit_id= 10001;
+INSERT INTO t3 VALUES (121, 0);
+
+SET SESSION debug_dbug=@old_dbug_slave;
+
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+
+--connection server_1
+# Inject two group commits. The bug was that record_gtid for a
+# non-transactional event group would commit its own transaction, which would
+# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This
+# in turn lead to access to freed group_commit_orderer object, losing a wakeup
+# and causing slave threads to hang.
+# We inject a small sleep in the corresponding record_gtid() to make the race
+# easier to hit.
+
+SET @old_dbug_slave= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+# Group commit with cid=10010, two event groups.
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+SET @commit_id= 10010;
+ALTER TABLE t1 COMMENT "Hulubulu!";
+SET SESSION server_id= @old_server_id;
+INSERT INTO t3 VALUES (130, 0);
+
+# Group commit with cid=10011, one event group.
+SET @commit_id= 10011;
+INSERT INTO t3 VALUES (131, 0);
+
+SET SESSION debug_dbug=@old_dbug_slave;
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
+
+--connection server_1
+INSERT INTO t3 VALUES (201,0), (202,0);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_mdev8031';
+
+--connection server_1
+# We artificially create a situation that hopefully resembles the original
+# bug which was only seen "in the wild", and only once.
+# Setup a fake group commit with lots of conflicts that will lead to deadloc
+# kill. The slave DBUG injection causes the slave to be deadlock killed at
+# a particular point during the retry, and then later do a small sleep at
+# another critical point where the prior transaction then has a chance to
+# complete. Finally an extra KILL check catches an unhandled, lingering
+# deadlock kill. So rather artificial, but at least it exercises the
+# relevant code paths.
+SET @old_dbug_slave= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+SET @commit_id= 10200;
+INSERT INTO t3 VALUES (203, 1);
+INSERT INTO t3 VALUES (204, 1);
+INSERT INTO t3 VALUES (205, 1);
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=205;
+UPDATE t3 SET b=b+1 WHERE a=205;
+SET SESSION debug_dbug=@old_dbug_slave;
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** Check getting deadlock killed inside open_binlog() during retry. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
+SET @old_max= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size= 4096;
+
+--connection server_1
+SET @old_dbug_slave= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+--let $large= `SELECT REPEAT("*", 8192)`
+SET @commit_id= 10210;
+--echo Omit long queries that cause relaylog rotations and transaction retries...
+--disable_query_log
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
+--enable_query_log
+SET SESSION debug_dbug=@old_dbug_slave;
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+SET GLOBAL max_relay_log_size= @old_max;
+--source include/start_slave.inc
+
+--echo *** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
+--connection server_1
+# Inject an event group terminated by ROLLBACK, by mixing MyISAM and InnoDB
+# in a transaction. The bug was an assertion on the ROLLBACK due to
+# mark_start_commit() being already called.
+--disable_warnings
+BEGIN;
+INSERT INTO t2 VALUES (2000);
+INSERT INTO t1 VALUES (2000);
+INSERT INTO t2 VALUES (2001);
+ROLLBACK;
+--enable_warnings
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
+
+
+# Clean up.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+SET DEBUG_SYNC= 'RESET';
+
+--connection server_1
+DROP function foo;
+DROP TABLE t1,t2,t3,t4,t5,t6;
+SET DEBUG_SYNC= 'RESET';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc b/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
new file mode 100644
index 00000000000..cddc9286bd2
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
@@ -0,0 +1,38 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
+#
+# The function mysql_show_binlog_events has a local stack variable
+# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
+# this variable goes out of scope and is destroyed before clean
+# thd->current_linfo.
+#
+# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
+# that with the fix local variable linfo is valid along all
+# mysql_show_binlog_events function scope.
+#
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+--connection slave
+SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
+--send SHOW BINLOG EVENTS
+
+--connection slave1
+SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
+FLUSH LOGS;
+SET DEBUG_SYNC= 'now SIGNAL end';
+
+--connection slave
+--disable_result_log
+--reap
+--enable_result_log
+SET DEBUG_SYNC= 'RESET';
+
+--connection master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_partition.test b/mysql-test/suite/rpl/include/rpl_partition.test
new file mode 100644
index 00000000000..119e3bebc42
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_partition.test
@@ -0,0 +1,262 @@
+############################################################
+# Author: MATZ #
+# Date: 2006-03-22 #
+# Purpose: See if replication of partition tables work #
+############################################################
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_query_log
+
+--echo --- Start test 2 partition RANGE testing --
+
+# 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
+# Note that the storage engine should not be explicit: the default
+# storage engine is used on master and 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 --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave --
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+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 ---
+
+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 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 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 tables on master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show 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;
+
+# End of 5.1 test case
diff --git a/mysql-test/suite/rpl/include/rpl_record_compare.test b/mysql-test/suite/rpl/include/rpl_record_compare.test
new file mode 100644
index 00000000000..2bc088d17b4
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_record_compare.test
@@ -0,0 +1,64 @@
+
+#
+# BUG#52868: Wrong handling of NULL value during update, replication out of sync
+#
+-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
+
+-- source include/rpl_reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+-- disable_warnings
+UPDATE IGNORE t1 SET c5 = 'a';
+-- enable_warnings
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
+-- echo ## (1 column less and no varchar)
+-- source include/rpl_reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+-- disable_warnings
+UPDATE IGNORE t1 SET c5 = 'a';
+-- enable_warnings
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- echo ## case #2 - X bit is wrongly set.
+
+-- source include/rpl_reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
+INSERT INTO t1(c1) VALUES (10);
+INSERT INTO t1(c1) VALUES (NULL);
+UPDATE t1 SET c1= 0;
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
diff --git a/mysql-test/suite/rpl/include/rpl_relayrotate.inc b/mysql-test/suite/rpl/include/rpl_relayrotate.inc
new file mode 100644
index 00000000000..4de554d3143
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_relayrotate.inc
@@ -0,0 +1,18 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#######################################################
+# Wrapper for rpl_relayrotate.test to allow multi #
+# Engines to reuse test code. By JBM 2006-02-15 #
+#######################################################
+-- source include/have_innodb.inc
+# Slow test, don't run during staging part
+-- source include/not_staging.inc
+-- source include/master-slave.inc
+
+let $engine_type=innodb;
+-- source suite/rpl/include/rpl_relayrotate.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_relayrotate.test b/mysql-test/suite/rpl/include/rpl_relayrotate.test
new file mode 100644
index 00000000000..28670fe0985
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_relayrotate.test
@@ -0,0 +1,77 @@
+# When the relay log gets rotated while the I/O thread
+# is reading a transaction, the transaction spans on two or more
+# relay logs. If STOP SLAVE occurs while the SQL thread is
+# executing a part of the transaction in the non-first relay logs,
+# we test if START SLAVE will resume in the beginning of the
+# transaction (i.e., step back to the first relay log)
+
+# The slave is started with max_binlog_size=16384 bytes,
+# to force many rotations (approximately 30 rotations)
+
+# We have to sync with master, to ensure slave had time to start properly
+# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
+connection master;
+sync_slave_with_master;
+connection slave;
+stop slave;
+connection master;
+--disable_warnings
+eval create table t1 (a int) engine=$engine_type;
+--enable_warnings
+let $1=8000;
+disable_query_log;
+begin;
+while ($1)
+{
+# eval means expand $ expressions
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+# This will generate a 500kB master's binlog,
+# which corresponds to 30 slave's relay logs.
+enable_query_log;
+save_master_pos;
+connection slave;
+reset slave;
+start slave;
+# We wait 1 sec for the SQL thread to be somewhere in
+# the middle of the transaction, hopefully not in
+# the first relay log, and hopefully before the COMMIT.
+# Usually it stops when the SQL thread is around the 15th relay log.
+# We cannot use MASTER_POS_WAIT() as master's position
+# increases only when the slave executes the COMMIT.
+# Note that except when using Valgrind, 1 second is enough for the I/O slave
+# thread to fetch the whole master's binlog.
+sleep 1;
+stop slave;
+# We suppose the SQL thread stopped before COMMIT.
+# If so the transaction was rolled back
+# and the table is now empty.
+# Now restart
+start slave;
+# And see if the table contains '8000'
+# which proves that the transaction restarted at
+# the right place.
+# We must wait for the transaction to commit before
+# reading, with a sync_with_master.
+sync_with_master;
+select max(a) from t1;
+connection master;
+
+# The following DROP is a very important cleaning task:
+# imagine the next test is run with --skip-innodb: it will do
+# DROP TABLE IF EXISTS t1; but this will delete the frm and leave
+# some data in the InnoDB datafile (because at that time mysqld
+# does not know about InnoDB : --skip-innodb). So if later in the
+# test suite a test wants to create an InnoDB table called t1, it
+# will fail with
+# InnoDB: Error: table t1 already exists in InnoDB internal
+# InnoDB: data dictionary. Have you deleted the .frm file etc
+drop table t1;
+# wait until this drop is executed on slave
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/include/rpl_reset_slave.test b/mysql-test/suite/rpl/include/rpl_reset_slave.test
new file mode 100644
index 00000000000..e7a78f36efc
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_reset_slave.test
@@ -0,0 +1,113 @@
+# TBF - difference in row level logging
+# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
+
+# See SHOW SLAVE STATUS displays well after RESET SLAVE (it should display the
+# --master-* options from mysqld, as this is what is going to be used next time
+# slave threads will be started). In bug 985, it displayed old values (of before
+# RESET SLAVE).
+# See if slave crashes when doing a CREATE TEMPORARY TABLE twice, separated by
+# RESET SLAVE.
+
+-- source include/master-slave.inc
+sync_slave_with_master;
+--disable_query_log
+call mtr.add_suppression('Slave I/O: Get master BINLOG_CHECKSUM failed with error');
+--enable_query_log
+let $status_items= Master_User, Master_Host;
+source include/show_slave_status.inc;
+
+source include/stop_slave.inc;
+change master to master_user='test';
+source include/show_slave_status.inc;
+
+reset slave;
+source include/show_slave_status.inc;
+
+change master to master_user='root';
+source include/start_slave.inc;
+sync_with_master;
+source include/show_slave_status.inc;
+
+# test of crash with temp tables & RESET SLAVE
+# (test to see if RESET SLAVE clears temp tables in memory and disk)
+source include/stop_slave.inc;
+reset slave;
+source include/start_slave.inc;
+connection master;
+create temporary table t1 (a int);
+sync_slave_with_master;
+source include/stop_slave.inc;
+reset slave;
+source include/start_slave.inc;
+sync_with_master;
+show status like 'slave_open_temp_tables';
+connection master;
+drop temporary table if exists t1;
+sync_slave_with_master;
+
+#
+#Bug#34654 RESET SLAVE does not clear LAST_IO_Err*
+#
+
+# clearing the status
+source include/stop_slave.inc;
+reset slave;
+source include/check_slave_no_error.inc;
+
+#
+# verifying start slave resets Last_IO_Error and Last_IO_Errno.
+#
+
+change master to master_user='impossible_user_name';
+start slave;
+let $slave_io_errno= 1045;
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
+
+change master to master_user='root';
+source include/start_slave.inc;
+source include/check_slave_no_error.inc;
+
+#
+# verifying reset slave resets Last_{IO,SQL}_Err{or,no}
+#
+
+stop slave;
+change master to master_user='impossible_user_name';
+start slave;
+let $slave_io_errno= 1045;
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
+
+reset slave;
+source include/check_slave_no_error.inc;
+change master to master_user='root';
+
+
+#
+# BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796
+#
+
+reset slave;
+--source include/start_slave.inc
+
+--source include/stop_slave.inc
+--let $_slave_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+--let $_slave_master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
+--let $_slave_master_port= query_get_value(SHOW SLAVE STATUS, Master_Port, 1)
+
+reset slave all;
+--error ER_BAD_SLAVE
+start slave;
+
+--let $_show_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+if ($_show_master_host != No such row)
+{
+ die;
+}
+
+--replace_result $_slave_master_host MASTER_HOST $_slave_master_user MASTER_USER $_slave_master_port MASTER_PORT
+--eval CHANGE MASTER TO MASTER_HOST= '$_slave_master_host', MASTER_USER= '$_slave_master_user', MASTER_PORT= $_slave_master_port
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_001.test b/mysql-test/suite/rpl/include/rpl_row_001.test
new file mode 100644
index 00000000000..4df2d793244
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_001.test
@@ -0,0 +1,96 @@
+let $LOAD_FILE= $MYSQLTEST_VARDIR/std_data/words.dat;
+CREATE TABLE t1 (word CHAR(20) NOT NULL);
+--replace_result $LOAD_FILE LOAD_FILE
+eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
+--replace_result $LOAD_FILE LOAD_FILE
+eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
+SELECT * FROM t1 ORDER BY word LIMIT 10;
+
+#
+# Save password row for root
+#
+
+create temporary table tmp select * from mysql.user where host="localhost" and user="root";
+
+#
+# Test slave with wrong password
+#
+
+save_master_pos;
+connection slave;
+sync_with_master;
+STOP SLAVE;
+connection master;
+UPDATE mysql.user SET password=password('foo') WHERE host='localhost' AND user='root';
+connection slave;
+START SLAVE;
+connection master;
+#
+# Give slave time to do at last one failed connect retry
+# This one must be short so that the slave will not stop retrying
+real_sleep 2;
+UPDATE mysql.user SET password=password('') WHERE host='localhost' AND user='root';
+# Give slave time to connect (will retry every second)
+
+sleep 2;
+
+CREATE TABLE t3(n INT);
+INSERT INTO t3 VALUES(1),(2);
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY n;
+SELECT SUM(LENGTH(word)) FROM t1;
+connection master;
+DROP TABLE t1,t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# Test if the slave SQL thread can be more than 16K behind the slave
+# I/O thread (> IO_SIZE)
+
+connection master;
+# we'll use table-level locking to delay slave SQL thread
+eval CREATE TABLE t1 (n INT) ENGINE=$engine_type;
+sync_slave_with_master;
+connection master;
+RESET MASTER;
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
+
+connection master;
+let $1=5000;
+# Generate 16K of relay log
+disable_query_log;
+while ($1)
+{
+ eval INSERT INTO t1 VALUES($1);
+ dec $1;
+}
+enable_query_log;
+SELECT COUNT(*) FROM t1;
+save_master_pos;
+
+# Try to cause a large relay log lag on the slave by locking t1
+connection slave;
+LOCK TABLES t1 READ;
+START SLAVE;
+UNLOCK TABLES;
+sync_with_master;
+SELECT COUNT(*) FROM t1;
+
+connection master;
+DROP TABLE t1;
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES(3456);
+sync_slave_with_master;
+SELECT n FROM t1;
+
+connection master;
+DROP TABLE t1;
+
+# resttore old passwords
+replace into mysql.user select * from tmp;
+drop temporary table tmp;
+
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_row_UUID.test b/mysql-test/suite/rpl/include/rpl_row_UUID.test
new file mode 100644
index 00000000000..368596d4fbc
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_UUID.test
@@ -0,0 +1,77 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the UUID() in rbr #
+#############################################################################
+
+# Begin clean up test section
+connection master;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+
+# Section 1 test
+
+eval CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=$engine_type;
+INSERT INTO test.t1 VALUES(1,UUID(),UUID());
+delimiter |;
+create procedure test.p1()
+begin
+ INSERT INTO test.t1 VALUES(2,UUID(),UUID());
+ INSERT INTO test.t1 VALUES(3,UUID(),UUID());
+end|
+delimiter ;|
+
+CALL test.p1();
+
+# Now the same thing with a function
+
+delimiter |;
+create function test.fn1(x int)
+ returns int
+begin
+ insert into t1 values (4+x,UUID(),UUID());
+ insert into t1 values (5+x,UUID(),UUID());
+ return 0;
+end|
+
+delimiter ;|
+# test both in SELECT and in INSERT
+select fn1(0);
+eval create table t2 (a int) engine=$engine_type;
+insert into t2 values(fn1(2));
+
+sync_slave_with_master;
+SHOW CREATE TABLE test.t1;
+
+# Dump the databases and so we can see if they match
+# Another method would be to use SELECT INTO OUTFILE on master,
+# then LOAD DATA INFILE in slave, and use a query to compare.
+# This would have the advantage that it would not assume
+# the system has a 'diff'
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql
+
+connection master;
+# Let's cleanup
+
+DROP PROCEDURE test.p1;
+DROP FUNCTION test.fn1;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+
+# Let's compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-)
+
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql;
+
+# Cleanup dump files.
+# Long-term "system rm" is not portable; we could live without
+# this cleanup as no other test will use these files and they'll
+# be removed at next testsuite run.
+
diff --git a/mysql-test/suite/rpl/include/rpl_row_annotate.test b/mysql-test/suite/rpl/include/rpl_row_annotate.test
new file mode 100644
index 00000000000..317a9c86539
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_annotate.test
@@ -0,0 +1,185 @@
+########################################################################
+# WL47: Store in binlog text of statements that caused RBR events
+# new event : ANNOTATE_ROWS_EVENT
+# new master option : --binlog-annotate-row-events
+# new slave option : --replicate-annotate-row-events
+########################################################################
+--source include/master-slave.inc
+connect (master2,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
+connection master;
+--disable_query_log
+
+--disable_warnings
+DROP DATABASE IF EXISTS test1;
+--enable_warnings
+
+CREATE DATABASE test1;
+USE test1;
+
+CREATE TABLE t1(a int primary key, b int);
+CREATE TABLE t2(a int, b int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE xt1(a int, b int);
+CREATE TABLE xt2(a int, b int);
+
+CREATE TABLE t5 (
+ a INT PRIMARY KEY AUTO_INCREMENT,
+ b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
+);
+
+SET SESSION binlog_annotate_row_events = OFF;
+
+INSERT INTO t1 VALUES (0,0), (1,1);
+
+SET SESSION binlog_annotate_row_events = ON;
+
+UPDATE t1 SET b = b + 1;
+REPLACE t1 VALUES (1,1), (2,2), (3,3);
+
+INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
+INSERT INTO t3 VALUES (1,1), (2,2), (3,3);
+DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a;
+
+INSERT INTO xt1 VALUES (1,1), (2,2), (3,3);
+INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
+DELETE xt1, t2 FROM xt1 INNER JOIN t2 INNER JOIN t3 WHERE xt1.a=t2.a AND t2.a=t3.a;
+
+INSERT INTO xt1 VALUES (1,1), (2,2), (3,3);
+INSERT INTO xt2 VALUES (1,1), (2,2), (3,3);
+DELETE xt1, xt2 FROM xt1 INNER JOIN xt2 INNER JOIN t3 WHERE xt1.a=xt2.a AND xt2.a=t3.a;
+
+INSERT INTO t5(b) VALUES ('foo'), ('bar'), ('baz');
+SET NAMES latin1;
+INSERT INTO t5(b) VALUES ('gås');
+SET NAMES utf8;
+INSERT INTO t5(b) VALUES ('gås');
+SET NAMES latin1;
+
+FLUSH LOGS;
+
+--echo ########################################################################
+--echo # TABLES ON MASTER
+--echo ########################################################################
+--enable_query_log
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t5 ORDER BY a;
+
+sync_slave_with_master;
+--echo ########################################################################
+--echo # TABLES ON SLAVE: should be the same as on master
+--echo ########################################################################
+--disable_query_log
+USE test1;
+--enable_query_log
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t5 ORDER BY a;
+
+--echo ########################################################################
+--echo # EVENTS ON SLAVE
+let $annotate= `select @@global.replicate_annotate_row_events`;
+if ($annotate)
+{
+ --echo # The following Annotate_rows events should appear below:
+ --echo # - UPDATE t1 SET b = b + 1;
+ --echo # - REPLACE t1 VALUES (1,1), (2,2), (3,3);
+ --echo # - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
+ --echo # - INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
+ --echo # - DELETE t1, t2 FROM <...>
+ --echo # - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
+ --echo # - DELETE xt1, t2 FROM <...>
+ --echo # - INSERT INTO t5(b) VALUES <...> (3 instances)
+}
+if (!$annotate)
+{
+ --echo # No Annotate_rows events should appear below
+}
+
+
+
+--echo ########################################################################
+--echo # Ensure that a replication failure doesn't segfault - MDEV-7864
+--echo ########################################################################
+DELETE FROM t3 WHERE a=2;
+connection master;
+INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d;
+INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10;
+DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a;
+connection slave;
+--echo ---- Wait until slave stops with an error ----
+# Wait until the slave tries to run the query, fails with key not
+# found error, and stops the SQL thread.
+let $slave_sql_errno= 1032; # Can't find record
+source include/wait_for_slave_sql_error.inc;
+--let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+--replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
+--disable_query_log
+--eval SELECT "$err" as 'Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can\'t find record in \'t3\'" error)'
+--enable_query_log
+call mtr.add_suppression("Can't find record in 't3'");
+
+SET GLOBAL sql_slave_skip_counter=1;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+
+--echo ########################################################################
+FLUSH LOGS;
+
+--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 'slave-bin.000001' from $start_pos
+
+--echo #
+--echo ########################################################################
+--echo # INSERTs DELAYED ON MASTERs
+--echo ########################################################################
+connection master;
+SET SESSION binlog_annotate_row_events = ON;
+INSERT DELAYED INTO test1.t4 VALUES (1,1);
+FLUSH TABLES;
+SELECT * FROM test1.t4 ORDER BY a;
+
+sync_slave_with_master;
+connection master;
+sync_slave_with_master;
+
+--echo ########################################################################
+--echo # ON SLAVE
+--echo # No Annotate_rows events should appear below
+--echo ########################################################################
+FLUSH LOGS;
+
+--exec $MYSQL --host=127.0.0.1 --port=$SLAVE_MYPORT test -e "show binlog events in 'slave-bin.000002'" > $MYSQLTEST_VARDIR/tmp/annotated_events.txt
+perl;
+ open F, '<', "$ENV{MYSQLTEST_VARDIR}/tmp/annotated_events.txt" or die;
+ binmode STDOUT;
+ while (defined ($_ = <F>)) {
+ if (/Annotate_rows/) {
+ s/[0-9]+\sAnnotate_rows\s[0-9]+\s[0-9]+/# Annotate_rows # #/;
+ print($_);
+ $_ = <F>;
+ s/[0-9]+\sTable_map\s[0-9]+\s[0-9]+\stable_id:\s[0-9]+/# Table_map # # table_id: #/;
+ print($_);
+ }
+ }
+EOF
+
+# Clean-up
+connection master;
+--disable_query_log
+DROP DATABASE test1;
+sync_slave_with_master;
+--enable_query_log
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_basic.test b/mysql-test/suite/rpl/include/rpl_row_basic.test
new file mode 100644
index 00000000000..33d5dd328f3
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_basic.test
@@ -0,0 +1,675 @@
+#
+# Basic tests of row-level logging
+#
+
+#
+# First we test tables with only an index.
+#
+
+#BUG#12662190 - COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS
+#Testing command counters -BEFORE
+#Storing the before counts of Slave
+connection slave;
+let $slave_com_commit_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_commit', Value, 1);
+let $slave_com_insert_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_insert', Value, 1);
+let $slave_com_delete_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_delete', Value, 1);
+let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_update', Value, 1);
+
+connection master;
+eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ;
+SELECT * FROM t1;
+sync_slave_with_master;
+SELECT * FROM t1;
+
+# Testing insert
+connection master;
+INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
+INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
+SELECT * FROM t1 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY C1,C2;
+
+# Testing delete
+# Observe that are several rows having the value for the index but only one
+# should be deleted.
+connection master;
+DELETE FROM t1 WHERE C1 = C2;
+SELECT * FROM t1 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY C1,C2;
+
+#
+# Testing update.
+# Note that we have a condition on a column that is not part of the index for
+# the table. The right row should be updated nevertheless.
+#
+connection master;
+UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t1 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY C1,C2;
+
+#BUG#12662190 - COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS
+#Testing command counters -AFTER
+#Storing the after counts of Slave
+connection slave;
+let $slave_com_commit_after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_commit', Value, 1);
+let $slave_com_insert_after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_insert', Value, 1);
+let $slave_com_delete_after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_delete', Value, 1);
+let $slave_com_update_after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_update', Value, 1);
+
+#Commit count check
+--let $assert_text= Counter for COM_COMMIT is consistent with the number of actual commits
+--let $assert_cond= $slave_com_commit_after - $slave_com_commit_before = 4
+--source include/assert.inc
+#Insert count check
+--let $assert_text= Counter for COM_INSERT is consistent with the number of actual inserts
+--let $assert_cond= $slave_com_insert_after - $slave_com_insert_before = 2
+--source include/assert.inc
+#Delete count check
+--let $assert_text= Counter for COM_DELETE is consistent with the number of actual deletes
+--let $assert_cond= $slave_com_delete_after - $slave_com_delete_before = 1
+--source include/assert.inc
+#Update count check
+--let $assert_text= Counter for COM_UPDATE is consistent with the number of actual updates
+--let $assert_cond= $slave_com_update_after - $slave_com_update_before = 1
+--source include/assert.inc
+
+# Testing update with a condition that does not match any rows, but
+# which has a match for the index.
+connection master;
+UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
+SELECT * FROM t1 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY c1,c2;
+
+#
+# Testing table with primary key
+#
+connection master;
+eval CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = $type ;
+INSERT INTO t2
+ VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
+ (6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
+SELECT * FROM t2 ORDER BY c1,c2;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY c1,c2;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+
+connection master;
+UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+
+# Testing update with a condition that does not match any rows, but
+# which has a match for the primary key.
+connection master;
+UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
+SELECT * FROM t2 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY c1,c2;
+
+connection master;
+DELETE FROM t2 WHERE c1 % 4 = 0;
+SELECT * FROM t2 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY c1,c2;
+
+connection master;
+UPDATE t2 SET c12='X';
+
+#
+# Testing table with a multi-column primary key.
+#
+connection master;
+eval CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = $type ;
+
+INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
+INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
+SELECT * FROM t3 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY C1,C2;
+
+connection master;
+DELETE FROM t3 WHERE C1 = C2;
+SELECT * FROM t3 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY C1,C2;
+
+connection master;
+UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t3 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY C1,C2;
+
+#
+# Testing table without index or primary key
+#
+connection master;
+eval CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT$extra_index_t6) ENGINE = $type;
+
+# Testing insert
+INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+SELECT * FROM t6 ORDER BY C3;
+sync_slave_with_master;
+SELECT * FROM t6 ORDER BY C3;
+
+# Testing delete
+# Observe that are several rows having the value for the index but only one
+# should be deleted.
+connection master;
+DELETE FROM t6 WHERE C1 = C2;
+SELECT * FROM t6 ORDER BY C3;
+sync_slave_with_master;
+SELECT * FROM t6 ORDER BY C3;
+
+#
+# Testing update.
+# Note that we have a condition on a column that is not part of the index for
+# the table. The right row should be updated nevertheless.
+#
+connection master;
+UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t6 ORDER BY C3;
+sync_slave_with_master;
+SELECT * FROM t6 ORDER BY C3;
+
+# now mixing the 3 tables without begin/commit
+connection master;
+eval CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = $type ;
+INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+
+UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+sync_slave_with_master;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+
+#
+# Testing special column types
+#
+
+if (`select char_length('$bit_field_special') > 0`) {
+ connection slave;
+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
+ eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
+}
+
+connection master;
+eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ;
+
+INSERT INTO t4 SET C1 = 1;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+sync_slave_with_master;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+
+if (`select char_length('$bit_field_special') > 0`) {
+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+}
+
+#
+# Testing conflicting operations
+#
+connection master;
+eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
+sync_slave_with_master;
+--echo --- original values ---
+INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
+SELECT * FROM t7 ORDER BY C1;
+
+# since bug#31552/31609 idempotency is not default any longer. In order
+# the preceding test INSERT INTO t7 to pass the mode is switched
+# temprorarily
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+
+connection master;
+--echo --- new values inserted ---
+INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
+SELECT * FROM t7 ORDER BY C1;
+sync_slave_with_master;
+
+set @@global.slave_exec_mode= default;
+--echo --- old values should be overwritten by replicated values ---
+SELECT * FROM t7 ORDER BY C1;
+
+#
+# A more complicated test where the table has several keys and we are
+# causing a conflict for a key that is not "last".
+#
+connection master;
+eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
+
+# First we make sure that the constraints are correctly set.
+INSERT INTO t8 VALUES (99,99,99);
+--error ER_DUP_ENTRY
+INSERT INTO t8 VALUES (99,22,33);
+--error ER_DUP_ENTRY
+INSERT INTO t8 VALUES (11,99,33);
+--error ER_DUP_ENTRY
+INSERT INTO t8 VALUES (11,22,99);
+SELECT * FROM t8 ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t8 ORDER BY a;
+INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
+SELECT * FROM t8 ORDER BY a;
+
+# since bug#31552/31609 idempotency is not default any longer. In order
+# the preceding test INSERT INTO t8 to pass the mode is switched
+# temprorarily
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+
+connection master;
+# We insert a row that will cause conflict on the primary key but not
+# on the other keys.
+INSERT INTO t8 VALUES (2,4,8);
+sync_slave_with_master;
+set @@global.slave_exec_mode= default;
+
+SELECT * FROM t8 ORDER BY a;
+
+# BUG#31552: Replication breaks when deleting rows from out-of-sync
+# table without PK
+
+--echo **** Test for BUG#31552 ****
+
+# Clean up t1 so that we can use it.
+connection master;
+DELETE FROM t1;
+sync_slave_with_master;
+
+# Just to get a clean binary log
+--source include/rpl_reset.inc
+
+connection master;
+INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
+sync_slave_with_master;
+# since bug#31552/31609 idempotency is not default any longer. In order
+# the following test DELETE FROM t1 to pass the mode is switched
+# temprorarily
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+DELETE FROM t1 WHERE C1 = 'L';
+
+connection master;
+DELETE FROM t1;
+query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
+sync_slave_with_master;
+set @@global.slave_exec_mode= default;
+source include/check_slave_is_running.inc;
+query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
+
+# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
+# between machines with mixed endiannes
+# (regression test)
+
+--echo **** Test for BUG#37076 ****
+connection master;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
+INSERT INTO t1 VALUES(
+ '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
+
+sync_slave_with_master slave;
+SELECT * FROM t1;
+
+#
+# cleanup
+#
+
+connection master;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+sync_slave_with_master;
+
+#
+# BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars
+#
+
+# We have 4 combinations to test with respect to the field length
+# (i.e., the number of bytes) of the CHAR fields:
+#
+# 1. Replicating from CHAR<256 to CHAR<256
+# 2. Replicating from CHAR<256 to CHAR>255
+# 3. Replicating from CHAR>255 to CHAR<256
+# 4. Replicating from CHAR>255 to CHAR>255
+
+# We also make a special case of using the max size of a field on the
+# master, i.e. CHAR(255) in UTF-8, giving another three cases.
+#
+# 5. Replicating UTF-8 CHAR(255) to CHAR(<256)
+# 6. Replicating UTF-8 CHAR(255) to CHAR(>255)
+# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
+
+connection master;
+eval CREATE TABLE t1 (i INT NOT NULL,
+ c CHAR(16) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+
+eval CREATE TABLE t2 (i INT NOT NULL,
+ c CHAR(16) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+
+sync_slave_with_master;
+ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+eval CREATE TABLE t3 (i INT NOT NULL,
+ c CHAR(128) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+sync_slave_with_master;
+ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+eval CREATE TABLE t4 (i INT NOT NULL,
+ c CHAR(128) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+
+eval CREATE TABLE t5 (i INT NOT NULL,
+ c CHAR(255) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+sync_slave_with_master;
+ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+eval CREATE TABLE t6 (i INT NOT NULL,
+ c CHAR(255) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+sync_slave_with_master;
+ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+eval CREATE TABLE t7 (i INT NOT NULL,
+ c CHAR(255) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL) ENGINE = $type ;
+
+connection slave;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t1 VALUES (1, "", 1);
+INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t2 VALUES (1, "", 1);
+INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+sync_slave_with_master;
+
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677");
+call mtr.add_suppression("Can't find record in 't1'");
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t4 VALUES (1, "", 1);
+INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+sync_slave_with_master;
+
+let $diff_tables= master:t4, slave:t4;
+source include/diff_tables.inc;
+
+--echo [expecting slave to stop]
+connection master;
+INSERT INTO t5 VALUES (1, "", 1);
+INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+
+connection slave;
+# 1677 = ER_SLAVE_CONVERSION_FAILED
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+--source include/rpl_reset.inc
+
+--echo [expecting slave to stop]
+connection master;
+INSERT INTO t6 VALUES (1, "", 1);
+INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+
+connection slave;
+# 1677 = ER_SLAVE_CONVERSION_FAILED
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+--source include/rpl_reset.inc
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t7 VALUES (1, "", 1);
+INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+sync_slave_with_master;
+
+let $diff_tables= master:t7, slave:t7;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1, t2, t3, t4, t5, t6, t7;
+sync_slave_with_master;
+
+#
+# BUG#32709: Assertion failed: trx_data->empty(), file .\log.cc, line 1293
+#
+
+connection master;
+eval CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=$type;
+
+INSERT INTO t1 VALUES (1), (2), (3);
+--error ER_DUP_ENTRY
+UPDATE t1 SET a = 10;
+INSERT INTO t1 VALUES (4);
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+#
+# Bug #38230 Differences between master and slave after
+# UPDATE or DELETE with LIMIT with pk
+#
+# the regression test verifies consistency via selecting
+
+--disable_abort_on_error
+
+--connection master
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `int_nokey` int(11) NOT NULL,
+ `int_key` int(11) NOT NULL,
+ `date_key` date NOT NULL,
+ `date_nokey` date NOT NULL,
+ `time_key` time NOT NULL,
+ `time_nokey` time NOT NULL,
+ `datetime_key` datetime NOT NULL,
+ `datetime_nokey` datetime NOT NULL,
+ `varchar_key` varchar(1) NOT NULL,
+ `varchar_nokey` varchar(1) NOT NULL,
+ PRIMARY KEY (`pk`),
+ KEY `int_key` (`int_key`),
+ KEY `date_key` (`date_key`),
+ KEY `time_key` (`time_key`),
+ KEY `datetime_key` (`datetime_key`),
+ KEY `varchar_key` (`varchar_key`)
+) ENGINE=$type;
+
+INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
+
+eval CREATE TABLE t2 (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `int_nokey` int(11) NOT NULL,
+ `int_key` int(11) NOT NULL,
+ `date_key` date NOT NULL,
+ `date_nokey` date NOT NULL,
+ `time_key` time NOT NULL,
+ `time_nokey` time NOT NULL,
+ `datetime_key` datetime NOT NULL,
+ `datetime_nokey` datetime NOT NULL,
+ `varchar_key` varchar(1) NOT NULL,
+ `varchar_nokey` varchar(1) NOT NULL,
+ PRIMARY KEY (`pk`),
+ KEY `int_key` (`int_key`),
+ KEY `date_key` (`date_key`),
+ KEY `time_key` (`time_key`),
+ KEY `datetime_key` (`datetime_key`),
+ KEY `varchar_key` (`varchar_key`)
+) ENGINE=$type;
+
+INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
+
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
+DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
+UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+
+--sync_slave_with_master
+--echo *** results: t2 must be consistent ****
+
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+
+--connection master
+DROP TABLE t1, t2;
+
+--enable_abort_on_error
+
+--echo EOF OF TESTS
+
+#
+# BUG#40004: Replication failure with no PK + no indexes
+#
+
+# The test cases are taken from the bug report. It is difficult to
+# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
+# with the test cases we have.
+
+connection master;
+
+eval CREATE TABLE t1 (a int) ENGINE=$type;
+
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 2 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 5 );
+
+UPDATE t1 SET a = 5 WHERE a = 9;
+DELETE FROM t1 WHERE a < 6;
+UPDATE t1 SET a = 9 WHERE a < 3;
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a < 4;
+UPDATE t1 SET a = 8 WHERE a < 5;
+
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+#
+# Bug #39752: Replication failure on RBR + MyISAM + no PK
+#
+
+# The test cases are taken from the bug report. It is difficult to
+# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
+# with the test cases we have.
+
+connection master;
+
+# Since t1 contain a bit field, we have to do this trick to handle InnoDB
+if (`select char_length('$bit_field_special') > 0`) {
+ connection slave;
+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
+ eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
+}
+
+--disable_warnings
+connection master;
+eval CREATE TABLE t1 (a bit) ENGINE=$type;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
+DELETE FROM t1 WHERE a < 2 LIMIT 4;
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 9 );
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 8 );
+UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 4 );
+INSERT IGNORE INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
+DELETE FROM t1 WHERE a = 4 LIMIT 7;
+UPDATE IGNORE t1 SET a = 9 WHERE a < 2 LIMIT 9;
+UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
+DELETE FROM t1 WHERE a < 0 LIMIT 5;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
+UPDATE IGNORE t1 SET a = 4 WHERE a < 6 LIMIT 4;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
+UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 8;
+DELETE FROM t1 WHERE a < 8 LIMIT 8;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 6 );
+DELETE FROM t1 WHERE a < 6 LIMIT 7;
+UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 7 );
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT IGNORE INTO t1 ( a ) VALUES ( 7 );
+INSERT IGNORE INTO t1 ( a ) VALUES ( 6 );
+UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
+DELETE FROM t1 WHERE a = 2 LIMIT 9;
+DELETE FROM t1 WHERE a = 1 LIMIT 4;
+UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
+INSERT INTO t1 ( a ) VALUES ( 0 );
+DELETE FROM t1 WHERE a < 3 LIMIT 0;
+UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
+INSERT INTO t1 ( a ) VALUES ( 1 );
+UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+--enable_warnings
+
+sync_slave_with_master;
+
+if (`select char_length('$bit_field_special') > 0`) {
+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+}
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_row_blob.test b/mysql-test/suite/rpl/include/rpl_row_blob.test
new file mode 100644
index 00000000000..5cd7b6b4b29
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_blob.test
@@ -0,0 +1,175 @@
+#################################################
+# Author: JBM
+# Date: 2006-01-06
+# Purpose: Test test that BLOBs are replicated
+# correctly.
+################################################
+
+# Pre test clean up section
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+--enable_warnings
+
+# Start test section
+--echo ***** Table Create Section ****
+--echo
+--disable_warnings
+--replace_result $engine_type #
+eval CREATE TABLE test.t1 (c1 int not null auto_increment,
+data LONGBLOB, PRIMARY KEY(c1))ENGINE=$engine_type;
+--enable_warnings
+--echo
+--echo **** Data Insert Section test.t1 *****
+--echo
+INSERT INTO test.t1 VALUES (NULL, NULL);
+INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
+INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
+--echo
+
+--echo **** Data Insert Validation Master Section test.t1 ****
+--echo
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
+save_master_pos;
+connection slave;
+sync_with_master;
+--echo
+--echo **** Data Insert Validation Slave Section test.t1 ****
+--echo
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
+connection master;
+--echo
+
+--echo **** Data Update Section test.t1 ****
+--echo
+UPDATE test.t1 set data=repeat('a',18*1024) where c1 = 1;
+UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
+--echo
+
+--echo **** Data Update Validation Master Section test.t1 ****
+--echo
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+save_master_pos;
+connection slave;
+sync_with_master;
+--echo
+--echo **** Data Update Validation Slave Section test.t1 ****
+--echo
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+connection master;
+--echo
+--echo **** End Test Section test.t1 ****
+--echo
+
+--echo **** Create Table test.t2 ****
+--echo
+--disable_warnings
+--replace_result $engine_type #
+eval CREATE TABLE test.t2 (
+ c1 INT NOT NULL PRIMARY KEY,
+ c2 TEXT,
+ c3 INT,
+ c4 LONGBLOB,
+ KEY(c3))ENGINE=$engine_type;
+--enable_warnings
+--echo
+
+--echo *** Setup Values For test.t2 ***
+# x0 size 256 (current inline size)
+set @x0 = '01234567012345670123456701234567';
+set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
+
+# b1 length 2000+256 (blob part aligned)
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@x0);
+# d1 length 3000
+set @d1 = 'dd1';
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+
+# b2 length 20000
+set @b2 = 'b2';
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+
+# d2 length 30000
+set @d2 = 'dd2';
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+--echo
+
+--echo **** Data Insert Section test.t2 *****
+--echo
+INSERT INTO test.t2 VALUES(1,@b1,111,@d1);
+INSERT INTO test.t2 VALUES(2,@b2,222,@d2);
+--echo
+
+--echo **** Data Insert Validation Master Section test.t2 ****
+--echo
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+save_master_pos;
+connection slave;
+sync_with_master;
+--echo
+--echo **** Data Insert Validation Slave Section test.t2 ****
+--echo
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+connection master;
+--echo
+
+--echo **** Data Update Section test.t2 ****
+--echo
+UPDATE test.t2 SET c2=@b2, c4=@d2 WHERE c1=1;
+UPDATE test.t2 SET c2=@b1, c4=@d1 WHERE c1=2;
+--echo
+
+--echo **** Data Update Validation Master Section test.t2 ****
+--echo
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+save_master_pos;
+connection slave;
+sync_with_master;
+--echo
+--echo **** Data Update Validation Slave Section test.t2 ****
+--echo
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+connection master;
+--echo
+
+# Post test clean up section
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql
+
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql;
+
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+# ensure cleanup on slave as well:
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/include/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/include/rpl_row_delayed_ins.test
new file mode 100644
index 00000000000..bad308ff814
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_delayed_ins.test
@@ -0,0 +1,21 @@
+# See if INSERT DELAYED gets replicated
+# Only in row-based, as we do SHOW BINLOG EVENTS
+
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+connection master;
+let $VERSION=`select version()`;
+eval create table t1(a int not null primary key) engine=$engine_type;
+insert delayed into t1 values (1);
+insert delayed into t1 values (2);
+insert delayed into t1 values (3);
+flush tables;
+SELECT * FROM t1 ORDER BY a;
+sync_slave_with_master;
+
+SELECT * FROM t1 ORDER BY a;
+connection master;
+drop table t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_func003.test b/mysql-test/suite/rpl/include/rpl_row_func003.test
new file mode 100644
index 00000000000..f46f9eddc60
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_func003.test
@@ -0,0 +1,81 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Update: 08/29/2005 Comment out sleep. Only needed for debugging #
+#############################################################################
+# Note: Time changes and is not deteministic, so instead we dump both the #
+# master and slave and diff the dumps. If the dumps differ then the #
+# test case will fail. To run during diff failuers, comment out the #
+# diff. #
+# Test: Tests MySQL stored function using RAND() and a flow control. The #
+# test inserts rows into a givin table with the function used in #
+# the insert statement. Depending on the RAND() value returned #
+# inside the function one set of text is returned. In addition, #
+# it uses a transaction to see the effect a rollback has on master #
+# Vs slave. #
+#############################################################################
+
+CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP FUNCTION IF EXISTS test.f1;
+DROP TABLE IF EXISTS test.t1;
+
+--enable_warnings
+
+eval CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=$engine_type;
+
+delimiter |;
+create function test.f1() RETURNS CHAR(16)
+BEGIN
+ DECLARE tmp CHAR(16);
+ DECLARE var_name FLOAT;
+ SET var_name = RAND();
+ IF var_name > .6
+ THEN SET tmp = 'Texas';
+ ELSE SET tmp = 'MySQL';
+ END IF;
+RETURN tmp;
+END|
+delimiter ;|
+
+--disable_warnings
+INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
+INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
+--enable_warnings
+
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+--disable_warnings
+INSERT INTO test.t1 VALUES (null,test.f1());
+--enable_warnings
+ROLLBACK;
+SET AUTOCOMMIT=1;
+
+ sync_slave_with_master;
+ connection master;
+
+# Time to dump the databases and so we can see if they match
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_slave.sql
+
+# First lets cleanup
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
+
+
+# the test will show that the diff statement failed and no reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files yourself to see what is not matching :-) File are located
+# in $MYSQLTEST_VARDIR/tmp
+
+diff_files $MYSQLTEST_VARDIR/tmp/func003_master.sql $MYSQLTEST_VARDIR/tmp/func003_slave.sql;
+
+# Clean up
+remove_file $MYSQLTEST_VARDIR/tmp/func003_master.sql;
+remove_file $MYSQLTEST_VARDIR/tmp/func003_slave.sql;
+
+# End of 5.0 test case
diff --git a/mysql-test/suite/rpl/include/rpl_row_img.test b/mysql-test/suite/rpl/include/rpl_row_img.test
new file mode 100644
index 00000000000..9cf2b6f9e9e
--- /dev/null
+++ b/mysql-test/suite/rpl/include/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 suite/rpl/include/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/suite/rpl/include/rpl_row_img_blobs.test b/mysql-test/suite/rpl/include/rpl_row_img_blobs.test
new file mode 100644
index 00000000000..9a7063819e0
--- /dev/null
+++ b/mysql-test/suite/rpl/include/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 suite/rpl/include/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/suite/rpl/include/rpl_row_sp002.test b/mysql-test/suite/rpl/include/rpl_row_sp002.test
new file mode 100644
index 00000000000..90c273eb026
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_sp002.test
@@ -0,0 +1,208 @@
+#############################################################################
+# This test is being created to test out the non deterministic items with #
+# row based replication. #
+#############################################################################
+# Test: Contains two stored procedures test one that insert data into tables#
+# and use the LAST_INSERTED_ID() on tables with FOREIGN KEY(a) #
+# REFERENCES ON DELETE CASCADE. This test also has a delete sp that #
+# should cause a delete cascade. #
+# The second test has a sp that will either insert rows or delete from#
+# the table depending on the CASE outcome. The test uses this SP in a#
+# transaction first rolling back and then commiting, #
+#############################################################################
+
+
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin test section 1
+
+eval CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=$engine_type;
+eval CREATE TABLE test.t2 (a INT AUTO_INCREMENT KEY, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON DELETE CASCADE) ENGINE=$engine_type;
+
+delimiter |;
+create procedure test.p1(IN i CHAR(6))
+begin
+ INSERT INTO test.t1 (t) VALUES (i);
+ INSERT INTO test.t2 VALUES (NULL,LAST_INSERT_ID());
+end|
+create procedure test.p2(IN i INT)
+begin
+ DELETE FROM test.t1 where a < i;
+end|
+delimiter ;|
+
+let $message=< -- test 1 call p1 -- >;
+--source include/show_msg.inc
+SET FOREIGN_KEY_CHECKS=1;
+call test.p1('texas');
+call test.p1('Live');
+call test.p1('next');
+call test.p1('to');
+call test.p1('OK');
+call test.p1('MySQL');
+
+let $message=< -- test 1 select master after p1 -- >;
+--source include/show_msg.inc
+
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 select slave after p1 -- >;
+--source include/show_msg.inc
+sync_slave_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 call p2 & select master -- >;
+--source include/show_msg.inc
+connection master;
+call test.p2(4);
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 select slave after p2 -- >;
+--source include/show_msg.inc
+sync_slave_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+connection master;
+#show binlog events;
+let $message=< -- End test 1 Begin test 2 -- >;
+--source include/show_msg.inc
+# End test 1 Begin test 2
+
+--disable_warnings
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+--enable_warnings
+# End of cleanup
+
+eval CREATE TABLE test.t1 (a INT, t CHAR(6), PRIMARY KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE test.t2 (a INT, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON UPDATE CASCADE, PRIMARY KEY(a)) ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE test.p1(IN nm INT, IN ch CHAR(6))
+BEGIN
+ INSERT INTO test.t1 (a,t) VALUES (nm, ch);
+ INSERT INTO test.t2 VALUES (nm, LAST_INSERT_ID());
+END|
+CREATE PROCEDURE test.p2(IN i INT)
+BEGIN
+ UPDATE test.t1 SET a = i*10 WHERE a = i;
+END|
+delimiter ;|
+SET FOREIGN_KEY_CHECKS=1;
+CALL test.p1(1,'texas');
+CALL test.p1(2,'Live');
+CALL test.p1(3,'next');
+CALL test.p1(4,'to');
+CALL test.p1(5,'OK');
+CALL test.p1(6,'MySQL');
+
+let $message=< -- test 2 select Master after p1 -- >;
+--source include/show_msg.inc
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 2 select Slave after p1 -- >;
+--source include/show_msg.inc
+sync_slave_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 2 call p2 & select Master -- >;
+--source include/show_msg.inc
+connection master;
+CALL test.p2(2);
+CALL test.p2(4);
+CALL test.p2(6);
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 select Slave after p2 -- >;
+--source include/show_msg.inc
+sync_slave_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+connection master;
+#show binlog events;
+let $message=< -- End test 2 Begin test 3 -- >;
+--source include/show_msg.inc
+# End test 2 begin test 3
+
+eval CREATE TABLE test.t3 (a INT AUTO_INCREMENT KEY, t CHAR(6))ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE test.p3(IN n INT)
+begin
+CASE n
+WHEN 2 THEN
+ DELETE from test.t3;
+ELSE
+ INSERT INTO test.t3 VALUES (NULL,'NONE');
+END CASE;
+end|
+delimiter ;|
+
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+
+-- disable_query_log
+-- disable_result_log
+let $n=50;
+while ($n)
+{
+ eval call test.p3($n);
+ dec $n;
+}
+-- enable_result_log
+-- enable_query_log
+
+ROLLBACK;
+select * from test.t3;
+sync_slave_with_master;
+select * from test.t3;
+
+connection master;
+START TRANSACTION;
+
+-- disable_query_log
+-- disable_result_log
+let $n=50;
+while ($n)
+{
+ eval call test.p3($n);
+ dec $n;
+}
+-- enable_result_log
+-- enable_query_log
+
+COMMIT;
+select * from test.t3;
+sync_slave_with_master;
+select * from test.t3;
+
+connection master;
+#show binlog events from 1627;
+
+
+# First lets cleanup
+SET AUTOCOMMIT=1;
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE test.p3;
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+
+# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_sp003.test b/mysql-test/suite/rpl/include/rpl_row_sp003.test
new file mode 100644
index 00000000000..a8f25485f26
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_sp003.test
@@ -0,0 +1,79 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/13/2005 Created from Bug 12335 #
+#############################################################################
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+
+eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+ INSERT INTO test.t1 VALUES (4);
+ SELECT get_lock("test", 100);
+ UPDATE test.t1 set a=a+4 WHERE a=4;
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ UPDATE test.t1 SET a=a+1;
+END|
+delimiter ;|
+
+SELECT get_lock("test", 200);
+
+connection master1;
+send CALL test.p1();
+
+connection master;
+# Make sure that the call on master1 arrived at the get_lock.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'User lock' and
+ info = 'SELECT get_lock("test", 100)';
+--source include/wait_condition.inc
+CALL test.p2();
+SELECT release_lock("test");
+
+connection master1;
+# Reap CALL test.p1() to ensure that it has fully completed
+# before doing any selects on test.t1.
+--reap
+# Release lock acquired by it.
+SELECT release_lock("test");
+
+connection master;
+SELECT * FROM test.t1;
+sync_slave_with_master;
+connection slave;
+SELECT * FROM test.t1;
+
+connection master;
+DROP TABLE IF EXISTS test.t1;
+eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
+CALL test.p2();
+CALL test.p1();
+SELECT release_lock("test");
+SELECT * FROM test.t1;
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM test.t1;
+connection master;
+#show binlog events from 720;
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+sync_slave_with_master;
+
+# End of 5.0 test case
diff --git a/mysql-test/suite/rpl/include/rpl_row_sp006.test b/mysql-test/suite/rpl/include/rpl_row_sp006.test
new file mode 100644
index 00000000000..16a8374ae7f
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_sp006.test
@@ -0,0 +1,84 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Updated: 08/29/2005 to remove sleeps #
+#############################################################################
+# Test: This test uses two SPs, one to populate a table, and another to use #
+# Cursors, CURRENT_DATE(), loop control, date math and logic control #
+# to populate a table with data from the first table. #
+#############################################################################
+
+# Begin clean up test section
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+eval CREATE TABLE IF NOT EXISTS t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=$engine_type;
+eval CREATE TABLE IF NOT EXISTS t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE done INT DEFAULT 0;
+ DECLARE spa CHAR(16);
+ DECLARE spb INT;
+ DECLARE cur1 CURSOR FOR SELECT name,
+ (YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
+ FROM t1;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+
+ OPEN cur1;
+
+ SET AUTOCOMMIT=0;
+ REPEAT
+ FETCH cur1 INTO spa, spb;
+ IF NOT done THEN
+ START TRANSACTION;
+ INSERT INTO t2 VALUES (spa,spb);
+ COMMIT;
+ END IF;
+ UNTIL done END REPEAT;
+
+ SET AUTOCOMMIT=1;
+ CLOSE cur1;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+ INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
+END|
+delimiter ;|
+
+CALL p2();
+sync_slave_with_master;
+
+connection master;
+CALL p1();
+sync_slave_with_master;
+
+connection master;
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp006_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp006_slave.sql
+
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+# Lets compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-) Failed test
+# Dump files will be located in $MYSQLTEST_VARDIR/tmp.
+
+diff_files $MYSQLTEST_VARDIR/tmp/sp006_master.sql $MYSQLTEST_VARDIR/tmp/sp006_slave.sql;
+
+sync_slave_with_master;
+
+# End of 5.1 test case
diff --git a/mysql-test/suite/rpl/include/rpl_row_sp007.test b/mysql-test/suite/rpl/include/rpl_row_sp007.test
new file mode 100644
index 00000000000..4a68dddfdc2
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_sp007.test
@@ -0,0 +1,46 @@
+#############################################################################
+# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
+# rollback to save point and then commits. #
+#############################################################################
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin test section 1
+delimiter |;
+eval CREATE PROCEDURE test.p1(IN i INT)
+BEGIN
+ DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
+ DROP TABLE IF EXISTS test.t1;
+ CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=$engine_type;
+ START TRANSACTION;
+ INSERT INTO test.t1 VALUES(i);
+ savepoint t1_save;
+ INSERT INTO test.t1 VALUES (14);
+ ROLLBACK to savepoint t1_save;
+ COMMIT;
+END|
+delimiter ;|
+
+CALL test.p1(12);
+SELECT * FROM test.t1;
+
+sync_slave_with_master;
+SELECT * FROM test.t1;
+
+connection master;
+CALL test.p1(13);
+SELECT * FROM test.t1;
+
+sync_slave_with_master;
+SELECT * FROM test.t1;
+
+connection master;
+#show binlog events;
+
+
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+
+# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_tabledefs.test b/mysql-test/suite/rpl/include/rpl_row_tabledefs.test
new file mode 100644
index 00000000000..194079b160a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_row_tabledefs.test
@@ -0,0 +1,232 @@
+# Test how replication of tables work when the definition on the
+# master and slave differs.
+
+# Consider making these part of the basic RBR tests.
+
+connection master;
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
+DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
+--enable_query_log
+--enable_warnings
+sync_slave_with_master;
+STOP SLAVE;
+SET @my_sql_mode= @@global.sql_mode;
+SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
+START SLAVE;
+
+connection master;
+eval CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
+eval CREATE TABLE t5 (a INT, b INT, c INT) ENGINE=$engine_type;
+eval CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=$engine_type;
+eval CREATE TABLE t7 (a INT NOT NULL) ENGINE=$engine_type;
+eval CREATE TABLE t8 (a INT NOT NULL) ENGINE=$engine_type;
+
+# Table used to detect that slave is running
+eval CREATE TABLE t9 (a INT) ENGINE=$engine_type;
+
+sync_slave_with_master;
+
+# On the slave, we add one INT column last in table 't1_int',
+ALTER TABLE t1_int ADD x INT DEFAULT 42;
+# ... and add BIT columns last in table 't1_bit' to ensure that we
+# have at least one extra null byte on the slave,
+ALTER TABLE t1_bit
+ ADD x BIT(3) DEFAULT b'011',
+ ADD y BIT(5) DEFAULT b'10101',
+ ADD z BIT(2) DEFAULT b'10';
+# ... and add one CHAR column last in table 't1_char',
+ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
+# ... and add one non-nullable INT column last in table 't1_text'
+# with no default,
+ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
+# ... and remove the last column in t2
+ALTER TABLE t2 DROP b;
+# ... change the type of the single column in table 't4'
+ALTER TABLE t4 MODIFY a FLOAT;
+# ... change the type of the middle column of table 't5'
+ALTER TABLE t5 MODIFY b FLOAT;
+# ... change the type of the last column of table 't6'
+ALTER TABLE t6 MODIFY c FLOAT;
+
+# ... add one byte worth of null bytes to the table on the slave
+ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
+ ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
+
+# ... add 8 columns that are nullable: t8 will not be entirely
+# nullable and have no null bits (just an X bit)
+ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
+ ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
+ ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
+ ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
+
+# Insert some values for tables on slave side. These should not be
+# modified when the row from the master is applied.
+# since bug#31552/31609 idempotency is not default any longer. In order
+# the following INSERTs to pass the mode is switched temprorarily
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+
+# so the inserts are going to be overridden
+INSERT INTO t1_int VALUES (2, 4, 4711);
+INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
+INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
+
+connection master;
+INSERT INTO t1_int VALUES (1,2);
+INSERT INTO t1_int VALUES (2,5);
+INSERT INTO t1_bit VALUES (1,2);
+INSERT INTO t1_bit VALUES (2,5);
+INSERT INTO t1_char VALUES (1,2);
+INSERT INTO t1_char VALUES (2,5);
+SELECT * FROM t1_int ORDER BY a;
+SELECT * FROM t1_bit ORDER BY a;
+SELECT * FROM t1_char ORDER BY a;
+sync_slave_with_master;
+set @@global.slave_exec_mode= default;
+
+SELECT a,b,x FROM t1_int ORDER BY a;
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+SELECT a,b,x FROM t1_char ORDER BY a;
+
+connection master;
+UPDATE t1_int SET b=2*b WHERE a=2;
+UPDATE t1_char SET b=2*b WHERE a=2;
+UPDATE t1_bit SET b=2*b WHERE a=2;
+SELECT * FROM t1_int ORDER BY a;
+SELECT * FROM t1_bit ORDER BY a;
+SELECT * FROM t1_char ORDER BY a;
+sync_slave_with_master;
+SELECT a,b,x FROM t1_int ORDER BY a;
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+SELECT a,b,x FROM t1_char ORDER BY a;
+
+connection master;
+INSERT INTO t9 VALUES (2);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t1_nodef VALUES (1,2);
+
+# Last insert on wider slave table succeeds while slave sql sql_mode permits.
+# The previous version of the above test expected slave sql to stop.
+# bug#38173 relaxed conditions to stop only with the strict mode.
+sync_slave_with_master;
+select count(*) from t1_nodef;
+
+#
+# Replicating to tables with fewer columns at the end works as of WL#3228
+#
+connection master;
+INSERT INTO t9 VALUES (2);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t2 VALUES (2,4);
+SELECT * FROM t2;
+sync_slave_with_master;
+SELECT * FROM t2;
+--source include/check_slave_is_running.inc
+
+connection master;
+INSERT INTO t9 VALUES (4);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t4 VALUES (4);
+connection slave;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677");
+--let $slave_skip_counter= 2
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+connection master;
+INSERT INTO t9 VALUES (5);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t5 VALUES (5,10,25);
+connection slave;
+--let $slave_skip_counter= 2
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+connection master;
+INSERT INTO t9 VALUES (6);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t6 VALUES (6,12,36);
+connection slave;
+--let $slave_skip_counter= 2
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+connection master;
+INSERT INTO t9 VALUES (6);
+sync_slave_with_master;
+--source include/check_slave_is_running.inc
+
+# Testing some tables extra field that can be null and cannot be null
+# (but have default values)
+
+connection master;
+INSERT INTO t7 VALUES (1),(2),(3);
+INSERT INTO t8 VALUES (1),(2),(3);
+SELECT * FROM t7 ORDER BY a;
+SELECT * FROM t8 ORDER BY a;
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a;
+SELECT * FROM t8 ORDER BY a;
+
+# We will now try to update and then delete a row on the master where
+# the extra field on the slave does not have a default value. This
+# update should not generate an error even though there is no default
+# for the extra column.
+
+connection master;
+TRUNCATE t1_nodef;
+SET SQL_LOG_BIN=0;
+INSERT INTO t1_nodef VALUES (1,2);
+INSERT INTO t1_nodef VALUES (2,4);
+SET SQL_LOG_BIN=1;
+sync_slave_with_master;
+
+connection slave;
+INSERT INTO t1_nodef VALUES (1,2,3,4,5);
+INSERT INTO t1_nodef VALUES (2,4,6,8,10);
+
+connection master;
+UPDATE t1_nodef SET b=2*b WHERE a=1;
+SELECT * FROM t1_nodef ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1_nodef ORDER BY a;
+
+connection master;
+DELETE FROM t1_nodef WHERE a=2;
+SELECT * FROM t1_nodef ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1_nodef ORDER BY a;
+
+--echo **** Cleanup ****
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
+DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+sync_slave_with_master;
+
+# Restore sql_mode
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/suite/rpl/include/rpl_semi_sync.inc b/mysql-test/suite/rpl/include/rpl_semi_sync.inc
new file mode 100644
index 00000000000..393b49372e1
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_semi_sync.inc
@@ -0,0 +1,551 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/not_embedded.inc;
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+let $engine_type= InnoDB;
+#let $engine_type= MyISAM;
+
+# Suppress warnings that might be generated during the test
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+call mtr.add_suppression("mysqld: Got an error reading communication packets");
+connection slave;
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
+
+# wait for dying connections (if any) to disappear
+let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
+--source include/wait_condition.inc
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master, save the count of connections before start
+# semi-sync slave for comparison below.
+let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+
+--echo #
+--echo # Uninstall semi-sync plugins on master and slave
+--echo #
+connection slave;
+source include/stop_slave.inc;
+reset slave;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+
+connection master;
+reset master;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+
+--echo #
+--echo # Main test of semi-sync replication start here
+--echo #
+
+connection master;
+
+set global rpl_semi_sync_master_timeout= 60000; # 60s
+
+echo [ default state of semi-sync on master should be OFF ];
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ enable semi-sync on master ];
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+--echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
+--echo #
+
+# BUG#45672 When semi-sync is enabled on master, it would allocate
+# transaction node even without semi-sync slave connected, and would
+# finally result in transaction node allocation error.
+#
+# Semi-sync master will pre-allocate 'max_connections' transaction
+# nodes, so here we do more than that much transactions to check if it
+# will fail or not.
+# select @@global.max_connections + 1;
+let $i= `select @@global.max_connections + 1`;
+disable_query_log;
+eval create table t1 (a int) engine=$engine_type;
+while ($i)
+{
+ eval insert into t1 values ($i);
+ dec $i;
+}
+drop table t1;
+enable_query_log;
+
+# BUG#45673
+echo [ status of semi-sync on master should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# reset master to make sure the following test will start with a clean environment
+reset master;
+
+connection slave;
+
+echo [ default state of semi-sync on slave should be OFF ];
+show variables like 'rpl_semi_sync_slave_enabled';
+
+echo [ enable semi-sync on slave ];
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+
+# NOTE: Rpl_semi_sync_master_client will only be updated when
+# semi-sync slave has started binlog dump request
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+echo [ initial master state after the semi-sync slave connected ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1(a int) engine = $engine_type;
+
+echo [ master state after CREATE TABLE statement ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master.
+let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
+eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
+
+echo [ insert records to table ];
+insert t1 values (10);
+insert t1 values (9);
+insert t1 values (8);
+insert t1 values (7);
+insert t1 values (6);
+insert t1 values (5);
+insert t1 values (4);
+insert t1 values (3);
+insert t1 values (2);
+insert t1 values (1);
+
+echo [ master status after inserts ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+sync_slave_with_master;
+
+echo [ slave status after replicated inserts ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+--echo
+--echo # BUG#50157
+--echo # semi-sync replication crashes when replicating a transaction which
+--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
+
+connection master;
+SET SESSION AUTOCOMMIT= 0;
+CREATE TABLE t2(c1 INT) ENGINE=innodb;
+sync_slave_with_master;
+
+connection master;
+BEGIN;
+--echo
+--echo # Even though it is in a transaction, this statement is binlogged into binlog
+--echo # file immediately.
+--disable_warnings
+CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
+--enable_warnings
+--echo
+--echo # These statements will not be binlogged until the transaction is committed
+INSERT INTO t2 VALUES(11);
+INSERT INTO t2 VALUES(22);
+COMMIT;
+
+DROP TABLE t2, t3;
+SET SESSION AUTOCOMMIT= 1;
+sync_slave_with_master;
+
+
+--echo #
+--echo # Test semi-sync master will switch OFF after one transaction
+--echo # timeout waiting for slave reply.
+--echo #
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+set global rpl_semi_sync_master_timeout= 5000;
+
+# The first semi-sync check should be on because after slave stop,
+# there are no transactions on the master.
+echo [ master status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+echo [ semi-sync replication of these transactions will fail ];
+insert into t1 values (500);
+
+# Wait for the semi-sync replication of this transaction to timeout
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= OFF;
+source include/wait_for_status_var.inc;
+
+# The second semi-sync check should be off because one transaction
+# times out during waiting.
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# Semi-sync status on master is now OFF, so all these transactions
+# will be replicated asynchronously.
+delete from t1 where a=10;
+delete from t1 where a=9;
+delete from t1 where a=8;
+delete from t1 where a=7;
+delete from t1 where a=6;
+delete from t1 where a=5;
+delete from t1 where a=4;
+delete from t1 where a=3;
+delete from t1 where a=2;
+delete from t1 where a=1;
+
+insert into t1 values (100);
+
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync status on master will be ON again when slave catches up
+--echo #
+
+# Save the master position for later use.
+save_master_pos;
+
+connection slave;
+
+echo [ slave status should be OFF ];
+show status like 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+sync_with_master;
+
+echo [ slave status should be ON ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+connection master;
+
+# The master semi-sync status should be on again after slave catches up.
+echo [ master status should be ON again after slave catches up ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+--replace_result 305 304
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo #
+--echo # Test disable/enable master semi-sync on the fly.
+--echo #
+
+drop table t1;
+sync_slave_with_master;
+
+source include/stop_slave.inc;
+
+--echo #
+--echo # Flush status
+--echo #
+connection master;
+echo [ Semi-sync master status variables before FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
+# clean status after this.
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+echo [ Semi-sync master status variables after FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+
+connection master;
+
+source include/show_master_logs.inc;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ disable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+echo [ enable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+--echo #
+--echo # Test RESET MASTER/SLAVE
+--echo #
+
+connection slave;
+
+source include/start_slave.inc;
+
+connection master;
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+drop table t1;
+
+##show status like 'Rpl_semi_sync_master_status';
+
+sync_slave_with_master;
+--replace_column 2 #
+show status like 'Rpl_relay%';
+
+echo [ test reset master ];
+connection master;
+
+reset master;
+
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+connection slave;
+
+source include/stop_slave.inc;
+reset slave;
+
+# Kill the dump thread on master for previous slave connection and
+# wait for it to exit
+connection master;
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ --replace_result $_tid _tid
+ eval kill query $_tid;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+
+# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
+# 1 after dump thread started.
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+
+sync_slave_with_master;
+
+select * from t1;
+
+connection master;
+
+echo [ master semi-sync status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Start semi-sync replication without SUPER privilege
+--echo #
+connection slave;
+source include/stop_slave.inc;
+reset slave;
+connection master;
+reset master;
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ --replace_result $_tid _tid
+ eval kill query $_tid;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+# Do not binlog the following statement because it will generate
+# different events for ROW and STATEMENT format
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+set sql_log_bin=1;
+connection slave;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+change master to master_user='rpl',master_password='rpl_password';
+source include/start_slave.inc;
+show status like 'Rpl_semi_sync_slave_status';
+connection master;
+
+# Wait for the semi-sync binlog dump thread to start
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+insert into t1 values (4);
+insert into t1 values (5);
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync slave connect to non-semi-sync master
+--echo #
+
+# Disable semi-sync on master
+connection slave;
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+connection master;
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ --replace_result $_tid _tid
+ eval kill query $_tid;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+echo [ Semi-sync status on master should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+connection master;
+insert into t1 values (8);
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync clients should be 1, status should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+sync_slave_with_master;
+show status like 'Rpl_semi_sync_slave_status';
+
+# Uninstall semi-sync plugin on master
+connection slave;
+source include/stop_slave.inc;
+connection master;
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+insert into t1 values (10);
+sync_slave_with_master;
+
+--echo #
+--echo # Test non-semi-sync slave connect to semi-sync master
+--echo #
+
+connection master;
+set global rpl_semi_sync_master_timeout= 5000; # 5s
+set global rpl_semi_sync_master_enabled= 1;
+
+connection slave;
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+echo [ uninstall semi-sync slave plugin ];
+set global rpl_semi_sync_slave_enabled= 0;
+
+echo [ reinstall semi-sync slave plugin and disable semi-sync ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+--echo #
+--echo # Clean up
+--echo #
+
+connection slave;
+source include/stop_slave.inc;
+set global rpl_semi_sync_slave_enabled= 0;
+
+connection master;
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+change master to master_user='root',master_password='';
+source include/start_slave.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+connection master;
+drop user rpl@127.0.0.1;
+flush privileges;
+set global rpl_semi_sync_master_timeout= default;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_set_null.test b/mysql-test/suite/rpl/include/rpl_set_null.test
new file mode 100644
index 00000000000..3755c8bbfa5
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_set_null.test
@@ -0,0 +1,82 @@
+# Both of the following tests check that comparison of binlog BI
+# against SE record will not fail due to remains from previous values
+# in the SE record (before a given field was set to null).
+#
+# In MIXED mode:
+# - Insert and update are executed as statements
+# - Delete is executed as a row event
+# - Assertion: checks that comparison will not fail because the update
+# statement will clear the record contents for the nulled
+# field. If data was not cleared, some engines may keep
+# the value and return it later as garbage - despite the
+# fact that field is null. This may cause slave to
+# falsely fail in the comparison (memcmp would fail
+# because of "garbage" in record data).
+#
+# In ROW mode:
+# - Insert, update and delete are executed as row events.
+# - Assertion: checks that comparison will not fail because the update
+# rows event will clear the record contents before
+# feeding the new value to the SE. This protects against
+# SEs that do not clear record contents when storing
+# nulled fields. If the engine did not clear the data it
+# would cause slave to falsely fail in the comparison
+# (memcmp would fail because of "garbage" in record
+# data). This scenario is pretty much the same described
+# above in MIXED mode, but checks different execution
+# path in the slave.
+
+# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on
+# delete cant find record
+
+-- source include/rpl_reset.inc
+
+-- connection master
+-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine
+INSERT INTO `t1` VALUES ( 1, 1 );
+UPDATE t1 SET c1=NULL where c2=1;
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+-- connection master
+# triggers switch to row mode when on mixed
+DELETE FROM t1 WHERE c2=1 LIMIT 1;
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- source include/rpl_reset.inc
+
+-- connection master
+
+# BUG#49482: RBR: Replication may break on deletes when MyISAM tables
+# + char field are used
+
+-- eval CREATE TABLE t1 (c1 CHAR) Engine=$engine
+
+INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
+SELECT * FROM t1;
+UPDATE t1 SET c1=NULL WHERE c1='w';
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+-- connection master
+# triggers switch to row mode when on mixed
+DELETE FROM t1 LIMIT 2;
+-- sync_slave_with_master
+
+-- let $diff_tables= master:t1, slave:t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE t1;
+-- sync_slave_with_master
diff --git a/mysql-test/suite/rpl/include/rpl_show_binlog_events.inc b/mysql-test/suite/rpl/include/rpl_show_binlog_events.inc
new file mode 100644
index 00000000000..4530f8c639a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_show_binlog_events.inc
@@ -0,0 +1,17 @@
+# Include file for rpl_show_relaylog_events.inc
+
+--let $log_type= BINLOG
+if ($is_relay_log) {
+ --let $log_type= RELAYLOG
+}
+--let $args=
+if ($binlog_file != '') {
+ --let $args= IN <FILE>
+}
+if ($binlog_limit) {
+ --let $args= $args LIMIT $binlog_limit
+}
+--echo ******** [$CURRENT_CONNECTION] SHOW $log_type EVENTS $args ********
+--source include/show_events.inc
+
+
diff --git a/mysql-test/suite/rpl/include/rpl_show_log_events_with_varying_options.inc b/mysql-test/suite/rpl/include/rpl_show_log_events_with_varying_options.inc
new file mode 100644
index 00000000000..ce6f094a707
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_show_log_events_with_varying_options.inc
@@ -0,0 +1,11 @@
+# Include file for rpl_show_log_events.inc
+
+--let $binlog_limit=
+--source suite/rpl/include/rpl_show_binlog_events.inc
+--let $binlog_limit= 2
+--source suite/rpl/include/rpl_show_binlog_events.inc
+--let $binlog_limit= 2,4
+--source suite/rpl/include/rpl_show_binlog_events.inc
+--let $binlog_limit=
+--let $binlog_file=
+--source suite/rpl/include/rpl_show_binlog_events.inc
diff --git a/mysql-test/suite/rpl/include/rpl_show_relaylog_events.inc b/mysql-test/suite/rpl/include/rpl_show_relaylog_events.inc
new file mode 100644
index 00000000000..d590eafdc40
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_show_relaylog_events.inc
@@ -0,0 +1,65 @@
+-- connection master
+-- source include/rpl_reset.inc
+
+-- connection master
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+
+# PART I
+#
+# SHOWs contents of binary logs on the master and both, binary and
+# relay logs, on the slave.
+#
+
+--let $is_relay_log= 0
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source suite/rpl/include/rpl_show_log_events_with_varying_options.inc
+
+--sync_slave_with_master
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source suite/rpl/include/rpl_show_log_events_with_varying_options.inc
+
+--let $is_relay_log= 1
+--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+--source suite/rpl/include/rpl_show_log_events_with_varying_options.inc
+
+#
+# PART II
+#
+# Although this second part of the test may seem redudant it is
+# actually needed to assert that SHOW RELAYLOG EVENTS works properly
+# with respect to the ordering of the relay log in relay-log.index.
+#
+# If no file is specified with "IN" then first relay log file in
+# relay-log.index (ie, the oldest one) should be picked and its
+# contents displayed. The same happens for SHOW BINLOG EVENTS, so we
+# show them both. All in all, this is the reason for re-assert after
+# MASTER and SLAVE's FLUSH LOGS operations.
+#
+
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+-- connection master
+FLUSH LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+DROP TABLE t1;
+
+--let $is_relay_log= 0
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source suite/rpl/include/rpl_show_log_events_with_varying_options.inc
+
+--sync_slave_with_master
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source suite/rpl/include/rpl_show_log_events_with_varying_options.inc
+
+--let $is_relay_log= 1
+--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+--source suite/rpl/include/rpl_show_log_events_with_varying_options.inc
+
+
+# clear show_binlog_event/show_relaylog_events parameters
+let $binlog_file= ;
+let $binlog_limit= ;
diff --git a/mysql-test/suite/rpl/include/rpl_skip_replication.inc b/mysql-test/suite/rpl/include/rpl_skip_replication.inc
new file mode 100644
index 00000000000..97fc961d438
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_skip_replication.inc
@@ -0,0 +1,402 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it.
+#
+# Usage:
+#
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --source suite/rpl/include/rpl_skip_replication.inc
+#
+# The script uses MYSQLBINLOG to verify certain results.
+# By default, it uses binary logs directly. If it is undesirable,
+# this behavior can be overridden by setting $use_remote_binlog
+# as shown above.
+# The value will be unset after every execution of the script,
+# so if it is needed, it should be set explicitly before each call.
+#
+
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+connection slave;
+# Test that SUPER is required to change @@replicate_events_marked_for_skip.
+CREATE USER 'nonsuperuser'@'127.0.0.1';
+GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
+ SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
+connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,);
+connection nonpriv;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+disconnect nonpriv;
+connection slave;
+DROP USER'nonsuperuser'@'127.0.0.1';
+
+SELECT @@global.replicate_events_marked_for_skip;
+--error ER_SLAVE_MUST_STOP
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+SELECT @@global.replicate_events_marked_for_skip;
+STOP SLAVE;
+--error ER_GLOBAL_VARIABLE
+SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+START SLAVE;
+
+connection master;
+SELECT @@skip_replication;
+--error ER_LOCAL_VARIABLE
+SET GLOBAL skip_replication=1;
+SELECT @@skip_replication;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t2(a) VALUES (1);
+
+
+# Test that master-side filtering works.
+SET skip_replication=1;
+
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (2);
+INSERT INTO t2(a) VALUES (2);
+
+# Inject a rotate event in the binlog stream sent to slave (otherwise we will
+# fail sync_slave_with_master as the last event on the master is not present
+# on the slave).
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+
+sync_slave_with_master;
+connection slave;
+SHOW TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t3;
+
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+sync_slave_with_master;
+
+
+# Test that slave-side filtering works.
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+
+connection master;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (3);
+INSERT INTO t2(a) VALUES (3);
+
+# Inject a rotate event in the binlog stream sent to slave (otherwise we will
+# fail sync_slave_with_master as the last event on the master is not present
+# on the slave).
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+
+sync_slave_with_master;
+connection slave;
+SHOW TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t3;
+
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+
+
+# Test that events with @@skip_replication=1 are not filtered when filtering is
+# not set on slave.
+connection master;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t3(a) VALUES(2);
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t3;
+connection master;
+DROP TABLE t3;
+
+#
+# Test that the slave will preserve the @@skip_replication flag in its
+# own binlog.
+#
+
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+RESET MASTER;
+
+connection master;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,0);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,0);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,0);
+
+sync_slave_with_master;
+connection slave;
+# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have
+# applied all events.
+SELECT * FROM t1 ORDER by a;
+
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+let $SLAVE_DATADIR= `select @@datadir`;
+
+connection master;
+TRUNCATE t1;
+
+# Now apply the slave binlog to the master, to check that both the slave
+# and mysqlbinlog will preserve the @@skip_replication flag.
+
+--let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001
+ --let $use_remote_mysqlbinlog= 0
+}
+--exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
+
+# The master should have all three events.
+SELECT * FROM t1 ORDER by a;
+
+# The slave should be missing event 2, which is marked with the
+# @@skip_replication flag.
+
+connection slave;
+START SLAVE;
+
+connection master;
+sync_slave_with_master;
+
+connection slave;
+SELECT * FROM t1 ORDER by a;
+
+#
+# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication
+# events.
+#
+
+connection master;
+TRUNCATE t1;
+
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+# We will skip two INSERTs (in addition to any skipped due to
+# @@skip_replication). Since from 5.5 every statement is wrapped in
+# BEGIN ... END, we need to skip 6 events for this.
+SET GLOBAL sql_slave_skip_counter=6;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+
+connection master;
+# Need to fix @@binlog_format to get consistent event count.
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= statement;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,5);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,5);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,5);
+INSERT INTO t1 VALUES (4,5);
+SET binlog_format= @old_binlog_format;
+
+sync_slave_with_master;
+connection slave;
+
+# The slave should have skipped the first three inserts (number 1 and 3 due
+# to @@sql_slave_skip_counter=2, number 2 due to
+# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4
+# should be left.
+SELECT * FROM t1;
+
+
+#
+# Check that BINLOG statement preserves the @@skip_replication flag.
+#
+connection slave;
+# Need row @@binlog_format for BINLOG statements containing row events.
+--source include/stop_slave.inc
+SET @old_slave_binlog_format= @@global.binlog_format;
+SET GLOBAL binlog_format= row;
+--source include/start_slave.inc
+
+connection master;
+TRUNCATE t1;
+
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= row;
+# Format description log event.
+BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAA371saA==';
+# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1
+BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
+# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0
+BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
+SET binlog_format= @old_binlog_format;
+
+SELECT * FROM t1 ORDER BY a;
+sync_slave_with_master;
+connection slave;
+# Slave should have only the second insert, the first should be ignored due to
+# the @@skip_replication flag.
+SELECT * FROM t1 ORDER by a;
+
+--source include/stop_slave.inc
+SET GLOBAL binlog_format= @old_slave_binlog_format;
+--source include/start_slave.inc
+
+
+# Test that it is not possible to change @@skip_replication inside a
+# transaction or statement, thereby replicating only parts of statements
+# or transactions.
+connection master;
+SET skip_replication=0;
+
+BEGIN;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=0;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+ROLLBACK;
+SET skip_replication=1;
+BEGIN;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=0;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+COMMIT;
+SET autocommit=0;
+INSERT INTO t2(a) VALUES(100);
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+ROLLBACK;
+SET autocommit=1;
+
+SET skip_replication=1;
+--delimiter |
+CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
+CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
+CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
+--delimiter ;
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SELECT foo(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SELECT baz(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET @a= foo(1);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET @a= baz(1);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+UPDATE t2 SET b=foo(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+UPDATE t2 SET b=baz(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+INSERT INTO t1 VALUES (101, foo(1));
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+INSERT INTO t1 VALUES (101, baz(0));
+SELECT @@skip_replication;
+CALL bar(0);
+SELECT @@skip_replication;
+CALL bar(1);
+SELECT @@skip_replication;
+DROP FUNCTION foo;
+DROP PROCEDURE bar;
+DROP FUNCTION baz;
+
+
+# Test that master-side filtering happens on the master side, and that
+# slave-side filtering happens on the slave.
+
+# First test that events do not reach the slave when master-side filtering
+# is configured. Do this by replicating first with only the IO thread running
+# and master-side filtering; then change to no filtering and start the SQL
+# thread. This should still skip the events, as master-side filtering
+# means the events never reached the slave.
+connection master;
+SET skip_replication= 0;
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+START SLAVE IO_THREAD;
+connection master;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+--source include/save_master_pos.inc
+connection slave;
+--source include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+connection slave;
+# Now only the second insert of (2) should be visible, as the first was
+# filtered on the master, so even though the SQL thread ran without skipping
+# events, it will never see the event in the first place.
+SELECT * FROM t1;
+
+# Now tests that when slave-side filtering is configured, events _do_ reach
+# the slave.
+connection master;
+SET skip_replication= 0;
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE IO_THREAD;
+connection master;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+--source include/save_master_pos.inc
+connection slave;
+--source include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+connection slave;
+# Now both inserts should be visible. Since filtering was configured to be
+# slave-side, the event is in the relay log, and when the SQL thread ran we
+# had disabled filtering again.
+SELECT * FROM t1 ORDER BY a;
+
+
+# Clean up.
+connection master;
+SET skip_replication=0;
+DROP TABLE t1,t2;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_special_charset.inc b/mysql-test/suite/rpl/include/rpl_special_charset.inc
new file mode 100644
index 00000000000..641aa483d32
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_special_charset.inc
@@ -0,0 +1,32 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+################################################################################
+# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
+# Problem: IO thread fails to connect to master if servers are configured with
+# special character sets like utf16, utf32, ucs2.
+#
+# Analysis: MySQL server does not support few special character sets like
+# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
+# When IO thread is trying to connect to Master, it sets server's character
+# set as client's character set. When Slave server is started with these
+# special character sets, IO thread (a connection to Master) fails because
+# of the above said reason.
+#
+# Fix: If server's character set is not supported as client's character set,
+# then set default's client character set(latin1) as client's character set.
+###############################################################################
+--source include/master-slave.inc
+call mtr.add_suppression("'utf16' can not be used as client character set");
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+--sync_slave_with_master
+--let diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_sporadic_master.inc b/mysql-test/suite/rpl/include/rpl_sporadic_master.inc
new file mode 100644
index 00000000000..ad4c44cbf74
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_sporadic_master.inc
@@ -0,0 +1,32 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# test to see if replication can continue when master sporadically fails on
+# COM_BINLOG_DUMP and additionally limits the number of events per dump
+
+source include/master-slave.inc;
+
+create table t2(n int);
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (NULL),(NULL);
+truncate table t1;
+# We have to use 4 in the following to make this test work with all table types
+insert into t1 values (4),(NULL);
+sync_slave_with_master;
+--source include/stop_slave.inc
+--source include/start_slave.inc
+connection master;
+insert into t1 values (NULL),(NULL);
+flush logs;
+truncate table t1;
+insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
+sync_slave_with_master;
+select * from t1 ORDER BY n;
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_ssl.inc b/mysql-test/suite/rpl/include/rpl_ssl.inc
new file mode 100644
index 00000000000..aff5499c8e5
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_ssl.inc
@@ -0,0 +1,115 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/have_ssl_communication.inc;
+source include/master-slave.inc;
+
+# create a user for replication that requires ssl encryption
+connection master;
+create user replssl@localhost;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+
+sync_slave_with_master;
+
+# Set slave to use SSL for connection to master
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to
+ master_user='replssl',
+ master_password='',
+ master_ssl=1,
+ master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
+ master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
+ master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
+start slave;
+
+# Switch to master and insert one record, then sync it to slave
+connection master;
+insert into t1 values(1);
+sync_slave_with_master;
+
+# The record should now be on slave
+select * from t1;
+
+# The slave is synced and waiting/reading from master
+# SHOW SLAVE STATUS will show "Waiting for master to send event"
+let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key;
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
+# Stop the slave, as reported in bug#21871 it would hang
+STOP SLAVE;
+
+select * from t1;
+
+# Do the same thing a number of times
+disable_query_log;
+disable_result_log;
+# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
+# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
+# red trees.
+disable_parsing;
+let $i= 100;
+while ($i)
+{
+ start slave;
+ connection master;
+ insert into t1 values (NULL);
+ select * from t1; # Some variance
+ connection slave;
+ select * from t1; # Some variance
+ stop slave;
+ dec $i;
+}
+enable_parsing;
+START SLAVE;
+enable_query_log;
+enable_result_log;
+connection master;
+# INSERT one more record to make sure
+# the sync has something to do
+insert into t1 values (NULL);
+let $master_count= `select count(*) from t1`;
+
+sync_slave_with_master;
+--source include/wait_for_slave_to_start.inc
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
+let $slave_count= `select count(*) from t1`;
+
+if ($slave_count != $master_count)
+{
+ echo master and slave differed in number of rows;
+ echo master: $master_count;
+ echo slave: $slave_count;
+
+ connection master;
+ select count(*) t1;
+ select * from t1;
+ connection slave;
+ select count(*) t1;
+ select * from t1;
+ query_vertical show slave status;
+}
+
+connection master;
+drop user replssl@localhost;
+drop table t1;
+sync_slave_with_master;
+
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_user = 'root',
+ master_ssl = 0,
+ master_ssl_ca = '',
+ master_ssl_cert = '',
+ master_ssl_key = '';
+
+--echo End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_start_stop_slave.test b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test
new file mode 100644
index 00000000000..32f33b2a31d
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_start_stop_slave.test
@@ -0,0 +1,216 @@
+# Slow test, don't run during staging part
+source include/not_staging.inc;
+
+#
+# Bug#6148 ()
+#
+# Let the master do lots of insertions
+
+connection master;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+connection slave;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+connection master;
+create table t1(n int);
+sync_slave_with_master;
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+connection master;
+let $1=2500;
+disable_query_log;
+while ($1)
+{
+ eval insert into t1 values($1);
+ dec $1;
+}
+enable_query_log;
+save_master_pos;
+
+connection slave;
+start slave;
+let $wait_condition= SELECT COUNT(*) > 0 FROM t1;
+source include/wait_condition.inc;
+stop slave io_thread;
+start slave io_thread;
+source include/wait_for_slave_to_start.inc;
+sync_with_master;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+
+#
+# Bug#38205 Row-based Replication (RBR) causes inconsistencies...
+# Bug#319 if while a non-transactional slave is replicating a transaction...
+#
+# Verifying that STOP SLAVE does not interrupt excution of a group
+# execution of events if the group can not roll back.
+# Killing the sql thread continues to provide a "hard" stop (the
+# part II, moved to the bugs suite as it's hard to make it
+# deterministic with KILL).
+#
+
+#
+# Part I. The being stopped sql thread finishes first the current group of
+# events if the group contains an event on a non-transaction table.
+
+connection master;
+create table t1i(n int primary key) engine=innodb;
+create table t2m(n int primary key) engine=myisam;
+begin;
+insert into t1i values (1);
+insert into t1i values (2);
+insert into t1i values (3);
+commit;
+
+sync_slave_with_master;
+connection slave;
+begin;
+insert into t1i values (5);
+
+connection master;
+let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+begin;
+insert into t1i values (4);
+insert into t2m values (1); # non-ta update to process
+insert into t1i values (5); # to block at. to be played with stopped
+commit;
+
+connection slave;
+# slave sql thread must be locked out by the conn `slave' explicit lock
+let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval select $pos0_master - $pos0_slave as zero;
+--enable_query_log
+
+connection slave1;
+let $count= 1;
+let $table= t2m;
+source include/wait_until_rows_count.inc;
+send stop slave;
+
+connection slave;
+rollback; # release the sql thread
+
+connection slave1;
+reap;
+source include/wait_for_slave_to_stop.inc;
+let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+--echo *** sql thread is *not* running: $sql_status ***
+
+
+connection master;
+let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+
+let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+
+--echo *** the prove: the stopped slave has finished the current transaction ***
+
+--disable_query_log
+select count(*) as five from t1i;
+eval select $pos1_master - $pos1_slave as zero;
+eval select $pos1_slave > $pos0_slave as one;
+--enable_query_log
+
+source include/start_slave.inc;
+
+# clean-up
+connection master;
+drop table t1i, t2m;
+
+sync_slave_with_master;
+
+--echo #
+--echo # Bug#56096 STOP SLAVE hangs if executed in parallel with user sleep
+--echo #
+
+--connection master
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT );
+
+sync_slave_with_master;
+
+--connection slave1
+--echo # lock table for synchronization
+LOCK TABLES t1 WRITE;
+
+--connection master
+--echo # insert into the table
+INSERT INTO t1 SELECT SLEEP(4);
+
+--connection slave
+--echo # Slave: wait for the insert
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE STATE = "Waiting for table metadata lock"
+ AND INFO = "INSERT INTO t1 SELECT SLEEP(4)";
+--source include/wait_condition.inc
+
+--echo # send slave stop
+--send STOP SLAVE
+
+--connection slave1
+--echo # wait for stop slave
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE INFO = "STOP SLAVE";
+--source include/wait_condition.inc
+
+--echo # Slave1: unlock the table
+UNLOCK TABLES;
+
+--connection slave
+--echo # wait for the slave to stop
+--reap
+--source include/wait_for_slave_to_stop.inc
+
+--echo # Start slave again
+--source include/start_slave.inc
+
+--echo # Clean up
+--connection master
+DROP TABLE t1;
+sync_slave_with_master;
+
+#
+# bug#3593869-64035 attempt to read a member of event_coordinates
+# referenced by NULL pointer crashes server.
+# Testing how out of valid range position value is handled with an error.
+#
+
+--connection master
+RESET MASTER;
+let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+let $master_pos= `SELECT $master_pos + 1`;
+
+--connection slave
+--source include/stop_slave.inc
+--replace_regex /[0-9]+/MASTER_POS/
+eval CHANGE MASTER TO master_log_pos=$master_pos;
+
+START SLAVE;
+# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+--let $slave_param=Last_IO_Errno
+--let $slave_param_value=1236
+--source include/wait_for_slave_param.inc
+
+--let $slave_field_result_replace= / at [0-9]*/ at XXX/
+--let $status_items= Last_IO_Errno, Last_IO_Error
+--source include/show_slave_status.inc
+
+--source include/stop_slave.inc
+RESET SLAVE;
+
+--connection master
+RESET MASTER;
+
+# Slave is stopped by bug#3593869-64035 tests.
diff --git a/mysql-test/suite/rpl/include/rpl_stm_EE_err2.test b/mysql-test/suite/rpl/include/rpl_stm_EE_err2.test
new file mode 100644
index 00000000000..2f4435357ff
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_stm_EE_err2.test
@@ -0,0 +1,41 @@
+###################################
+# Author: JBM
+# Date: 2006-01-11
+# Purpose: Second test case from
+# rpl_EE_err.test split out
+# from orginal to make the
+# first work with both RBR and SBR
+###################################
+#REQUIREMENT: An INSERT with a faked duplicate entry error on
+#master should be replicated to slave and force the slave to stop
+#(since the slave can't cause a faked error to re-occur).
+###################################
+
+-- source include/master-slave.inc
+
+connection master;
+eval create table t1 (a int, unique(a)) engine=$engine_type;
+set sql_log_bin=0;
+insert into t1 values(2);
+set sql_log_bin=1;
+
+--error ER_DUP_ENTRY
+insert into t1 values(1),(2);
+drop table t1;
+
+connection slave;
+--source include/wait_for_slave_sql_to_stop.inc
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* error.* 0");
+let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+--echo Error: "$error" (expected different error codes on master and slave)
+--echo Errno: "$errno" (expected 0)
+drop table t1;
+--source include/stop_slave.inc
+# Clear error messages.
+RESET SLAVE;
+
+# End of 4.1 tests
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_stm_create_if_not_exists.test b/mysql-test/suite/rpl/include/rpl_stm_create_if_not_exists.test
new file mode 100644
index 00000000000..cecbd45c02a
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_stm_create_if_not_exists.test
@@ -0,0 +1,268 @@
+--echo
+--echo
+connection master;
+
+if ($is_temporary)
+{
+ --let $_temporary=TEMPORARY
+}
+
+CREATE TABLE t2(c1 INT, c2 char(10));
+INSERT INTO t2 VALUES(1, 'abc'), (2, 'abc');
+
+--echo
+--echo # The original query should be binlogged if the table does not exist.
+--echo # ------------------------------------------------------------------
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1 (c1 INT , c2 INT, c3 char(10), c4 INT KEY)
+ SELECT 'abc' AS c3, 1 AS c4;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # The statement should be binlogged as two events. one is
+--echo # 'CREATE $_temporary TABLE IF NOT EXISTS ..', another one is
+--echo # 'INSERT ... SELECT'.
+--echo # ------------------------------------------------------------------
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT 'abc', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # Verify if it can be binlogged with right database name when the table
+--echo # is not in the default database
+--echo
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+CREATE DATABASE db1;
+USE db1;
+
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS test.t1
+ SELECT 'abc', 20;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:test.t1,slave:test.t1
+ --source include/diff_tables.inc
+}
+USE test;
+DROP DATABASE db1;
+
+--echo
+--echo # It should be binlogged as 'REPLACE ... SELECT'
+--echo # if the original statement has option REPLACE
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ REPLACE SELECT '123', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # It should be binlogged as 'INSERT IGNORE... SELECT'
+--echo # if the original statement has option IGNORE
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ IGNORE SELECT '123', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # Nothing should be binlogged if error happens and no any row is inserted
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+--error ER_DUP_ENTRY
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT '123', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # Verify it can binlog well when there are some braces('(')
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ (SELECT '123', 3) UNION (SELECT '123', 4);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ REPLACE (SELECT 'abc', 3) UNION (SELECT 'abc', 4);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ IGNORE (SELECT '123', 3) UNION (SELECT '123', 4);
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+if (!$is_temporary)
+{
+ --echo
+ --echo # Throw a warning that table already exists and don't insert anything
+ --echo
+ CREATE VIEW t3 AS SELECT * FROM t2;
+ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+ CREATE TABLE IF NOT EXISTS t3
+ SELECT '123', 2;
+ source include/show_binlog_events.inc;
+ DROP VIEW t3;
+}
+
+--echo
+--echo # The statement can be binlogged correctly when it is in a SP/EVENT/TRIGGER
+--echo
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+eval CREATE PROCEDURE p1(IN a INT)
+ CREATE $_temporary TABLE IF NOT EXISTS t1 SELECT '123', a;
+
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+call p1(500);
+call p1(600);
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+DROP PROCEDURE p1;
+
+--echo
+--echo # The statement can be binlogged correctly when it is in a prepared statement
+--echo
+eval PREPARE stm FROM "CREATE $_temporary TABLE IF NOT EXISTS t1 SELECT '123', ?";
+
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+SET @a= 700;
+EXECUTE stm USING @a;
+SET @a= 800;
+EXECUTE stm USING @a;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # The statement can be binlogged correctly when it is in a conditional comment
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo # The whole statement in a conditional comment
+eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT 'abc', 900*/;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # There is an long comment before SELECT
+eval /*!CREATE $_temporary /*blabla*/ TABLE IF NOT EXISTS t1
+ SELECT 'abc', 901*/;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Conditional comment starts just from SELECT
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ /*!SELECT 'abc',*/ 902;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Only SELECT keyword is in the conditional comment
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ /*!SELECT*/ /*!'abc',*/ 904;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Conditional comment is after SELECT keyword
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT /*!'abc',*/ 903;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Conditional comment ends just before SELECT keyword
+eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
+ */SELECT 'abc', 905;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+DROP TABLE t2;
+eval DROP $_temporary TABLE t1;
+
diff --git a/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc b/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc
new file mode 100644
index 00000000000..41339f539f8
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc
@@ -0,0 +1,107 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# BUG#12400313 / BUG#64503 test case
+#
+#
+# Description
+# -----------
+#
+# This test case starts the slave server with:
+# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
+#
+# Then it issues some queries that will cause the slave to reach
+# relay-log-space-limit. We lock the table so that the SQL thread is
+# not able to purge the log and then we issue some more statements.
+#
+# The purpose is to show that the IO thread will honor the limits
+# while the SQL thread is not able to purge the relay logs, which did
+# not happen before this patch. In addition we assert that while
+# ignoring the limit (SQL thread needs to rotate before purging), the
+# IO thread does not do it in an uncontrolled manner.
+
+--source include/have_binlog_format_statement.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--disable_query_log
+CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
+
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+
+--sync_slave_with_master
+
+# wait for the SQL thread to sleep
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
+--source include/wait_show_condition.inc
+
+# now the io thread has set rli->ignore_space_limit
+# lets lock the table so that once the SQL thread awakes
+# it blocks there and does not set rli->ignore_space_limit
+# back to zero
+LOCK TABLE t1 WRITE;
+
+# now issue more statements that will overflow the
+# rli->log_space_limit (in this case ~10K)
+--connection master
+
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+
+--connection slave
+
+# ASSERT that the IO thread waits for the SQL thread to release some
+# space before continuing
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= LIKE 'Waiting for %'
+# before the patch (IO would have transfered everything)
+#--let $condition= = 'Waiting for master to send event'
+# after the patch (now it waits for space to be freed)
+#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
+--source include/wait_show_condition.inc
+
+# without the patch we can uncomment the following two lines and
+# watch the IO thread synchronize with the master, thus writing
+# relay logs way over the space limit
+#--connection master
+#--source include/sync_slave_io_with_master.inc
+
+## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
+--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
+--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
+--let $assert_text= Assert that relay log space is close to the limit
+--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
+--source include/assert.inc
+
+# unlock the table and let SQL thread continue applying events
+UNLOCK TABLES;
+
+--connection master
+--sync_slave_with_master
+--let $diff_tables=master:test.t1,slave:test.t1
+--source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+--enable_query_log
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_stop_middle_group.test b/mysql-test/suite/rpl/include/rpl_stop_middle_group.test
new file mode 100644
index 00000000000..ac01fb04d16
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_stop_middle_group.test
@@ -0,0 +1,148 @@
+# Proving that stopping in the middle of applying a group of events
+# does not have immediate effect if a non-transaction table has been changed.
+# The slave sql thread has to try to finish applying first.
+# The tests rely on simulation of the killed status.
+# The matter of testing correlates to some of `rpl_start_stop_slave' that does
+# not require `have_debug'.
+
+connection master;
+
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+create table tm (a int auto_increment primary key) engine=myisam;
+create table ti (a int auto_increment primary key) engine=innodb;
+
+sync_slave_with_master;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+set @@global.debug_dbug="d,stop_slave_middle_group";
+
+connection master;
+
+begin;
+insert into ti set a=null;
+insert into tm set a=null; # to simulate killed status on the slave
+commit;
+
+connection slave;
+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");
+call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes");
+
+# slave will catch the killed status but won't shut down immediately
+# only after the whole group has done (commit)
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+# checking: no error and the group is finished
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $read = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1);
+let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT $read = $exec into @check;
+--enable_query_log
+eval SELECT "NO$error" AS Last_SQL_Error, @check as `true`;
+select count(*) as one from tm;
+select count(*) as one from ti;
+
+set @@global.debug_dbug=@saved_dbug;
+
+#
+# bug#45940 issues around rli->last_event_start_time
+# Testing of slave stopped after it had waited (in vain) for
+# the group be finished.
+# It could not be finished because of simulation of failure to
+# receive the terminal part
+# The test relay on simulation of the incomplete group in the relay log
+
+# Two cases are verified: a mixed transacton and a mixed multi-table update.
+#
+# The mixed transacton.
+#
+source include/start_slave.inc;
+
+connection master;
+
+truncate table tm; # cleanup of former tests
+truncate table ti;
+
+#connection slave;
+sync_slave_with_master;
+
+set @@global.debug_dbug="d,stop_slave_middle_group,incomplete_group_in_relay_log";
+
+connection master;
+
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+
+connection slave;
+
+# slave will catch the killed status, won't shut down immediately
+# but does it eventually having the whole group unfinished (not committed)
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+# checking: the error and group unfinished
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $read = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1);
+let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT $read - $exec > 0 into @check;
+--enable_query_log
+eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
+select count(*) as one from tm;
+select count(*) as zero from ti;
+
+set @@global.debug_dbug=@saved_dbug;
+
+#
+# The mixed multi-table update
+#
+stop slave;
+truncate table tm;
+source include/start_slave.inc;
+
+connection master;
+
+#connection slave;
+sync_slave_with_master;
+set @@global.debug_dbug="d,stop_slave_middle_group,incomplete_group_in_relay_log";
+
+connection master;
+update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
+
+connection slave;
+
+# slave will catch the killed status, won't shut down immediately
+# but does it eventually having the whole group unfinished (not committed)
+#
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+# checking: the error and group unfinished
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $read = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1);
+let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT $read - $exec > 0 into @check;
+--enable_query_log
+eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
+select max(a) as two from tm;
+select max(a) as one from ti;
+
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+#
+# clean-up
+#
+
+# the sql thread has an error, so reset replication state
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+
+connection master;
+drop table tm, ti;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/include/rpl_stop_slave.test b/mysql-test/suite/rpl/include/rpl_stop_slave.test
new file mode 100644
index 00000000000..12f99ed12ea
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_stop_slave.test
@@ -0,0 +1,56 @@
+#
+# Auxiliary file which is used to test BUG#56118
+#
+# Slave should apply all statements in the transaction before stop if any
+# temporary table is created or dropped.
+#
+# USEAGE:
+# --let $tmp_table_stm= a SQL statement
+# --source suite/rpl/include/rpl_stop_slave.test
+#
+
+if (!$tmp_table_stm)
+{
+ --echo \$tmp_table_stm is NULL
+ --die $tmp_table_stm is NULL
+}
+
+connection master;
+BEGIN;
+DELETE FROM t1;
+eval $tmp_table_stm;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+connection slave;
+
+# To check if slave SQL thread is applying INSERT statement
+let $show_statement= SHOW PROCESSLIST;
+let $field= Info;
+let $condition= LIKE 'INSERT%';
+source include/wait_show_condition.inc;
+
+send STOP SLAVE SQL_THREAD;
+
+connection slave1;
+--echo # To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
+SET DEBUG_SYNC= 'RESET';
+
+connection slave;
+reap;
+source include/wait_for_slave_sql_to_stop.inc;
+
+--echo # Slave should stop after the transaction has committed.
+--echo # So t1 on master is same to t1 on slave.
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+connection slave;
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_to_start.inc;
+
+connection master;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_sv_relay_space.test b/mysql-test/suite/rpl/include/rpl_sv_relay_space.test
new file mode 100644
index 00000000000..6edbbf68266
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_sv_relay_space.test
@@ -0,0 +1,24 @@
+source include/master-slave.inc;
+
+#
+# Bug#7100 relay_log_space_max missing from SHOW VARIABLES
+#
+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.
+
+eval CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=$engine_type;
+INSERT INTO t1 SET name='Andy', age=31;
+INSERT INTO t1 SET name='Jacob', age=2;
+INSERT INTO t1 SET name='Caleb', age=1;
+ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY,
+ ALGORITHM=COPY;
+SELECT * FROM t1 ORDER BY id;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY id;
+connection master;
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
new file mode 100644
index 00000000000..31b80732c60
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
@@ -0,0 +1,633 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# rpl_switch_stm_row_mixed tests covers
+#
+# - Master is switching explicitly between STATEMENT, ROW, and MIXED
+# binlog format showing when it is possible and when not.
+# - Master switching from MIXED to RBR implicitly listing all use
+# cases, e.g a query invokes UUID(), thereafter to serve as the
+# definition of MIXED binlog format
+# - correctness of execution
+
+
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+
+# Since this test generates row-based events in the binary log, the
+# slave SQL thread cannot be in STATEMENT mode to execute this test,
+# so we only execute it for MIXED and ROW as default value of
+# BINLOG_FORMAT.
+
+connection slave;
+
+connection master;
+--disable_warnings
+drop database if exists mysqltest1;
+create database mysqltest1;
+--enable_warnings
+use mysqltest1;
+
+# Save binlog format
+set @my_binlog_format= @@global.binlog_format;
+
+# play with switching
+set session binlog_format=mixed;
+show session variables like "binlog_format%";
+set session binlog_format=statement;
+show session variables like "binlog_format%";
+set session binlog_format=row;
+show session variables like "binlog_format%";
+
+set global binlog_format=DEFAULT;
+show global variables like "binlog_format%";
+set global binlog_format=MIXED;
+show global variables like "binlog_format%";
+set global binlog_format=STATEMENT;
+show global variables like "binlog_format%";
+set global binlog_format=ROW;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+
+CREATE TABLE t1 (a varchar(100));
+
+prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+set @string="emergency_1_";
+insert into t1 values("work_2_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_3_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_4_",UUID()));
+insert into t1 select "yesterday_5_";
+
+# verify that temp tables prevent a switch to SBR
+create temporary table tmp(a char(100));
+insert into tmp values("see_6_");
+--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
+set binlog_format=statement;
+insert into t1 select * from tmp;
+drop temporary table tmp;
+
+# Now we go to SBR
+set binlog_format=statement;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+set global binlog_format=statement;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_7_";
+insert into t1 values("work_8_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_9_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values("for_10_");
+insert into t1 select "yesterday_11_";
+
+# test statement (is not default after wl#3368)
+set binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+set global binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_12_";
+insert into t1 values("work_13_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_14_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values("for_15_");
+insert into t1 select "yesterday_16_";
+
+# and now the mixed mode
+
+set global binlog_format=mixed;
+select @@global.binlog_format, @@session.binlog_format;
+set binlog_format=default;
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+set @string="emergency_17_";
+insert into t1 values("work_18_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_19_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_20_",UUID()));
+insert into t1 select "yesterday_21_";
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_22_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_23_",UUID()));
+insert into t1 select "yesterday_24_";
+
+# Test of CREATE TABLE SELECT
+
+create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
+create table t3 select 1 union select UUID();
+--disable_warnings
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+--enable_warnings
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
+create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
+# what if UUID() is first:
+--disable_warnings
+insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+--enable_warnings
+
+# inside a stored procedure
+
+delimiter |;
+create procedure foo()
+begin
+insert into t1 values("work_25_");
+insert into t1 values(concat("for_26_",UUID()));
+insert into t1 select "yesterday_27_";
+end|
+create procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end|
+create function foo3() returns bigint unsigned
+begin
+ set session binlog_format=row; # rejected for stored funcs
+ insert into t1 values("alarm");
+ return 100;
+end|
+create procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end|
+delimiter ;|
+call foo();
+call foo2();
+call foo4("hello");
+call foo4(UUID());
+call foo4("world");
+
+# test that can't SET in a stored function
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
+select foo3();
+select * from t1 where a="alarm";
+
+# Tests of stored functions/triggers/views for BUG#20930 "Mixed
+# binlogging mode does not work with stored functions, triggers,
+# views"
+
+# Function which calls procedure
+drop function foo3;
+delimiter |;
+create function foo3() returns bigint unsigned
+begin
+ insert into t1 values("foo3_32_");
+ call foo();
+ return 100;
+end|
+delimiter ;|
+insert into t2 select foo3();
+
+prepare stmt1 from 'insert into t2 select foo3()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# Test if stored function calls stored function which calls procedure
+# which requires row-based.
+
+delimiter |;
+create function foo4() returns bigint unsigned
+begin
+ insert into t2 select foo3();
+ return 100;
+end|
+delimiter ;|
+select foo4();
+
+prepare stmt1 from 'select foo4()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# A simple stored function
+delimiter |;
+create function foo5() returns bigint unsigned
+begin
+ insert into t2 select UUID();
+ return 100;
+end|
+delimiter ;|
+select foo5();
+
+prepare stmt1 from 'select foo5()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# A simple stored function where UUID() is in the argument
+delimiter |;
+create function foo6(x varchar(100)) returns bigint unsigned
+begin
+ insert into t2 select x;
+ return 100;
+end|
+delimiter ;|
+select foo6("foo6_1_");
+select foo6(concat("foo6_2_",UUID()));
+
+prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+
+# Test of views using UUID()
+
+create view v1 as select uuid();
+create table t11 (data varchar(255));
+insert into t11 select * from v1;
+# Test of querying INFORMATION_SCHEMA which parses the view's body,
+# to verify that it binlogs statement-based (is not polluted by
+# the parsing of the view's body).
+insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
+prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# Test of triggers with UUID()
+delimiter |;
+create trigger t11_bi before insert on t11 for each row
+begin
+ set NEW.data = concat(NEW.data,UUID());
+end|
+delimiter ;|
+insert into t11 values("try_560_");
+
+# Test that INSERT DELAYED works in mixed mode (BUG#20649)
+insert delayed into t2 values("delay_1_");
+insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values("delay_6_");
+
+# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
+# replicate fine in statement-based ; we test that in mixed mode it
+# works).
+insert delayed into t2 values(rand());
+set @a=2.345;
+insert delayed into t2 values(@a);
+
+# With INSERT DELAYED, rows are written to the binlog after they are
+# written to the table. Therefore, it is not enough to wait until the
+# rows make it to t2 on the master (the rows may not be in the binlog
+# at that time, and may still not be in the binlog when
+# sync_slave_with_master is later called). Instead, we wait until the
+# rows make it to t2 on the slave. We first call
+# sync_slave_with_master, so that we are sure that t2 has been created
+# on the slave.
+sync_slave_with_master;
+let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2;
+--source include/wait_condition.inc
+connection master;
+
+# If you want to do manual testing of the mixed mode regarding UDFs (not
+# testable automatically as quite platform- and compiler-dependent),
+# you just need to set the variable below to 1, and to
+# "make udf_example.so" in sql/, and to copy sql/udf_example.so to
+# MYSQL_TEST_DIR/lib/mysql.
+let $you_want_to_test_UDF=0;
+if ($you_want_to_test_UDF)
+{
+ CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
+ prepare stmt1 from 'insert into t1 select metaphon(?)';
+ set @string="emergency_133_";
+ insert into t1 values("work_134_");
+ execute stmt1 using @string;
+ deallocate prepare stmt1;
+ prepare stmt1 from 'insert into t1 select ?';
+ insert into t1 values(metaphon("work_135_"));
+ execute stmt1 using @string;
+ deallocate prepare stmt1;
+ insert into t1 values(metaphon("for_136_"));
+ insert into t1 select "yesterday_137_";
+ create table t6 select metaphon("for_138_");
+ create table t7 select 1 union select metaphon("for_139_");
+ create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3);
+ create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
+}
+
+create table t20 select * from t1; # save for comparing later
+create table t21 select * from t2;
+create table t22 select * from t3;
+drop table t1,t2,t3;
+
+# This tests the fix to
+# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog
+# We verify that under the mixed binlog mode, a stored function
+# modifying at least two tables having an auto_increment column,
+# is binlogged row-based. Indeed in statement-based binlogging,
+# only the auto_increment value generated for the first table
+# is recorded in the binlog, the value generated for the 2nd table
+# lacking.
+
+create table t1 (a int primary key auto_increment, b varchar(100));
+create table t2 (a int primary key auto_increment, b varchar(100));
+create table t3 (b varchar(100));
+delimiter |;
+create function f (x varchar(100)) returns int deterministic
+begin
+ insert into t1 values(null,x);
+ insert into t2 values(null,x);
+ return 1;
+end|
+delimiter ;|
+select f("try_41_");
+# Two operations which compensate each other except that their net
+# effect is that they advance the auto_increment counter of t2 on slave:
+sync_slave_with_master;
+use mysqltest1;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+
+connection master;
+# this is the call which didn't replicate well
+select f("try_42_");
+sync_slave_with_master;
+
+# now use prepared statement and test again, just to see that the RBB
+# mode isn't set at PREPARE but at EXECUTE.
+
+insert into t2 values(3,null),(4,null);
+delete from t2 where a>=3;
+
+connection master;
+prepare stmt1 from 'select f(?)';
+set @string="try_43_";
+insert into t1 values(null,"try_44_"); # should be SBB
+execute stmt1 using @string; # should be RBB
+deallocate prepare stmt1;
+sync_slave_with_master;
+
+# verify that if only one table has auto_inc, it does not trigger RBB
+# (we'll check in binlog further below)
+
+connection master;
+create table t12 select * from t1; # save for comparing later
+drop table t1;
+create table t1 (a int, b varchar(100), key(a));
+select f("try_45_");
+
+# restore table's key
+create table t13 select * from t1;
+drop table t1;
+create table t1 (a int primary key auto_increment, b varchar(100));
+
+# now test if it's two functions, each of them inserts in one table
+
+drop function f;
+# we need a unique key to have sorting of rows by mysqldump
+create table t14 (unique (a)) select * from t2;
+truncate table t2;
+delimiter |;
+create function f1 (x varchar(100)) returns int deterministic
+begin
+ insert into t1 values(null,x);
+ return 1;
+end|
+create function f2 (x varchar(100)) returns int deterministic
+begin
+ insert into t2 values(null,x);
+ return 1;
+end|
+delimiter ;|
+select f1("try_46_"),f2("try_47_");
+
+sync_slave_with_master;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+
+connection master;
+# Test with SELECT and INSERT
+select f1("try_48_"),f2("try_49_");
+insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
+sync_slave_with_master;
+
+# verify that if f2 does only read on an auto_inc table, this does not
+# switch to RBB
+connection master;
+drop function f2;
+delimiter |;
+create function f2 (x varchar(100)) returns int deterministic
+begin
+ declare y int;
+ insert into t1 values(null,x);
+ set y = (select count(*) from t2);
+ return y;
+end|
+delimiter ;|
+select f1("try_53_"),f2("try_54_");
+sync_slave_with_master;
+
+# And now, a normal statement with a trigger (no stored functions)
+
+connection master;
+drop function f2;
+delimiter |;
+create trigger t1_bi before insert on t1 for each row
+begin
+ insert into t2 values(null,"try_55_");
+end|
+delimiter ;|
+insert into t1 values(null,"try_56_");
+# and now remove one auto_increment and verify SBB
+alter table t1 modify a int, drop primary key;
+insert into t1 values(null,"try_57_");
+sync_slave_with_master;
+
+# Test for BUG#20499 "mixed mode with temporary table breaks binlog"
+# Slave used to have only 2 rows instead of 3.
+connection master;
+CREATE TEMPORARY TABLE t15 SELECT UUID();
+create table t16 like t15;
+INSERT INTO t16 SELECT * FROM t15;
+# we'll verify that this one is done RBB
+insert into t16 values("try_65_");
+drop table t15;
+# we'll verify that this one is done SBB
+insert into t16 values("try_66_");
+sync_slave_with_master;
+
+# and now compare:
+
+connection master;
+
+# first check that data on master is sensible
+select count(*) from t1;
+select count(*) from t2;
+select count(*) from t3;
+select count(*) from t4;
+select count(*) from t5;
+select count(*) from t11;
+select count(*) from t20;
+select count(*) from t21;
+select count(*) from t22;
+select count(*) from t12;
+select count(*) from t13;
+select count(*) from t14;
+select count(*) from t16;
+if ($you_want_to_test_UDF)
+{
+ select count(*) from t6;
+ select count(*) from t7;
+ select count(*) from t8;
+ select count(*) from t9;
+}
+
+sync_slave_with_master;
+
+#
+# Bug#20863 If binlog format is changed between update and unlock of
+# tables, wrong binlog
+#
+
+connection master;
+DROP TABLE IF EXISTS t11;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t11 (song VARCHAR(255));
+LOCK TABLES t11 WRITE;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
+UNLOCK TABLES;
+
+--query_vertical SELECT * FROM t11
+sync_slave_with_master;
+USE mysqltest1;
+--query_vertical SELECT * FROM t11
+
+connection master;
+DROP TABLE IF EXISTS t12;
+SET SESSION BINLOG_FORMAT=MIXED;
+CREATE TABLE t12 (data LONG);
+LOCK TABLES t12 WRITE;
+INSERT INTO t12 VALUES(UUID());
+UNLOCK TABLES;
+sync_slave_with_master;
+
+#
+# BUG#28086: SBR of USER() becomes corrupted on slave
+#
+
+connection master;
+
+# Just to get something that is non-trivial, albeit still simple, we
+# stuff the result of USER() and CURRENT_USER() into a variable.
+--delimiter $$
+CREATE FUNCTION my_user()
+ RETURNS CHAR(64)
+BEGIN
+ DECLARE user CHAR(64);
+ SELECT USER() INTO user;
+ RETURN user;
+END $$
+--delimiter ;
+
+--delimiter $$
+CREATE FUNCTION my_current_user()
+ RETURNS CHAR(64)
+BEGIN
+ DECLARE user CHAR(64);
+ SELECT CURRENT_USER() INTO user;
+ RETURN user;
+END $$
+--delimiter ;
+
+DROP TABLE IF EXISTS t13;
+CREATE TABLE t13 (data CHAR(64));
+INSERT INTO t13 VALUES (USER());
+INSERT INTO t13 VALUES (my_user());
+INSERT INTO t13 VALUES (CURRENT_USER());
+INSERT INTO t13 VALUES (my_current_user());
+
+sync_slave_with_master;
+
+# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+
+# Let's compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching
+
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+
+connection master;
+
+# Now test that mysqlbinlog works fine on a binlog generated by the
+# mixed mode
+
+# BUG#11312 "DELIMITER is not written to the binary log that causes
+# syntax error" makes that mysqlbinlog will fail if we pass it the
+# text of queries; this forces us to use --base64-output here.
+
+# BUG#20929 "BINLOG command causes invalid free plus assertion
+# failure" makes mysqld segfault when receiving --base64-output
+
+# So I can't enable this piece of test
+# SIGH
+
+if ($enable_when_11312_or_20929_fixed)
+{
+--exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
+drop database mysqltest1;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
+# the old mysqldump output on slave is the same as what it was on
+# master before restoring on master.
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+}
+
+drop database mysqltest1;
+sync_slave_with_master;
+
+connection master;
+# Restore binlog format setting
+set global binlog_format =@my_binlog_format;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_sync_test.inc b/mysql-test/suite/rpl/include/rpl_sync_test.inc
new file mode 100644
index 00000000000..1e2ec2ca83b
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_sync_test.inc
@@ -0,0 +1,159 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+########################################################################################
+# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
+# crashing the slave in two different situations:
+# (case-1) - Corrupt the relay log with changes which were not processed by
+# the SQL Thread and crashes it.
+# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
+#
+# Case 1:
+# 1 - Stops the SQL Thread
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the relay-log.bin* which most likely has such changes.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+#
+# Case 2:
+# 1 - Stops the SQL/IO Threads
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the master.info with wrong coordinates.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+########################################################################################
+
+########################################################################################
+# Configuring the environment
+########################################################################################
+--echo =====Configuring the enviroment=======;
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/not_crashrep.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+# Use innodb so we do not get "table should be repaired" issues.
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+flush tables;
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
+
+insert into t1(a) values(1);
+insert into t1(a) values(2);
+insert into t1(a) values(3);
+
+########################################################################################
+# Case 1: Corrupt a relay-log.bin*
+########################################################################################
+--echo =====Inserting data on the master but without the SQL Thread being running=======;
+sync_slave_with_master;
+
+connection slave;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
+--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/stop_slave_sql.inc
+
+connection master;
+insert into t1(a) values(4);
+insert into t1(a) values(5);
+insert into t1(a) values(6);
+
+--echo =====Removing relay log files and crashing/recoverying the slave=======;
+connection slave;
+--source include/stop_slave_io.inc
+
+let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
+
+--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
+perl;
+$file= $ENV{'FILE_TO_CORRUPT'};
+open(FILE, ">$file") || die "Unable to open $file.";
+truncate(FILE,0);
+print FILE "failure";
+close ($file);
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
+
+--echo =====Dumping and comparing tables=======;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+
+let $diff_tables=master:t1,slave:t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Case 2: Corrupt a master.info
+########################################################################################
+--echo =====Corrupting the master.info=======;
+connection slave;
+--source include/stop_slave.inc
+
+connection master;
+FLUSH LOGS;
+
+insert into t1(a) values(7);
+insert into t1(a) values(8);
+insert into t1(a) values(9);
+
+connection slave;
+let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
+
+--perl
+use strict;
+use warnings;
+my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
+my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
+open(FILE, "<", $src) or die;
+my @content= <FILE>;
+close FILE;
+open(FILE, ">", $dst) or die;
+binmode FILE;
+print FILE @content;
+close FILE;
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
+
+--echo =====Dumping and comparing tables=======;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+
+let $diff_tables=master:t1,slave:t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Clean up
+########################################################################################
+--echo =====Clean up=======;
+connection master;
+drop table t1;
+
+--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc b/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc
new file mode 100644
index 00000000000..6728ff55d6f
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc
@@ -0,0 +1,82 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/master-slave.inc
+
+if ($force_master_mysql56_temporal_format)
+{
+ connection master;
+ eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format;
+}
+
+if ($force_slave_mysql56_temporal_format)
+{
+ connection slave;
+ eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
+}
+
+connection master;
+SELECT @@global.mysql56_temporal_format AS on_master;
+connection slave;
+SELECT @@global.mysql56_temporal_format AS on_slave;
+connection master;
+
+CREATE TABLE t1
+(
+ c0 TIME(0),
+ c1 TIME(1),
+ c2 TIME(2),
+ c3 TIME(3),
+ c4 TIME(4),
+ c5 TIME(5),
+ c6 TIME(6)
+);
+CREATE TABLE t2
+(
+ c0 TIMESTAMP(0),
+ c1 TIMESTAMP(1),
+ c2 TIMESTAMP(2),
+ c3 TIMESTAMP(3),
+ c4 TIMESTAMP(4),
+ c5 TIMESTAMP(5),
+ c6 TIMESTAMP(6)
+);
+
+CREATE TABLE t3
+(
+ c0 DATETIME(0),
+ c1 DATETIME(1),
+ c2 DATETIME(2),
+ c3 DATETIME(3),
+ c4 DATETIME(4),
+ c5 DATETIME(5),
+ c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+sync_slave_with_master;
+
+connection slave;
+--query_vertical SELECT * FROM t1;
+--query_vertical SELECT * FROM t2;
+--query_vertical SELECT * FROM t3;
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+connection slave;
+SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
+SET @@global.mysql56_temporal_format=DEFAULT;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_test_framework.inc b/mysql-test/suite/rpl/include/rpl_test_framework.inc
new file mode 100644
index 00000000000..dbcdd317f8e
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_test_framework.inc
@@ -0,0 +1,85 @@
+# ==== Purpose ====
+#
+# Auxiliary file used by suite/rpl/t/rpl_test_framework.test
+#
+# The purpose is to check that the sync chain generated in
+# rpl_change_topology.inc (invoked from rpl_init.inc) is correct. This
+# is done in two ways:
+# (1) Print the sync chain.
+# (2) Execute a statement and verify that it replicates to all slaves.
+#
+#
+# ==== Implementation ====
+#
+# Does this:
+# (1) Set up a given replication topology (rpl_init.inc)
+# (2) Print $rpl_sync_chain
+# (3) Execute "DELETE FROM t1" and then "INSERT INTO t1" on the master
+# (4) Sync and compare all servers.
+# (5) Clean up the replication topology (rpl_end.inc)
+#
+# (Technical detail: Since DELETE FROM t1 is not executed at the end,
+# some servers may have rows left in t1 from a previous invocation of
+# rpl_test_framework.inc. Therefore, this file will only work in
+# statement mode where "DELETE FROM t1" removes rows that exist on
+# slave but not on master.)
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_server_count= <number>
+# --let $rpl_topology= <topology specification>
+# --let $masters= <list of masters>
+# [--let $rpl_diff_servers= <list of servers>]
+# --source suite/rpl/include/rpl_test_framework.inc
+#
+# Parameters:
+# $next_number
+# The INSERT statement will insert $next_number into t1, and
+# $next_number will increase by 1.
+#
+# $rpl_server_count, $rpl_topology:
+# See include/rpl_init.inc
+#
+# $masters
+# This should be a list of numbers, each identifying a server.
+# The DELETE and INSERT statements will be executed on all servers
+# in the list.
+#
+# $rpl_diff_servers
+# See include/rpl_diff.inc
+
+--source include/rpl_init.inc
+--source include/rpl_generate_sync_chain.inc
+--echo rpl_sync_chain= '$rpl_sync_chain'
+
+--inc $next_number
+
+# Iterate over masters
+while ($masters)
+{
+ --let $master_i= `SELECT SUBSTRING_INDEX('$masters', ',', 1)`
+ --let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
+
+ # Connect to master and execute statement
+ connection server_$master_i;
+ DELETE FROM t1;
+ --eval INSERT INTO t1 VALUES ($next_number)
+}
+
+--source include/rpl_sync.inc
+
+# Compare all servers.
+--let $diff_tables= server_$rpl_server_count:t1
+--let $server_i= $rpl_server_count
+--dec $server_i
+while ($server_i)
+{
+ --let $diff_tables= server_$server_i:t1,$diff_tables
+ --dec $server_i
+}
+--source include/diff_tables.inc
+
+--let $diff_servers=
+--let $masters=
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/include/rpl_tmp_table_and_DDL.test
new file mode 100644
index 00000000000..9cf287281a0
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_tmp_table_and_DDL.test
@@ -0,0 +1,159 @@
+#
+# This test verify if executing DDL statement before trying to manipulate
+# a temporary table causes row-based replication to break with error 'table
+# does not exist'.
+#
+
+# CREATE TABLE when a temporary table is open.
+CREATE TEMPORARY TABLE t1 (a INT);
+EVAL CREATE TABLE t2 (a INT, b INT) ENGINE= $ENGINE_TYPE;
+INSERT INTO t1 VALUES (1);
+
+# CREATE EVENT when a temporary table is open.
+CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
+INSERT INTO t1 VALUES (1);
+
+# ALTER EVENT when a temporary table is open.
+ALTER EVENT e1 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
+INSERT INTO t1 VALUES (1);
+
+# DROP EVENT when a temporary table is open.
+DROP EVENT IF EXISTS e1;
+INSERT INTO t1 VALUES (1);
+
+# CREATE PROCEDURE when a temporary table is open.
+CREATE PROCEDURE p1() SELECT 1;
+INSERT INTO t1 VALUES (1);
+
+# Alter PROCEDURE when a temporary table is open.
+ALTER PROCEDURE p1 SQL SECURITY INVOKER;
+INSERT INTO t1 VALUES (1);
+
+# CREATE FUNCTION when a temporary table is open.
+CREATE FUNCTION f1() RETURNS INT RETURN 123;
+INSERT INTO t1 VALUES (1);
+
+# ALTER FUNCTION when a temporary table is open.
+ALTER FUNCTION f1 SQL SECURITY INVOKER;
+INSERT INTO t1 VALUES (1);
+
+# CREATE DATABASE when a temporary table is open.
+CREATE DATABASE mysqltest1;
+INSERT INTO t1 VALUES (1);
+
+# DROP DATABASE when a temporary table is open.
+DROP DATABASE mysqltest1;
+INSERT INTO t1 VALUES (1);
+
+# CREATE USER when a temporary table is open.
+CREATE USER test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# GRANT select on table to user when a temporary table is open.
+GRANT SELECT ON t2 TO test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# GRANT all on function to user when a temporary table is open.
+GRANT ALL ON f1 TO test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# GRANT all on procedure to user when a temporary table is open.
+GRANT ALL ON p1 TO test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# GRANT usage on *.* to user when a temporary table is open.
+GRANT USAGE ON *.* TO test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
+REVOKE ALL PRIVILEGES ON f1 FROM test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
+REVOKE ALL PRIVILEGES ON p1 FROM test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
+REVOKE ALL PRIVILEGES ON t2 FROM test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# REVOKE usage on *.* from user when a temporary table is open.
+REVOKE USAGE ON *.* FROM test_1@localhost;
+INSERT INTO t1 VALUES (1);
+
+# RENAME USER when a temporary table is open.
+RENAME USER test_1@localhost TO test_2@localhost;
+INSERT INTO t1 VALUES (1);
+
+# DROP USER when a temporary table is open.
+DROP USER test_2@localhost;
+INSERT INTO t1 VALUES (1);
+
+# Test ACL statement in sub statement
+DELIMITER |;
+CREATE PROCEDURE p2()
+BEGIN
+ # CREATE USER when a temporary table is open.
+ CREATE TEMPORARY TABLE t3 (a INT);
+ CREATE USER test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # GRANT select on table to user when a temporary table is open.
+ GRANT SELECT ON t2 TO test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # GRANT all on function to user when a temporary table is open.
+ GRANT ALL ON f1 TO test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # GRANT all on procedure to user when a temporary table is open.
+ GRANT ALL ON p1 TO test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # GRANT usage on *.* to user when a temporary table is open.
+ GRANT USAGE ON *.* TO test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
+ REVOKE ALL PRIVILEGES ON f1 FROM test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
+ REVOKE ALL PRIVILEGES ON p1 FROM test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
+ REVOKE ALL PRIVILEGES ON t2 FROM test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # REVOKE usage on *.* from user when a temporary table is open.
+ REVOKE USAGE ON *.* FROM test_2@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # RENAME USER when a temporary table is open.
+ RENAME USER test_2@localhost TO test_3@localhost;
+ INSERT INTO t1 VALUES (1);
+
+ # DROP USER when a temporary table is open.
+ DROP USER test_3@localhost;
+ INSERT INTO t1 VALUES (1);
+ DROP TEMPORARY TABLE t3;
+END |
+DELIMITER ;|
+
+# DROP PROCEDURE when a temporary table is open.
+DROP PROCEDURE p1;
+INSERT INTO t1 VALUES (1);
+DROP PROCEDURE p2;
+INSERT INTO t1 VALUES (1);
+
+# DROP FUNCTION when a temporary table is open.
+DROP FUNCTION f1;
+INSERT INTO t1 VALUES (1);
+
+# DROP TABLE when a temporary table is open.
+DROP TABLE t2;
+INSERT INTO t1 VALUES (1);
+
+DROP TEMPORARY TABLE t1;
+
diff --git a/mysql-test/suite/rpl/include/rpl_trig004.test b/mysql-test/suite/rpl/include/rpl_trig004.test
new file mode 100644
index 00000000000..4988fe87f8f
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_trig004.test
@@ -0,0 +1,48 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/09/2005 #
+#############################################################################
+# TEST: Use after insert and before inset triggers and stored procdures to #
+# Update and insert data #
+#############################################################################
+# Change Auth: JBM #
+# Date: 2006-02-14 #
+####################################################
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+--error 0,1360
+DROP TRIGGER test.t1_bi_t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+eval CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=$engine_type;
+eval CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=$engine_type;
+
+
+delimiter //;
+CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
+delimiter ;//
+
+INSERT INTO test.t2 VALUES (1, 0.0);
+--error ER_DUP_ENTRY
+INSERT INTO test.t2 VALUES (1, 0.0);
+
+#show binlog events;
+select * from test.t1;
+select * from test.t2;
+sync_slave_with_master;
+connection slave;
+select * from test.t1;
+select * from test.t2;
+
+connection master;
+
+DROP TRIGGER test.t1_bi_t2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+
+sync_slave_with_master;
+# End of 5.0 test case
diff --git a/mysql-test/suite/rpl/include/rpl_truncate.test b/mysql-test/suite/rpl/include/rpl_truncate.test
new file mode 100644
index 00000000000..c169dfd0228
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_truncate.test
@@ -0,0 +1,13 @@
+# Test to check for the different version of truncating a table.
+# The statements are "TRUNCATE tbl" and "DELETE FROM tbl". We check
+# the behaviour of each possible value for BINLOG_FORMAT.
+
+--source include/master-slave.inc
+
+let $trunc_stmt = TRUNCATE TABLE;
+--source suite/rpl/include/rpl_truncate_helper.test
+
+let $trunc_stmt = DELETE FROM;
+--source suite/rpl/include/rpl_truncate_helper.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_truncate_helper.test b/mysql-test/suite/rpl/include/rpl_truncate_helper.test
new file mode 100644
index 00000000000..ddfba6c52c5
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_truncate_helper.test
@@ -0,0 +1,29 @@
+--source include/rpl_reset.inc
+
+connection master;
+eval CREATE TABLE t1 (a INT, b LONG) ENGINE=$engine;
+INSERT INTO t1 VALUES (1,1), (2,2);
+sync_slave_with_master;
+connection master;
+eval $trunc_stmt t1;
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+--echo ==== Test using a table with delete triggers ====
+connection master;
+SET @count := 1;
+eval CREATE TABLE t2 (a INT, b LONG) ENGINE=$engine;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
+sync_slave_with_master;
+connection master;
+eval $trunc_stmt t1;
+sync_slave_with_master;
+
+let $diff_tables= master:t2, slave:t2;
+source include/diff_tables.inc;
+
+connection master;
+DROP TABLE t1,t2;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/include/rpl_typeconv.inc b/mysql-test/suite/rpl/include/rpl_typeconv.inc
new file mode 100644
index 00000000000..9e566258882
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_typeconv.inc
@@ -0,0 +1,78 @@
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption suite).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+connection slave;
+set @saved_slave_type_conversions = @@global.slave_type_conversions;
+CREATE TABLE type_conversions (
+ TestNo INT AUTO_INCREMENT PRIMARY KEY,
+ Source TEXT,
+ Target TEXT,
+ Flags TEXT,
+ On_Master LONGTEXT,
+ On_Slave LONGTEXT,
+ Expected LONGTEXT,
+ Compare INT,
+ Error TEXT);
+
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
+SELECT @@global.slave_type_conversions;
+
+# Checking strict interpretation of type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+source suite/rpl/include/type_conversions.test;
+
+# Checking lossy integer type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+source suite/rpl/include/type_conversions.test;
+
+# Checking non-lossy integer type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+source suite/rpl/include/type_conversions.test;
+
+# Checking all type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+source suite/rpl/include/type_conversions.test;
+
+connection slave;
+--echo **** Result of conversions ****
+disable_query_log;
+SELECT RPAD(Source, 15, ' ') AS Source_Type,
+ RPAD(Target, 15, ' ') AS Target_Type,
+ RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
+ IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
+ IF(Compare, '<Correct value>',
+ CONCAT("'", On_Slave, "' != '", Expected, "'")))
+ AS Value_On_Slave
+ FROM type_conversions;
+enable_query_log;
+DROP TABLE type_conversions;
+
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+set global slave_type_conversions = @saved_slave_type_conversions;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/type_conversions.test b/mysql-test/suite/rpl/include/type_conversions.test
new file mode 100644
index 00000000000..edd46f14ba9
--- /dev/null
+++ b/mysql-test/suite/rpl/include/type_conversions.test
@@ -0,0 +1,1272 @@
+# File containing different lossy and non-lossy type conversions.
+
+# Integral conversion testing, we do not reduce the test using
+# transitivity of conversions since the implementation is not using a
+# transitivity strategy. Instead we do an exhaustive testing.
+
+disable_query_log;
+connection slave;
+--let $conv = `select @@slave_type_conversions`
+--echo **** Running tests with @@SLAVE_TYPE_CONVERSIONS = '$conv' ****
+
+let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
+let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
+
+# TINYBLOB
+
+let $source_type = TINYBLOB;
+let $target_type = TINYBLOB;
+let $source_value = 'aaa';
+let $target_value = 'aaa';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= BLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= LONGBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# BLOB
+
+let $source_type = BLOB;
+let $target_type = TINYBLOB;
+let $source_value = 'aaa';
+let $target_value = 'aaa';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= BLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= LONGBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# MEDIUMBLOB
+
+let $source_type = MEDIUMBLOB;
+let $target_type = TINYBLOB;
+let $source_value = 'aaa';
+let $target_value = 'aaa';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= BLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= LONGBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# LONGBLOB
+
+let $source_type = LONGBLOB;
+let $target_type = TINYBLOB;
+let $source_value = 'aaa';
+let $target_value = 'aaa';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= BLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= LONGBLOB;
+let $source_value= 'aaa';
+let $target_value= 'aaa';
+let $can_convert= 1;
+source suite/rpl/include/check_type.inc;
+
+# BUG#49836 (additional tests - GEOMETRY TYPE)
+
+let $source_type = GEOMETRY;
+let $target_type = BLOB;
+let $source_value = PointFromText('POINT(10 10)');
+let $target_value = PointFromText('POINT(10 10)');
+let $can_convert = 0;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = BLOB;
+let $target_type = GEOMETRY;
+let $source_value = 'aaa';
+let $target_value = 'aaa';
+let $can_convert = 0;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = GEOMETRY;
+let $target_type = GEOMETRY;
+let $source_value = PointFromText('POINT(10 10)');
+let $target_value = PointFromText('POINT(10 10)');
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = BIT(1);
+let $target_type = BIT(1);
+let $source_value = b'1';
+let $target_value = b'1';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = DATE;
+let $target_type = DATE;
+let $source_value = '2009-11-21';
+let $target_value = '2009-11-21';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = ENUM('master','slave');
+let $target_type = ENUM('master','slave');
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = CHAR(10);
+let $target_type = ENUM('master','slave');
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = CHAR(10);
+let $target_type = SET('master','slave');
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = ENUM('master','slave');
+let $target_type = CHAR(10);
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('master','slave');
+let $target_type = CHAR(10);
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('master','slave');
+let $target_type = SET('master','slave');
+let $source_value = '';
+let $target_value = '';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('master','slave');
+let $target_type = SET('master','slave');
+let $source_value = 'master,slave';
+let $target_value = 'master,slave';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('0','1','2','3','4','5','6');
+let $target_type = SET('0','1','2','3','4','5','6');
+let $source_value = '5';
+let $target_value = '5';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('0','1','2','3','4','5','6');
+let $target_type = SET('0','1','2','3','4','5','6','7','8','9','10');
+let $source_value = '5';
+let $target_value = '5';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10');
+let $target_type = SET('0','1','2','3','4','5','6');
+let $source_value = '5';
+let $target_value = '5';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10');
+let $target_type = SET('0','1','2','3','4','5','6');
+let $source_value = '7';
+let $target_value = '';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = TINYINT;
+let $target_type = TINYINT;
+let $source_value = 1;
+let $target_value = 1;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type = TINYINT;
+let $target_type = SMALLINT;
+let $source_value = 1;
+let $target_value = 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= TINYINT;
+let $source_value= 1 << 9;
+let $target_value= (1 << 7) - 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= TINYINT UNSIGNED;
+let $source_value= 1 << 9;
+let $target_value= (1 << 8) - 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= TINYINT;
+let $source_value= 1 << 20;
+let $target_value= (1 << 7) - 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= TINYINT UNSIGNED;
+let $source_value= 1 << 20;
+let $target_value= (1 << 8) - 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= TINYINT;
+let $source_value= (1 << 30);
+let $target_value= (1 << 7) - 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= TINYINT UNSIGNED;
+let $source_value= (1 << 30);
+let $target_value= (1 << 8) - 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= INT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= CHAR(20);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= CHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= CHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= VARCHAR(20);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= VARCHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= VARCHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= TINYTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= TEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= MEDIUMTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= LONGTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= VARCHAR(20);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= VARCHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= VARCHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= CHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= CHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= TINYTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= TEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= MEDIUMTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= LONGTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $blob = `select repeat('abcd', 125)`;
+let $truncated_blob = `select left('$blob', 255)`;
+
+let $source_type= VARCHAR(500);
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= VARCHAR(510);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= VARCHAR(255);
+let $source_value= '$blob';
+let $target_value= '$truncated_blob';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= TINYTEXT;
+let $source_value= '$blob';
+let $target_value= '$truncated_blob';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= TEXT;
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= MEDIUMTEXT;
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= LONGTEXT;
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $tiny_blob = `select repeat('tiny blob ', 25)`;
+let $truncated_tiny_blob = `select left('$tiny_blob', 254)`;
+
+let $source_type= TINYTEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMTEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGTEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= CHAR(255);
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= CHAR(250);
+let $source_value= '$tiny_blob';
+let $target_value= left('$tiny_blob', 250);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TEXT;
+let $target_type= CHAR(255);
+let $source_value= '$blob';
+let $target_value= left('$blob', 255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMTEXT;
+let $target_type= CHAR(255);
+let $source_value= '$blob';
+let $target_value= left('$blob', 255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGTEXT;
+let $target_type= CHAR(255);
+let $source_value= '$blob';
+let $target_value= left('$blob', 255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= TINYTEXT;
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= TEXT;
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TEXT;
+let $target_type= TINYTEXT;
+let $source_value= '$blob';
+let $target_value= left('$blob',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(10,5);
+let $source_value= 3.14159;
+let $target_value= 3.14159;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(10,6);
+let $source_value= 3.14159;
+let $target_value= 3.141590;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(11,5);
+let $source_value= 3.14159;
+let $target_value= 3.14159;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(11,6);
+let $source_value= 3.14159;
+let $target_value= 3.141590;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(10,4);
+let $source_value= 3.14159;
+let $target_value= 3.1416;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(9,5);
+let $source_value= 3.14159;
+let $target_value= 3.14159;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(9,4);
+let $source_value= 3.14159;
+let $target_value= 3.1416;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= FLOAT;
+let $target_type= DECIMAL(10,5);
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DOUBLE;
+let $target_type= DECIMAL(10,5);
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= FLOAT;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DOUBLE;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= FLOAT;
+let $target_type= FLOAT;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DOUBLE;
+let $target_type= DOUBLE;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= FLOAT;
+let $target_type= DOUBLE;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= DOUBLE;
+let $target_type= FLOAT;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIT(5);
+let $target_type= BIT(5);
+let $source_value= b'11001';
+let $target_value= b'11001';
+let $can_convert = 1;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIT(5);
+let $target_type= BIT(6);
+let $source_value= b'11001';
+let $target_value= b'11001';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIT(6);
+let $target_type= BIT(5);
+let $source_value= b'111001';
+let $target_value= b'11111';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIT(5);
+let $target_type= BIT(12);
+let $source_value= b'11001';
+let $target_value= b'11001';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BIT(12);
+let $target_type= BIT(5);
+let $source_value= b'101100111000';
+let $target_value= b'11111';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+--echo #
+--echo # MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+--echo #
+
+# This is to make sure that the compressed data is longer than 64K
+SET column_compression_threshold=16*256*256;
+
+# TINYBLOB COMPRESSED
+
+let $source_type= TINYBLOB COMPRESSED;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB COMPRESSED;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB COMPRESSED;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB COMPRESSED;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB COMPRESSED;
+let $target_type= VARBINARY(255);
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+# BLOB COMPRESSED
+
+let $source_type= BLOB COMPRESSED;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB COMPRESSED;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB COMPRESSED;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB COMPRESSED;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB COMPRESSED;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',65500);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+# MEDIUMBLOB COMPRESSED
+
+let $source_type= MEDIUMBLOB COMPRESSED;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= MEDIUMBLOB COMPRESSED;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65535);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= MEDIUMBLOB COMPRESSED;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',66000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= MEDIUMBLOB COMPRESSED;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',66000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= MEDIUMBLOB COMPRESSED;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+# LONGBLOB COMPRESSED
+
+let $source_type= LONGBLOB COMPRESSED;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= LONGBLOB COMPRESSED;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65535);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= LONGBLOB COMPRESSED;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',66000);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= LONGBLOB COMPRESSED;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',66000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= LONGBLOB COMPRESSED;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+SET column_compression_threshold=DEFAULT;
+--echo # End of MDEV-15821
+
+
+--echo #
+--echo # MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
+--echo #
+
+# TINYBLOB
+
+let $source_type= TINYBLOB;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= VARBINARY(255);
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+# BLOB
+
+let $source_type= BLOB;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',65535);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+# MEDIUMBLOB
+
+let $source_type= MEDIUMBLOB;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65535);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= MEDIUMBLOB;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',66000);
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+
+# LONGBLOB
+
+let $source_type= LONGBLOB;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65535);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# This failed before the fix
+let $source_type= LONGBLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',66000);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+--echo # End of MDEV-15833
+
+--echo #
+--echo # MDEV-17098 DATE <-> DATETIME
+--echo #
+
+# NON-LOSSY
+let $source_temp_format= 1; # irrelevant with DATE though
+let $source_type= DATE;
+let $target_temp_format= 1; # to produce MYSQL_TYPE_DATETIME2
+let $target_type= DATETIME(6);
+let $source_value= '2018-10-11';
+let $target_value= '2018-10-11 00:00:00.000000';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_temp_format= 1;
+let $source_type= DATE;
+let $target_temp_format= 0; # to produce "old" MYSQL_TYPE_DATETIME
+let $target_type= DATETIME(6);
+let $source_value= '2018-10-11';
+let $target_value= '2018-10-11 00:00:00.000000';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_temp_format= 0;
+let $source_type= DATE;
+let $target_temp_format= 1;
+let $target_type= DATETIME(6);
+let $source_value= '2018-10-11';
+let $target_value= '2018-10-11 00:00:00.000000';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# zero-precision test version
+let $source_temp_format= 1;
+let $source_type= DATE;
+let $target_temp_format= 1;
+let $target_type= DATETIME(0);
+let $source_value= '2018-10-11';
+let $target_value= '2018-10-11 00:00:00';
+let $can_convert = $if_is_non_lossy;
+source suite/rpl/include/check_type.inc;
+
+# LOSSY
+let $source_temp_format= 1;
+let $source_type= DATETIME(6);
+let $target_temp_format= 1;
+let $target_type= DATE;
+let $source_value= '2018-10-11 00:00:00.000001';
+let $target_value= '2018-10-11';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+let $source_temp_format= 1;
+let $source_type= DATETIME(6);
+let $target_temp_format= 0;
+let $target_type= DATE;
+let $source_value= '2018-10-11 00:00:00.000001';
+let $target_value= '2018-10-11';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# zero-precision test version
+let $source_temp_format= 1;
+let $source_type= DATETIME(0);
+let $target_temp_format= 1;
+let $target_type= DATE;
+let $source_value= '2018-10-11 00:00:00';
+let $target_value= '2018-10-11';
+let $can_convert = $if_is_lossy;
+source suite/rpl/include/check_type.inc;
+
+# TODO: fix MDEV-17394 Row-based replication DATETIME(m) to
+# DATETIME(s) does not work or incorrect
+#
+#
+# let $source_temp_format= 0;
+# let $source_type= DATETIME(6);
+# let $target_temp_format= 1;
+# let $target_type= DATE;
+# ...
+# let $source_temp_format= 0;
+# let $source_type= DATETIME(6);
+# let $target_temp_format= 0;
+# let $target_type= DATE;
+# ...
+
+let $source_temp_format=;
+let $target_temp_format=;
+--echo # End of MDEV-17098
+
+
+--source include/rpl_reset.inc
+enable_query_log;
diff --git a/mysql-test/suite/rpl/r/rpl_000011.result b/mysql-test/suite/rpl/r/rpl_000011.result
index 136a6a3aacb..eb0d89bd3cb 100644
--- a/mysql-test/suite/rpl/r/rpl_000011.result
+++ b/mysql-test/suite/rpl/r/rpl_000011.result
@@ -1,15 +1,13 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection master;
create table t1 (n int);
insert into t1 values(1);
connection slave;
-show global status like 'com_insert';
-Variable_name Value
-Com_insert 1
+# Com_insert = 1
stop slave;
-show global status like 'com_insert';
-Variable_name Value
-Com_insert 1
+# Com_insert = 1
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_instant.result b/mysql-test/suite/rpl/r/rpl_alter_instant.result
new file mode 100644
index 00000000000..35380fdeddf
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_alter_instant.result
@@ -0,0 +1,66 @@
+include/master-slave.inc
+[connection master]
+use test;
+create table t1 (id int primary key, c1 int default 10, c2 varchar(20) default 'holiday') engine = innodb;
+insert into t1 values(1, 12345, 'abcde'), (2, default, default), (3, 23456, 'xyzab');
+set time_zone='+03:00';
+set timestamp = 1;
+alter table t1 add column d1 timestamp not null default current_timestamp;
+select * from t1;
+id c1 c2 d1
+1 12345 abcde 1970-01-01 03:00:01
+2 10 holiday 1970-01-01 03:00:01
+3 23456 xyzab 1970-01-01 03:00:01
+connection slave;
+connection slave;
+set time_zone='+03:00';
+select * from t1;
+id c1 c2 d1
+1 12345 abcde 1970-01-01 03:00:01
+2 10 holiday 1970-01-01 03:00:01
+3 23456 xyzab 1970-01-01 03:00:01
+connection master;
+alter table t1 add column d2 timestamp not null default current_timestamp, ALGORITHM=copy;
+connection slave;
+connection slave;
+select * from t1;
+id c1 c2 d1 d2
+1 12345 abcde 1970-01-01 03:00:01 1970-01-01 03:00:01
+2 10 holiday 1970-01-01 03:00:01 1970-01-01 03:00:01
+3 23456 xyzab 1970-01-01 03:00:01 1970-01-01 03:00:01
+connection master;
+drop table t1;
+create table t4 (id int primary key, c2 int);
+insert into t4 values(1,1),(2,2),(3,3);
+set timestamp = 1000;
+alter table t4 add column (c3 datetime default current_timestamp(), c4 timestamp not null default current_timestamp());
+select * from t4;
+id c2 c3 c4
+1 1 1970-01-01 03:16:40 1970-01-01 03:16:40
+2 2 1970-01-01 03:16:40 1970-01-01 03:16:40
+3 3 1970-01-01 03:16:40 1970-01-01 03:16:40
+alter table t4 add column c5 time not null default current_timestamp();
+Warnings:
+Note 1265 Data truncated for column 'c5' at row 1
+Note 1265 Data truncated for column 'c5' at row 2
+Note 1265 Data truncated for column 'c5' at row 3
+alter table t4 add column c6 date not null default current_timestamp();
+Warnings:
+Note 1265 Data truncated for column 'c6' at row 1
+Note 1265 Data truncated for column 'c6' at row 2
+Note 1265 Data truncated for column 'c6' at row 3
+select * from t4;
+id c2 c3 c4 c5 c6
+1 1 1970-01-01 03:16:40 1970-01-01 03:16:40 03:16:40 1970-01-01
+2 2 1970-01-01 03:16:40 1970-01-01 03:16:40 03:16:40 1970-01-01
+3 3 1970-01-01 03:16:40 1970-01-01 03:16:40 03:16:40 1970-01-01
+connection slave;
+connection slave;
+select * from t4;
+id c2 c3 c4 c5 c6
+1 1 1970-01-01 03:16:40 1970-01-01 03:16:40 03:16:40 1970-01-01
+2 2 1970-01-01 03:16:40 1970-01-01 03:16:40 03:16:40 1970-01-01
+3 3 1970-01-01 03:16:40 1970-01-01 03:16:40 03:16:40 1970-01-01
+connection master;
+drop table t4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
index eb4e45ad28e..4c667bd7f5a 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
@@ -174,7 +174,7 @@ SET SQL_LOG_BIN=1;
SET @@global.debug_dbug=@old_debug;
###################### TEST #10
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
-call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("Could not use .*");
RESET MASTER;
SHOW WARNINGS;
Level Code Message
@@ -234,7 +234,7 @@ include/rpl_reset.inc
connection slave;
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
call mtr.add_suppression("Error writing file .*");
-call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("Could not use .*");
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
###################### TEST #13
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
index 0c780122e38..3f01c80b195 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -11,8 +11,8 @@ grant select on t to x@y;
rollback;
show grants for x@y;
Grants for x@y
-GRANT USAGE ON *.* TO 'x'@'y'
-GRANT SELECT ON `d1`.`t` TO 'x'@'y'
+GRANT USAGE ON *.* TO `x`@`y`
+GRANT SELECT ON `d1`.`t` TO `x`@`y`
start transaction;
insert into t values (2);
revoke select on t from x@y;
@@ -23,7 +23,7 @@ s1
2
show grants for x@y;
Grants for x@y
-GRANT USAGE ON *.* TO 'x'@'y'
+GRANT USAGE ON *.* TO `x`@`y`
drop user x@y;
drop database d1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
index 178c23b9f98..a87ba9a9d2d 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -42,6 +42,8 @@ COUNT(*)
>>> Something was written to binary log <<<
connection master;
ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b);
+Warnings:
+Warning 1280 Name 'pk_t1' ignored for PRIMARY key.
connection slave;
connection master;
INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4);
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
index 8852ae97aa8..2e75080810b 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
@@ -47,6 +47,8 @@ COUNT(*)
>>> Something was written to binary log <<<
connection master;
ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b);
+Warnings:
+Warning 1280 Name 'pk_t1' ignored for PRIMARY key.
connection slave;
connection master;
INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4);
@@ -228,7 +230,7 @@ ALTER TABLE t1 ENGINE=BLACKHOLE
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -237,6 +239,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t2` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+# Number of rows: 4
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -245,7 +248,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -254,6 +257,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+# Number of rows: 4
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -262,7 +266,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -271,6 +275,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -279,7 +284,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -288,6 +293,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -296,7 +302,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -305,6 +311,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+# Number of rows: 4
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -321,7 +328,7 @@ ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -330,6 +337,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+# Number of rows: 4
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -338,7 +346,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-10 trans
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -347,6 +355,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -355,7 +364,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-11 trans
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -364,6 +373,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -380,7 +390,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-13 trans
/*!100001 SET @@session.gtid_seq_no=13*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -389,6 +399,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+# Number of rows: 4
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -397,7 +408,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-14 trans
/*!100001 SET @@session.gtid_seq_no=14*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -406,6 +417,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -414,7 +426,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-15 trans
/*!100001 SET @@session.gtid_seq_no=15*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -423,6 +435,7 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-test/suite/rpl/r/rpl_charset.result
index a96cb26dd9d..5bda623172b 100644
--- a/mysql-test/suite/rpl/r/rpl_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_charset.result
@@ -121,4 +121,27 @@ primary key (`pk`)
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
+#
+# Start of 10.3 tests
+#
+#
+# MDEV-12685 Oracle-compatible function CHR()
+#
+connection master;
+CREATE DATABASE db1 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;
+USE db1;
+CREATE TABLE t1 AS SELECT CHR(0x60);
+connection slave;
+SHOW CREATE TABLE db1.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CHR(0x60)` varchar(4) COLLATE latin1_bin DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
+connection master;
+USE test;
+DROP DATABASE db1;
+connection slave;
+#
+# End of 10.3 tests
+#
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
index 76024d1fd74..e1474d8854e 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
@@ -19,7 +19,7 @@ SET @sum = @sum + NEW.val + 1
connection master;
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
+Note 1359 Trigger 'db1.val_sum' 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
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_view.result b/mysql-test/suite/rpl/r/rpl_create_drop_view.result
index fef1edb2018..facd40a6018 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_view.result
@@ -96,10 +96,10 @@ connection master;
DROP VIEW v1;
DROP TABLE t1;
DROP VIEW v1;
-ERROR 42S02: Unknown table 'test.v1'
+ERROR 42S02: Unknown VIEW: 'test.v1'
DROP VIEW IF EXISTS v2;
Warnings:
-Note 1051 Unknown table 'test.v2'
+Note 4092 Unknown VIEW: 'test.v2'
# Syncing slave with master
connection slave;
SELECT * FROM v1;
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index 1c9611ba8f0..bb8c45ae4eb 100644
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -39,7 +39,9 @@ connection slave;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
+connection slave1;
START SLAVE;
+connection slave;
SELECT COUNT(*) FROM t2;
COUNT(*)
0
@@ -61,8 +63,10 @@ BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
+connection slave1;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1205]
+connection slave;
SELECT COUNT(*) FROM t2;
COUNT(*)
0
@@ -92,8 +96,10 @@ SELECT * FROM t1 FOR UPDATE;
a
1
1
+connection slave1;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1205]
+connection slave;
SELECT COUNT(*) FROM t2;
COUNT(*)
0
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 9eca21b38e4..0797e66e9ec 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -15,8 +15,8 @@ grant drop on test.* to rpl_do_grant@localhost;
connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
-GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
-GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
+GRANT SELECT ON *.* TO `rpl_do_grant`@`localhost`
+GRANT DROP ON `test`.* TO `rpl_do_grant`@`localhost`
connection master;
set password for rpl_do_grant@localhost=password("does it work?");
connection slave;
@@ -54,55 +54,55 @@ connection master;
create user rpl_do_grant@localhost;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant`@`localhost`
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant`@`localhost`
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection master;
rename user rpl_do_grant@localhost to rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection master;
grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT, DELETE ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT, DELETE ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection master;
revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection master;
revoke all privileges, grant option from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection master;
drop user rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
@@ -142,9 +142,9 @@ Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
SHOW GRANTS FOR 'create_rout_db'@'localhost';
Grants for create_rout_db@localhost
-GRANT USAGE ON *.* TO 'create_rout_db'@'localhost' IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
-GRANT CREATE ROUTINE ON `bug42217_db`.* TO 'create_rout_db'@'localhost' WITH GRANT OPTION
-GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'create_rout_db'@'localhost'
+GRANT USAGE ON *.* TO `create_rout_db`@`localhost` IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
+GRANT CREATE ROUTINE ON `bug42217_db`.* TO `create_rout_db`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO `create_rout_db`@`localhost`
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
@@ -236,11 +236,11 @@ GRANT EXECUTE ON PROCEDURE p1 TO 'user49119'@'localhost';
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
-GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
+GRANT EXECUTE ON PROCEDURE `test`.`p1` TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection slave;
@@ -248,11 +248,11 @@ connection slave;
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
-GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
+GRANT EXECUTE ON PROCEDURE `test`.`p1` TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection master;
@@ -266,10 +266,10 @@ ERROR 42000: There is no such grant defined for user 'root' on host 'localhost'
### after revoke statement failure
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection slave;
@@ -278,10 +278,10 @@ connection slave;
### after revoke statement failure (should match
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-test/suite/rpl/r/rpl_drop_view.result
index f6ced4eb41f..aa4df701609 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_view.result
@@ -9,9 +9,9 @@ create view v1 as select * from t1;
create view v2 as select * from t2;
create view v3 as select * from t3;
drop view not_exist_view;
-ERROR 42S02: Unknown table 'test.not_exist_view'
+ERROR 42S02: Unknown VIEW: 'test.not_exist_view'
drop view v1, not_exist_view;
-ERROR 42S02: Unknown table 'test.not_exist_view'
+ERROR 42S02: Unknown VIEW: 'test.not_exist_view'
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
drop view v2, v3;
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index e51bc982110..a84bc6b67f5 100644
--- a/mysql-test/suite/rpl/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -2,17 +2,15 @@ include/master-slave.inc
[connection master]
SET @old_event_scheduler = @@global.event_scheduler;
set global event_scheduler=1;
-DROP EVENT IF EXISTS test.justonce;
-drop table if exists t1,t2;
CREATE TABLE `t1` (
`id` INT(10) UNSIGNED NOT NULL,
`c` VARCHAR(50) NOT NULL,
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+) DEFAULT CHARSET=utf8;
INSERT INTO t1 (id, c) VALUES (1, 'manually');
"Creating event test.justonce on the master"
-CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO
+CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO
INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce');
"Checking event is active on master"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
@@ -31,7 +29,7 @@ db name status originator
test justonce SLAVESIDE_DISABLED 1
"Dropping event test.slave_once on the slave"
DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
@@ -45,7 +43,7 @@ connection master;
"Dropping event test.justonce on the master"
DROP EVENT IF EXISTS test.justonce;
"Creating event test.er on the master"
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -58,7 +56,7 @@ db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
connection master;
"Altering event test.er on the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -80,7 +78,7 @@ connection slave;
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
"Creating event test.slave_terminate on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
@@ -91,7 +89,7 @@ test slave_terminate ENABLED 2
"Dropping event test.slave_terminate on the slave"
DROP EVENT test.slave_terminate;
"Creating event test.slave_terminate with DISABLE ON SLAVE on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
@@ -106,7 +104,6 @@ connection master;
DROP TABLE t1;
connection slave;
connection master;
-connection master;
CREATE TABLE t28953 (a INT);
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
DO BEGIN
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
index 3722e438d32..32df09789cc 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
@@ -568,3 +568,16 @@ ERROR HY000: Function or expression 'binlog_gtid_pos()' cannot be used in the DE
#
# End of 10.2 tests
#
+#
+# Start of 10.3 tests
+#
+#
+# MDEV-13967 Parameter data type control for Item_long_func
+#
+SELECT MASTER_GTID_WAIT(ROW(1,1),'str');
+ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait'
+SELECT MASTER_GTID_WAIT('str',ROW(1,1));
+ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait'
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
index 7b6e95bf718..ed2a2b287e9 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
@@ -88,16 +88,16 @@ include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
-SET GLOBAL debug_dbug="+d,crash_commit_before";
START SLAVE;
+SET GLOBAL debug_dbug="+d,crash_commit_before";
connection server_1;
INSERT INTO t1 VALUES (5);
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
-SET GLOBAL debug_dbug="+d,crash_commit_after";
START SLAVE;
+SET GLOBAL debug_dbug="+d,crash_commit_after";
connection server_1;
INSERT INTO t1 VALUES (6);
include/save_master_gtid.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
index 47ba3c956b1..54156685806 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
@@ -12,21 +12,21 @@ connection master;
INSERT INTO t1 VALUES (1);
connection slave;
CALL mtr.add_suppression("Slave: Failed to open mysql.gtid_slave_pos");
-include/wait_for_slave_sql_error.inc [errno=1942]
+include/wait_for_slave_sql_error.inc [errno=1944]
include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id, domain_id);
START SLAVE;
-include/wait_for_slave_sql_error.inc [errno=1942]
+include/wait_for_slave_sql_error.inc [errno=1944]
include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
START SLAVE;
-include/wait_for_slave_sql_error.inc [errno=1942]
+include/wait_for_slave_sql_error.inc [errno=1944]
include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id);
START SLAVE;
-include/wait_for_slave_sql_error.inc [errno=1942]
+include/wait_for_slave_sql_error.inc [errno=1944]
include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (domain_id, sub_id);
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_ignored.result b/mysql-test/suite/rpl/r/rpl_gtid_ignored.result
index 8d5b9be2ca0..ac608c3c2a3 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_ignored.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_ignored.result
@@ -79,6 +79,7 @@ a
9
connection server_1;
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
SET debug_sync = "reset";
connection server_2;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result
index c49207b99fa..aaeb0c8f119 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result
@@ -1,5 +1,12 @@
include/master-slave.inc
[connection master]
+connection slave;
+include/stop_slave.inc
+SET sql_log_bin=0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+SET sql_log_bin=1;
+include/start_slave.inc
+connection master;
CREATE TABLE t1 (i int) ENGINE=InnoDB;
connection slave;
*** MDEV-4484, incorrect error handling when entries in gtid_slave_pos not found. ***
@@ -13,7 +20,6 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,gtid_slave_pos_simulate_failed_delete";
SET sql_log_bin= 0;
CALL mtr.add_suppression("Can't find file");
-ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET sql_log_bin= 1;
include/start_slave.inc
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
index 3f3b5e4344a..ff845794c22 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
@@ -194,7 +194,7 @@ domain_id COUNT(*)
*** MDEV-4650: show variables; ERROR 1946 (HY000): Failed to load replication slave GTID position ***
connection server_2;
SET sql_log_bin=0;
-RENAME TABLE mysql.gtid_slave_pos TO mysql.gtid_slave_pos_old;
+RENAME TABLE mysql.gtid_slave_pos TO mysql.old_gtid_slave_pos;
SET sql_log_bin=1;
SHOW VARIABLES;
SHOW VARIABLES LIKE 'gtid_slave_pos';
@@ -207,7 +207,7 @@ Level Code Message
Error 1146 Table 'mysql.gtid_slave_pos' doesn't exist
Error 1946 Failed to load replication slave GTID position from table mysql.gtid_slave_pos
SET sql_log_bin=0;
-RENAME TABLE mysql.gtid_slave_pos_old TO mysql.gtid_slave_pos;
+RENAME TABLE mysql.old_gtid_slave_pos TO mysql.gtid_slave_pos;
CALL mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
SET sql_log_bin=1;
SHOW VARIABLES LIKE 'gtid_slave_pos';
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result
index 886f6cfd2cb..2295aad34ac 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_until.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result
@@ -10,6 +10,8 @@ SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
RETURN s;
END|
connection server_2;
+include/stop_slave.inc
+include/start_slave.inc
START SLAVE UNTIL master_gtid_pos = "";
ERROR HY000: Slave is already running
include/stop_slave_io.inc
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 7717dcf6700..d878a8d9df9 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -46,7 +46,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1293832861.123456/*!*/;
SET @@session.time_zone='+03:00'/*!*/;
@@ -55,7 +55,7 @@ insert t1 (b,c) values (now(6), now(6))
SET TIMESTAMP=1293832861.123456/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1293832861/*!*/;
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010')
@@ -63,7 +63,7 @@ insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','201
SET TIMESTAMP=1293832861/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (now(), now())
@@ -71,7 +71,7 @@ insert t1 (b,c) values (now(), now())
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (0,0)
@@ -79,7 +79,7 @@ insert t1 (b,c) values (0,0)
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (a,b,c) values (0,0,now(6))
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index f3d69112efd..64da944a5dc 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
@@ -17,8 +17,8 @@ grant select on *.* to rpl_ignore_grant@localhost;
grant drop on test.* to rpl_ignore_grant@localhost;
show grants for rpl_ignore_grant@localhost;
Grants for rpl_ignore_grant@localhost
-GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
-GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
+GRANT SELECT ON *.* TO `rpl_ignore_grant`@`localhost`
+GRANT DROP ON `test`.* TO `rpl_ignore_grant`@`localhost`
connection slave;
show grants for rpl_ignore_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index 4eeb333d10c..1e0d6f537ab 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -44,54 +44,54 @@ GRANT INSERT ON test.* TO mysqltest6@localhost;
GRANT INSERT ON test.t1 TO mysqltest6@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
-GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
-GRANT SELECT ON `test`.`t1` TO 'mysqltest1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
+GRANT SELECT ON `test`.`t1` TO `mysqltest1`@`localhost`
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
-GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO 'mysqltest2'@'localhost'
-GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO `mysqltest2`@`localhost`
+GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost`
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
-GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost`
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
-GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
-GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
-GRANT INSERT ON `test`.`t1` TO 'mysqltest6'@'localhost'
+GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost`
+GRANT INSERT ON `test`.* TO `mysqltest6`@`localhost`
+GRANT INSERT ON `test`.`t1` TO `mysqltest6`@`localhost`
flush privileges;
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
-GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
+GRANT USAGE ON *.* TO `mysqltest5`@`somehost`
set sql_mode="";
connection slave;
**** Checking grants on slave ****
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
-GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
-GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest2`@`localhost`
+GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost`
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
-GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost`
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
-GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
+GRANT USAGE ON *.* TO `mysqltest5`@`somehost`
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
-GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
-GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
+GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost`
+GRANT INSERT ON `test`.* TO `mysqltest6`@`localhost`
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
**** Revoking grants on master ****
@@ -102,27 +102,27 @@ REVOKE select(a) on t4
from mysqltest3@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
-GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
connection slave;
**** Checking grants on slave ****
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
set global slave_exec_mode='IDEMPOTENT';
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* error.* 1032");
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix.result b/mysql-test/suite/rpl/r/rpl_ip_mix.result
index e139f863c8a..cc11f481991 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix.result
@@ -64,3 +64,5 @@ Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+connection slave;
+reset slave all;
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix2.result b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
index 70599d097a7..d304eff9ab4 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix2.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
@@ -64,3 +64,5 @@ Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+connection slave;
+reset slave all;
diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index 18298986069..04f55fc1263 100644
--- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
@@ -45,4 +45,17 @@ master_pos_wait('master-bin.000001',1000000,1,"my_slave")
STOP SLAVE 'my_slave';
RESET SLAVE 'my_slave' ALL;
change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+#
+# Start of 10.3 tests
+#
+#
+# MDEV-13965 Parameter data type control for Item_longlong_func
+#
+SELECT MASTER_POS_WAIT('x',1,ROW(1,1));
+ERROR HY000: Illegal parameter data type row for operation 'master_pos_wait'
+SELECT MASTER_POS_WAIT('x',1,1,ROW(1,1));
+ERROR HY000: Illegal parameter data type row for operation 'master_pos_wait'
+#
+# End of 10.3 tests
+#
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev-11092.result b/mysql-test/suite/rpl/r/rpl_mdev-11092.result
index 90b809477b2..8bc8fe4a20b 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev-11092.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev-11092.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
+call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*");
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
SET GLOBAL max_binlog_stmt_cache_size = 4096;
diff --git a/mysql-test/suite/rpl/r/rpl_mdev10863.result b/mysql-test/suite/rpl/r/rpl_mdev10863.result
index 158d4a921b7..6accd1ee830 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev10863.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev10863.result
@@ -46,5 +46,6 @@ SET GLOBAL slave_parallel_threads=@old_parallel_threads;
SET GLOBAL max_relay_log_size= @old_max_relay;
include/start_slave.inc
connection server_1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev12179.result b/mysql-test/suite/rpl/r/rpl_mdev12179.result
new file mode 100644
index 00000000000..8373eb43774
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mdev12179.result
@@ -0,0 +1,275 @@
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase");
+SET GLOBAL gtid_pos_auto_engines="innodb";
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+
+SELECT @@SESSION.gtid_pos_auto_engines;
+ERROR HY000: Variable 'gtid_pos_auto_engines' is a GLOBAL variable
+SET GLOBAL gtid_pos_auto_engines= NULL;
+ERROR 42000: Variable 'gtid_pos_auto_engines' can't be set to the value of 'NULL'
+SET GLOBAL gtid_pos_auto_engines="innodb";
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+InnoDB
+SET GLOBAL gtid_pos_auto_engines="myisam,innodb";
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+MyISAM,InnoDB
+SET GLOBAL gtid_pos_auto_engines="innodb,myisam";
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+InnoDB,MyISAM
+SET GLOBAL gtid_pos_auto_engines="innodb,innodb,myisam,innodb,myisam,myisam,innodb";
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+InnoDB,MyISAM
+SET GLOBAL gtid_pos_auto_engines=DEFAULT;
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+
+SET GLOBAL gtid_pos_auto_engines="";
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+
+include/start_slave.inc
+connection server_1;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+connection server_2;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+include/stop_slave.inc
+SET sql_log_bin=0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+CREATE TABLE mysql.gtid_slave_pos_innodb LIKE mysql.gtid_slave_pos;
+ALTER TABLE mysql.gtid_slave_pos_innodb ENGINE=InnoDB;
+INSERT INTO mysql.gtid_slave_pos_innodb SELECT * FROM mysql.gtid_slave_pos;
+TRUNCATE mysql.gtid_slave_pos;
+SET sql_log_bin=1;
+connection server_1;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+include/save_master_gtid.inc
+*** Restart server with --gtid-pos-auto-engines=innodb,myisam ***
+connection server_2;
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+*** Verify no new gtid_slave_pos* tables are created ***
+SELECT table_name, engine FROM information_schema.tables
+WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+table_name engine
+gtid_slave_pos MyISAM
+gtid_slave_pos_innodb InnoDB
+SELECT @@gtid_pos_auto_engines;
+@@gtid_pos_auto_engines
+InnoDB,MyISAM
+include/stop_slave.inc
+SET sql_log_bin=0;
+INSERT INTO mysql.gtid_slave_pos_innodb SELECT * FROM mysql.gtid_slave_pos;
+DROP TABLE mysql.gtid_slave_pos;
+RENAME TABLE mysql.gtid_slave_pos_innodb TO mysql.gtid_slave_pos;
+SET sql_log_bin=1;
+connection server_1;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (4);
+INSERT INTO t2 VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t2 ORDER BY a;
+a
+1
+include/save_master_gtid.inc
+*** Restart server with --gtid-pos-auto-engines=myisam,innodb ***
+connection server_2;
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+SELECT * FROM t2 ORDER BY a;
+a
+1
+*** Verify that no new gtid_slave_pos* tables are auto-created ***
+SELECT table_name, engine FROM information_schema.tables
+WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+table_name engine
+gtid_slave_pos InnoDB
+include/stop_slave.inc
+SET sql_log_bin=0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+SET sql_log_bin=1;
+connection server_1;
+INSERT INTO t1 VALUES (5);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+include/save_master_gtid.inc
+connection server_2;
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+*** Verify that mysql.gtid_slave_pos_InnoDB is auto-created ***
+SELECT lower(table_name), engine FROM information_schema.tables
+WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+lower(table_name) engine
+gtid_slave_pos MyISAM
+gtid_slave_pos_innodb InnoDB
+include/stop_slave.inc
+SET sql_log_bin=0;
+INSERT INTO mysql.gtid_slave_pos SELECT * FROM mysql.gtid_slave_pos_InnoDB;
+DROP TABLE mysql.gtid_slave_pos_InnoDB;
+SET sql_log_bin=1;
+connection server_1;
+INSERT INTO t1 VALUES (6);
+INSERT INTO t2 VALUES (3);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+include/save_master_gtid.inc
+*** Restart server without --gtid-pos-auto-engines ***
+connection server_2;
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+*** Verify that no mysql.gtid_slave_pos* table is auto-created ***
+SELECT table_name, engine FROM information_schema.tables
+WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+table_name engine
+gtid_slave_pos MyISAM
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id max(seq_no)
+0 11
+include/stop_slave.inc
+SET GLOBAL gtid_pos_auto_engines="innodb";
+include/start_slave.inc
+connection server_1;
+INSERT INTO t1 VALUES (7);
+INSERT INTO t2 VALUES (4);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+include/save_master_gtid.inc
+connection server_2;
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+4
+*** Verify that mysql.gtid_slave_pos_InnoDB is auto-created ***
+SELECT lower(table_name), engine FROM information_schema.tables
+WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+lower(table_name) engine
+gtid_slave_pos MyISAM
+gtid_slave_pos_innodb InnoDB
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id max(seq_no)
+0 13
+connection server_2;
+*** Restart the slave server to prove 'gtid_slave_pos_innodb' autodiscovery ***
+connection server_2;
+SELECT max(seq_no) FROM mysql.gtid_slave_pos_InnoDB into @seq_no;
+connection server_1;
+INSERT INTO t2(a) SELECT 1+MAX(a) FROM t2;
+include/save_master_gtid.inc
+connection server_2;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET GLOBAL gtid_pos_auto_engines="";
+SET sql_log_bin=0;
+DROP TABLE mysql.gtid_slave_pos_InnoDB;
+SET sql_log_bin=1;
+include/start_slave.inc
+connection server_1;
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index ee9377906ad..7e26e82d8c9 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -189,7 +189,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
`c``3` VARCHAR(7))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!")
@@ -200,7 +200,7 @@ COMMIT
SET TIMESTAMP=1000000000/*!*/;
truncate `t``1`
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -288,7 +288,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
@@ -296,7 +296,7 @@ INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,1844674407370
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`a``1`:=-9223372036854775808/*!*/;
SET @`a``2`:=42/*!*/;
@@ -383,7 +383,7 @@ master-bin.000002 # Query 1 # COMMIT
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `ts``et`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
index 862851c7a49..74d9cf55cd4 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -651,9 +651,9 @@ DROP TABLE t1, t2, t3;
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
-Check that no more than the expected last two GTIDs are in mysql.gtid_slave_pos
-select count(*) from mysql.gtid_slave_pos order by domain_id, sub_id;
-count(*)
-2
+Check that no more than the expected last four GTIDs are in mysql.gtid_slave_pos
+select count(4) <= 4 from mysql.gtid_slave_pos order by domain_id, sub_id;
+count(4) <= 4
+1
connection server_1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_read_only2.result b/mysql-test/suite/rpl/r/rpl_read_only2.result
new file mode 100644
index 00000000000..c457f49e67d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_read_only2.result
@@ -0,0 +1,53 @@
+include/master-slave.inc
+[connection master]
+#
+# Ensure that read-only slave logs temporary table statements under statement based
+# replication. This is related to MDEV-17863.
+#
+connection slave;
+set global read_only=1;
+connection master;
+create table t1(a int) engine=MyISAM;
+create temporary table tmp1 (a int) engine=MyISAM;
+insert into t1 values(1);
+insert into tmp1 values (2);
+insert into t1 select * from tmp1;
+insert into t1 values(3);
+select * from t1;
+a
+1
+2
+3
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+drop table t1;
+drop temporary table tmp1;
+connection slave;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; create table t1(a int) engine=MyISAM
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; create temporary table tmp1 (a int) engine=MyISAM
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into t1 values(1)
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into tmp1 values (2)
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into t1 select * from tmp1
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `test`; insert into t1 values(3)
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; analyze table t1
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tmp1` /* generated by server */
+set global read_only=0;
+connection master;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index 82f6f537329..2518b207111 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -128,4 +128,6 @@ show binlog events in '';
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
purge master logs before now();
End of 5.0 tests
+#cleanup
include/stop_slave.inc
+reset slave all;
diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index 3ca694a8e76..f7684d5ad97 100644
--- a/mysql-test/suite/rpl/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
@@ -15,6 +15,7 @@ Aaron
Aaron
Ababa
Ababa
+create temporary table tmp select * from mysql.user where host="localhost" and user="root";
connection slave;
STOP SLAVE;
connection master;
@@ -65,5 +66,7 @@ n
3456
connection master;
DROP TABLE t1;
+replace into mysql.user select * from tmp;
+drop temporary table tmp;
connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result b/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result
new file mode 100644
index 00000000000..dc6a67b48d2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result
@@ -0,0 +1,42 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+call mtr.add_suppression("Slave IO thread did not receive an expected Rows-log end-of-statement");
+call mtr.add_suppression("Relay log write failure: could not queue event from master");
+SET @save_debug= @@global.debug;
+SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss";
+include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, MASTER_USE_GTID=SLAVE_POS;
+connection master;
+CREATE TABLE t (a INT, b text(8192));;
+INSERT INTO t values (1, repeat('b', 8192)), (1, repeat('b', 8192));
+connection slave;
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_error.inc [errno=1595]
+SET GLOBAL debug_dbug="-d,simulate_stmt_end_rows_event_loss";
+include/start_slave.inc
+connection master;
+connection slave;
+connection slave;
+include/stop_slave.inc
+connection master;
+SET @save_log_bin_compress= @@GLOBAL.log_bin_compress;
+SET @save_log_bin_compress_min_len= @@GLOBAL.log_bin_compress_min_len;
+SET @@GLOBAL.log_bin_compress=ON;
+SET @@GLOBAL.log_bin_compress_min_len=10;
+INSERT INTO t values (2, repeat('b', 8192)), (2, repeat('b', 8192));
+connection slave;
+SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss";
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_error.inc [errno=1595]
+SET GLOBAL debug_dbug="-d,simulate_stmt_end_rows_event_loss";
+include/start_slave.inc
+connection master;
+connection slave;
+connection master;
+SET @@GLOBAL.log_bin_compress= @save_log_bin_compress;
+SET @@GLOBAL.log_bin_compress_min_len= @save_log_bin_compress_min_len;
+DROP TABLE t;
+connection slave;
+SET GLOBAL debug_dbug= @save_debug;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
index 650f6eeee51..f1a0059a04f 100644
--- a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
@@ -16,7 +16,8 @@ DELETE FROM t1;
DROP TABLE t1;
connection slave;
# Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
-Occurrences: update=1, delete=1
+FOUND 1 /The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err
+FOUND 1 /The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err
include/stop_slave.inc
SET @@GLOBAL.debug_dbug = @saved_dbug;
SET GLOBAL log_warnings = 2;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 6d574681d73..106efb555d3 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -4,6 +4,7 @@ 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("mysqld: Got an error reading communication packets");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
@@ -176,7 +177,7 @@ 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
+Rpl_semi_sync_master_clients 0
[ semi-sync replication of these transactions will fail ]
insert into t1 values (500);
[ master status should be OFF ]
@@ -321,7 +322,6 @@ connection slave;
include/stop_slave.inc
reset slave;
connection master;
-kill query _tid;
connection slave;
include/start_slave.inc
connection master;
@@ -353,7 +353,6 @@ include/stop_slave.inc
reset slave;
connection 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;
@@ -404,7 +403,6 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
connection master;
-kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
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
index 927113726fa..c61340f3967 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
@@ -5,6 +5,7 @@ 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("mysqld: Got an error reading communication packets");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
@@ -177,7 +178,7 @@ 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
+Rpl_semi_sync_master_clients 0
[ semi-sync replication of these transactions will fail ]
insert into t1 values (500);
[ master status should be OFF ]
@@ -322,7 +323,6 @@ connection slave;
include/stop_slave.inc
reset slave;
connection master;
-kill query _tid;
connection slave;
include/start_slave.inc
connection master;
@@ -354,7 +354,6 @@ include/stop_slave.inc
reset slave;
connection 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;
@@ -405,7 +404,6 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
connection master;
-kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
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
index 30280551ce2..6a23f24b66d 100644
--- 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
@@ -5,6 +5,7 @@ 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("mysqld: Got an error reading communication packets");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
@@ -177,7 +178,7 @@ 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
+Rpl_semi_sync_master_clients 0
[ semi-sync replication of these transactions will fail ]
insert into t1 values (500);
[ master status should be OFF ]
@@ -322,7 +323,6 @@ connection slave;
include/stop_slave.inc
reset slave;
connection master;
-kill query _tid;
connection slave;
include/start_slave.inc
connection master;
@@ -354,7 +354,6 @@ include/stop_slave.inc
reset slave;
connection 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;
@@ -405,7 +404,6 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
connection master;
-kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
index c347ff410ac..917e7c2b02b 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
@@ -5,6 +5,7 @@ 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("mysqld: Got an error reading communication packets");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
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
index c237eb8df47..24daf0d72b5 100644
--- 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
@@ -6,6 +6,7 @@ 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("mysqld: Got an error reading communication packets");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result b/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result
new file mode 100644
index 00000000000..786e1682bb0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result
@@ -0,0 +1,33 @@
+include/master-slave.inc
+[connection master]
+connection master;
+SET @@GLOBAL.rpl_semi_sync_master_enabled = 1;
+connection slave;
+include/stop_slave.inc
+SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1;
+include/start_slave.inc
+connection master;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 SET a=1;
+connection slave;
+connection master;
+# Shutdown master
+include/rpl_stop_server.inc [server_number=1]
+connection slave;
+include/stop_slave.inc
+# Restart master
+include/rpl_start_server.inc [server_number=1]
+connection slave;
+include/stop_slave.inc
+Warnings:
+Note 1255 Slave already has been stopped
+include/start_slave.inc
+connection master;
+SET @@GLOBAL.debug_dbug="";
+SET @@GLOBAL. rpl_semi_sync_master_enabled = 0;
+connection master;
+DROP TABLE t1;
+connection slave;
+include/stop_slave.inc
+SET @@GLOBAL. rpl_semi_sync_slave_enabled = 0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result
new file mode 100644
index 00000000000..6b39b296cdf
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result
@@ -0,0 +1,40 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog*");
+set global rpl_semi_sync_master_enabled = ON;
+SET @@GLOBAL.rpl_semi_sync_master_timeout=100;
+create table t1 (i int);
+connection slave;
+set global rpl_semi_sync_slave_enabled = ON;
+CALL mtr.add_suppression("Semi-sync slave net_flush*");
+SET @save_debug= @@global.debug;
+SET GLOBAL debug_dbug="+d,semislave_failed_net_flush";
+include/start_slave.inc
+connection master;
+connection slave;
+"Assert that the net_fulsh() reply failed is present in slave error log.
+FOUND 1 /Semi-sync slave net_flush\(\) reply failed/ in mysqld.2.err
+"Assert that Slave IO thread is up and running."
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running ON
+Slave_IO_Running= Yes
+"Clear the network failure simulation."
+SET GLOBAL debug_dbug= @save_debug;
+connection master;
+insert into t1 values (10);
+connection slave;
+connection slave;
+# Compare the tables on master and slave.
+include/diff_tables.inc [master:t1, slave:t1]
+connection master;
+drop table t1;
+connection slave;
+set global rpl_semi_sync_slave_enabled = OFF;
+connection master;
+set global rpl_semi_sync_master_enabled = OFF;
+SET @@GLOBAL.rpl_semi_sync_master_timeout = 10000;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result
deleted file mode 100644
index 5ba751155e6..00000000000
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result
+++ /dev/null
@@ -1,69 +0,0 @@
-include/master-slave.inc
-[connection master]
-call mtr.add_suppression("Read semi-sync reply network error");
-call mtr.add_suppression("Timeout waiting for reply of binlog");
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master';
-connection slave;
-INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave';
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-connection master;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-CREATE TABLE t1(i int);
-INSERT INTO t1 values (1);
-DROP TABLE t1;
-connection slave;
-include/install_semisync.inc
-connection master;
-connection slave;
-connection slave;
-show global status like "Slave%_running";
-Variable_name Value
-Slave_running ON
-Slaves_running 1
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-Warnings:
-Warning 1620 Plugin is busy and will be uninstalled on shutdown
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-plugin_name plugin_status
-rpl_semi_sync_slave DELETED
-connection master;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-Warnings:
-Warning 1620 Plugin is busy and will be uninstalled on shutdown
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-plugin_name plugin_status
-rpl_semi_sync_master DELETED
-CREATE TABLE t1(i int);
-INSERT INTO t1 values (2);
-DROP TABLE t1;
-connection slave;
-show status like "Rpl_semi_sync_slave_status";
-Variable_name Value
-Rpl_semi_sync_slave_status ON
-connection 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_clients";
-Variable_name Value
-Rpl_semi_sync_master_clients 1
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-plugin_name plugin_status
-rpl_semi_sync_master DELETED
-connection slave;
-include/stop_slave.inc
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-plugin_name plugin_status
-connection master;
-create table t2 (a int);
-drop table t2;
-connection slave;
-include/start_slave.inc
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-plugin_name plugin_status
-connection master;
-CREATE TABLE t1(i int);
-INSERT INTO t1 values (3);
-DROP TABLE t1;
-connection slave;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result
new file mode 100644
index 00000000000..4bf6af2714d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result
@@ -0,0 +1,8 @@
+include/master-slave.inc
+[connection master]
+connection master;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 SET a=1;
+DROP TABLE t1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result b/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result
new file mode 100644
index 00000000000..9607e8a7998
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result
@@ -0,0 +1,353 @@
+include/master-slave.inc
+[connection master]
+CALL mtr.add_suppression("Failed to start semi-sync ACK receiver thread.*");
+CALL mtr.add_suppression("Failed to register slave to semi-sync ACK receiver thread.*");
+CALL mtr.add_suppression("Failed to stop ack receiver thread on pthread_join.*");
+CALL mtr.add_suppression("Got an error reading communication packets:*");
+CALL mtr.add_suppression("Timeout waiting for reply of binlog*");
+CALL mtr.add_suppression("slave_read_sync_header*");
+CALL mtr.add_suppression("Missing magic number for semi-sync*");
+CALL mtr.add_suppression("Got timeout reading communication packets*");
+CALL mtr.add_suppression("Failed to call*");
+CALL mtr.add_suppression("Execution failed on master*");
+CALL mtr.add_suppression("Failed on request_dump()*");
+CALL mtr.add_suppression("Semi-sync master failed on*");
+CALL mtr.add_suppression("Master command COM_BINLOG_DUMP failed*");
+CALL mtr.add_suppression("on master failed*");
+CALL mtr.add_suppression("Master server does not support semi-sync*");
+CALL mtr.add_suppression("Semi-sync slave net_flush*");
+CALL mtr.add_suppression("Failed to flush master info*");
+CALL mtr.add_suppression("Request to stop slave SQL Thread received while apply*");
+connection master;
+[ 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
+connection slave;
+[ enable semi-sync on slave ]
+stop slave;
+set global rpl_semi_sync_slave_enabled = 1;
+start slave;
+show status like 'rpl_semi_sync_slave%';
+Variable_name Value
+Rpl_semi_sync_slave_send_ack 0
+Rpl_semi_sync_slave_status ON
+connection master;
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+connection slave;
+connection master;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like "rpl_semi_sync_master_yes_tx";
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 1
+#########################################
+# Test rpl_semi_sync_master_wait_point #
+#########################################
+# Test after_sync and after_commit first.
+#Test after_sync
+connection con1;
+SET GLOBAL rpl_semi_sync_master_timeout = 1000000;
+SET GLOBAL rpl_semi_sync_master_wait_point= 'AFTER_SYNC';
+SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL after_sync_done WAIT_FOR end";
+INSERT into t1 values (1);;
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
+connection slave;
+#slave can see record (1) after sync slave with master
+select * from t1;
+a
+1
+connection con2;
+#con2 shouldn't see record (1)
+select * from t1;
+a
+SET DEBUG_SYNC= "now SIGNAL end";
+connection con1;
+connection con1;
+select * from t1;
+a
+1
+truncate table t1;
+connection slave;
+connection con1;
+SET DEBUG_SYNC= 'reset';
+SET DEBUG_SYNC= "commit_before_get_LOCK_log SIGNAL before_fetch_done WAIT_FOR more_queue";
+INSERT into t1 VALUES (1);;
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR before_fetch_done";
+SET DEBUG_SYNC= "after_semisync_queue SIGNAL more_queue";
+INSERT INTO t1 VALUES (2);
+connection con1;
+connection con1;
+SET DEBUG_SYNC= 'reset';
+SET DEBUG_SYNC= "commit_before_get_LOCK_log SIGNAL before_fetch_done WAIT_FOR disable_semisync";
+INSERT into t1 VALUES (3);;
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR before_fetch_done";
+SET GLOBAL rpl_semi_sync_master_enabled= 0;
+SET DEBUG_SYNC= "now SIGNAL disable_semisync";
+connection con1;
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+#Test after_commit
+connection con1;
+SET GLOBAL rpl_semi_sync_master_wait_point= 'AFTER_COMMIT';
+SET DEBUG_SYNC= "after_group_after_commit SIGNAL after_commit_done WAIT_FOR end";
+INSERT into t1 values (4);;
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR after_commit_done";
+connection slave;
+select * from t1;
+a
+1
+2
+3
+4
+connection con2;
+select * from t1;
+a
+1
+2
+3
+4
+SET DEBUG_SYNC= "now SIGNAL end";
+connection con1;
+connection con1;
+select * from t1;
+a
+1
+2
+3
+4
+truncate table t1;
+#######################################################
+# Test some other options in order to cover the patch #
+#######################################################
+connection slave;
+# Test rpl_semi_sync_slave_trace_level
+SET GLOBAL rpl_semi_sync_slave_trace_level= 1;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 16;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 64;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 128;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 32;
+connection master;
+# Test rpl_semi_sync_master_trace_level
+SET GLOBAL rpl_semi_sync_master_trace_level= 1;
+SET GLOBAL rpl_semi_sync_master_trace_level= 16;
+SET GLOBAL rpl_semi_sync_master_trace_level= 64;
+SET GLOBAL rpl_semi_sync_master_trace_level= 128;
+SET GLOBAL rpl_semi_sync_master_trace_level= 32;
+# Test rpl_semi_sync_master_timeout
+SET GLOBAL rpl_semi_sync_master_timeout= 1000;
+SET GLOBAL rpl_semi_sync_master_timeout= 10000;
+SET GLOBAL rpl_semi_sync_master_timeout = 1000000;
+# Test rpl_semi_sync_slave_kill_conn_timeout
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 10;
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 20;
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 60;
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 5;
+############################################
+# Test rpl_semi_sync_master_wait_no_slave #
+############################################
+SET GLOBAL rpl_semi_sync_master_wait_no_slave = 1;
+connection slave;
+STOP SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+connection con1;
+SET GLOBAL rpl_semi_sync_master_timeout = 1000;
+INSERT INTO t1 values (1);;
+connection con1;
+# Rpl_semi_sync_master_no_tx should be non-zero
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx'
+connection slave;
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+connection con1;
+INSERT INTO t1 values (2);
+connection slave;
+connection con1;
+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
+connection slave;
+STOP SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+connection con1;
+SET GLOBAL rpl_semi_sync_master_wait_no_slave= 0;
+SET GLOBAL rpl_semi_sync_master_timeout= 1000000000;
+INSERT INTO t1 values (3);
+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
+connection slave;
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+connection con1;
+SET GLOBAL rpl_semi_sync_master_timeout= 10000000;
+SET GLOBAL rpl_semi_sync_master_wait_no_slave= 1;
+INSERT INTO t1 values (4);
+connection slave;
+connection con1;
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+##########################################
+# Test rpl_semi_sync_slave_delay_master #
+##########################################
+connection slave;
+SET GLOBAL rpl_semi_sync_slave_delay_master= 1;
+START SLAVE IO_THREAD;
+Warnings:
+Note 1254 Slave is already running
+include/wait_for_slave_io_to_start.inc
+connection con1;
+INSERT INTO t1 values (3);
+include/sync_slave_io_with_master.inc
+connection con1;
+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
+connection slave;
+connection slave;
+select * from t1 order by a;
+a
+1
+2
+3
+3
+4
+connection con1;
+select * from t1 order by a;
+a
+1
+2
+3
+3
+4
+connection slave;
+SET GLOBAL rpl_semi_sync_slave_delay_master = 0;
+STOP SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+##########################################################
+# Test rpl_semi_sync_master_enabled and new ACK thread #
+#########################################################
+connection con1;
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+INSERT INTO t1 VALUES (1);
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+INSERT INTO t1 VALUES (2);
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+# Test failure of select error .
+SET GLOBAL debug = 'd,rpl_semisync_simulate_select_error';
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+INSERT INTO t1 VALUES(3);
+connection slave;
+connection con1;
+# Test failure of pthread_create
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure';
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET GLOBAL rpl_semi_sync_master_enabled= ON;
+# Test failure of pthread_join
+SET GLOBAL rpl_semi_sync_master_enabled= OFF;
+#
+# Failure on registering semisync slave
+#
+SET GLOBAL debug= 'd,rpl_semisync_simulate_add_slave_failure';
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET GLOBAL rpl_semi_sync_master_enabled= ON;
+connection slave;
+STOP SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+connection con1;
+SET GLOBAL debug='';
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+connection slave;
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+connection con1;
+connection slave;
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+##################################################################
+# Test fixing of BUG#70669 #
+#SLAVE CAN'T CONTINUE REPLICATION AFTER MASTER'S CRASH RECOVERY #
+#################################################################
+connection con1;
+SET GLOBAL sync_binlog = 1;
+CREATE TABLE t2 (c1 INT);
+connection slave;
+connection con1;
+INSERT INTO t2 values (1);
+connection slave;
+connection con2;
+connection con1;
+connection slave;
+show tables like 't2';
+Tables_in_test (t2)
+t2
+select * from t2;
+c1
+1
+connection con1;
+INSERT INTO t2 VALUES (2);
+connection con2;
+INSERT INTO t2 VALUES (3);
+connection con1;
+connection con2;
+connection con1;
+SET GLOBAL sync_binlog = 0;
+DROP TABLE t2;
+connection con2;
+connection slave;
+show tables like 't2';
+Tables_in_test (t2)
+connection con2;
+#cleanup
+connection master;
+SET DEBUG_SYNC= 'reset';
+disconnect con1;
+disconnect con2;
+disconnect con3;
+SET GLOBAL rpl_semi_sync_master_timeout= 10000;
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+DROP TABLE t1;
+connection slave;
+SET GLOBAL rpl_semi_sync_slave_enabled = 0;
+stop slave;
+start slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index 7d351339925..0172336a99c 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection master;
==== Test Without sql_mode=strict_trans_tables ====
create table t1 (n int not null primary key);
connection slave;
@@ -105,9 +107,7 @@ 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
+# Slave_skipped_errros = 4
connection master;
INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1);
@@ -119,9 +119,7 @@ SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2;
connection slave;
-show global status like 'slave_skipped_errors';
-Variable_name Value
-Slave_skipped_errors 5
+# Slave_skipped_errros = 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_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
index 9a34844489f..60ad6dc6e4f 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -35,6 +35,7 @@ a b
1 ZZ
connection slave;
call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* error.* 1146");
+call mtr.add_suppression("At line *");
include/wait_for_slave_sql_error.inc [errno=1146]
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 411a24278d5..686380427b5 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -17,7 +17,7 @@ insert into t1 values (b);
insert into t1 values (unix_timestamp());
end|
select * from mysql.proc where name='foo' and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
declare b int;
set b = 8;
@@ -28,10 +28,10 @@ declare b int;
set b = 8;
insert into t1 values (b);
insert into t1 values (unix_timestamp());
-end
+end NONE
connection slave;
select * from mysql.proc where name='foo' and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
declare b int;
set b = 8;
@@ -42,7 +42,7 @@ declare b int;
set b = 8;
insert into t1 values (b);
insert into t1 values (unix_timestamp());
-end
+end NONE
connection master;
set timestamp=1000000000;
call foo();
@@ -128,6 +128,7 @@ show warnings;
Level Code Message
Error 1062 Duplicate entry '20' for key 'a'
Warning 1196 Some non-transactional changed tables couldn't be rolled back
+Note 4094 At line 4 in mysqltest1.foo4
select * from t2;
a
20
@@ -136,19 +137,19 @@ select * from t2;
a
20
select * from mysql.proc where name="foo4" and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
insert into t2 values(20),(20);
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
insert into t2 values(20),(20);
-end
+end NONE
connection master;
drop procedure foo4;
select * from mysql.proc where name="foo4" and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
connection slave;
select * from mysql.proc where name="foo4" and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
connection master;
drop procedure foo;
drop procedure foo2;
@@ -234,22 +235,22 @@ select fn3();
fn3()
0
select * from mysql.proc where db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
-end
+end NONE
mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
-end
+end NONE
mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
return 0;
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return 0;
-end
+end NONE
select * from t1;
a
1000000000
@@ -259,22 +260,22 @@ select * from t1;
a
1000000000
select * from mysql.proc where db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+db 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 aggregate
mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
-end
+end NONE
mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
-end
+end NONE
mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
return 0;
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return 0;
-end
+end NONE
connection master;
delete from t2;
alter table t2 add unique (a);
@@ -290,6 +291,7 @@ end|
do fn1(100);
Warnings:
Error 1062 Duplicate entry '100' for key 'a'
+Note 4094 At line 3 in mysqltest1.fn1
Warning 1196 Some non-transactional changed tables couldn't be rolled back
select fn1(20);
ERROR 23000: Duplicate entry '20' for key 'a'
@@ -808,7 +810,7 @@ insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values ( NAME_CONST('b',8))
@@ -816,7 +818,7 @@ insert into t1 values ( NAME_CONST('b',8))
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (unix_timestamp())
@@ -824,7 +826,7 @@ insert into t1 values (unix_timestamp())
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -870,7 +872,7 @@ insert into t2 values(3);
insert into t1 values (5);
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -878,7 +880,7 @@ insert into t2 values(3)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (15)
@@ -886,7 +888,7 @@ insert into t1 values (15)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -897,7 +899,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
alter procedure foo4 sql security invoker
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -905,7 +907,7 @@ insert into t2 values(3)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (5)
@@ -913,7 +915,7 @@ insert into t1 values (5)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
@@ -934,7 +936,7 @@ begin
insert into t2 values(20),(20);
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(20),(20)
@@ -962,7 +964,7 @@ insert into t1 values (x);
return x+2;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete t1,t2 from t1,t2
@@ -970,7 +972,7 @@ delete t1,t2 from t1,t2
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
@@ -978,7 +980,7 @@ SELECT `mysqltest1`.`fn1`(20)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(fn1(21))
@@ -996,7 +998,7 @@ begin
return unix_timestamp();
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1004,7 +1006,7 @@ delete from t1
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values(fn1())
@@ -1026,7 +1028,7 @@ begin
return 0;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
@@ -1047,7 +1049,7 @@ insert into t2 values(x),(x);
return 10;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(100)
@@ -1055,7 +1057,7 @@ SELECT `mysqltest1`.`fn1`(100)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
@@ -1063,7 +1065,7 @@ SELECT `mysqltest1`.`fn1`(20)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1074,7 +1076,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
@@ -1082,7 +1084,7 @@ insert into t1 values (1)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1093,7 +1095,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
drop trigger trg
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
@@ -1140,7 +1142,7 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW
SET TIMESTAMP=t/*!*/;
create table t1 (a int)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 (a) values (f1())
@@ -1167,7 +1169,7 @@ SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
INSERT INTO t1 VALUES(arg)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
@@ -1221,7 +1223,7 @@ SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`()
begin end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t values ( 1 )
@@ -1236,7 +1238,7 @@ insert into t values (1);
return 0;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `mysqltest`/*!*/;
SET TIMESTAMP=t/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_sp.result b/mysql-test/suite/rpl/r/rpl_stm_sp.result
new file mode 100644
index 00000000000..4e2d4c80fb6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_sp.result
@@ -0,0 +1,26 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-11815 SP variables of temporal data types do not replicate correctly
+#
+connection master;
+CREATE TABLE t1(a INT);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE a TIME DEFAULT '01:01:01';
+INSERT INTO t1 VALUES (a=10101);
+END;
+$$
+CALL p1;
+SELECT * FROM t1;
+a
+1
+connection slave;
+SELECT * FROM t1;
+a
+1
+connection master;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
index 597df34c302..a4dbf13290a 100644
--- a/mysql-test/suite/rpl/r/rpl_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -16,7 +16,7 @@ include/stop_slave.inc
# It guarantees that SQL thread is applying the transaction when
# STOP SLAVE command launchs.
SET @saved_dbug = @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,after_mysql_insert,*';
+set global debug_dbug= '+d,after_mysql_insert';
include/start_slave.inc
# CREATE TEMPORARY TABLE with InnoDB engine
@@ -101,7 +101,7 @@ include/stop_slave.inc
connection master;
include/stop_dump_threads.inc
SET @saved_dbug = @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,dump_thread_wait_before_send_xid,*';
+set global debug_dbug= '+d,dump_thread_wait_before_send_xid';
connection slave;
include/start_slave.inc
BEGIN;
diff --git a/mysql-test/suite/rpl/r/rpl_trans_no_trans.result b/mysql-test/suite/rpl/r/rpl_trans_no_trans.result
new file mode 100644
index 00000000000..a7a6d921bc1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_trans_no_trans.result
@@ -0,0 +1,44 @@
+include/master-slave.inc
+[connection master]
+create or replace table t1(id int)engine=innodb;
+create or replace table t3(id int)engine=myisam;
+create or replace function t99 (a int)
+returns int(10)
+MODIFIES SQL DATA
+begin
+if (a > 100)
+then
+insert into t3 values (a);
+end if;
+return a;
+end//
+begin;
+insert into t1 values(t99(1));
+insert into t1 values(t99(101));
+commit;
+select * from t1;
+id
+1
+101
+select * from t3;
+id
+101
+insert into t1 values(t99(1));
+drop function t99;
+drop table t1,t3;
+connection slave;
+connection master;
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+CREATE TABLE t2 (j INT) ENGINE=MyISAM;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+SET @a = unknown_column_just_to_raise_an_error;
+INSERT INTO t2 VALUES (NULL) ;
+END||
+INSERT INTO t1 VALUES (1);
+ERROR 42S22: Unknown column 'unknown_column_just_to_raise_an_error' in 'field list'
+connection slave;
+connection master;
+drop trigger tr;
+drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result
index e65dede28e0..1ba259edf8e 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv.result
@@ -40,6 +40,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -52,6 +56,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -64,6 +72,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -76,6 +88,10 @@ connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
#
+# MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
+#
+# End of MDEV-15821
+#
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
#
# End of MDEV-15833
@@ -208,6 +224,26 @@ BIT(5) BIT(6) <Correct error>
BIT(6) BIT(5) <Correct error>
BIT(5) BIT(12) <Correct error>
BIT(12) BIT(5) <Correct error>
+TINYBLOB COMPRE TINYBLOB <Correct error>
+TINYBLOB COMPRE BLOB <Correct error>
+TINYBLOB COMPRE MEDIUMBLOB <Correct error>
+TINYBLOB COMPRE LONGBLOB <Correct error>
+TINYBLOB COMPRE VARBINARY(255) <Correct error>
+BLOB COMPRESSED TINYBLOB <Correct error>
+BLOB COMPRESSED BLOB <Correct error>
+BLOB COMPRESSED MEDIUMBLOB <Correct error>
+BLOB COMPRESSED LONGBLOB <Correct error>
+BLOB COMPRESSED VARBINARY(65500 <Correct error>
+MEDIUMBLOB COMP TINYBLOB <Correct error>
+MEDIUMBLOB COMP BLOB <Correct error>
+MEDIUMBLOB COMP MEDIUMBLOB <Correct error>
+MEDIUMBLOB COMP LONGBLOB <Correct error>
+MEDIUMBLOB COMP VARBINARY(65500 <Correct error>
+LONGBLOB COMPRE TINYBLOB <Correct error>
+LONGBLOB COMPRE BLOB <Correct error>
+LONGBLOB COMPRE MEDIUMBLOB <Correct error>
+LONGBLOB COMPRE LONGBLOB <Correct error>
+LONGBLOB COMPRE VARBINARY(65500 <Correct error>
TINYBLOB BLOB <Correct error>
TINYBLOB MEDIUMBLOB <Correct error>
TINYBLOB LONGBLOB <Correct error>
@@ -352,6 +388,26 @@ BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
+TINYBLOB COMPRE TINYBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE BLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE LONGBLOB ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE VARBINARY(255) ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED TINYBLOB ALL_NON_LOSSY <Correct error>
+BLOB COMPRESSED BLOB ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED LONGBLOB ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED VARBINARY(65500 ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB COMP TINYBLOB ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB COMP BLOB ALL_NON_LOSSY <Correct error>
+MEDIUMBLOB COMP MEDIUMBLOB ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP LONGBLOB ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP VARBINARY(65500 ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE TINYBLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE BLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE MEDIUMBLOB ALL_NON_LOSSY <Correct error>
+LONGBLOB COMPRE LONGBLOB ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE VARBINARY(65500 ALL_NON_LOSSY <Correct error>
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
TINYBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
@@ -496,6 +552,26 @@ BIT(5) BIT(6) ALL_LOSSY <Correct error>
BIT(6) BIT(5) ALL_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY <Correct error>
BIT(12) BIT(5) ALL_LOSSY <Correct value>
+TINYBLOB COMPRE TINYBLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE BLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE MEDIUMBLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE LONGBLOB ALL_LOSSY <Correct error>
+TINYBLOB COMPRE VARBINARY(255) ALL_LOSSY <Correct error>
+BLOB COMPRESSED TINYBLOB ALL_LOSSY <Correct value>
+BLOB COMPRESSED BLOB ALL_LOSSY <Correct error>
+BLOB COMPRESSED MEDIUMBLOB ALL_LOSSY <Correct error>
+BLOB COMPRESSED LONGBLOB ALL_LOSSY <Correct error>
+BLOB COMPRESSED VARBINARY(65500 ALL_LOSSY <Correct value>
+MEDIUMBLOB COMP TINYBLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB COMP BLOB ALL_LOSSY <Correct value>
+MEDIUMBLOB COMP MEDIUMBLOB ALL_LOSSY <Correct error>
+MEDIUMBLOB COMP LONGBLOB ALL_LOSSY <Correct error>
+MEDIUMBLOB COMP VARBINARY(65500 ALL_LOSSY <Correct value>
+LONGBLOB COMPRE TINYBLOB ALL_LOSSY <Correct value>
+LONGBLOB COMPRE BLOB ALL_LOSSY <Correct value>
+LONGBLOB COMPRE MEDIUMBLOB ALL_LOSSY <Correct value>
+LONGBLOB COMPRE LONGBLOB ALL_LOSSY <Correct error>
+LONGBLOB COMPRE VARBINARY(65500 ALL_LOSSY <Correct value>
TINYBLOB BLOB ALL_LOSSY <Correct error>
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
TINYBLOB LONGBLOB ALL_LOSSY <Correct error>
@@ -640,6 +716,26 @@ BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+TINYBLOB COMPRE VARBINARY(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+BLOB COMPRESSED VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+MEDIUMBLOB COMP VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+LONGBLOB COMPRE VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
diff --git a/mysql-test/suite/rpl/r/rpl_update.result b/mysql-test/suite/rpl/r/rpl_update.result
new file mode 100644
index 00000000000..31bc50a78de
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_update.result
@@ -0,0 +1,16 @@
+include/master-slave.inc
+[connection master]
+set sql_mode=simultaneous_assignment;
+create table t1 (a int, b int);
+insert into t1 values(1, 2);
+update t1 set a=b, b=a;
+select * from t1;
+a b
+2 1
+connection slave;
+select * from t1;
+a b
+2 1
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view_debug.result b/mysql-test/suite/rpl/r/rpl_view_debug.result
index e23f33c035f..1ec3dda9daa 100644
--- a/mysql-test/suite/rpl/r/rpl_view_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_view_debug.result
@@ -24,7 +24,7 @@ connection master;
SET @saved_dbug = @@SESSION.debug_dbug;
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
+ERROR HY000: Out of memory.
show tables;
Tables_in_test
t1
diff --git a/mysql-test/suite/rpl/r/sequence.result b/mysql-test/suite/rpl/r/sequence.result
new file mode 100644
index 00000000000..6286c5c7106
--- /dev/null
+++ b/mysql-test/suite/rpl/r/sequence.result
@@ -0,0 +1,129 @@
+include/rpl_init.inc [topology=1->2->3]
+include/rpl_connect.inc [creating master]
+include/rpl_connect.inc [creating slave]
+include/rpl_connect.inc [creating slave2]
+connection master;
+set @@default_storage_engine="aria";
+CREATE SEQUENCE s1 cache=10;
+create table t1 select * from s1;
+select NEXT VALUE for s1,seq from seq_1_to_20;
+NEXT VALUE for s1 seq
+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
+insert into t1 select * from s1;
+do setval(s1,5, 1, 0);
+insert into t1 select * from s1;
+do setval(s1, 5000, 1 ,0);
+insert into t1 select * from s1;
+alter sequence s1 minvalue=-1 start=-1 restart=-1;
+insert into t1 select * from s1;
+insert into s1 values(-100,-1000,9223372036854775806,1,1,1000,0,0);
+insert into t1 select * from s1;
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 10 0 0
+21 1 9223372036854775806 1 1 10 0 0
+21 1 9223372036854775806 1 1 10 0 0
+5001 1 9223372036854775806 1 1 10 0 0
+-1 -1 9223372036854775806 -1 1 10 0 0
+-100 -1000 9223372036854775806 1 1 1000 0 0
+connection slave;
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 10 0 0
+21 1 9223372036854775806 1 1 10 0 0
+21 1 9223372036854775806 1 1 10 0 0
+5001 1 9223372036854775806 1 1 10 0 0
+-1 -1 9223372036854775806 -1 1 10 0 0
+-100 -1000 9223372036854775806 1 1 1000 0 0
+connection slave2;
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 10 0 0
+21 1 9223372036854775806 1 1 10 0 0
+21 1 9223372036854775806 1 1 10 0 0
+5001 1 9223372036854775806 1 1 10 0 0
+-1 -1 9223372036854775806 -1 1 10 0 0
+-100 -1000 9223372036854775806 1 1 1000 0 0
+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 SEQUENCE s1 cache=10
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) PAGE_CHECKSUM=1
+master-bin.000001 # Annotate_rows # # create table t1 select * from s1
+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 # Annotate_rows # # select NEXT VALUE for s1,seq from seq_1_to_20
+master-bin.000001 # Table_map # # table_id: # (test.s1)
+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 # Annotate_rows # # insert into t1 select * from s1
+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 # Annotate_rows # # insert into t1 select * from s1
+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 # Annotate_rows # # do setval(s1, 5000, 1 ,0)
+master-bin.000001 # Table_map # # table_id: # (test.s1)
+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 # Annotate_rows # # insert into t1 select * from s1
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; alter sequence s1 minvalue=-1 start=-1 restart=-1
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # insert into t1 select * from s1
+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 # Annotate_rows # # insert into s1 values(-100,-1000,9223372036854775806,1,1,1000,0,0)
+master-bin.000001 # Table_map # # table_id: # (test.s1)
+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 # Annotate_rows # # insert into t1 select * from s1
+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
+connection master;
+drop table s1,t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
index 64219e3908d..999d9417b3f 100644
--- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
+++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
@@ -3,6 +3,7 @@ include/master-slave.inc
call mtr.add_suppression("Master is configured to log replication events");
connection slave;
connection slave;
+include/wait_for_slave_to_stop.inc
start slave;
connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_000011.test b/mysql-test/suite/rpl/t/rpl_000011.test
index 216e568fc42..289b79f7de8 100644
--- a/mysql-test/suite/rpl/t/rpl_000011.test
+++ b/mysql-test/suite/rpl/t/rpl_000011.test
@@ -5,19 +5,19 @@
#
source include/master-slave.inc;
-
+--connection slave
+let $initial_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
+--connection master
create table t1 (n int);
insert into t1 values(1);
-sync_slave_with_master;
-show global status like 'com_insert';
+sync_slave_with_master;
+let $current_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
+--let $delta_com_insert= `select $current_com_insert - $initial_com_insert from dual`
+--echo # Com_insert = $delta_com_insert
stop slave;
-# Temporary work-around for bug MDEV-8301. There is a small window during
-# thread exit where the local status values of a thread are counted twice
-# in the global status. Remove this wait_condition.inc once MDEV-8301 is
-# fixed.
---let $wait_condition= SELECT variable_value=1 FROM information_schema.global_status WHERE variable_name="Com_insert";
---source include/wait_condition.inc
-show global status like 'com_insert';
+let $current_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
+--let $delta_com_insert= `select $current_com_insert - $initial_com_insert from dual`
+--echo # Com_insert = $delta_com_insert
--source include/wait_for_slave_to_stop.inc
start slave;
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/rpl/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test
index 28c5af0a192..b2ca3aacb58 100644
--- a/mysql-test/suite/rpl/t/rpl_EE_err.test
+++ b/mysql-test/suite/rpl/t/rpl_EE_err.test
@@ -1,2 +1,2 @@
let $engine_type=myisam;
--- source extra/rpl_tests/rpl_EE_err.test
+-- source include/rpl_EE_err.test
diff --git a/mysql-test/suite/rpl/t/rpl_alter_instant.test b/mysql-test/suite/rpl/t/rpl_alter_instant.test
new file mode 100644
index 00000000000..260f7e92d10
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_alter_instant.test
@@ -0,0 +1,50 @@
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+use test;
+create table t1 (id int primary key, c1 int default 10, c2 varchar(20) default 'holiday') engine = innodb;
+
+insert into t1 values(1, 12345, 'abcde'), (2, default, default), (3, 23456, 'xyzab');
+
+set time_zone='+03:00';
+set timestamp = 1;
+alter table t1 add column d1 timestamp not null default current_timestamp;
+
+select * from t1;
+sync_slave_with_master;
+
+connection slave;
+set time_zone='+03:00';
+select * from t1;
+
+connection master;
+alter table t1 add column d2 timestamp not null default current_timestamp, ALGORITHM=copy;
+
+sync_slave_with_master;
+
+connection slave;
+select * from t1;
+
+connection master;
+drop table t1;
+
+
+# datetime
+create table t4 (id int primary key, c2 int);
+insert into t4 values(1,1),(2,2),(3,3);
+set timestamp = 1000;
+alter table t4 add column (c3 datetime default current_timestamp(), c4 timestamp not null default current_timestamp());
+select * from t4;
+alter table t4 add column c5 time not null default current_timestamp();
+alter table t4 add column c6 date not null default current_timestamp();
+
+select * from t4;
+sync_slave_with_master;
+
+connection slave;
+select * from t4;
+
+connection master;
+drop table t4;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test
index fe0f1689471..6d01fdb8796 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment.test
@@ -4,4 +4,4 @@
-- source include/have_innodb.inc
let $engine_type=innodb;
let $engine_type2=myisam;
--- source extra/rpl_tests/rpl_auto_increment.test
+-- source include/rpl_auto_increment.test
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test b/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
index b5eb3c5408a..82db8f08c90 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
@@ -21,43 +21,43 @@ source include/master-slave.inc;
--echo # Test case1: INVOKES A TRIGGER with after insert action
let $trigger_action = after insert;
-source extra/rpl_tests/rpl_auto_increment_invoke_trigger.test;
+source include/rpl_auto_increment_invoke_trigger.test;
--echo # Test case2: INVOKES A TRIGGER with before insert action
let $trigger_action = before insert;
-source extra/rpl_tests/rpl_auto_increment_invoke_trigger.test;
+source include/rpl_auto_increment_invoke_trigger.test;
--echo # Test case3: INVOKES A TRIGGER with after update action
let $trigger_action = after update;
-source extra/rpl_tests/rpl_auto_increment_invoke_trigger.test;
+source include/rpl_auto_increment_invoke_trigger.test;
--echo # Test case4: INVOKES A TRIGGER with before update action
let $trigger_action = before update;
-source extra/rpl_tests/rpl_auto_increment_invoke_trigger.test;
+source include/rpl_auto_increment_invoke_trigger.test;
--echo # Test case5: INVOKES A TRIGGER with after delete action
let $trigger_action = after delete;
-source extra/rpl_tests/rpl_auto_increment_invoke_trigger.test;
+source include/rpl_auto_increment_invoke_trigger.test;
--echo # Test case6: INVOKES A TRIGGER with before delete action
let $trigger_action = before delete;
-source extra/rpl_tests/rpl_auto_increment_invoke_trigger.test;
+source include/rpl_auto_increment_invoke_trigger.test;
--echo # Test case7: CALLS A FUNCTION which INVOKES A TRIGGER with after insert action
let $insert_action = after insert;
-source extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test;
+source include/rpl_autoinc_func_invokes_trigger.test;
--echo # Test case8: CALLS A FUNCTION which INVOKES A TRIGGER with before insert action
let $insert_action = before insert;
-source extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test;
+source include/rpl_autoinc_func_invokes_trigger.test;
--echo # Test case9: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with after insert action
let $insert_action = after insert;
-source extra/rpl_tests/rpl_auto_increment_insert_view.test;
+source include/rpl_auto_increment_insert_view.test;
--echo # Test case10: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with before insert action
let $insert_action = before insert;
-source extra/rpl_tests/rpl_auto_increment_insert_view.test;
+source include/rpl_auto_increment_insert_view.test;
--echo # Test case11: INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES INTO A TABLE WITH AUTOINC COLUMN
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
index 6a2cf20d756..30faaf79613 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_binlog_errors.inc
+--source include/rpl_binlog_errors.inc
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test
index 9128382d12b..927f0d80778 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole.test
@@ -20,6 +20,6 @@ source include/master-slave.inc;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-source extra/rpl_tests/rpl_blackhole_basic.test;
+source include/rpl_blackhole_basic.test;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test b/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test
index 86ad32aafac..afc8e25766a 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test
@@ -32,7 +32,7 @@ SET timestamp=1000000000;
RESET MASTER;
connection master;
-source extra/rpl_tests/rpl_blackhole_basic.test;
+source include/rpl_blackhole_basic.test;
# Verify on slave.
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
index 6d222cba115..573c1d111fc 100644
--- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_cant_read_event_incident.inc
+--source include/rpl_cant_read_event_incident.inc
diff --git a/mysql-test/suite/rpl/t/rpl_charset.test b/mysql-test/suite/rpl/t/rpl_charset.test
index 3ed9147508e..31ea2bc8f07 100644
--- a/mysql-test/suite/rpl/t/rpl_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_charset.test
@@ -1,2 +1,2 @@
let $engine_type=myisam;
-source extra/rpl_tests/rpl_charset.test;
+source include/rpl_charset.test;
diff --git a/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test
index 8e006b1b6a0..0edf8fda7f3 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_checksum.inc
+--source include/rpl_checksum.inc
diff --git a/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
index 56c3e1e1cb5..59b338d2556 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_checksum_cache.inc
+--source include/rpl_checksum_cache.inc
diff --git a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
index 1e2ca875190..5d54790827c 100644
--- a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
+++ b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
@@ -1,5 +1,5 @@
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type=innodb;
--- source extra/rpl_tests/rpl_commit_after_flush.test
+-- source include/rpl_commit_after_flush.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test
index 310b0cef8e8..e51d1c65e95 100644
--- a/mysql-test/suite/rpl/t/rpl_corruption.test
+++ b/mysql-test/suite/rpl/t/rpl_corruption.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_corruption.inc
+--source include/rpl_corruption.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
index 9280f35f638..c26243ab3c6 100644
--- a/mysql-test/suite/rpl/t/rpl_create_drop_view.test
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_view.test
@@ -41,7 +41,7 @@ connection master;
DROP VIEW v1;
DROP TABLE t1;
---error ER_BAD_TABLE_ERROR
+--error ER_UNKNOWN_VIEW
DROP VIEW v1;
DROP VIEW IF EXISTS v2;
diff --git a/mysql-test/suite/rpl/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test
index 2045ec97edd..b11a6927f09 100644
--- a/mysql-test/suite/rpl/t/rpl_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_ddl.test
@@ -28,5 +28,5 @@ let $engine_type= InnoDB;
let $temp_engine_type= MEMORY;
let $show_binlog = 0;
let $manipulate = 0;
--- source extra/rpl_tests/rpl_ddl.test
+-- source include/rpl_ddl.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index ade915da105..e2311cb06b5 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
@@ -1,4 +1,4 @@
-- source include/have_innodb.inc
-- source include/long_test.inc
let $engine_type=innodb;
--- source extra/rpl_tests/rpl_deadlock.test
+-- source include/rpl_deadlock.test
diff --git a/mysql-test/suite/rpl/t/rpl_delayed_slave.test b/mysql-test/suite/rpl/t/rpl_delayed_slave.test
index 2400a821e2b..7dd7b9cf6d9 100644
--- a/mysql-test/suite/rpl/t/rpl_delayed_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_delayed_slave.test
@@ -109,7 +109,7 @@ eval CHANGE MASTER TO MASTER_DELAY = $time2;
INSERT INTO t1 VALUES ('normal setup', 1);
--let $query_number= 1
---source extra/rpl_tests/delayed_slave_wait_on_query.inc
+--source include/delayed_slave_wait_on_query.inc
--echo ==== Slave lags "naturally" after master ====
@@ -258,7 +258,7 @@ INSERT INTO t1 VALUES ('stop slave and start slave: DML', 7);
--source include/rpl_assert.inc
--let $query_number= 7
---source extra/rpl_tests/delayed_slave_wait_on_query.inc
+--source include/delayed_slave_wait_on_query.inc
--echo ==== STOP SLAVE / START SLAVE + DDL ====
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 9ab637063e0..c07649cb49a 100644
--- a/mysql-test/suite/rpl/t/rpl_delete_no_where.test
+++ b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
@@ -1,4 +1,4 @@
-- source include/master-slave.inc
let $engine_type=myisam;
--- source extra/rpl_tests/rpl_delete_no_where.test
+-- source include/rpl_delete_no_where.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index f66187b12f5..372afaa63c6 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -13,8 +13,8 @@ insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
---replace_result \\ / 66 39 93 39 17 39 247 39 "File exists" "Directory not empty"
---error 1010
+--replace_result \\ / 66 39 93 39 17 39 247 39 41 39 "File exists" "Directory not empty"
+--error ER_DB_DROP_RMDIR
drop database mysqltest1;
use mysqltest1;
show tables;
@@ -30,8 +30,8 @@ while ($1)
}
--enable_query_log
---replace_result \\ / 66 39 93 39 17 39 247 39 "File exists" "Directory not empty"
---error 1010
+--replace_result \\ / 66 39 93 39 17 39 247 39 41 39 "File exists" "Directory not empty"
+--error ER_DB_DROP_RMDIR
drop database mysqltest1;
use mysqltest1;
show tables;
diff --git a/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-test/suite/rpl/t/rpl_drop_view.test
index 55a0ea104d8..1893dd21926 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_view.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_view.test
@@ -13,9 +13,9 @@ create table t3 (c int);
create view v1 as select * from t1;
create view v2 as select * from t2;
create view v3 as select * from t3;
---error 1051
+--error ER_UNKNOWN_VIEW
drop view not_exist_view;
---error 1051
+--error ER_UNKNOWN_VIEW
drop view v1, not_exist_view;
--error 1146
select * from v1;
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 5bdf8ad2412..3e73fc7a3ee 100644
--- a/mysql-test/suite/rpl/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -9,16 +9,158 @@
SET @old_event_scheduler = @@global.event_scheduler;
set global event_scheduler=1;
-let $engine_type= MyISAM;
+# first, we need a table to record something from an event
+
+eval CREATE TABLE `t1` (
+ `id` INT(10) UNSIGNED NOT NULL,
+ `c` VARCHAR(50) NOT NULL,
+ `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 (id, c) VALUES (1, 'manually');
+
+# We create the event so that it inserts exactly 1 row in the table
+# A recuring event is used so that we can be sure the event will
+# fire regardless of timing delays on the server. Otherwise, it is
+# possible for the event to timeout before it has inserted a row.
+--echo "Creating event test.justonce on the master"
+CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO
+ INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce');
+
+# Show the event is alive and present on master
+--echo "Checking event is active on master"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
+
+# Wait until event has fired. We know this because t1 will contain
+# the row from the event.
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM t1 WHERE c = 'from justonce';
+--source include/wait_condition.inc
+
+# check that table t1 contains something
+--echo "Checking event data on the master"
+let $events_done=`SELECT count(*) FROM t1 id`;
+--disable_query_log
+eval SELECT $events_done > 0 as ONE;
+--enable_query_log
---source include/rpl_events.inc
+sync_slave_with_master;
+
+--echo "Checking event data on the slave"
+--disable_query_log
+eval SELECT count(*) - $events_done as ZERO FROM t1 id;
+--enable_query_log
+
+--echo "Checking event is inactive on slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
+
+# Create an event on the slave and check to see what the originator is.
+--echo "Dropping event test.slave_once on the slave"
+--disable_warnings
+DROP EVENT IF EXISTS test.slave_once;
+--enable_warnings
+
+# Create an event on slave and check its state. An event shouldn't be executed
+# so set start time in 1 hour.
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+ INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
+
+--echo "Checking event status on the slave for originator value = slave's server_id"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
+
+--echo "Dropping event test.slave_once on the slave"
+--disable_warnings
+DROP EVENT IF EXISTS test.slave_once;
+--enable_warnings
+
+connection master;
+
+# BUG#20384 - disable events on slave
+--echo "Dropping event test.justonce on the master"
+--disable_warnings
+DROP EVENT IF EXISTS test.justonce;
+--enable_warnings
+
+# Create an event on master and check its state on slave. An event shouldn't be executed
+# so set start time in 1 hour. Check that changes of event statement replicated to slave
+
+--echo "Creating event test.er on the master"
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+ INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
+
+--echo "Checking event status on the master"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+
+sync_slave_with_master;
+
+--echo "Checking event status on the slave"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+
+connection master;
+--echo "Altering event test.er on the master"
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+ INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
+
+--echo "Checking event status on the master"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+
+sync_slave_with_master;
+
+--echo "Checking event status on the slave"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+
+connection master;
+--echo "Dropping event test.er on the master"
+DROP EVENT test.er;
+
+--echo "Checking event status on the master"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
+
+--disable_info
+
+sync_slave_with_master;
+
+--echo "Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
+
+# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status
+# on CREATE EVENT
+
+# Create an event on slave and check its status. An event shouldn't be executed
+# so set start time in 1 hour.
+
+--echo "Creating event test.slave_terminate on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+ INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
+
+--echo "Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+
+--echo "Dropping event test.slave_terminate on the slave"
+DROP EVENT test.slave_terminate;
+
+--echo "Creating event test.slave_terminate with DISABLE ON SLAVE on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
+ INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate');
+
+--echo "Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+
+--echo "Dropping event test.slave_terminate on the slave"
+DROP EVENT test.slave_terminate;
+
+--echo "Cleanup"
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+connection master;
#
# Bug #28953 Using events in a replication let the slave crash.
#
-connection master;
-
CREATE TABLE t28953 (a INT);
DELIMITER |;
@@ -39,7 +181,7 @@ DROP EVENT event2;
#
# BUG#44331
# This test verifies if the definer is consistent between master and slave,
-# when the event is created without the DEFINER clause set explicitly or the
+# when the event is created without the DEFINER clause set explicitly or the
# DEFINER is set to CURRENT_USER
#
CREATE TABLE test.t1(details CHAR(30));
@@ -53,7 +195,7 @@ CREATE DEFINER=CURRENT_USER /*!50000 EVENT event44331_2 */
ON SCHEDULE AT CURRENT_TIMESTAMP
ON COMPLETION PRESERVE DISABLE
DO INSERT INTO test.t1 VALUES('event event44331_2 fired - DEFINER=CURRENT_USER');
-
+
CREATE DEFINER=CURRENT_USER() EVENT event44331_3
ON SCHEDULE AT CURRENT_TIMESTAMP
ON COMPLETION PRESERVE DISABLE
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
index 201392346be..63ae0fce9ba 100644
--- a/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
@@ -6,6 +6,6 @@
-- source include/master-slave.inc
let $engine_type = 'InnoDB';
---source extra/rpl_tests/rpl_extra_col_master.test
+--source include/rpl_extra_col_master.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
index 4f344cfaca9..72a35992fe5 100644
--- a/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
@@ -5,6 +5,6 @@
-- source include/master-slave.inc
let $engine_type = 'MyISAM';
---source extra/rpl_tests/rpl_extra_col_master.test
+--source include/rpl_extra_col_master.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
index f4b04468273..e16e1dba408 100644
--- a/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
@@ -3,5 +3,5 @@
-- source include/master-slave.inc
let $engine_type = 'InnoDB';
--- source extra/rpl_tests/rpl_extra_col_slave.test
+-- source include/rpl_extra_col_slave.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
index d8d64aed566..f1e9fa242cc 100644
--- a/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
@@ -2,5 +2,5 @@
-- source include/master-slave.inc
let $engine_type = 'MyISAM';
--- source extra/rpl_tests/rpl_extra_col_slave.test
+-- source include/rpl_extra_col_slave.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
index 99860f16966..a65c19cb38c 100644
--- a/mysql-test/suite/rpl/t/rpl_failed_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
@@ -1,3 +1,3 @@
-- source include/have_innodb.inc
let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_failed_optimize.test
+-- source include/rpl_failed_optimize.test
diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
index a61c06a92e5..02665c70b9e 100644
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
@@ -6,7 +6,7 @@
# The COLLATION_SERVER and TIME_ZONE are got only on master server version 4.
# So they can't be verified by test case here.
# Finish the following tests by calling its common test script:
-# extra/rpl_tests/rpl_get_master_version_and_clock.test.
+# include/rpl_get_master_version_and_clock.test.
source include/have_debug.inc;
source include/have_debug_sync.inc;
@@ -28,17 +28,17 @@ call mtr.add_suppression("Slave I/O thread .* register on master");
#Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
SET @saved_dbug = @@GLOBAL.debug_dbug;
-# set up two parameters to pass into extra/rpl_tests/rpl_get_master_version_and_clock
+# set up two parameters to pass into include/rpl_get_master_version_and_clock
let $dbug_sync_point= 'debug_lock.before_get_UNIX_TIMESTAMP';
let $debug_sync_action= 'now SIGNAL signal.get_unix_timestamp';
-source extra/rpl_tests/rpl_get_master_version_and_clock.test;
+source include/rpl_get_master_version_and_clock.test;
#Test case 2: Try to get the value of the SERVER_ID from master under network disconnection
connection slave;
let $dbug_sync_point= 'debug_lock.before_get_SERVER_ID';
let $debug_sync_action= 'now SIGNAL signal.get_server_id';
-source extra/rpl_tests/rpl_get_master_version_and_clock.test;
+source include/rpl_get_master_version_and_clock.test;
# cleanup
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
index b04f82e1725..004003ea524 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -1,4 +1,4 @@
---source extra/rpl_tests/rpl_gtid_basic.inc
+--source include/rpl_gtid_basic.inc
--echo #
--echo # Start of 10.2 tests
@@ -14,3 +14,23 @@ CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600
--echo #
--echo # End of 10.2 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-13967 Parameter data type control for Item_long_func
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT MASTER_GTID_WAIT(ROW(1,1),'str');
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT MASTER_GTID_WAIT('str',ROW(1,1));
+
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
index cf749dd8d65..e72d1c3ef47 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
@@ -161,8 +161,9 @@ EOF
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
wait
EOF
-SET GLOBAL debug_dbug="+d,crash_commit_before";
START SLAVE;
+--error 0,2006,2013
+SET GLOBAL debug_dbug="+d,crash_commit_before";
--connection server_1
INSERT INTO t1 VALUES (5);
@@ -185,8 +186,9 @@ EOF
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
wait
EOF
-SET GLOBAL debug_dbug="+d,crash_commit_after";
START SLAVE;
+--error 0,2006,2013
+SET GLOBAL debug_dbug="+d,crash_commit_after";
--connection server_1
INSERT INTO t1 VALUES (6);
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
index 517e5073b2d..c02e2670c92 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
@@ -17,7 +17,7 @@ INSERT INTO t1 VALUES (1);
--connection slave
CALL mtr.add_suppression("Slave: Failed to open mysql.gtid_slave_pos");
---let $slave_sql_errno=1942
+--let $slave_sql_errno=1944
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
@@ -25,19 +25,19 @@ ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id, domain_id);
START SLAVE;
---let $slave_sql_errno=1942
+--let $slave_sql_errno=1944
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
START SLAVE;
---let $slave_sql_errno=1942
+--let $slave_sql_errno=1944
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (sub_id);
START SLAVE;
---let $slave_sql_errno=1942
+--let $slave_sql_errno=1944
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_ignored.test b/mysql-test/suite/rpl/t/rpl_gtid_ignored.test
index cb98be3c838..6e927bd5a77 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_ignored.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_ignored.test
@@ -129,6 +129,7 @@ SELECT * FROM t1 ORDER BY a;
# Clean up.
--connection server_1
DROP TABLE t1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
SET debug_sync = "reset";
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4484.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4484.test
index 5b13a5e1fc1..e1f5696f5a1 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4484.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4484.test
@@ -2,6 +2,18 @@
--source include/have_debug.inc
--source include/master-slave.inc
+--connection slave
+--source include/stop_slave.inc
+# Since we inject an error updating mysql.gtid_slave_pos, we will get different
+# output depending on whether it is InnoDB or MyISAM (roll back or no roll
+# back). So fix it to make sure we are consistent, in case an earlier test case
+# left it as InnoDB.
+SET sql_log_bin=0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+SET sql_log_bin=1;
+--source include/start_slave.inc
+
+--connection master
CREATE TABLE t1 (i int) ENGINE=InnoDB;
--sync_slave_with_master
@@ -20,10 +32,6 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,gtid_slave_pos_simulate_failed_delete";
SET sql_log_bin= 0;
CALL mtr.add_suppression("Can't find file");
-# Since we inject an error updating mysql.gtid_slave_pos, we will get different
-# output depending on whether it is InnoDB or MyISAM (roll back or no roll
-# back). So fix it to make sure we are consistent.
-ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET sql_log_bin= 1;
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
index 3d605f3f213..4202aa82516 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -232,6 +232,20 @@ EOF
SET sql_log_bin= 0;
ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET sql_log_bin= 1;
+# Do a second restart to get the mysql.gtid_slave_pos table loaded with
+# the right engine.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart:
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
--source include/start_slave.inc
--connection server_1
@@ -285,7 +299,7 @@ SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
--connection server_2
SET sql_log_bin=0;
--let $old_pos= `SELECT @@GLOBAL.gtid_slave_pos`
-RENAME TABLE mysql.gtid_slave_pos TO mysql.gtid_slave_pos_old;
+RENAME TABLE mysql.gtid_slave_pos TO mysql.old_gtid_slave_pos;
SET sql_log_bin=1;
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
@@ -313,7 +327,7 @@ SHOW WARNINGS;
# Restore things.
SET sql_log_bin=0;
-RENAME TABLE mysql.gtid_slave_pos_old TO mysql.gtid_slave_pos;
+RENAME TABLE mysql.old_gtid_slave_pos TO mysql.gtid_slave_pos;
CALL mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
SET sql_log_bin=1;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until.test b/mysql-test/suite/rpl/t/rpl_gtid_until.test
index 20d4510ccc8..aa05ecf79ab 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_until.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_until.test
@@ -19,6 +19,9 @@ delimiter ;|
--connection server_2
--sync_with_master
+# Restart SQL thread to pick up ALTER TABLE of mysql.gtid_slave_pos.
+--source include/stop_slave.inc
+--source include/start_slave.inc
# Both replication threads must be stopped for UNTIL master_gtid_pos.
--error ER_SLAVE_WAS_RUNNING
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 9be855e1a8b..4bb6477ca98 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_incident.inc
+--source include/rpl_incident.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
index 6f515b9390a..6f6ab7e8d7c 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_init_slave_errors.inc
+--source include/rpl_init_slave_errors.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_insert_delayed.test
index 342b9115de8..6a88899fec3 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_delayed.test
@@ -1,5 +1,5 @@
--source include/not_embedded.inc
--source include/not_windows.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_insert_delayed.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test
index ad32ad24b33..c9d84049ff6 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id.test
@@ -3,4 +3,4 @@
#################################
-- source include/have_innodb.inc
let $engine_type=myisam;
--- source extra/rpl_tests/rpl_insert_id.test
+-- source include/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 148afdac87b..d9ba2a2bdcc 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
@@ -3,4 +3,4 @@
#################################
-- source include/have_innodb.inc
let $engine_type=innodb;
--- source extra/rpl_tests/rpl_insert_id_pk.test
+-- source include/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 0891a04db25..2940ad16bf2 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
@@ -7,9 +7,9 @@
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-- let $engine_type=innodb
--- source extra/rpl_tests/rpl_insert_ignore.test
+-- source include/rpl_insert_ignore.test
-- let $engine_type=myisam
--- source extra/rpl_tests/rpl_insert_ignore.test
+-- source include/rpl_insert_ignore.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.test b/mysql-test/suite/rpl/t/rpl_ip_mix.test
index 3ddbd598334..63c5fa9251c 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix.test
@@ -44,3 +44,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
# clean up
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+--connection slave
+reset slave all;
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.test b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
index feaf4af44cf..3fff54e52bf 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
@@ -45,3 +45,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
# clean up
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+connection slave;
+reset slave all;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test
index 76b008caa92..9f0ba95a03f 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata.test
@@ -1,4 +1,4 @@
-- source include/have_binlog_format_statement.inc
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_loaddata.test
+-- source include/rpl_loaddata.test
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index 8d90afaed27..712041467ab 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_loaddata_local.inc
+--source include/rpl_loaddata_local.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index babf4208b3d..10fecf1f653 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_loadfile.inc
+--source include/rpl_loadfile.inc
diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index a3f3ff56464..d8c8162ed9f 100644
--- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
@@ -56,5 +56,23 @@ eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', maste
# End of 10.0 tests
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-13965 Parameter data type control for Item_longlong_func
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT MASTER_POS_WAIT('x',1,ROW(1,1));
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT MASTER_POS_WAIT('x',1,1,ROW(1,1));
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
+
+
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev-11092.test b/mysql-test/suite/rpl/t/rpl_mdev-11092.test
index 31a385b40e6..782d24803c7 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev-11092.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev-11092.test
@@ -6,7 +6,7 @@
########################################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
+call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*");
let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_mdev10863.test b/mysql-test/suite/rpl/t/rpl_mdev10863.test
index 796e770672d..81cdfd84dbe 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev10863.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev10863.test
@@ -99,6 +99,7 @@ SET GLOBAL max_relay_log_size= @old_max_relay;
--source include/start_slave.inc
--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
DROP TABLE t1;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev12179.test b/mysql-test/suite/rpl/t/rpl_mdev12179.test
new file mode 100644
index 00000000000..a0241784c85
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mdev12179.test
@@ -0,0 +1,316 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--connection server_2
+call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase");
+
+--error ER_SLAVE_MUST_STOP
+SET GLOBAL gtid_pos_auto_engines="innodb";
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+
+# Test the @@gtid_pos_auto_engines sysvar.
+SELECT @@gtid_pos_auto_engines;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.gtid_pos_auto_engines;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL gtid_pos_auto_engines= NULL;
+SET GLOBAL gtid_pos_auto_engines="innodb";
+SELECT @@gtid_pos_auto_engines;
+SET GLOBAL gtid_pos_auto_engines="myisam,innodb";
+SELECT @@gtid_pos_auto_engines;
+SET GLOBAL gtid_pos_auto_engines="innodb,myisam";
+SELECT @@gtid_pos_auto_engines;
+SET GLOBAL gtid_pos_auto_engines="innodb,innodb,myisam,innodb,myisam,myisam,innodb";
+SELECT @@gtid_pos_auto_engines;
+SET GLOBAL gtid_pos_auto_engines=DEFAULT;
+SELECT @@gtid_pos_auto_engines;
+SET GLOBAL gtid_pos_auto_engines="";
+SELECT @@gtid_pos_auto_engines;
+
+--source include/start_slave.inc
+
+--connection server_1
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+--source include/stop_slave.inc
+SET sql_log_bin=0;
+# Reset storage engine for mysql.gtid_slave_pos in case an earlier test
+# might have changed it to InnoDB.
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+CREATE TABLE mysql.gtid_slave_pos_innodb LIKE mysql.gtid_slave_pos;
+ALTER TABLE mysql.gtid_slave_pos_innodb ENGINE=InnoDB;
+INSERT INTO mysql.gtid_slave_pos_innodb SELECT * FROM mysql.gtid_slave_pos;
+TRUNCATE mysql.gtid_slave_pos;
+SET sql_log_bin=1;
+
+# Restart the slave mysqld server, and verify that the GTID position is
+# read correctly from the new mysql.gtid_slave_pos_innodb table.
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+SELECT * FROM t1 ORDER BY a;
+--source include/save_master_gtid.inc
+
+# Let the slave mysqld server start again.
+# As we are restarting, also take the opportunity to test --gtid-pos-auto-engines
+--echo *** Restart server with --gtid-pos-auto-engines=innodb,myisam ***
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart: --skip-slave-start=0 --gtid-pos-auto-engines=innodb,myisam
+EOF
+
+--connection server_2
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--echo *** Verify no new gtid_slave_pos* tables are created ***
+SELECT table_name, engine FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+
+SELECT @@gtid_pos_auto_engines;
+--source include/stop_slave.inc
+SET sql_log_bin=0;
+INSERT INTO mysql.gtid_slave_pos_innodb SELECT * FROM mysql.gtid_slave_pos;
+DROP TABLE mysql.gtid_slave_pos;
+RENAME TABLE mysql.gtid_slave_pos_innodb TO mysql.gtid_slave_pos;
+SET sql_log_bin=1;
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--connection server_1
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (4);
+INSERT INTO t2 VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--echo *** Restart server with --gtid-pos-auto-engines=myisam,innodb ***
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart: --skip-slave-start=0 --gtid-pos-auto-engines=myisam,innodb
+EOF
+
+--connection server_2
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Verify that no new gtid_slave_pos* tables are auto-created ***
+SELECT table_name, engine FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+
+
+--source include/stop_slave.inc
+SET sql_log_bin=0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+SET sql_log_bin=1;
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (5);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--echo *** Restart server with --gtid-pos-auto-engines=innodb ***
+restart: --skip-slave-start=0 --gtid-pos-auto-engines=innodb
+EOF
+
+--connection server_2
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Verify that mysql.gtid_slave_pos_InnoDB is auto-created ***
+# Note, the create happens asynchronously, so wait for it.
+let $wait_condition=
+ SELECT EXISTS (SELECT * FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name='gtid_slave_pos_InnoDB');
+--source include/wait_condition.inc
+# MDEV-15373 lowercases 'table_name' to satisfy --lower-case-table-names options
+SELECT lower(table_name), engine FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+
+
+--source include/stop_slave.inc
+SET sql_log_bin=0;
+INSERT INTO mysql.gtid_slave_pos SELECT * FROM mysql.gtid_slave_pos_InnoDB;
+DROP TABLE mysql.gtid_slave_pos_InnoDB;
+SET sql_log_bin=1;
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (6);
+INSERT INTO t2 VALUES (3);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--echo *** Restart server without --gtid-pos-auto-engines ***
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart: --skip-slave-start=0
+EOF
+
+--connection server_2
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Verify that no mysql.gtid_slave_pos* table is auto-created ***
+SELECT table_name, engine FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+
+--source include/stop_slave.inc
+SET GLOBAL gtid_pos_auto_engines="innodb";
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (7);
+INSERT INTO t2 VALUES (4);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Verify that mysql.gtid_slave_pos_InnoDB is auto-created ***
+let $wait_condition=
+ SELECT EXISTS (SELECT * FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name='gtid_slave_pos_InnoDB');
+--source include/wait_condition.inc
+SELECT lower(table_name), engine FROM information_schema.tables
+ WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
+ ORDER BY table_name;
+SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+
+# Check that the auto-created InnoDB table starts being used without
+# needing slave restart. The auto-create happens asynchronously, so it
+# is non-deterministic when it will start being used. But we can wait
+# for it to happen.
+
+--let $count=300
+--let $done=0
+--let $old_silent= $keep_include_silent
+--let $keep_include_silent= 1
+--disable_query_log
+while (!$done)
+{
+ --connection server_1
+ INSERT INTO t2(a) SELECT 1+MAX(a) FROM t2;
+ --source include/save_master_gtid.inc
+
+ --connection server_2
+ --source include/sync_with_master_gtid.inc
+ --let $done=`SELECT COUNT(*) > 0 FROM mysql.gtid_slave_pos_InnoDB`
+ if (!$done)
+ {
+ dec $count;
+ if (!$count)
+ {
+ SELECT * FROM mysql.gtid_slave_pos_InnoDB;
+ --die Timeout waiting for mysql.gtid_slave_pos_InnoDB to be used
+ }
+ real_sleep 0.1;
+ }
+}
+--enable_query_log
+--let $keep_include_silent=$old_silent
+# Note that at this point, the contents of table t2, as well as the GTID
+# position, is non-deterministic.
+
+# MDEV-15373 engine gtid_slave_pos table name disobeys lower-case-table-names
+# This snippet verifies that engine gtid_slave_pos table is found,
+# its data are up-to-date.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--connection server_2
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--echo *** Restart the slave server to prove 'gtid_slave_pos_innodb' autodiscovery ***
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart: --skip-slave-start=0
+EOF
+
+--connection server_2
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+SELECT max(seq_no) FROM mysql.gtid_slave_pos_InnoDB into @seq_no;
+
+--connection server_1
+INSERT INTO t2(a) SELECT 1+MAX(a) FROM t2;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+if (`SELECT max(seq_no) <> @seq_no + 1 FROM mysql.gtid_slave_pos_InnoDB`)
+{
+ SELECT * FROM mysql.gtid_slave_pos_InnoDB;
+ --die Inconsistent table
+}
+#
+# end of MDEV-15373
+
+#--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL gtid_pos_auto_engines="";
+SET sql_log_bin=0;
+DROP TABLE mysql.gtid_slave_pos_InnoDB;
+SET sql_log_bin=1;
+--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_mdev359.test b/mysql-test/suite/rpl/t/rpl_mdev359.test
index 3026c6d363e..5b02ecd72c0 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev359.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev359.test
@@ -1,4 +1,3 @@
---source include/have_semisync.inc
--source include/not_embedded.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_mixed_or_statement.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test
index 606508ccde1..093b7b92413 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev382.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev382.test
@@ -1,11 +1,7 @@
--source include/have_innodb.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
-
-if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB 5.6.10 or earlier
-}
+--source include/not_windows.inc #unix shell escaping used for mysqlbinlog
# MDEV-382: multiple SQL injections in replication code.
diff --git a/mysql-test/suite/rpl/t/rpl_mdev6020.test b/mysql-test/suite/rpl/t/rpl_mdev6020.test
index 8484e3e11c0..ec3fd92f817 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev6020.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev6020.test
@@ -1,6 +1,3 @@
-# Running this with valgrind can take > 5000 seconds with xtradb
---source include/not_valgrind.inc
-
--source include/have_innodb.inc
--source include/have_partition.inc
--source include/have_binlog_format_mixed_or_row.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
index 81b01cc9140..c4c89d9048b 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
@@ -4,5 +4,5 @@
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_binlog_max_cache_size.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
index d3412c3cd52..e707bb9973b 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
@@ -8,5 +8,5 @@
--source include/have_innodb.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_drop_create_temp_table.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
index fa948f8f5fe..e3dc6cbaa73 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
@@ -1,5 +1,5 @@
################################################################################
-# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test
+# Check file include/rpl_implicit_commit_binlog.test
################################################################################
--source include/have_udf.inc
--source include/have_binlog_format_mixed.inc
@@ -8,5 +8,5 @@
--let $engine=Innodb
set session storage_engine=innodb;
---source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_implicit_commit_binlog.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
index a9c8f6fe3e1..1df53270b74 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
@@ -8,5 +8,5 @@
let $engine_type=Innodb;
let $database_name=test;
---source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_mixing_engines.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test
index cc147eb3263..3927ed698e6 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update.test
@@ -1,2 +1,2 @@
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_multi_update.test
+-- source include/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 95952cd9e15..d2368f2016b 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test
@@ -5,5 +5,5 @@
--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;
---source extra/rpl_tests/rpl_multi_update2.test
+--source include/rpl_multi_update2.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test
index d356ca88517..0a15e9aa229 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update3.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test
@@ -5,5 +5,5 @@
--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;
--- source extra/rpl_tests/rpl_multi_update3.test
+-- source include/rpl_multi_update3.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
index 93ec9acf5ea..1f2f8749a0c 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
@@ -11,5 +11,5 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
let $database_name=test;
---source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_mixing_engines.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
index 50577a1849c..b4552c79349 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
@@ -11,7 +11,7 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
let $database_name=test;
---source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_mixing_engines.test
--diff_files suite/rpl/r/rpl_non_direct_row_mixing_engines.result suite/rpl/r/rpl_row_mixing_engines.result
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
index e340eb74115..23552515df7 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
@@ -11,5 +11,5 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
let $database_name=test;
---source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_mixing_engines.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
index 6a1cc341060..0e67cd3600b 100644
--- a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
@@ -16,5 +16,5 @@
--source include/master-slave.inc
let $engine=Innodb;
---source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_not_null.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
index 6ef0b65d5ff..718761d6d23 100644
--- a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
@@ -15,5 +15,5 @@
--source include/master-slave.inc
let $engine=MyISAM;
---source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_not_null.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 31357cb148e..1bf99c2366b 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_packet.inc
+--source include/rpl_packet.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index b7c4bb429a4..ee39bfa7a39 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_parallel.inc
+--source include/rpl_parallel.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
index ebf6eff2cc4..0b10dd3cda7 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -567,8 +567,15 @@ DROP TABLE t1, t2, t3;
# The earlier part of this test file have plenty of transactions being rolled
# back. But the last DROP TABLE statement runs on its own and should never
# conflict, thus at this point the mysql.gtid_slave_pos table should be clean.
---echo Check that no more than the expected last two GTIDs are in mysql.gtid_slave_pos
-select count(*) from mysql.gtid_slave_pos order by domain_id, sub_id;
+#
+# To support @@gtid_pos_auto_engines, when a row is inserted in the table, it
+# is associated with the engine of the table at insertion time, and it will
+# only be deleted during record_gtid from a table of the same engine. Since we
+# alter the table from MyISAM to InnoDB at the start of this test, we should
+# end up with 4 rows: two left-over from when the table was MyISAM, and two
+# left-over from the InnoDB part.
+--echo Check that no more than the expected last four GTIDs are in mysql.gtid_slave_pos
+select count(4) <= 4 from mysql.gtid_slave_pos order by domain_id, sub_id;
--connection server_1
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
index 9e93b0b56e9..8c8892d5370 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_parallel_show_binlog_events_purge_logs.inc
+--source include/rpl_parallel_show_binlog_events_purge_logs.inc
diff --git a/mysql-test/suite/rpl/t/rpl_read_only2.test b/mysql-test/suite/rpl/t/rpl_read_only2.test
new file mode 100644
index 00000000000..da825c8fc7f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_read_only2.test
@@ -0,0 +1,30 @@
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # Ensure that read-only slave logs temporary table statements under statement based
+--echo # replication. This is related to MDEV-17863.
+--echo #
+
+connection slave;
+set global read_only=1;
+
+connection master;
+
+create table t1(a int) engine=MyISAM;
+create temporary table tmp1 (a int) engine=MyISAM;
+insert into t1 values(1);
+insert into tmp1 values (2);
+insert into t1 select * from tmp1;
+insert into t1 values(3);
+select * from t1;
+analyze table t1;
+drop table t1;
+drop temporary table tmp1;
+
+sync_slave_with_master;
+--source include/show_binlog_events.inc
+set global read_only=0;
+connection master;
+
+--source include/rpl_end.inc
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 87df66bc148..ccb1424a976 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
@@ -1,3 +1,3 @@
-- source include/have_innodb.inc
let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_sv_relay_space.test
+-- source include/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 e022921a5bb..6aa91dbccaa 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
@@ -1,2 +1,2 @@
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_sv_relay_space.test
+-- source include/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 5e3bcdcd711..720739e14c0 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_relayrotate.inc
+--source include/rpl_relayrotate.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index 358c0be5b3b..0d65a05bf50 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -193,4 +193,8 @@ show binlog events in '';
purge master logs before now();
--echo End of 5.0 tests
+--echo #cleanup
+
+--remove_file $MYSQLD_SLAVE_DATADIR/master.info
--source include/stop_slave.inc
+reset slave all;
diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test
index 47b6da75dd6..06d01f2476e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_001.test
@@ -7,5 +7,5 @@
-- source include/master-slave.inc
let $engine_type=MYISAM;
--- source extra/rpl_tests/rpl_row_001.test
+-- source include/rpl_row_001.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test
index 1de44af8156..8e1aa6d20d0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_UUID.test
+++ b/mysql-test/suite/rpl/t/rpl_row_UUID.test
@@ -4,5 +4,5 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=myisam;
---source extra/rpl_tests/rpl_row_UUID.test
+--source include/rpl_row_UUID.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_annotate_do.test b/mysql-test/suite/rpl/t/rpl_row_annotate_do.test
index 4114f90b90b..ffaae3146f3 100644
--- a/mysql-test/suite/rpl/t/rpl_row_annotate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_row_annotate_do.test
@@ -13,4 +13,4 @@
###############################################################################
--source include/have_binlog_format_row.inc
---source extra/rpl_tests/rpl_row_annotate.test
+--source include/rpl_row_annotate.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test b/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test
index ef746e76b4d..24dd2a1c373 100644
--- a/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test
+++ b/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test
@@ -6,4 +6,4 @@
###############################################################################
--source include/have_binlog_format_row.inc
---source extra/rpl_tests/rpl_row_annotate.test
+--source include/rpl_row_annotate.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
index d4a1777a8dc..f1e836c64b7 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
@@ -3,7 +3,7 @@
let $type= 'MYISAM' ;
let $extra_index= ;
--- source extra/rpl_tests/rpl_row_basic.test
+-- source include/rpl_row_basic.test
connection slave;
call mtr.add_suppression("Can't find record in 't1'");
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
index 55ea2f3c3c8..b84a4c13c80 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
@@ -6,6 +6,6 @@ connection slave;
let $bit_field_special = ALL_LOSSY;
let $type= 'INNODB' ;
let $extra_index= ;
--- source extra/rpl_tests/rpl_row_basic.test
+-- source include/rpl_row_basic.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
index cc031d382e0..a4db32cf46e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
@@ -4,5 +4,5 @@
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_binlog_max_cache_size.test
--source include/rpl_end.inc
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 5c1c705f48d..57f3e91aa10 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
@@ -8,6 +8,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_row_blob.test
+-- source include/rpl_row_blob.test
--source include/rpl_end.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 e83da6ba142..246d38f486c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
@@ -7,6 +7,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=myisam;
--- source extra/rpl_tests/rpl_row_blob.test
+-- source include/rpl_row_blob.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
index 9ad33a4b819..adf37d99073 100644
--- a/mysql-test/suite/rpl/t/rpl_row_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
@@ -1,4 +1,4 @@
-# See the top of mysql-test/extra/rpl_tests/rpl_conflicts.test for
+# See the top of mysql-test/include/rpl_conflicts.test for
# explanation of what this test does.
#
# This test file is for row-logging mode. It runs the test twice, with
@@ -18,7 +18,7 @@ SET @old_slave_exec_mode= @@global.slave_exec_mode;
--echo ######## Run with slave_exec_mode=STRICT ########
SET @@global.slave_exec_mode = 'STRICT';
-source extra/rpl_tests/rpl_conflicts.test;
+source include/rpl_conflicts.test;
--source include/rpl_reset.inc
@@ -26,7 +26,7 @@ source extra/rpl_tests/rpl_conflicts.test;
--echo ######## Run with slave_exec_mode=IDEMPOTENT ########
set @@global.slave_exec_mode= 'IDEMPOTENT';
-source extra/rpl_tests/rpl_conflicts.test;
+source include/rpl_conflicts.test;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
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 b898a9a120a..603af39834c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
+++ b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
@@ -1,2 +1,2 @@
let $engine_type=myisam;
--- source extra/rpl_tests/rpl_row_delayed_ins.test
+-- source include/rpl_row_delayed_ins.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
index c3aa937be6f..bc5c60749c0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
@@ -7,5 +7,5 @@
--source include/have_innodb.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_drop_create_temp_table.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss-master.opt b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss-master.opt
new file mode 100644
index 00000000000..144bbca0730
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss-master.opt
@@ -0,0 +1,2 @@
+--binlog-row-event-max-size=8192
+
diff --git a/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test
new file mode 100644
index 00000000000..5b2d99f3bf1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test
@@ -0,0 +1,66 @@
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+# Loss of STMT_END flagged event must error out the IO thread
+--connection slave
+call mtr.add_suppression("Slave IO thread did not receive an expected Rows-log end-of-statement");
+call mtr.add_suppression("Relay log write failure: could not queue event from master");
+
+SET @save_debug= @@global.debug;
+SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss";
+--source include/stop_slave.inc
+--replace_result $MASTER_MYPORT MASTER_PORT
+--eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, MASTER_USE_GTID=SLAVE_POS
+
+--connection master
+--let $max_row_size=8192
+--eval CREATE TABLE t (a INT, b text($max_row_size));
+--eval INSERT INTO t values (1, repeat('b', $max_row_size)), (1, repeat('b', $max_row_size))
+
+# Prove that the missed STMT_END marked rows-event causes the io thread stop.
+--connection slave
+START SLAVE IO_THREAD;
+--let $slave_io_errno=1595
+--source include/wait_for_slave_io_error.inc
+SET GLOBAL debug_dbug="-d,simulate_stmt_end_rows_event_loss";
+--source include/start_slave.inc
+
+--connection master
+sync_slave_with_master;
+
+# Compressed version of the above
+--connection slave
+--source include/stop_slave.inc
+
+--connection master
+SET @save_log_bin_compress= @@GLOBAL.log_bin_compress;
+SET @save_log_bin_compress_min_len= @@GLOBAL.log_bin_compress_min_len;
+
+SET @@GLOBAL.log_bin_compress=ON;
+SET @@GLOBAL.log_bin_compress_min_len=10;
+
+--eval INSERT INTO t values (2, repeat('b', $max_row_size)), (2, repeat('b', $max_row_size))
+
+# Prove that the missed STMT_END marked rows-event causes the io thread stop.
+--connection slave
+SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss";
+START SLAVE IO_THREAD;
+--let $slave_io_errno=1595
+--source include/wait_for_slave_io_error.inc
+SET GLOBAL debug_dbug="-d,simulate_stmt_end_rows_event_loss";
+--source include/start_slave.inc
+
+--connection master
+sync_slave_with_master;
+
+# cleanup
+
+--connection master
+SET @@GLOBAL.log_bin_compress= @save_log_bin_compress;
+SET @@GLOBAL.log_bin_compress_min_len= @save_log_bin_compress_min_len;
+DROP TABLE t;
+sync_slave_with_master;
+SET GLOBAL debug_dbug= @save_debug;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test b/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
index 2753fd1f9e0..e3edabe239d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
+++ b/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
@@ -42,16 +42,11 @@ DROP TABLE t1;
--sync_slave_with_master
--echo # Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
-perl;
- use strict;
- my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
- open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
- my $upd_count = () = grep(/The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount/g,<FILE>);
- seek(FILE, 0, 0) or die "Can't seek to beginning of file: $!";
- my $del_count = () = grep(/The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/g,<FILE>);
- print "Occurrences: update=$upd_count, delete=$del_count\n";
- close(FILE);
-EOF
+--let SEARCH_FILE=$log_error_
+--let SEARCH_PATTERN=The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount
+--source include/search_pattern_in_file.inc
# cleanup
--source include/stop_slave.inc
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 71cd4a5b9ae..2d5cde82dcc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
@@ -9,5 +9,5 @@ let $rename_event_pos= `select @binlog_start_pos + 819`;
# we disable the ps-protocol for this statement.
--disable_ps_protocol
--- source extra/rpl_tests/rpl_flsh_tbls.test
+-- source include/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 c153bc70253..def987faede 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func003.test
@@ -8,5 +8,5 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_row_func003.test
+-- source include/rpl_row_func003.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
index 467202391b0..21f224f5ad2 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
@@ -36,7 +36,7 @@
-- 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
+-- let $row_img_test_script= include/rpl_row_img_blobs.test
-- source include/rpl_row_img_general_loop.inc
## MINIMAL
@@ -44,7 +44,7 @@
-- 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
+-- let $row_img_test_script= include/rpl_row_img_blobs.test
-- source include/rpl_row_img_general_loop.inc
## FULL
@@ -52,7 +52,7 @@
-- 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
+-- let $row_img_test_script= include/rpl_row_img_blobs.test
-- source include/rpl_row_img_general_loop.inc
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
index 24b9655bd81..06764fe8f07 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test
@@ -29,7 +29,7 @@
-- 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
+-- let $row_img_test_script= include/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
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
index 5d5f95a6552..7f4944b59ea 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test
@@ -29,7 +29,7 @@
-- 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
+-- let $row_img_test_script= include/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
diff --git a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
index 6fdcd885930..68e07ef1f44 100644
--- a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
@@ -1,5 +1,5 @@
################################################################################
-# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test
+# Check file include/rpl_implicit_commit_binlog.test
################################################################################
--source include/have_udf.inc
--source include/have_binlog_format_row.inc
@@ -8,5 +8,5 @@
--let $engine=Innodb
set session storage_engine=innodb;
---source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_implicit_commit_binlog.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
index 78a66a7df32..44c04dd62d3 100644
--- a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
+++ b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
@@ -9,4 +9,4 @@
-- source include/have_binlog_format_row.inc
-- let $engine=InnoDB
--- source extra/rpl_tests/rpl_lower_case_table_names.test
+-- source include/rpl_lower_case_table_names.test
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 af4efed872f..c2cb2b4a7f6 100644
--- a/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
+++ b/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
@@ -10,4 +10,4 @@ DROP TABLE t1;
let $lock_option= CONCURRENT;
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_loaddata.test
+-- source include/rpl_loaddata.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test
index 1d37d4327d0..25fcc4f4e58 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log.test
@@ -10,6 +10,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_log.test
+-- source include/rpl_log.test
--source include/rpl_end.inc
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 0eccde7ecb9..92fe0eb9665 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
@@ -8,6 +8,6 @@
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_log.test
+-- source include/rpl_log.test
--source include/rpl_end.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 3e057d48ec9..0ec85244a6b 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
@@ -6,4 +6,4 @@
# Requires statement logging
source include/have_binlog_format_row.inc;
-source extra/rpl_tests/rpl_max_relay_size.test;
+source include/rpl_max_relay_size.test;
diff --git a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
index cf402752812..c1a13cd9e52 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
@@ -8,5 +8,5 @@
let $engine_type=Innodb;
let $database_name=test;
---source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_mixing_engines.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
index b3808680db2..39149f6bcbb 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
@@ -7,5 +7,5 @@
#
-- let $engine= InnoDB
--- source extra/rpl_tests/rpl_record_compare.test
+-- source include/rpl_record_compare.test
--source include/rpl_end.inc
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 0d6b08bd0c1..d9c06d6b25f 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
@@ -27,6 +27,6 @@ UPDATE t1 SET c1= 0;
DROP TABLE t1;
-- sync_slave_with_master
--- source extra/rpl_tests/rpl_record_compare.test
+-- source include/rpl_record_compare.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
index a970c161153..284c6154e8b 100644
--- a/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
@@ -1,5 +1,5 @@
# TBF - difference in row level logging
# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
-- source include/have_binlog_format_row.inc
--- source extra/rpl_tests/rpl_reset_slave.test
+-- source include/rpl_reset_slave.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
index 0882d603203..3d4b8f1e3eb 100644
--- a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
+++ b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
@@ -15,5 +15,5 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
--- source extra/rpl_tests/rpl_show_relaylog_events.inc
+-- source include/rpl_show_relaylog_events.inc
--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 c863c9c02e1..f096c157059 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
@@ -1,3 +1,3 @@
-- source include/have_innodb.inc
let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_row_sp002.test
+-- source include/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 f1cad89b58e..0a361202e94 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
@@ -12,5 +12,5 @@
-- source include/master-slave.inc
let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_row_sp003.test
+-- source include/rpl_row_sp003.test
--source include/rpl_end.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 f8ff2b2ca8e..c575a105b68 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
@@ -8,5 +8,5 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_row_sp006.test
+-- source include/rpl_row_sp006.test
--source include/rpl_end.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 e2003092d10..6eaafa8cce5 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
@@ -1,3 +1,3 @@
-- source include/have_innodb.inc
let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_row_sp007.test
+-- source include/rpl_row_sp007.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
index 030ec7d6541..e1ecf70206a 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
@@ -3,7 +3,7 @@
-- source include/master-slave.inc
let $engine_type = 'MyISAM';
--- source extra/rpl_tests/rpl_row_tabledefs.test
+-- source include/rpl_row_tabledefs.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
index 35eddfc3ed4..49abc84c58a 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
@@ -4,7 +4,7 @@
-- source include/master-slave.inc
let $engine_type = 'InnoDB';
--- source extra/rpl_tests/rpl_row_tabledefs.test
+-- source include/rpl_row_tabledefs.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
index 5bdd1ff8b6b..b0588cb2d58 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
@@ -238,11 +238,11 @@ DROP TABLE `t1`;
#
# Each varchar field takes up to 2 metadata bytes, see:
#
-# Field_varstring::do_save_field_metadata (field.cc)
+# Field_varstring::save_field_metadata (field.cc)
#
# The float field takes 1 byte, see:
#
-# Field_float::do_save_field_metadata (field.cc)
+# Field_float::save_field_metadata (field.cc)
#
-- let $generated_sql= $MYSQLTEST_VARDIR/tmp/b50018.sql
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test
index e10e0d51039..0cbdea335be 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig004.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig004.test
@@ -10,6 +10,6 @@
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_trig004.test
+-- source include/rpl_trig004.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_triggers.test b/mysql-test/suite/rpl/t/rpl_row_triggers.test
index 00f9197ace8..d5f29b9207d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_triggers.test
+++ b/mysql-test/suite/rpl/t/rpl_row_triggers.test
@@ -1,5 +1,4 @@
-- source include/have_binlog_format_row.inc
--- source include/have_rbr_triggers.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index d5f80619aeb..5c17bcb2344 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_semi_sync.inc
+--source include/rpl_semi_sync.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
index b8f3c8130be..4d96fd694ec 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
@@ -1,4 +1,3 @@
-source include/have_semisync.inc;
source include/not_embedded.inc;
source include/have_innodb.inc;
source include/master-slave.inc;
@@ -11,6 +10,8 @@ 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("mysqld: Got an error reading communication packets");
+
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test b/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test
index c524fcff3a4..96f7e805fc5 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_gtid_reconnect.test
@@ -1,6 +1,5 @@
source include/not_embedded.inc;
source include/have_binlog_format_mixed.inc;
-source include/have_semisync.inc;
source include/master-slave.inc;
#
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_master_shutdown.test b/mysql-test/suite/rpl/t/rpl_semi_sync_master_shutdown.test
new file mode 100644
index 00000000000..2224f78d6d0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_master_shutdown.test
@@ -0,0 +1,60 @@
+# MDEV-16812 Semisync slave io thread segfaults at STOP-SLAVE handling
+#
+# The test verifies that the semisync-enabled slave io thread
+# finishes off as specified in particular trying to connect even to a shut down
+# master for a semisync firewell routine.
+
+source include/not_embedded.inc;
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+--connection master
+
+--let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled `
+SET @@GLOBAL.rpl_semi_sync_master_enabled = 1;
+
+--connection slave
+source include/stop_slave.inc;
+--let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled `
+SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1;
+source include/start_slave.inc;
+
+--connection master
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 SET a=1;
+
+--sync_slave_with_master
+
+connection master;
+--echo # Shutdown master
+--let $rpl_server_number=1
+source include/rpl_stop_server.inc;
+
+--connection slave
+--source include/stop_slave.inc
+
+#connection master;
+--echo # Restart master
+--let $rpl_server_number=1
+source include/rpl_start_server.inc;
+
+#
+# Clean up
+#
+--connection slave
+--source include/stop_slave.inc
+--source include/start_slave.inc
+
+--connection master
+SET @@GLOBAL.debug_dbug="";
+--eval SET @@GLOBAL. rpl_semi_sync_master_enabled = $sav_enabled_master
+
+--connection master
+DROP TABLE t1;
+
+--sync_slave_with_master
+source include/stop_slave.inc;
+--eval SET @@GLOBAL. rpl_semi_sync_slave_enabled = $sav_enabled_slave
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test b/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
index 0d2739e1937..587e1290187 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
@@ -6,7 +6,6 @@
# lost such events.
# The test verifies the fixes' correctness simulating the 2GB offset.
-source include/have_semisync.inc;
source include/not_embedded.inc;
source include/have_innodb.inc;
source include/have_debug.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test
new file mode 100644
index 00000000000..f0eb474f00e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test
@@ -0,0 +1,87 @@
+# ==== Purpose ====
+#
+# Test verifies that slave IO thread doesn't report an error, when slave fails
+# to send an acknowledgment to master with semi sync replication in use.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Have semi synchronous replication in use.
+# 1 - Enable a debug simulation point which simulates network flush failure
+# at the time of slave reply operation.
+# 2 - Do some operation on master and wait for it to be replicated. Master
+# will timeout waiting for reply from slave.
+# 3 - Check the slave error log for appropriate error message regarding
+# net_flush operation failure.
+# 4 - Remove the debug simulation and do some more DML operations on master
+# and wait for them to be replicated.
+# 5 - Slave will be able to replicate and data is consistent on both master
+# and slave. Semi sync will be automatically turned on.
+#
+# ==== References ====
+#
+# MDEV-20217: Semi_sync: Last_IO_Error: Fatal error: Failed to run
+# 'after_queue_event' hook
+#
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+
+--connection master
+call mtr.add_suppression("Timeout waiting for reply of binlog*");
+--let $sav_timeout_master=`SELECT @@GLOBAL.rpl_semi_sync_master_timeout`
+set global rpl_semi_sync_master_enabled = ON;
+SET @@GLOBAL.rpl_semi_sync_master_timeout=100;
+create table t1 (i int);
+
+--connection slave
+set global rpl_semi_sync_slave_enabled = ON;
+CALL mtr.add_suppression("Semi-sync slave net_flush*");
+SET @save_debug= @@global.debug;
+SET GLOBAL debug_dbug="+d,semislave_failed_net_flush";
+--source include/start_slave.inc
+
+--connection master
+--sync_slave_with_master
+
+# Check error log for correct messages.
+let $log_error_= `SELECT @@GLOBAL.log_error`;
+if(!$log_error_)
+{
+ # MySQL Server on windows is started with --console and thus
+ # does not know the location of its .err log, use default location
+ let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
+}
+--echo "Assert that the net_fulsh() reply failed is present in slave error log.
+--let SEARCH_FILE=$log_error_
+--let SEARCH_PATTERN=Semi-sync slave net_flush\(\) reply failed
+--source include/search_pattern_in_file.inc
+
+--echo "Assert that Slave IO thread is up and running."
+SHOW STATUS LIKE 'Slave_running';
+let $status= query_get_value("show slave status", Slave_IO_Running, 1);
+echo Slave_IO_Running= $status;
+
+--echo "Clear the network failure simulation."
+SET GLOBAL debug_dbug= @save_debug;
+
+--connection master
+insert into t1 values (10);
+--sync_slave_with_master
+
+--connection slave
+--echo # Compare the tables on master and slave.
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+--connection master
+drop table t1;
+--sync_slave_with_master
+set global rpl_semi_sync_slave_enabled = OFF;
+
+--connection master
+set global rpl_semi_sync_master_enabled = OFF;
+--eval SET @@GLOBAL.rpl_semi_sync_master_timeout = $sav_timeout_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test
deleted file mode 100644
index 58d79cf7ff0..00000000000
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test
+++ /dev/null
@@ -1,137 +0,0 @@
-###############################################################################
-# Bug#17638477 UNINSTALL AND INSTALL SEMI-SYNC PLUGIN CAUSES SLAVES TO BREAK
-# Problem: Uninstallation of Semi sync plugin should be blocked when it is
-# in use.
-# Test case: Uninstallation of semi sync should be allowed
-# On Master:
-# 1) When there is no dump thread
-# 2) When there are no semi sync slaves (i.e., async replication).
-# On Slave:
-# 1) When there is no I/O thread
-# 2) When there are no semi sync enabled I/O thread (i.e.,async replication).
-###############################################################################
-
---source include/have_semisync_plugin.inc
---source include/not_embedded.inc
---source include/have_binlog_format_statement.inc
---source include/master-slave.inc
-
-call mtr.add_suppression("Read semi-sync reply network error");
-call mtr.add_suppression("Timeout waiting for reply of binlog");
-
-###############################################################################
-# Case 1: Uninstallation of semi sync plugins should be allowed when it is
-# not in use i.e., when asynchronous replication is active.
-###############################################################################
-# Step 1.1: Install semi sync master plugin on master
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master';
-
-# Step 1.2: Install semi sync slave plugin on slave
---connection slave
-INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave';
-
-# Step 1.3: Uninstallation of semisync plugin on master and slave should be
-# allowed at this state as there is no semi sync replication enabled between
-# master and slave.
-UNINSTALL PLUGIN rpl_semi_sync_slave;
---connection master
-UNINSTALL PLUGIN rpl_semi_sync_master;
-
-# Step 1.4: Check that replication is working fine at the end of the test case.
-CREATE TABLE t1(i int);
-INSERT INTO t1 values (1);
-DROP TABLE t1;
---sync_slave_with_master
-
-###############################################################################
-# Case 2: Uninstallation of semi sync plugins should be disallowed
-# when it is in use i.e., when semi sync replication is active
-###############################################################################
-# Step 2.1: Install and enable semi sync replication between master and slave
---source include/install_semisync.inc
-
-# Step 2.2: Check that rpl_semi_sync_slave uninstallation on Slave is not
-# possible at this state
---connection slave
-show global status like "Slave%_running";
-
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-
-# Step 2.3: Check that rpl_semi_sync_master uninstallation on Master is not
-# possible at this state
---connection master
-
-# The following is to catch errors if the next uninstall plugin would succeed
-let $slaves_connected_value= query_get_value(SHOW GLOBAL STATUS LIKE 'Slaves_connected', Value, 1);
-if (`SELECT $slaves_connected_value <> 1`)
-{
- SHOW GLOBAL STATUS LIKE 'Slave_connections';
- SHOW GLOBAL STATUS LIKE 'Slaves_connected';
- --die *** Unexpected number of connected slaves ***
-}
-UNINSTALL PLUGIN rpl_semi_sync_master;
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-
-# Step 2.4: Check that replication is working fine at the end of the test case.
-CREATE TABLE t1(i int);
-INSERT INTO t1 values (2);
-DROP TABLE t1;
---sync_slave_with_master
-
-# Step 2.5: Make sure rpl_semi_sync_master_status on Master and
-# rpl_semi_sync_slave_staus on Slave are ON
-show status like "Rpl_semi_sync_slave_status";
-
-###############################################################################
-# Case 3: Uninstallation of semi sync plugin should be disallowed when there
-# are semi sync slaves even though rpl_semi_sync_master_enabled= OFF;.
-###############################################################################
-# Step 3.1: Disable semi sync on master
---connection master
-show status like "Rpl_semi_sync_master_status";
-
-# Step 3.2: Check that still Rpl_semi_sync_master_clients is 1
-show status like "Rpl_semi_sync_master_clients";
-
-# Step 3.3: Since Rpl_semi_sync_master_clients is 1, uninstallation of
-# rpl_semi_sync_master should be disallowed.
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-
-###############################################################################
-# Case 4: Uninstallation of semi sync plugin should be allowed when it is not
-# in use. Same as Case 1 but this case is to check the case after enabling and
-# disabling semi sync replication.
-###############################################################################
-
-# Step 4.1: Stop IO thread on slave.
---connection slave
---source include/stop_slave.inc
-
-# Step 4.2: Disable semi sync on slave.
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-
---connection master
-# Send something to the slave so that the master would notice that nobody's listening.
-create table t2 (a int); drop table t2;
-# and wait for plugin to be unloaded automatically
-let $wait_condition=select count(*) = 0 from information_schema.plugins where plugin_name like 'rpl_%';
---source include/wait_condition.inc
-
---connection slave
-
-# Step 4.3: Start IO thread on slave.
---source include/start_slave.inc
-
-# Step 4.4: Uninstall semi sync plugin, it should be successful now.
-select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
-
-# Step 4.7: Check that replication is working fine at the end of the test case
---connection master
-CREATE TABLE t1(i int);
-INSERT INTO t1 values (3);
-DROP TABLE t1;
---sync_slave_with_master
-
-# Cleanup
-source include/rpl_end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt
new file mode 100644
index 00000000000..d84ebab5d56
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt
@@ -0,0 +1 @@
+--rpl_semi_sync_master_enabled=0 --rpl_semi_sync_master_wait_no_slave=0
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test
new file mode 100644
index 00000000000..fecd0e25cb2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test
@@ -0,0 +1,14 @@
+# The test verifies master crash of MDEV-18096 when the server starts with
+# rpl_semi_sync_master_enabled = OFF rpl_semi_sync_master_wait_no_slave = OFF
+
+--source include/master-slave.inc
+--source include/have_binlog_format_mixed.inc
+
+--connection master
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 SET a=1;
+DROP TABLE t1;
+
+--sync_slave_with_master
+
+--source include/rpl_end.inc
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
index 6e4dc456a27..dcff4030fdb 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
@@ -1,4 +1,3 @@
-source include/have_semisync.inc;
source include/not_embedded.inc;
source include/have_innodb.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues-master.opt b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues-master.opt
new file mode 100644
index 00000000000..2672d4ff35e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues-master.opt
@@ -0,0 +1 @@
+--binlog_format=row
diff --git a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues-slave.opt b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues-slave.opt
new file mode 100644
index 00000000000..2672d4ff35e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues-slave.opt
@@ -0,0 +1 @@
+--binlog_format=row
diff --git a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test
new file mode 100644
index 00000000000..52cd9e31753
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test
@@ -0,0 +1,410 @@
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+CALL mtr.add_suppression("Failed to start semi-sync ACK receiver thread.*");
+CALL mtr.add_suppression("Failed to register slave to semi-sync ACK receiver thread.*");
+CALL mtr.add_suppression("Failed to stop ack receiver thread on pthread_join.*");
+CALL mtr.add_suppression("Got an error reading communication packets:*");
+CALL mtr.add_suppression("Timeout waiting for reply of binlog*");
+CALL mtr.add_suppression("slave_read_sync_header*");
+CALL mtr.add_suppression("Missing magic number for semi-sync*");
+CALL mtr.add_suppression("Got timeout reading communication packets*");
+CALL mtr.add_suppression("Failed to call*");
+CALL mtr.add_suppression("Execution failed on master*");
+CALL mtr.add_suppression("Failed on request_dump()*");
+CALL mtr.add_suppression("Semi-sync master failed on*");
+CALL mtr.add_suppression("Master command COM_BINLOG_DUMP failed*");
+CALL mtr.add_suppression("on master failed*");
+CALL mtr.add_suppression("Master server does not support semi-sync*");
+CALL mtr.add_suppression("Semi-sync slave net_flush*");
+CALL mtr.add_suppression("Failed to flush master info*");
+CALL mtr.add_suppression("Request to stop slave SQL Thread received while apply*");
+
+connection master;
+echo [ enable semi-sync on master ];
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+
+connection slave;
+echo [ enable semi-sync on slave ];
+stop slave;
+set global rpl_semi_sync_slave_enabled = 1;
+start slave;
+show status like 'rpl_semi_sync_slave%';
+
+connection master;
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+sync_slave_with_master;
+
+connection master;
+connect(con1,localhost,root,,);
+connect(con2,localhost,root,,);
+connect(con3,localhost,root,,);
+
+show status like 'Rpl_semi_sync_master_clients';
+show status like "rpl_semi_sync_master_yes_tx";
+
+--echo #########################################
+--echo # Test rpl_semi_sync_master_wait_point #
+--echo #########################################
+--echo # Test after_sync and after_commit first.
+
+--echo #Test after_sync
+connection con1;
+# Let's set a very large timeout value for testing purpose.
+SET GLOBAL rpl_semi_sync_master_timeout = 1000000;
+SET GLOBAL rpl_semi_sync_master_wait_point= 'AFTER_SYNC';
+SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL after_sync_done WAIT_FOR end";
+--send INSERT into t1 values (1);
+
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
+
+sync_slave_with_master;
+--echo #slave can see record (1) after sync slave with master
+select * from t1;
+
+connection con2;
+--echo #con2 shouldn't see record (1)
+select * from t1;
+SET DEBUG_SYNC= "now SIGNAL end";
+
+connection con1;
+reap;
+
+connection con1;
+select * from t1;
+truncate table t1;
+
+sync_slave_with_master;
+
+# Test more threads in one semisync queue
+connection con1;
+SET DEBUG_SYNC= 'reset';
+SET DEBUG_SYNC= "commit_before_get_LOCK_log SIGNAL before_fetch_done WAIT_FOR more_queue";
+#SET DEBUG_SYNC= "before_semisync_fetch SIGNAL before_fetch_done WAIT_FOR more_queue";
+--send INSERT into t1 VALUES (1);
+
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR before_fetch_done";
+SET DEBUG_SYNC= "after_semisync_queue SIGNAL more_queue";
+INSERT INTO t1 VALUES (2);
+
+connection con1;
+reap;
+
+# Test more threads in one semisync queue, but disable semisync before
+# waiting.
+connection con1;
+SET DEBUG_SYNC= 'reset';
+SET DEBUG_SYNC= "commit_before_get_LOCK_log SIGNAL before_fetch_done WAIT_FOR disable_semisync";
+#SET DEBUG_SYNC= "before_semisync_fetch SIGNAL before_fetch_done WAIT_FOR more_queue";
+#SET DEBUG_SYNC= "before_semisync_fetch SIGNAL before_fetch_done WAIT_FOR disable_semisync";
+--send INSERT into t1 VALUES (3);
+
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR before_fetch_done";
+SET GLOBAL rpl_semi_sync_master_enabled= 0;
+SET DEBUG_SYNC= "now SIGNAL disable_semisync";
+
+connection con1;
+reap;
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo #Test after_commit
+connection con1;
+SET GLOBAL rpl_semi_sync_master_wait_point= 'AFTER_COMMIT';
+SET DEBUG_SYNC= "after_group_after_commit SIGNAL after_commit_done WAIT_FOR end";
+--send INSERT into t1 values (4);
+
+connection con2;
+SET DEBUG_SYNC= "now WAIT_FOR after_commit_done";
+
+sync_slave_with_master;
+select * from t1;
+
+connection con2;
+select * from t1;
+SET DEBUG_SYNC= "now SIGNAL end";
+
+connection con1;
+reap;
+
+connection con1;
+select * from t1;
+truncate table t1;
+
+--echo #######################################################
+--echo # Test some other options in order to cover the patch #
+--echo #######################################################
+connection slave;
+--echo # Test rpl_semi_sync_slave_trace_level
+SET GLOBAL rpl_semi_sync_slave_trace_level= 1;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 16;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 64;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 128;
+SET GLOBAL rpl_semi_sync_slave_trace_level= 32;
+connection master;
+--echo # Test rpl_semi_sync_master_trace_level
+SET GLOBAL rpl_semi_sync_master_trace_level= 1;
+SET GLOBAL rpl_semi_sync_master_trace_level= 16;
+SET GLOBAL rpl_semi_sync_master_trace_level= 64;
+SET GLOBAL rpl_semi_sync_master_trace_level= 128;
+SET GLOBAL rpl_semi_sync_master_trace_level= 32;
+--echo # Test rpl_semi_sync_master_timeout
+SET GLOBAL rpl_semi_sync_master_timeout= 1000;
+SET GLOBAL rpl_semi_sync_master_timeout= 10000;
+SET GLOBAL rpl_semi_sync_master_timeout = 1000000;
+
+--echo # Test rpl_semi_sync_slave_kill_conn_timeout
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 10;
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 20;
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 60;
+SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout= 5;
+
+--echo ############################################
+--echo # Test rpl_semi_sync_master_wait_no_slave #
+--echo ############################################
+SET GLOBAL rpl_semi_sync_master_wait_no_slave = 1;
+connection slave;
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+
+connection con1;
+SET GLOBAL rpl_semi_sync_master_timeout = 1000;
+--send INSERT INTO t1 values (1);
+
+connection con1;
+reap;
+echo # Rpl_semi_sync_master_no_tx should be non-zero
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+
+# test rpl_semi_sync_master_wait_no_slave = 0
+connection slave;
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+
+connection con1;
+INSERT INTO t1 values (2);
+sync_slave_with_master;
+connection con1;
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+
+connection slave;
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+
+connection con1;
+SET GLOBAL rpl_semi_sync_master_wait_no_slave= 0;
+SET GLOBAL rpl_semi_sync_master_timeout= 1000000000;
+INSERT INTO t1 values (3);
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+
+
+connection slave;
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+
+connection con1;
+--let $status_var= Rpl_semi_sync_master_status
+--let $status_var_value=ON
+--source include/wait_for_status_var.inc
+
+SET GLOBAL rpl_semi_sync_master_timeout= 10000000;
+SET GLOBAL rpl_semi_sync_master_wait_no_slave= 1;
+INSERT INTO t1 values (4);
+sync_slave_with_master;
+
+connection con1;
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo ##########################################
+--echo # Test rpl_semi_sync_slave_delay_master #
+--echo ##########################################
+
+connection slave;
+SET GLOBAL rpl_semi_sync_slave_delay_master= 1;
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+
+connection con1;
+INSERT INTO t1 values (3);
+--source include/sync_slave_io_with_master.inc
+
+connection con1;
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+
+sync_slave_with_master;
+
+connection slave;
+select * from t1 order by a;
+connection con1;
+select * from t1 order by a;
+
+connection slave;
+SET GLOBAL rpl_semi_sync_slave_delay_master = 0;
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+
+--echo ##########################################################
+--echo # Test rpl_semi_sync_master_enabled and new ACK thread #
+--echo #########################################################
+connection con1;
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+show status like 'Rpl_semi_sync_master_clients';
+INSERT INTO t1 VALUES (1);
+SET GLOBAL rpl_semi_sync_master_enabled = 1;
+INSERT INTO t1 VALUES (2);
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo # Test failure of select error .
+SET GLOBAL debug = 'd,rpl_semisync_simulate_select_error';
+# It can still receive ACK from semi-sync slave
+INSERT INTO t1 VALUES(3);
+sync_slave_with_master;
+
+connection con1;
+--echo # Test failure of pthread_create
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure';
+SET GLOBAL rpl_semi_sync_master_enabled= ON;
+
+--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0
+--source include/wait_condition.inc
+
+# Todo: implement the thread join failure simulation
+--echo # Test failure of pthread_join
+#SET GLOBAL DEBUG = 'd,rpl_semisync_simulate_thread_join_failure';
+#SET GLOBAL rpl_semi_sync_master_enabled= ON;
+#
+#--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0
+#--source include/wait_condition.inc
+SET GLOBAL rpl_semi_sync_master_enabled= OFF;
+
+--echo #
+--echo # Failure on registering semisync slave
+--echo #
+SET GLOBAL debug= 'd,rpl_semisync_simulate_add_slave_failure';
+SET GLOBAL rpl_semi_sync_master_enabled= ON;
+
+connection slave;
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+
+connection con1;
+#--echo # Should be Zero.
+# Todo: implement the add_slave_failure simulation. Meanwhile
+# the status will be 1.
+# show status like 'Rpl_semi_sync_master_clients';
+SET GLOBAL debug='';
+
+--let $status_var= Rpl_semi_sync_master_clients
+--let $status_var_value= 1
+--let $status_type= GLOBAL
+--source include/wait_for_status_var.inc
+
+connection slave;
+--disable_warnings
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+--enable_warnings
+
+connection con1;
+sync_slave_with_master;
+
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo ##################################################################
+--echo # Test fixing of BUG#70669 #
+--echo #SLAVE CAN'T CONTINUE REPLICATION AFTER MASTER'S CRASH RECOVERY #
+--echo #################################################################
+connection con1;
+SET GLOBAL sync_binlog = 1;
+CREATE TABLE t2 (c1 INT);
+sync_slave_with_master;
+
+connection con1;
+# Block the session before its events are synced to disk
+#SET DEBUG_SYNC = 'before_sync_binlog_file SIGNAL before_sync_done WAIT_FOR continue';
+send INSERT INTO t2 values (1);
+
+connection slave;
+--let $table= t2
+--let $count= 1
+--source include/wait_until_rows_count.inc
+
+connection con2;
+#SET DEBUG_SYNC= "now WAIT_FOR before_sync_done";
+#SET DEBUG_SYNC = "now SIGNAL continue";
+
+connection con1;
+reap;
+
+sync_slave_with_master;
+show tables like 't2';
+select * from t2;
+
+connection con1;
+#SET DEBUG_SYNC= "before_update_pos SIGNAL leader_ready WAIT_FOR follower_ready";
+send INSERT INTO t2 VALUES (2);
+
+connection con2;
+#SET DEBUG_SYNC= "now WAIT_FOR leader_ready";
+#SET DEBUG_SYNC= "after_sync_queue SIGNAL follower_ready";
+send INSERT INTO t2 VALUES (3);
+
+connection con1;
+reap;
+connection con2;
+reap;
+
+connection con1;
+#SET DEBUG_SYNC = 'before_sync_binlog_file SIGNAL before_sync_done WAIT_FOR continue';
+SET GLOBAL sync_binlog = 0;
+
+# Todo: fix this simulation and implement the intended sync protocol.
+# As a workaround the DROP sender explicitly okays
+# which naturally increments the binlog position.
+#send DROP TABLE t2;
+DROP TABLE t2;
+
+connection con2;
+#SET DEBUG_SYNC= "now WAIT_FOR before_sync_done";
+
+sync_slave_with_master;
+
+# t2 should be dropped
+show tables like 't2';
+
+connection con2;
+#SET DEBUG_SYNC = "now SIGNAL continue";
+
+# This block is commented out on purpose. See the todo/workaround above.
+#connection con1;
+#reap;
+
+
+--echo #cleanup
+connection master;
+SET DEBUG_SYNC= 'reset';
+disconnect con1;
+disconnect con2;
+disconnect con3;
+SET GLOBAL rpl_semi_sync_master_timeout= 10000;
+SET GLOBAL rpl_semi_sync_master_enabled = 0;
+DROP TABLE t1;
+connection slave;
+SET GLOBAL rpl_semi_sync_slave_enabled = 0;
+stop slave;start slave;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_null_innodb.test b/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
index 5ef10263498..84f7adb32a9 100644
--- a/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
@@ -3,5 +3,5 @@
-- source include/master-slave.inc
-- let $engine= InnoDB
--- source extra/rpl_tests/rpl_set_null.test
+-- source include/rpl_set_null.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_null_myisam.test b/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
index 13cd7c3e4a8..db1bd4b77e7 100644
--- a/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
@@ -2,5 +2,5 @@
-- source include/master-slave.inc
-- let $engine= MyISAM
--- source extra/rpl_tests/rpl_set_null.test
+-- source include/rpl_set_null.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
index fa8eeb73fba..d3ef834e8ec 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_error.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
@@ -26,6 +26,10 @@
source include/have_innodb.inc;
source include/master-slave.inc;
+--connection slave
+let $initial_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1);
+
+connection master;
--echo ==== Test Without sql_mode=strict_trans_tables ====
create table t1 (n int not null primary key);
@@ -133,8 +137,9 @@ 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';
-
+let $current_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1);
+--let $delta_skipped_error= `select $current_skipped_error - $initial_skipped_error from dual`
+--echo # Slave_skipped_errros = $delta_skipped_error
connection master;
INSERT INTO t2 VALUES(1, 1);
@@ -151,7 +156,10 @@ 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';
+
+let $current_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1);
+--let $delta_skipped_error= `select $current_skipped_error - $initial_skipped_error from dual`
+--echo # Slave_skipped_errros = $delta_skipped_error
--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_replication.test b/mysql-test/suite/rpl/t/rpl_skip_replication.test
index c57256780a4..66fdbb8915a 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_replication.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_replication.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_skip_replication.inc
+--source include/rpl_skip_replication.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
index 426c3c831b0..928ad7e5e09 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -64,6 +64,7 @@ SELECT * FROM t3 ORDER BY a;
--connection slave
# 1146 = ER_NO_SUCH_TABLE
call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* error.* 1146");
+call mtr.add_suppression("At line *");
--let $slave_sql_errno= 1146
--source include/wait_for_slave_sql_error.inc
SHOW TABLES LIKE 't%';
diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test
index 6f196005711..fa19a17b1e4 100644
--- a/mysql-test/suite/rpl/t/rpl_special_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_special_charset.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_special_charset.inc
+--source include/rpl_special_charset.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 0a756982047..397756af396 100644
--- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_sporadic_master.inc
+--source include/rpl_sporadic_master.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 883b367e9f2..c4a534b9294 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_ssl.inc
+--source include/rpl_ssl.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
index face651b9a1..07b1000c99b 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
@@ -5,4 +5,4 @@
##############################
-- source include/have_binlog_format_mixed_or_statement.inc
let $engine_type=myisam;
--- source extra/rpl_tests/rpl_stm_EE_err2.test
+-- source include/rpl_stm_EE_err2.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
index 93cc06111e4..f893f9090e4 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
@@ -4,5 +4,5 @@
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_binlog_max_cache_size.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
index cd9e71cbff9..a4f592531a3 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
@@ -1,6 +1,6 @@
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc;
-source extra/rpl_tests/rpl_conflicts.test;
+source include/rpl_conflicts.test;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
index b395654a714..b971af71766 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
@@ -8,5 +8,5 @@
--source include/have_innodb.inc
--source include/master-slave.inc
---source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_drop_create_temp_table.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
index 83ef8699425..70178c2e32d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
@@ -3,4 +3,4 @@
--source include/binlog_start_pos.inc
let $rename_event_pos= `select @binlog_start_pos + 578`;
--- source extra/rpl_tests/rpl_flsh_tbls.test
+-- source include/rpl_flsh_tbls.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
index 774c87f551e..a095f7f7905 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
@@ -1,5 +1,5 @@
################################################################################
-# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test
+# Check file include/rpl_implicit_commit_binlog.test
################################################################################
--source include/have_udf.inc
--source include/have_binlog_format_statement.inc
@@ -8,5 +8,5 @@
--let $engine=Innodb
set session storage_engine=innodb;
---source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_implicit_commit_binlog.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_innodb.test b/mysql-test/suite/rpl/t/rpl_stm_innodb.test
index 97bfd168438..dbfbc7f6c64 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_innodb.test
@@ -5,5 +5,5 @@ source include/have_innodb.inc;
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc;
-source extra/rpl_tests/rpl_innodb.test;
+source include/rpl_innodb.test;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
index caaae06a8e9..619b57994c2 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
@@ -9,4 +9,4 @@
-- source include/not_windows.inc
-- let $engine=InnoDB
--- source extra/rpl_tests/rpl_lower_case_table_names.test
+-- source include/rpl_lower_case_table_names.test
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 32de2a94cbb..4409a1a8db5 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test
@@ -11,4 +11,4 @@ DROP TABLE t1;
let $lock_option= CONCURRENT;
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_loaddata.test
+-- source include/rpl_loaddata.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
index 016d3ed6090..5ff3846d2b9 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
@@ -19,6 +19,6 @@ disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
--- source extra/rpl_tests/rpl_loadfile.test
+-- source include/rpl_loadfile.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_log.test b/mysql-test/suite/rpl/t/rpl_stm_log.test
index 23130528465..4a0df44204a 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_log.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_log.test
@@ -2,7 +2,7 @@
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_log.test
+-- source include/rpl_log.test
# End of 4.1 tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
index 1a7139c889a..bea51ed21f9 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
@@ -5,4 +5,4 @@
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/rpl_tests/rpl_max_relay_size.test
+-- source include/rpl_max_relay_size.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
index 2b7aeed28ce..ab823799f5d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
@@ -15,5 +15,5 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
--- source extra/rpl_tests/rpl_show_relaylog_events.inc
+-- source include/rpl_show_relaylog_events.inc
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
index 9a92d60a2a1..9cb440b6599 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
@@ -8,7 +8,7 @@
let $engine_type=Innodb;
let $database_name=test;
---source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_mixing_engines.test
#
# BUG#49522: Replication problem with mixed MyISAM/InnoDB
diff --git a/mysql-test/suite/rpl/t/rpl_stm_multi_query.test b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
index e234f4b9622..2a593efdb35 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
@@ -4,4 +4,4 @@
# one binlog event containing all queries)
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/rpl_tests/rpl_multi_query.test
+-- source include/rpl_multi_query.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
index f72300ee2de..b4e53358712 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_stm_relay_ign_space.inc
+--source include/rpl_stm_relay_ign_space.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
index 6a99d4e1613..e32b0a789b2 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
@@ -1,6 +1,6 @@
# TBF - difference in row level logging
-- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/rpl_tests/rpl_reset_slave.test
+-- source include/rpl_reset_slave.test
# End of 4.1 tests
#
diff --git a/mysql-test/suite/rpl/t/rpl_stm_sp.test b/mysql-test/suite/rpl/t/rpl_stm_sp.test
new file mode 100644
index 00000000000..b99906b8d03
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_sp.test
@@ -0,0 +1,30 @@
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-11815 SP variables of temporal data types do not replicate correctly
+--echo #
+
+connection master;
+CREATE TABLE t1(a INT);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE a TIME DEFAULT '01:01:01';
+ INSERT INTO t1 VALUES (a=10101);
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+SELECT * FROM t1;
+
+sync_slave_with_master;
+SELECT * FROM t1;
+
+connection master;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+sync_slave_with_master;
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
index 76b2aed3f24..f401db33853 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
@@ -1,5 +1,5 @@
################################################################################
-# Please, check ./extra/rpl_tests/rpl_start_stop_slave.test
+# Please, check ./include/rpl_start_stop_slave.test
################################################################################
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
@@ -14,7 +14,7 @@ SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit
SET @@global.innodb_flush_log_at_trx_commit= 0;
SET @@session.binlog_direct_non_transactional_updates= FALSE;
---source ./extra/rpl_tests/rpl_start_stop_slave.test
+--source ./include/rpl_start_stop_slave.test
# clean up
--connection slave
diff --git a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
index 31880d17dfb..f2315f5e8c7 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
@@ -1,5 +1,5 @@
###################################################################################
-# Please, check extra/rpl_tests/rpl_stop_middle_group.test.
+# Please, check include/rpl_stop_middle_group.test.
###################################################################################
-- source include/have_debug.inc
-- source include/have_innodb.inc
@@ -7,5 +7,5 @@
-- source include/master-slave.inc
SET @@session.binlog_direct_non_transactional_updates= FALSE;
--- source extra/rpl_tests/rpl_stop_middle_group.test
+-- source include/rpl_stop_middle_group.test
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
index afe36334f18..17efa7ade3b 100644
--- a/mysql-test/suite/rpl/t/rpl_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -23,21 +23,21 @@ source include/stop_slave.inc;
--echo # It guarantees that SQL thread is applying the transaction when
--echo # STOP SLAVE command launchs.
SET @saved_dbug = @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,after_mysql_insert,*';
+set global debug_dbug= '+d,after_mysql_insert';
source include/start_slave.inc;
--echo
--echo # CREATE TEMPORARY TABLE with InnoDB engine
--echo # -----------------------------------------
let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
-source extra/rpl_tests/rpl_stop_slave.test;
+source include/rpl_stop_slave.test;
--echo
--echo # CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
--echo # ----------------------------------------------------
let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
SELECT c1 FROM t2;
-source extra/rpl_tests/rpl_stop_slave.test;
+source include/rpl_stop_slave.test;
# Don't need to verify 'CREATE TEMPORARY TABLE' with MyIASM engine, as it
# never is binlogged into a transaction since 5.5.
@@ -78,7 +78,7 @@ connection master;
--source include/stop_dump_threads.inc
SET @saved_dbug = @@GLOBAL.debug_dbug;
-SET GLOBAL debug_dbug= '+d,dump_thread_wait_before_send_xid,*';
+set global debug_dbug= '+d,dump_thread_wait_before_send_xid';
connection slave;
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index cd826c6be1e..2625508515b 100644
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_switch_stm_row_mixed.inc
+--source include/rpl_switch_stm_row_mixed.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
index 43dc2062ff0..fc56065731c 100644
--- a/mysql-test/suite/rpl/t/rpl_sync-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
@@ -1,2 +1,2 @@
---sync-relay-log-info=1 --relay-log-recovery=1 --loose-innodb_file_format_check=1 --default-storage-engine=MyISAM --loose-innodb-file-per-table=0
+--sync-relay-log-info=1 --relay-log-recovery=1 --default-storage-engine=MyISAM --loose-innodb-file-per-table=0
--skip-core-file
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
index ec98a344282..bdb0d8ec4cc 100644
--- a/mysql-test/suite/rpl/t/rpl_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -1,2 +1,2 @@
---source extra/rpl_tests/rpl_sync.inc
+--source include/rpl_sync_test.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
index 99a70e011c4..d976ae3757b 100644
--- 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
@@ -1 +1 @@
---source extra/rpl_tests/rpl_temporal_format_default_to_default.inc
+--source include/rpl_temporal_format_default_to_default.inc
diff --git a/mysql-test/suite/rpl/t/rpl_test_framework.test b/mysql-test/suite/rpl/t/rpl_test_framework.test
index e0f961caff1..cf559072e2f 100644
--- a/mysql-test/suite/rpl/t/rpl_test_framework.test
+++ b/mysql-test/suite/rpl/t/rpl_test_framework.test
@@ -5,8 +5,8 @@
# is correct.
#
# We test a number of different topologies. Each topology is tested
-# in extra/rpl_tests/rpl_test_framework.inc. See
-# extra/rpl_tests/rpl_test_framework.inc for details on how the sync
+# in include/rpl_test_framework.inc. See
+# include/rpl_test_framework.inc for details on how the sync
# chain is tested.
#
# ==== Related bugs ====
@@ -36,7 +36,7 @@ CREATE TABLE t1 (a INT);
--source include/rpl_end.inc
# Initialize $next_number before first call to
-# extra/rpl_tests/rpl_test_framework.text
+# include/rpl_test_framework.text
--let $next_number= 0
@@ -46,43 +46,43 @@ CREATE TABLE t1 (a INT);
--let $rpl_topology= 1 -> 2
--let $masters= 1,3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 2 -> 3
--let $masters= 1,2
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= none
--let $masters= 1,2,3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 1->2, 2->1
--let $masters= 1,3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 1->2->1
--let $masters= 2,3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 2->1->2
--let $masters= 1,3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 1->2->3
--let $masters= 1
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 2->3->2->1
--let $masters= 3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 1->2,2->3,3->1
--let $masters= 3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 1->3->2->1
--let $masters= 3
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--echo ==== Test 6-server topologies ====
@@ -91,19 +91,19 @@ CREATE TABLE t1 (a INT);
--let $rpl_topology= 1->2->3->4->1->5->6
--let $masters= 1
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 3->4->5->6->3->1->2
--let $masters= 4
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 6->5->4->3->2->1
--let $masters= 6
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--let $rpl_topology= 1->2->3->1,4->5->6
--let $masters= 3,4
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
--echo ==== Test 9-server topology ====
@@ -112,7 +112,7 @@ CREATE TABLE t1 (a INT);
--let $rpl_topology= 1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9
--let $masters= 2
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
if ($mtr_supports_more_than_10_servers) {
--echo ==== Test 15-server topologies ====
@@ -121,12 +121,12 @@ if ($mtr_supports_more_than_10_servers) {
--let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15->1
--let $masters= 2
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
# This is a binary tree
--let $rpl_topology= 1->2->4->8,1->3->6->12,2->5->10,3->7->14,4->9,5->11,6->13,7->15
--let $masters= 1
---source extra/rpl_tests/rpl_test_framework.inc
+--source include/rpl_test_framework.inc
}
--echo ==== Clean up ====
diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
index bc4119f332f..7029729d299 100644
--- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
@@ -9,7 +9,7 @@ source include/have_binlog_format_row.inc;
source include/master-slave.inc;
LET $ENGINE_TYPE= MyISAM;
-source extra/rpl_tests/rpl_tmp_table_and_DDL.test;
+source include/rpl_tmp_table_and_DDL.test;
sync_slave_with_master;
#
diff --git a/mysql-test/suite/rpl/t/rpl_trans_no_trans.test b/mysql-test/suite/rpl/t/rpl_trans_no_trans.test
new file mode 100644
index 00000000000..f6e3731dbf8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_trans_no_trans.test
@@ -0,0 +1,72 @@
+#
+# Test mixing transactional and non transactional tables
+#
+
+--source include/master-slave.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+
+#
+# Test updating conditionally a non transactinal table in a function
+# This verifies that we don't write only a table map for a non transactional,
+# without any row events
+# The original bug caused a crash on the slave when doing a sync_slave
+#
+
+create or replace table t1(id int)engine=innodb;
+create or replace table t3(id int)engine=myisam;
+
+delimiter //;
+create or replace function t99 (a int)
+returns int(10)
+MODIFIES SQL DATA
+begin
+ if (a > 100)
+ then
+ insert into t3 values (a);
+ end if;
+ return a;
+end//
+delimiter ;//
+begin;
+insert into t1 values(t99(1));
+insert into t1 values(t99(101));
+commit;
+select * from t1;
+select * from t3;
+insert into t1 values(t99(1));
+
+drop function t99;
+drop table t1,t3;
+
+sync_slave_with_master;
+connection master;
+
+#
+# MDEV-8203
+# Assertion `!current_stmt_is_commit || !rgi->tables_to_lock' failed in
+# Query_log_event::do_apply_event(rpl_group_info*, const char*, uint32)
+#
+
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+CREATE TABLE t2 (j INT) ENGINE=MyISAM;
+
+--delimiter ||
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ SET @a = unknown_column_just_to_raise_an_error;
+ INSERT INTO t2 VALUES (NULL) ;
+END||
+--delimiter ;
+
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 VALUES (1);
+--sync_slave_with_master
+
+connection master;
+
+drop trigger tr;
+drop table t1,t2;
+
+# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
index 4a8994d1878..e8b55b86aba 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
@@ -1,2 +1,2 @@
let $engine=MyISAM;
---source extra/rpl_tests/rpl_truncate.test
+--source include/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 fbedaed87c1..bac911b985e 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
@@ -1,3 +1,3 @@
--source include/have_innodb.inc
let $engine=InnoDB;
---source extra/rpl_tests/rpl_truncate.test
+--source include/rpl_truncate.test
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test
index 4dbfc27d088..c2517086258 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv.test
@@ -1 +1 @@
---source extra/rpl_tests/rpl_typeconv.inc
+--source include/rpl_typeconv.inc
diff --git a/mysql-test/suite/rpl/t/rpl_update.test b/mysql-test/suite/rpl/t/rpl_update.test
new file mode 100644
index 00000000000..b38078770a5
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_update.test
@@ -0,0 +1,15 @@
+source include/master-slave.inc;
+
+#
+# MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
+#
+set sql_mode=simultaneous_assignment;
+create table t1 (a int, b int);
+insert into t1 values(1, 2);
+update t1 set a=b, b=a;
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+source include/rpl_end.inc;
diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test
index daf3d2f8571..866041d2579 100644
--- a/mysql-test/suite/rpl/t/semisync_future-7591.test
+++ b/mysql-test/suite/rpl/t/semisync_future-7591.test
@@ -1,4 +1,3 @@
---source include/have_semisync.inc
--source include/master-slave.inc
call mtr.add_suppression("Timeout waiting for reply of binlog*");
diff --git a/mysql-test/suite/rpl/t/semisync_memleak_4066.test b/mysql-test/suite/rpl/t/semisync_memleak_4066.test
index f888f764b43..e88e2335696 100644
--- a/mysql-test/suite/rpl/t/semisync_memleak_4066.test
+++ b/mysql-test/suite/rpl/t/semisync_memleak_4066.test
@@ -1,7 +1,6 @@
#
# MDEV-4066 semisync_master + temporary tables causes memory leaks
#
-source include/have_semisync.inc;
source include/have_binlog_format_row.inc;
source include/master-slave.inc;
diff --git a/mysql-test/suite/rpl/t/sequence.cnf b/mysql-test/suite/rpl/t/sequence.cnf
new file mode 100644
index 00000000000..58b605ad928
--- /dev/null
+++ b/mysql-test/suite/rpl/t/sequence.cnf
@@ -0,0 +1,8 @@
+!include ../my.cnf
+
+[mysqld.3]
+log-slave-updates
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/rpl/t/sequence.test b/mysql-test/suite/rpl/t/sequence.test
new file mode 100644
index 00000000000..436a0b1cdab
--- /dev/null
+++ b/mysql-test/suite/rpl/t/sequence.test
@@ -0,0 +1,52 @@
+#
+# Testing sequences with replication
+#
+
+--source include/have_binlog_format_row.inc
+--source include/have_aria.inc
+--source include/have_sequence.inc
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+
+--let $rpl_connection_name= master
+--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= slave2
+--let $rpl_server_number= 3
+--source include/rpl_connect.inc
+
+--connection master
+
+set @@default_storage_engine="aria";
+
+CREATE SEQUENCE s1 cache=10;
+create table t1 select * from s1;
+select NEXT VALUE for s1,seq from seq_1_to_20;
+insert into t1 select * from s1;
+do setval(s1,5, 1, 0);
+insert into t1 select * from s1;
+do setval(s1, 5000, 1 ,0);
+insert into t1 select * from s1;
+alter sequence s1 minvalue=-1 start=-1 restart=-1;
+insert into t1 select * from s1;
+insert into s1 values(-100,-1000,9223372036854775806,1,1,1000,0,0);
+insert into t1 select * from s1;
+select * from t1;
+--sync_slave_with_master
+select * from t1;
+--sync_slave_with_master slave2
+select * from t1;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+connection master;
+drop table s1,t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
index 88d7076b1e4..06a9e8ad75b 100644
--- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
+++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
@@ -15,6 +15,7 @@ call mtr.add_suppression("Master is configured to log replication events");
# All done.
--connection slave
+--source include/wait_for_slave_to_stop.inc
start slave;
--connection master
diff --git a/mysql-test/suite/sql_sequence/alter.result b/mysql-test/suite/sql_sequence/alter.result
new file mode 100644
index 00000000000..612e2201d26
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/alter.result
@@ -0,0 +1,251 @@
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+#
+# Test alter sequence
+#
+CREATE SEQUENCE t1 nocache engine=myisam;
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 0 0 0
+select next value for t1;
+next value for t1
+1
+alter sequence t1 start=50;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 50 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2 1 9223372036854775806 50 1 0 0 0
+select next value for t1;
+next value for t1
+2
+alter sequence t1 minvalue=-100;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 50 minvalue -100 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 -100 9223372036854775806 50 1 0 0 0
+alter sequence t1 minvalue=100 start=100;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+alter sequence t1 minvalue=100 start=100 restart=100;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 100 minvalue 100 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+100 100 9223372036854775806 100 1 0 0 0
+alter sequence t1 maxvalue=500;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 100 minvalue 100 maxvalue 500 increment by 1 nocache nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+100 100 500 100 1 0 0 0
+drop sequence t1;
+CREATE SEQUENCE t1 engine=myisam;
+alter sequence t1 nocache;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
+alter sequence t1 cache=100;
+flush tables;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 100 nocycle ENGINE=MyISAM
+alter sequence t1 nocache;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
+flush tables;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 0 0 0
+select next value for t1;
+next value for t1
+1
+select next value for t1;
+next value for t1
+2
+select next value for t1;
+next value for t1
+3
+select next_not_cached_value, cycle_count from t1;
+next_not_cached_value cycle_count
+4 0
+drop sequence t1;
+CREATE SEQUENCE t1 maxvalue=100 engine=myisam;
+alter sequence t1 no maxvalue;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+alter sequence t1 cycle;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM
+alter sequence t1 nocycle;
+alter sequence t1 start=15 restart minvalue=10 maxvalue=20 cycle;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 15 minvalue 10 maxvalue 20 increment by 1 cache 1000 cycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+15 10 20 15 1 1000 1 0
+select NEXT VALUE for t1 from seq_1_to_10;
+NEXT VALUE for t1
+15
+16
+17
+18
+19
+20
+10
+11
+12
+13
+alter sequence t1 restart with 17 minvalue=10 maxvalue=20 cycle;
+select NEXT VALUE for t1 from seq_1_to_10;
+NEXT VALUE for t1
+17
+18
+19
+20
+10
+11
+12
+13
+14
+15
+drop sequence t1;
+CREATE SEQUENCE t1 maxvalue=100;
+alter sequence t1 increment=-2 start with 50 minvalue=-100;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 50 minvalue -100 maxvalue 100 increment by -2 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 -100 100 50 -2 1000 0 0
+select NEXT VALUE for t1 from seq_1_to_10;
+NEXT VALUE for t1
+1
+-1
+-3
+-5
+-7
+-9
+-11
+-13
+-15
+-17
+drop sequence t1;
+#
+# InnoDB (some things work different with InnoDB)
+
+CREATE SEQUENCE t1 cache 10 engine=innodb;
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 10 0 0
+select next value for t1;
+next value for t1
+1
+alter sequence t1 start=100;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 100 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 10 nocycle ENGINE=InnoDB
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 100 1 10 0 0
+select next value for t1;
+next value for t1
+11
+drop sequence t1;
+#
+# ALTER TABLE
+#
+CREATE SEQUENCE t1 engine=innodb;
+select next value for t1;
+next value for t1
+1
+alter table t1 rename t2;
+select next value for t2;
+next value for t2
+1001
+rename table t2 to t1;
+select next value for t1;
+next value for t1
+2001
+alter table t1 comment="foo";
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB COMMENT='foo'
+alter table t1 engine=myisam;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM COMMENT='foo'
+alter table t1 engine=innodb;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB COMMENT='foo'
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3001 1 9223372036854775806 1 1 1000 0 0
+drop sequence t1;
+CREATE SEQUENCE t1 engine=myisam;
+alter sequence t1 minvalue=100;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+drop sequence t1;
+CREATE SEQUENCE t1 engine=myisam;
+alter sequence t1 minvalue=25 maxvalue=20;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+drop sequence t1;
+create table t1 (a int);
+alter sequence t1 minvalue=100;
+ERROR 42S02: 'test.t1' is not a SEQUENCE
+drop table t1;
+alter sequence if exists t1 minvalue=100;
+Warnings:
+Note 4091 Unknown SEQUENCE: 'test.t1'
+alter sequence t1 minvalue=100;
+ERROR 42S02: Table 'test.t1' doesn't exist
+create sequence t1;
+alter sequence 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 '' at line 1
+drop sequence t1;
+CREATE SEQUENCE t1 maxvalue=100;
+alter sequence t1 increment=-2 start with 50;
+select next value for t1;
+next value for t1
+1
+select next value for t1;
+ERROR HY000: Sequence 'test.t1' has run out
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+0 1 100 50 -2 1000 0 0
+alter sequence t1 restart;
+select next value for t1;
+next value for t1
+50
+alter sequence t1 restart with 90;
+select next value for t1;
+next value for t1
+90
+drop sequence t1;
+CREATE SEQUENCE t1 engine=innodb;
+ALTER IGNORE TABLE t1 ADD CHECK (start_value < minimum_value);
+ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any constraints)
+DROP SEQUENCE t1;
+CREATE SEQUENCE s;
+ALTER TABLE s ORDER BY cache_size;
+ERROR HY000: Sequence 'test.s' table structure is invalid (ORDER BY)
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+1
+DROP SEQUENCE s;
diff --git a/mysql-test/suite/sql_sequence/alter.test b/mysql-test/suite/sql_sequence/alter.test
new file mode 100644
index 00000000000..53f71018337
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/alter.test
@@ -0,0 +1,162 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+drop table if exists t1;
+
+--echo #
+--echo # Test alter sequence
+--echo #
+
+CREATE SEQUENCE t1 nocache engine=myisam;
+select * from t1;
+select next value for t1;
+alter sequence t1 start=50;
+show create sequence t1;
+select * from t1;
+select next value for t1;
+
+alter sequence t1 minvalue=-100;
+show create sequence t1;
+select * from t1;
+--error ER_SEQUENCE_INVALID_DATA
+alter sequence t1 minvalue=100 start=100;
+alter sequence t1 minvalue=100 start=100 restart=100;
+show create sequence t1;
+select * from t1;
+
+alter sequence t1 maxvalue=500;
+show create sequence t1;
+select * from t1;
+drop sequence t1;
+
+CREATE SEQUENCE t1 engine=myisam;
+alter sequence t1 nocache;
+show create sequence t1;
+alter sequence t1 cache=100;
+flush tables;
+show create sequence t1;
+alter sequence t1 nocache;
+show create sequence t1;
+flush tables;
+show create sequence t1;
+select * from t1;
+select next value for t1;
+select next value for t1;
+select next value for t1;
+select next_not_cached_value, cycle_count from t1;
+drop sequence t1;
+
+CREATE SEQUENCE t1 maxvalue=100 engine=myisam;
+alter sequence t1 no maxvalue;
+show create sequence t1;
+select * from t1;
+alter sequence t1 cycle;
+show create sequence t1;
+alter sequence t1 nocycle;
+alter sequence t1 start=15 restart minvalue=10 maxvalue=20 cycle;
+show create sequence t1;
+select * from t1;
+select NEXT VALUE for t1 from seq_1_to_10;
+alter sequence t1 restart with 17 minvalue=10 maxvalue=20 cycle;
+select NEXT VALUE for t1 from seq_1_to_10;
+drop sequence t1;
+
+CREATE SEQUENCE t1 maxvalue=100;
+alter sequence t1 increment=-2 start with 50 minvalue=-100;
+show create sequence t1;
+select * from t1;
+select NEXT VALUE for t1 from seq_1_to_10;
+drop sequence t1;
+
+--echo #
+--echo # InnoDB (some things work different with InnoDB)
+--echo
+
+CREATE SEQUENCE t1 cache 10 engine=innodb;
+select * from t1;
+select next value for t1;
+alter sequence t1 start=100;
+show create sequence t1;
+select * from t1;
+select next value for t1;
+drop sequence t1;
+
+--echo #
+--echo # ALTER TABLE
+--echo #
+
+CREATE SEQUENCE t1 engine=innodb;
+select next value for t1;
+alter table t1 rename t2;
+select next value for t2;
+rename table t2 to t1;
+select next value for t1;
+alter table t1 comment="foo";
+show create sequence t1;
+alter table t1 engine=myisam;
+show create sequence t1;
+alter table t1 engine=innodb;
+show create sequence t1;
+select * from t1;
+drop sequence t1;
+
+#
+# Some error testing
+#
+
+CREATE SEQUENCE t1 engine=myisam;
+--error ER_SEQUENCE_INVALID_DATA
+alter sequence t1 minvalue=100;
+drop sequence t1;
+
+CREATE SEQUENCE t1 engine=myisam;
+--error ER_SEQUENCE_INVALID_DATA
+alter sequence t1 minvalue=25 maxvalue=20;
+drop sequence t1;
+
+create table t1 (a int);
+--error ER_NOT_SEQUENCE
+alter sequence t1 minvalue=100;
+drop table t1;
+
+alter sequence if exists t1 minvalue=100;
+--error ER_NO_SUCH_TABLE
+alter sequence t1 minvalue=100;
+
+create sequence t1;
+--error ER_PARSE_ERROR
+alter sequence t1;
+drop sequence t1;
+
+CREATE SEQUENCE t1 maxvalue=100;
+alter sequence t1 increment=-2 start with 50;
+select next value for t1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for t1;
+select * from t1;
+alter sequence t1 restart;
+select next value for t1;
+alter sequence t1 restart with 90;
+select next value for t1;
+drop sequence t1;
+
+#
+# MDEV-19977 Assertion `(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X'
+# failed in lock_rec_lock
+#
+
+CREATE SEQUENCE t1 engine=innodb;
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+ALTER IGNORE TABLE t1 ADD CHECK (start_value < minimum_value);
+DROP SEQUENCE t1;
+
+#
+# MDEV-19320 Sequence gets corrupted and produces ER_KEY_NOT_FOUND (Can't
+# find record) after ALTER .. ORDER BY
+#
+
+CREATE SEQUENCE s;
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+ALTER TABLE s ORDER BY cache_size;
+SELECT NEXTVAL(s);
+DROP SEQUENCE s;
diff --git a/mysql-test/suite/sql_sequence/alter_notembedded.result b/mysql-test/suite/sql_sequence/alter_notembedded.result
new file mode 100644
index 00000000000..25b33dd742b
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/alter_notembedded.result
@@ -0,0 +1,38 @@
+#
+# GRANT
+#
+create database s_db;
+create sequence s_db.s1;
+grant select on s_db.s1 to normal_1@'%' identified by 'pass';
+connect m_normal_1, localhost, normal_1, pass, s_db;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select nextval(s1);
+ERROR 42000: INSERT command denied to user 'normal_1'@'localhost' for table 's1'
+show create sequence s1;
+Table Create Table
+s1 CREATE SEQUENCE `s1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+alter sequence s1 restart 50;
+ERROR 42000: ALTER command denied to user 'normal_1'@'localhost' for table 's1'
+connection default;
+grant insert on s_db.s1 to normal_1@'%';
+connection m_normal_1;
+select nextval(s1);
+nextval(s1)
+1
+alter sequence s1 restart 50;
+ERROR 42000: ALTER command denied to user 'normal_1'@'localhost' for table 's1'
+connection default;
+grant alter on s_db.s1 to normal_1@'%';
+connection m_normal_1;
+alter sequence s1 restart 50;
+select nextval(s1);
+nextval(s1)
+50
+drop sequence s1;
+ERROR 42000: DROP command denied to user 'normal_1'@'localhost' for table 's1'
+connection default;
+disconnect m_normal_1;
+drop database s_db;
+drop user normal_1@'%';
diff --git a/mysql-test/suite/sql_sequence/alter_notembedded.test b/mysql-test/suite/sql_sequence/alter_notembedded.test
new file mode 100644
index 00000000000..a7c37b53473
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/alter_notembedded.test
@@ -0,0 +1,37 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # GRANT
+--echo #
+
+create database s_db;
+create sequence s_db.s1;
+grant select on s_db.s1 to normal_1@'%' identified by 'pass';
+
+connect(m_normal_1, localhost, normal_1, pass, s_db);
+select * from s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+select nextval(s1);
+show create sequence s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter sequence s1 restart 50;
+connection default;
+grant insert on s_db.s1 to normal_1@'%';
+connection m_normal_1;
+select nextval(s1);
+--error ER_TABLEACCESS_DENIED_ERROR
+alter sequence s1 restart 50;
+connection default;
+grant alter on s_db.s1 to normal_1@'%';
+connection m_normal_1;
+alter sequence s1 restart 50;
+select nextval(s1);
+--error ER_TABLEACCESS_DENIED_ERROR
+drop sequence s1;
+
+connection default;
+disconnect m_normal_1;
+drop database s_db;
+drop user normal_1@'%';
diff --git a/mysql-test/suite/sql_sequence/aria.result b/mysql-test/suite/sql_sequence/aria.result
new file mode 100644
index 00000000000..b39d85d58ca
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/aria.result
@@ -0,0 +1,66 @@
+set @@default_storage_engine="aria";
+CREATE SEQUENCE t1 cache=10;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 10 nocycle ENGINE=Aria
+select NEXT VALUE for t1,seq from seq_1_to_20;
+NEXT VALUE for t1 seq
+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
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+21 1 9223372036854775806 1 1 10 0 0
+drop sequence t1;
+create sequence s1;
+check table s1;
+Table Op Msg_type Msg_text
+test.s1 check note The storage engine for the table doesn't support check
+select next value for s1;
+next value for s1
+1
+flush tables;
+check table s1;
+Table Op Msg_type Msg_text
+test.s1 check note The storage engine for the table doesn't support check
+select next value for s1;
+next value for s1
+1001
+flush tables;
+repair table s1;
+Table Op Msg_type Msg_text
+test.s1 repair status OK
+select next value for s1;
+next value for s1
+2001
+drop sequence s1;
+CREATE SEQUENCE t1;
+alter sequence t1 minvalue=100;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+alter sequence t1 minvalue=100 start=100 restart=100;
+rename table t1 to t2;
+select next value for t2;
+next value for t2
+100
+alter table t2 rename to t1;
+select next value for t1;
+next value for t1
+1100
+drop table t1;
diff --git a/mysql-test/suite/sql_sequence/aria.test b/mysql-test/suite/sql_sequence/aria.test
new file mode 100644
index 00000000000..8e8a50ef412
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/aria.test
@@ -0,0 +1,43 @@
+--source include/have_sequence.inc
+--source include/have_aria.inc
+
+#
+# Simple test of the aria engine
+# As most test is above the engine, we only have to test base functionality
+#
+
+set @@default_storage_engine="aria";
+
+CREATE SEQUENCE t1 cache=10;
+show create sequence t1;
+select NEXT VALUE for t1,seq from seq_1_to_20;
+select * from t1;
+drop sequence t1;
+
+#
+# Create and check
+#
+
+create sequence s1;
+check table s1;
+select next value for s1;
+flush tables;
+check table s1;
+select next value for s1;
+flush tables;
+repair table s1;
+select next value for s1;
+drop sequence s1;
+
+#
+# ALTER and RENAME
+
+CREATE SEQUENCE t1;
+--error ER_SEQUENCE_INVALID_DATA
+alter sequence t1 minvalue=100;
+alter sequence t1 minvalue=100 start=100 restart=100;
+rename table t1 to t2;
+select next value for t2;
+alter table t2 rename to t1;
+select next value for t1;
+drop table t1;
diff --git a/mysql-test/suite/sql_sequence/auto_increment.result b/mysql-test/suite/sql_sequence/auto_increment.result
new file mode 100644
index 00000000000..bf0a04bbaf1
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/auto_increment.result
@@ -0,0 +1,30 @@
+set global auto_increment_increment= 2, auto_increment_offset= 2;
+create sequence s start with -3 minvalue= -1000 increment 0;
+select nextval(s);
+nextval(s)
+-2
+select nextval(s);
+nextval(s)
+0
+flush tables;
+select nextval(s);
+nextval(s)
+1998
+drop sequence s;
+set global auto_increment_increment= 2, auto_increment_offset= 1;
+create sequence s start with -3 minvalue= -1000 increment 0;
+select nextval(s);
+nextval(s)
+-3
+select nextval(s);
+nextval(s)
+-1
+select nextval(s);
+nextval(s)
+1
+flush tables;
+select nextval(s);
+nextval(s)
+1997
+drop sequence s;
+set global auto_increment_increment= default, auto_increment_offset= default;
diff --git a/mysql-test/suite/sql_sequence/auto_increment.test b/mysql-test/suite/sql_sequence/auto_increment.test
new file mode 100644
index 00000000000..335bef7ea37
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/auto_increment.test
@@ -0,0 +1,30 @@
+--source include/have_sequence.inc
+
+#
+# tests with auto_increment_increment and auto_increment_offset
+#
+
+set global auto_increment_increment= 2, auto_increment_offset= 2;
+
+create sequence s start with -3 minvalue= -1000 increment 0;
+
+select nextval(s);
+select nextval(s);
+flush tables;
+select nextval(s);
+drop sequence s;
+
+set global auto_increment_increment= 2, auto_increment_offset= 1;
+
+create sequence s start with -3 minvalue= -1000 increment 0;
+
+select nextval(s);
+select nextval(s);
+select nextval(s);
+flush tables;
+select nextval(s);
+drop sequence s;
+
+# Clean up
+
+set global auto_increment_increment= default, auto_increment_offset= default;
diff --git a/mysql-test/suite/sql_sequence/binlog.result b/mysql-test/suite/sql_sequence/binlog.result
new file mode 100644
index 00000000000..f01b3234e96
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/binlog.result
@@ -0,0 +1,33 @@
+create or replace sequence s1 cache 3;
+select next value for s1, minimum_value from s1 where maximum_value> 1;
+next value for s1 minimum_value
+1 1
+select next value for s1, minimum_value from s1 where maximum_value> 2;
+next value for s1 minimum_value
+2 1
+select next value for s1, minimum_value from s1 where maximum_value> 3;
+next value for s1 minimum_value
+3 1
+select next value for s1, minimum_value from s1 where maximum_value> 4;
+next value for s1 minimum_value
+4 1
+alter sequence s1 maxvalue 1000;
+drop sequence s1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create or replace sequence s1 cache 3
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # select next value for s1, minimum_value from s1 where maximum_value> 1
+master-bin.000001 # Table_map # # table_id: # (test.s1)
+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 # Annotate_rows # # select next value for s1, minimum_value from s1 where maximum_value> 4
+master-bin.000001 # Table_map # # table_id: # (test.s1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; alter sequence s1 maxvalue 1000
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP SEQUENCE `s1` /* generated by server */
diff --git a/mysql-test/suite/sql_sequence/binlog.test b/mysql-test/suite/sql_sequence/binlog.test
new file mode 100644
index 00000000000..5f2d52d7864
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/binlog.test
@@ -0,0 +1,27 @@
+--source include/have_udf.inc
+--source include/have_log_bin.inc
+--source include/binlog_start_pos.inc
+
+#
+# Testing binary logging of sequences
+#
+
+--disable_query_log
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+create or replace sequence s1 cache 3;
+select next value for s1, minimum_value from s1 where maximum_value> 1;
+select next value for s1, minimum_value from s1 where maximum_value> 2;
+select next value for s1, minimum_value from s1 where maximum_value> 3;
+select next value for s1, minimum_value from s1 where maximum_value> 4;
+
+#
+# Alter sequence
+#
+alter sequence s1 maxvalue 1000;
+
+drop sequence s1;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/sql_sequence/concurrent_create.result b/mysql-test/suite/sql_sequence/concurrent_create.result
new file mode 100644
index 00000000000..7e68195f7e0
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/concurrent_create.result
@@ -0,0 +1,33 @@
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+CREATE SEQUENCE s2 ENGINE=InnoDB;
+connect con1,localhost,root,,test;
+CREATE TABLE s3 LIKE s2;;
+connection default;
+CREATE SEQUENCE s4 ENGINE=InnoDB;
+SELECT * from s1 WHERE start_value IN (SELECT start_value FROM s2);
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+connection con1;
+disconnect con1;
+connection default;
+DROP SEQUENCE s1, s2, s3, s4;
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+PREPARE stmt FROM "CREATE TABLE s2 LIKE s1";
+execute stmt;
+drop table s2;
+execute stmt;
+drop table s2;
+execute stmt;
+select * from s2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+DROP SEQUENCE s1, s2;
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+connect con1,localhost,root,,test;
+CREATE TABLE s2 LIKE s1;;
+connection default;
+FLUSH TABLES;
+connection con1;
+disconnect con1;
+connection default;
+DROP TABLE s1,s2;
diff --git a/mysql-test/suite/sql_sequence/concurrent_create.test b/mysql-test/suite/sql_sequence/concurrent_create.test
new file mode 100644
index 00000000000..d6a57ff7d50
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/concurrent_create.test
@@ -0,0 +1,58 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+#
+# MDEV-15149 Assorted assertion failures upon concurrent creating / querying
+# sequences (same test case)
+#
+
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+CREATE SEQUENCE s2 ENGINE=InnoDB;
+
+--connect (con1,localhost,root,,test)
+--send CREATE TABLE s3 LIKE s2;
+
+--connection default
+CREATE SEQUENCE s4 ENGINE=InnoDB;
+SELECT * from s1 WHERE start_value IN (SELECT start_value FROM s2);
+
+--connection con1
+--reap
+
+# Cleanup
+--disconnect con1
+--connection default
+DROP SEQUENCE s1, s2, s3, s4;
+
+#
+# Check prepared statements
+#
+
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+PREPARE stmt FROM "CREATE TABLE s2 LIKE s1";
+execute stmt;
+drop table s2;
+execute stmt;
+drop table s2;
+execute stmt;
+select * from s2;
+DROP SEQUENCE s1, s2;
+
+#
+# MDEV-15117 Server crashes in in open_and_process_table or ASAN
+# heap-use-after-free in is_temporary_table upon creating/flushing sequences
+#
+
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+--connect (con1,localhost,root,,test)
+--send CREATE TABLE s2 LIKE s1;
+--connection default
+FLUSH TABLES;
+
+# Cleanup
+--connection con1
+--reap
+--disconnect con1
+--connection default
+
+DROP TABLE s1,s2;
diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result
new file mode 100644
index 00000000000..14464c60e99
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/create.result
@@ -0,0 +1,689 @@
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+create or replace sequence t1 engine=myisam;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+create or replace sequence t1 engine=innodb;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=InnoDB SEQUENCE=1
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+create or replace sequence t1 engine=maria;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=Aria SEQUENCE=1
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+create or replace sequence t1 engine=archive;
+ERROR HY000: Table storage engine 'ARCHIVE' does not support the create option 'SEQUENCE'
+show create table t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+create or replace sequence t1 start with 10;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 10 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+10 1 9223372036854775806 10 1 1000 0 0
+create or replace sequence t1 minvalue=11;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 11 minvalue 11 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 11 9223372036854775806 11 1 1000 0 0
+create or replace sequence t1 maxvalue=13 increment by -1;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 13 minvalue -9223372036854775807 maxvalue 13 increment by -1 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+13 -9223372036854775807 13 13 -1 1000 0 0
+create or replace sequence t1 increment by -1 cache 100;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with -1 minvalue -9223372036854775807 maxvalue -1 increment by -1 cache 100 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+-1 -9223372036854775807 -1 -1 -1 100 0 0
+create or replace sequence t1 cycle;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 1 0
+create or replace sequence t1 nocycle;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+create or replace sequence t1 cycle minvalue= 14;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 14 minvalue 14 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+14 14 9223372036854775806 14 1 1000 1 0
+create or replace sequence t1 cycle increment by -1;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with -1 minvalue -9223372036854775807 maxvalue -1 increment by -1 cache 1000 cycle ENGINE=MyISAM
+drop sequence t1;
+create sequence if not exists t1;
+create sequence if not exists t1 start with 10;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+create or replace sequence t1 start with 10 minvalue=10 maxvalue=11 nocache cycle;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 10 minvalue 10 maxvalue 11 increment by 1 nocache cycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+10 10 11 10 1 0 1 0
+create or replace sequence t1 start with 10 minvalue=-10 maxvalue=11 cache=10 cycle increment by 10;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 10 minvalue -10 maxvalue 11 increment by 10 cache 10 cycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+10 -10 11 10 10 10 1 0
+create or replace sequence t1 start with 10 NO MAXVALUE NO MINVALUE;
+create or replace sequence t1 start with 10 maxvalue 10;
+create or replace sequence t1 start with 10 minvalue 10;
+create or replace sequence t1 start with 10 minvalue 10 maxvalue 11 cycle;
+create or replace sequence t1 start with 10 maxvalue=9223372036854775806;
+create or replace sequence t1 start with 10 minvalue=-9223372036854775807;
+drop sequence if exists t1;
+create sequence t1 increment by 0;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 0 cache 1000 nocycle ENGINE=MyISAM
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 0 1000 0 0
+drop sequence t1;
+create table t1 (a int);
+show create sequence t1;
+ERROR 42S02: 'test.t1' is not a SEQUENCE
+drop sequence t1;
+ERROR 42S02: 'test.t1' is not a SEQUENCE
+drop sequence if exists t1;
+Warnings:
+Note 4091 Unknown SEQUENCE: 'test.t1'
+create sequence t1 start with 10 maxvalue=9;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+create sequence t1 minvalue= 100 maxvalue=10;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+create sequence t1 start with 9 minvalue=10;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+create or replace sequence t1 maxvalue=13, increment 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 ' increment by -1' at line 1
+create or replace sequence t1 start with= 10 maxvalue=13;
+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 '= 10 maxvalue=13' at line 1
+create or replace sequence t1 maxvalue=13, increment= -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 ' increment= -1' at line 1
+create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
+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 'NO MINVALUE' at line 1
+create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
+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 'NO MINVALUE' at line 1
+create sequence t1 start with 10 maxvalue=9223372036854775807;
+ERROR HY000: Sequence 'test.t1' values are conflicting
+create sequence t1 start with 10 minvalue=-9223372036854775808;
+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 '9223372036854775808' at line 1
+create sequence t1 RESTART WITH 10;
+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 'RESTART' at line 1
+create or replace sequence t1 start with 10 NO MINVALUE minvalue=1;
+drop sequence t1;
+create sequence t1;
+show fields from t1;
+Field Type Null Key Default Extra
+next_not_cached_value bigint(21) NO NULL
+minimum_value bigint(21) NO NULL
+maximum_value bigint(21) NO NULL
+start_value bigint(21) NO NULL
+increment bigint(21) NO NULL
+cache_size bigint(21) unsigned NO NULL
+cycle_option tinyint(1) unsigned NO NULL
+cycle_count bigint(21) NO NULL
+flush tables;
+show fields from t1;
+Field Type Null Key Default Extra
+next_not_cached_value bigint(21) NO NULL
+minimum_value bigint(21) NO NULL
+maximum_value bigint(21) NO NULL
+start_value bigint(21) NO NULL
+increment bigint(21) NO NULL
+cache_size bigint(21) unsigned NO NULL
+cycle_option tinyint(1) unsigned NO NULL
+cycle_count bigint(21) NO NULL
+create or replace sequence t1 engine=aria;
+show fields from t1;
+Field Type Null Key Default Extra
+next_not_cached_value bigint(21) NO NULL
+minimum_value bigint(21) NO NULL
+maximum_value bigint(21) NO NULL
+start_value bigint(21) NO NULL
+increment bigint(21) NO NULL
+cache_size bigint(21) unsigned NO NULL
+cycle_option tinyint(1) unsigned NO NULL
+cycle_count bigint(21) NO NULL
+show fields from t1;
+Field Type Null Key Default Extra
+next_not_cached_value bigint(21) NO NULL
+minimum_value bigint(21) NO NULL
+maximum_value bigint(21) NO NULL
+start_value bigint(21) NO NULL
+increment bigint(21) NO NULL
+cache_size bigint(21) unsigned NO NULL
+cycle_option tinyint(1) unsigned NO NULL
+cycle_count bigint(21) NO NULL
+flush tables;
+create or replace sequence t1 comment= "test 1";
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM COMMENT='test 1'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1 COMMENT='test 1'
+create or replace sequence t1 comment= "test 2" min_rows=1 max_rows=2;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM COMMENT='test 2'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM MIN_ROWS=1 MAX_ROWS=2 SEQUENCE=1 COMMENT='test 2'
+create or replace sequence t1 start=1 increment= 2;
+create or replace sequence t1 start 1 increment 2;
+create or replace sequence t1 cache +1;
+drop sequence t1;
+CREATE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) sequence=1;
+show create sequence t1;
+Table Create Table
+t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) ENGINE=MyISAM SEQUENCE=1
+drop sequence t1;
+CREATE OR REPLACE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count_not_exists` bigint(21) NOT NULL
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle_count_not_exists)
+CREATE OR REPLACE TABLE t1 (
+`next_not_cached_value` int(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (next_not_cached_value)
+CREATE OR REPLACE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle` bigint(21) unsigned NOT NULL, /* error */
+`cycle_count` bigint(21) NOT NULL
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle)
+CREATE OR REPLACE TABLE t1 (
+`next_not_cached_value` bigint(21), /* error */
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (next_not_cached_value)
+CREATE OR REPLACE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL,
+extra_field bigint(21)
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (Wrong number of columns)
+CREATE OR REPLACE TABLE t1 (
+`minimum_value` bigint(21) NOT NULL,
+`next_not_cached_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (minimum_value)
+CREATE OR REPLACE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL,
+key key1 (next_not_cached_value)
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any keys)
+CREATE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL,
+CHECK (start_value < minimum_value)
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any constraints)
+CREATE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL CHECK (start_value < minimum_value),
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (start_value)
+CREATE TABLE t1 (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) generated always as (1) virtual
+) sequence=1;
+ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle_count)
+drop sequence if exists t1;
+Warnings:
+Note 4091 Unknown SEQUENCE: 'test.t1'
+create sequence t1;
+create sequence t2;
+create table t3 (a int) engine=myisam;
+select table_catalog, table_schema, table_name, table_type from information_schema.tables where table_catalog="test";
+table_catalog table_schema table_name table_type
+CREATE SEQUENCE s1;
+drop sequence s1;
+drop sequence if exists t1,t2,t3,t4;
+Warnings:
+Note 4091 Unknown SEQUENCE: 'test.t3'
+Note 4091 Unknown SEQUENCE: 'test.t4'
+drop table if exists t1,t2,t3;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+Note 1051 Unknown table 'test.t2'
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop table t1,t2,s1;
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop table if exists t1,t2,s1,s2;
+Warnings:
+Note 1051 Unknown table 'test.s2'
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop sequence t1,t2,s1,s2;
+ERROR 42S02: Unknown SEQUENCE: 'test.t1,test.t2,test.s2'
+drop table if exists t1,t2;
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop sequence if exists t1,t2,s1,s2;
+Warnings:
+Note 4091 Unknown SEQUENCE: 'test.t1'
+Note 4091 Unknown SEQUENCE: 'test.t2'
+Note 4091 Unknown SEQUENCE: 'test.s2'
+drop table if exists t1,t2;
+CREATE TEMPORARY SEQUENCE s1;
+DROP SEQUENCE s1;
+DROP TEMPORARY SEQUENCE s1;
+ERROR 42S02: Unknown SEQUENCE: 'test.s1'
+CREATE TEMPORARY SEQUENCE s1;
+CREATE SEQUENCE s2;
+CREATE TEMPORARY TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+DROP TEMPORARY SEQUENCE t1,t2,s1,s2;
+ERROR 42S02: Unknown SEQUENCE: 'test.t1,test.t2,test.s2'
+DROP TEMPORARY SEQUENCE s1;
+ERROR 42S02: Unknown SEQUENCE: 'test.s1'
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1,t2,s1,s2;
+ERROR 42S02: Unknown table 'test.t1,test.s1'
+create view v1 as (select 1);
+CREATE SEQUENCE s1;
+DROP SEQUENCE s1,v1;
+ERROR 42S02: 'test.v1' is a view
+drop view v1;
+CREATE TEMPORARY SEQUENCE t1;
+select next value for t1;
+next value for t1
+1
+drop temporary table t1;
+select previous value for t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10;
+select next value for t1;
+next value for t1
+1
+select previous value for t1;
+previous value for t1
+1
+CREATE TEMPORARY SEQUENCE t1 start with 100 minvalue 100 maxvalue 200 increment by 1 cache 10;
+select previous value for t1;
+previous value for t1
+NULL
+select next value for t1;
+next value for t1
+100
+select previous value for t1;
+previous value for t1
+100
+drop temporary sequence t1;
+select previous value for t1;
+previous value for t1
+1
+drop sequence t1;
+CREATE TEMPORARY SEQUENCE t1 engine=innodb;
+select next value for t1;
+next value for t1
+1
+drop temporary table t1;
+select previous value for t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb;
+select next value for t1;
+next value for t1
+1
+select previous value for t1;
+previous value for t1
+1
+CREATE TEMPORARY SEQUENCE t1 start with 100 minvalue 100 maxvalue 200 increment by 1 cache 10 engine=innodb;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+select previous value for t1;
+previous value for t1
+NULL
+select next value for t1;
+next value for t1
+100
+select previous value for t1;
+previous value for t1
+100
+drop temporary sequence t1;
+select previous value for t1;
+previous value for t1
+1
+drop sequence t1;
+create table t1 (a int) engine=sql_sequence;
+ERROR 42000: Unknown storage engine 'sql_sequence'
+#
+# MDEV-13711 assertion on CREATE LIKE fix
+#
+create sequence s;
+create table t like s;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+show create sequence t;
+Table Create Table
+t CREATE SEQUENCE `t` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+drop tables t, s;
+#
+# MDEV-13714 SEQUENCE option fix
+#
+create or replace table s (
+`next_value` bigint(21) not null,
+`min_value` bigint(21) not null,
+`max_value` bigint(21) not null,
+`start` bigint(21) not null,
+`increment` bigint(21) not null,
+`cache` bigint(21) not null,
+`cycle` tinyint(1) unsigned not null,
+`round` bigint(21) not null)
+sequence=0;
+create or replace table s2 (
+`next_value` bigint(21) not null,
+`min_value` bigint(21) not null,
+`max_value` bigint(21) not null,
+`start` bigint(21) not null,
+`increment` bigint(21) not null,
+`cache` bigint(21) not null,
+`cycle` tinyint(1) unsigned not null,
+`round` bigint(21) not null)
+sequence=default;
+show create table s;
+Table Create Table
+s CREATE TABLE `s` (
+ `next_value` bigint(21) NOT NULL,
+ `min_value` bigint(21) NOT NULL,
+ `max_value` bigint(21) NOT NULL,
+ `start` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache` bigint(21) NOT NULL,
+ `cycle` tinyint(1) unsigned NOT NULL,
+ `round` bigint(21) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table s2;
+Table Create Table
+s2 CREATE TABLE `s2` (
+ `next_value` bigint(21) NOT NULL,
+ `min_value` bigint(21) NOT NULL,
+ `max_value` bigint(21) NOT NULL,
+ `start` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache` bigint(21) NOT NULL,
+ `cycle` tinyint(1) unsigned NOT NULL,
+ `round` bigint(21) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create sequence s;
+ERROR 42S02: 'test.s' is not a SEQUENCE
+show create sequence s2;
+ERROR 42S02: 'test.s2' is not a SEQUENCE
+drop table s,s2;
+#
+# MDEV-13721 Assertion is_lock_owner() failed in mysql_rm_table_no_locks
+#
+create or replace sequence s;
+create temporary table s (i int);
+drop sequence s;
+show create table s;
+Table Create Table
+s CREATE TEMPORARY TABLE `s` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table s;
+create or replace sequence s;
+create temporary sequence s;
+show create table s;
+Table Create Table
+s CREATE TEMPORARY TABLE `s` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+drop sequence s;
+show create table s;
+Table Create Table
+s CREATE TABLE `s` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+drop table s;
+create or replace sequence s;
+create temporary sequence s;
+drop temporary sequence s;
+show create table s;
+Table Create Table
+s CREATE TABLE `s` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+drop table s;
+create temporary sequence s;
+drop temporary table s;
+create temporary table s (i int);
+drop temporary sequence s;
+ERROR 42S02: Unknown SEQUENCE: 'test.s'
+drop table s;
+#
+# MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANT
+#
+CREATE SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/seq1';
+TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+# test/seq1 12288 11 # Redundant 0 Single
+DROP SEQUENCE seq1;
+CREATE TEMPORARY SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+DROP TEMPORARY SEQUENCE seq1;
+#
+# MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1
+#
+set global innodb_force_primary_key =1;
+CREATE SEQUENCE s1 START WITH 100 INCREMENT BY 10 ENGINE=innodb;
+set global innodb_force_primary_key=default;
+ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
+ERROR HY000: Sequence 'test.s1' table structure is invalid (Sequence tables cannot have any keys)
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/sql_sequence/create.test b/mysql-test/suite/sql_sequence/create.test
new file mode 100644
index 00000000000..2c41fb3658b
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/create.test
@@ -0,0 +1,517 @@
+#
+# Test create options with sequences
+#
+--source include/have_innodb.inc
+--source include/have_archive.inc
+
+drop table if exists t1;
+
+#
+# Check some sample engines
+#
+
+create or replace sequence t1 engine=myisam;
+show create sequence t1;
+show create table t1;
+select * from t1;
+create or replace sequence t1 engine=innodb;
+show create sequence t1;
+show create table t1;
+select * from t1;
+create or replace sequence t1 engine=maria;
+show create sequence t1;
+show create table t1;
+select * from t1;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+create or replace sequence t1 engine=archive;
+#
+# The following error should be fixed. We shouldn't delete old table on errors
+#
+--error ER_NO_SUCH_TABLE
+show create table t1;
+
+
+# Check start values
+create or replace sequence t1 start with 10;
+show create sequence t1;
+select * from t1;
+create or replace sequence t1 minvalue=11;
+show create sequence t1;
+select * from t1;
+create or replace sequence t1 maxvalue=13 increment by -1;
+show create sequence t1;
+select * from t1;
+
+create or replace sequence t1 increment by -1 cache 100;
+show create sequence t1;
+select * from t1;
+create or replace sequence t1 cycle;
+show create sequence t1;
+select * from t1;
+create or replace sequence t1 nocycle;
+show create sequence t1;
+select * from t1;
+show create sequence t1;
+create or replace sequence t1 cycle minvalue= 14;
+show create sequence t1;
+select * from t1;
+create or replace sequence t1 cycle increment by -1;
+show create sequence t1;
+
+drop sequence t1;
+create sequence if not exists t1;
+create sequence if not exists t1 start with 10;
+select * from t1;
+show create sequence t1;
+
+create or replace sequence t1 start with 10 minvalue=10 maxvalue=11 nocache cycle;
+show create sequence t1;
+select * from t1;
+create or replace sequence t1 start with 10 minvalue=-10 maxvalue=11 cache=10 cycle increment by 10;
+show create sequence t1;
+select * from t1;
+
+# NO MINVALUE, NO MAXVALUE
+create or replace sequence t1 start with 10 NO MAXVALUE NO MINVALUE;
+
+# Some edge cases
+create or replace sequence t1 start with 10 maxvalue 10;
+create or replace sequence t1 start with 10 minvalue 10;
+create or replace sequence t1 start with 10 minvalue 10 maxvalue 11 cycle;
+create or replace sequence t1 start with 10 maxvalue=9223372036854775806;
+create or replace sequence t1 start with 10 minvalue=-9223372036854775807;
+drop sequence if exists t1;
+
+create sequence t1 increment by 0;
+show create sequence t1;
+select * from t1;
+drop sequence t1;
+
+#
+# Wrong usage and arguments to create sequence
+#
+
+create table t1 (a int);
+--error ER_NOT_SEQUENCE
+show create sequence t1;
+--error ER_NOT_SEQUENCE2
+drop sequence t1;
+drop sequence if exists t1;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence t1 start with 10 maxvalue=9;
+--error ER_SEQUENCE_INVALID_DATA
+create sequence t1 minvalue= 100 maxvalue=10;
+--error ER_SEQUENCE_INVALID_DATA
+create sequence t1 start with 9 minvalue=10;
+--error ER_PARSE_ERROR
+create or replace sequence t1 maxvalue=13, increment by -1;
+--error ER_PARSE_ERROR
+create or replace sequence t1 start with= 10 maxvalue=13;
+--error ER_PARSE_ERROR
+create or replace sequence t1 maxvalue=13, increment= -1;
+--error ER_PARSE_ERROR
+create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
+--error ER_PARSE_ERROR
+create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
+--error ER_SEQUENCE_INVALID_DATA
+create sequence t1 start with 10 maxvalue=9223372036854775807;
+--error ER_PARSE_ERROR
+create sequence t1 start with 10 minvalue=-9223372036854775808;
+--error ER_PARSE_ERROR
+create sequence t1 RESTART WITH 10;
+
+# This should probably give an error
+create or replace sequence t1 start with 10 NO MINVALUE minvalue=1;
+drop sequence t1;
+
+#
+# Test with LIST COLUMNS as first command
+#
+create sequence t1;
+show fields from t1;
+flush tables;
+show fields from t1;
+create or replace sequence t1 engine=aria;
+show fields from t1;
+show fields from t1;
+flush tables;
+
+#
+# Test with other create options
+#
+
+create or replace sequence t1 comment= "test 1";
+show create sequence t1;
+show create table t1;
+create or replace sequence t1 comment= "test 2" min_rows=1 max_rows=2;
+show create sequence t1;
+show create table t1;
+create or replace sequence t1 start=1 increment= 2;
+create or replace sequence t1 start 1 increment 2;
+create or replace sequence t1 cache +1;
+drop sequence t1;
+
+#
+# test with create table
+#
+
+CREATE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) sequence=1;
+
+show create sequence t1;
+show create table t1;
+drop sequence t1;
+
+# Wrong column name
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count_not_exists` bigint(21) NOT NULL
+) sequence=1;
+
+# Wrong type
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `next_not_cached_value` int(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) sequence=1;
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle` bigint(21) unsigned NOT NULL, /* error */
+ `cycle_count` bigint(21) NOT NULL
+) sequence=1;
+
+
+# Missing NOT NULL
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `next_not_cached_value` bigint(21), /* error */
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) sequence=1;
+
+# Extra field
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL,
+ extra_field bigint(21)
+) sequence=1;
+
+# Wrong field order
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `minimum_value` bigint(21) NOT NULL,
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) sequence=1;
+
+# key
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE OR REPLACE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL,
+ key key1 (next_not_cached_value)
+) sequence=1;
+
+# Check constraint
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL,
+ CHECK (start_value < minimum_value)
+) sequence=1;
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL CHECK (start_value < minimum_value),
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) sequence=1;
+
+
+# Virtual field
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+CREATE TABLE t1 (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) generated always as (1) virtual
+) sequence=1;
+
+drop sequence if exists t1;
+
+#
+# DROP SEQUENCE
+#
+
+create sequence t1;
+create sequence t2;
+create table t3 (a int) engine=myisam;
+select table_catalog, table_schema, table_name, table_type from information_schema.tables where table_catalog="test";
+
+CREATE SEQUENCE s1;
+drop sequence s1;
+
+drop sequence if exists t1,t2,t3,t4;
+drop table if exists t1,t2,t3;
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop table t1,t2,s1;
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop table if exists t1,t2,s1,s2;
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+--error ER_UNKNOWN_SEQUENCES
+drop sequence t1,t2,s1,s2;
+drop table if exists t1,t2;
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE SEQUENCE s1;
+drop sequence if exists t1,t2,s1,s2;
+drop table if exists t1,t2;
+
+CREATE TEMPORARY SEQUENCE s1;
+DROP SEQUENCE s1;
+--error ER_UNKNOWN_SEQUENCES
+DROP TEMPORARY SEQUENCE s1;
+
+CREATE TEMPORARY SEQUENCE s1;
+CREATE SEQUENCE s2;
+CREATE TEMPORARY TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+--error ER_UNKNOWN_SEQUENCES
+DROP TEMPORARY SEQUENCE t1,t2,s1,s2;
+--error ER_UNKNOWN_SEQUENCES
+DROP TEMPORARY SEQUENCE s1;
+DROP TEMPORARY TABLE t1;
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1,t2,s1,s2;
+
+create view v1 as (select 1);
+CREATE SEQUENCE s1;
+--error ER_IT_IS_A_VIEW
+DROP SEQUENCE s1,v1;
+drop view v1;
+
+#
+# CREATE TEMPORARY SEQUENCE
+#
+
+CREATE TEMPORARY SEQUENCE t1;
+select next value for t1;
+drop temporary table t1;
+--error ER_NO_SUCH_TABLE
+select previous value for t1;
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10;
+select next value for t1;
+select previous value for t1;
+CREATE TEMPORARY SEQUENCE t1 start with 100 minvalue 100 maxvalue 200 increment by 1 cache 10;
+select previous value for t1;
+select next value for t1;
+select previous value for t1;
+drop temporary sequence t1;
+select previous value for t1;
+drop sequence t1;
+
+CREATE TEMPORARY SEQUENCE t1 engine=innodb;
+select next value for t1;
+drop temporary table t1;
+--error ER_NO_SUCH_TABLE
+select previous value for t1;
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb;
+select next value for t1;
+select previous value for t1;
+CREATE TEMPORARY SEQUENCE t1 start with 100 minvalue 100 maxvalue 200 increment by 1 cache 10 engine=innodb;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+select previous value for t1;
+select next value for t1;
+select previous value for t1;
+drop temporary sequence t1;
+select previous value for t1;
+drop sequence t1;
+
+#
+# Check that we can't create anything with the sequence engine
+#
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+create table t1 (a int) engine=sql_sequence;
+
+--echo #
+--echo # MDEV-13711 assertion on CREATE LIKE fix
+--echo #
+
+create sequence s;
+create table t like s;
+show create table t;
+show create sequence t;
+drop tables t, s;
+
+--echo #
+--echo # MDEV-13714 SEQUENCE option fix
+--echo #
+
+create or replace table s (
+ `next_value` bigint(21) not null,
+ `min_value` bigint(21) not null,
+ `max_value` bigint(21) not null,
+ `start` bigint(21) not null,
+ `increment` bigint(21) not null,
+ `cache` bigint(21) not null,
+ `cycle` tinyint(1) unsigned not null,
+ `round` bigint(21) not null)
+sequence=0;
+
+create or replace table s2 (
+ `next_value` bigint(21) not null,
+ `min_value` bigint(21) not null,
+ `max_value` bigint(21) not null,
+ `start` bigint(21) not null,
+ `increment` bigint(21) not null,
+ `cache` bigint(21) not null,
+ `cycle` tinyint(1) unsigned not null,
+ `round` bigint(21) not null)
+sequence=default;
+
+show create table s;
+show create table s2;
+--error ER_NOT_SEQUENCE
+show create sequence s;
+--error ER_NOT_SEQUENCE
+show create sequence s2;
+drop table s,s2;
+
+--echo #
+--echo # MDEV-13721 Assertion is_lock_owner() failed in mysql_rm_table_no_locks
+--echo #
+
+create or replace sequence s;
+create temporary table s (i int);
+drop sequence s;
+show create table s;
+drop table s;
+
+create or replace sequence s;
+create temporary sequence s;
+show create table s;
+drop sequence s;
+show create table s;
+drop table s;
+
+create or replace sequence s;
+create temporary sequence s;
+drop temporary sequence s;
+show create table s;
+drop table s;
+
+create temporary sequence s;
+drop temporary table s;
+create temporary table s (i int);
+--error ER_UNKNOWN_SEQUENCES
+drop temporary sequence s;
+drop table s;
+
+--echo #
+--echo # MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANT
+--echo #
+CREATE SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+
+--replace_column 1 # 5 #
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/seq1';
+
+DROP SEQUENCE seq1;
+CREATE TEMPORARY SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+DROP TEMPORARY SEQUENCE seq1;
+
+--echo #
+--echo # MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1
+--echo #
+
+set global innodb_force_primary_key =1;
+CREATE SEQUENCE s1 START WITH 100 INCREMENT BY 10 ENGINE=innodb;
+set global innodb_force_primary_key=default;
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/sql_sequence/debug_sync.opt b/mysql-test/suite/sql_sequence/debug_sync.opt
new file mode 100644
index 00000000000..7ba8cab8a92
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/debug_sync.opt
@@ -0,0 +1 @@
+--loose-debug-sync-timeout=2
diff --git a/mysql-test/suite/sql_sequence/debug_sync.result b/mysql-test/suite/sql_sequence/debug_sync.result
new file mode 100644
index 00000000000..516b2343a82
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/debug_sync.result
@@ -0,0 +1,7 @@
+connect con1,localhost,root,,;
+CREATE TEMPORARY SEQUENCE f ENGINE=InnoDB;
+disconnect con1;
+connection default;
+SELECT 'Still alive' AS `Heartbeat`;
+Heartbeat
+Still alive
diff --git a/mysql-test/suite/sql_sequence/debug_sync.test b/mysql-test/suite/sql_sequence/debug_sync.test
new file mode 100644
index 00000000000..ecc75f790a3
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/debug_sync.test
@@ -0,0 +1,15 @@
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+#
+# MDEV-13029
+# Assertion `ds_control' failed in debug_sync upon closing connection after
+# creating temporary sequence
+
+--connect (con1,localhost,root,,)
+CREATE TEMPORARY SEQUENCE f ENGINE=InnoDB;
+--disconnect con1
+--connection default
+--sleep 3
+
+SELECT 'Still alive' AS `Heartbeat`;
diff --git a/mysql-test/suite/sql_sequence/default.result b/mysql-test/suite/sql_sequence/default.result
new file mode 100644
index 00000000000..37d536d9020
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/default.result
@@ -0,0 +1,187 @@
+drop table if exists t1,s1,s2;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+Note 1051 Unknown table 'test.s1'
+Note 1051 Unknown table 'test.s2'
+drop view if exists v1;
+Warnings:
+Note 4092 Unknown VIEW: 'test.v1'
+#
+# Test DEFAULT
+#
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT nextval(`test`.`s1`),
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 SET b=1;
+insert into t1 SET b=2;
+insert into t1 (b) values (3),(4);
+select * from t1;
+a b
+1 1
+2 2
+3 3
+4 4
+update t1 set b=5 where a=1;
+delete from t1 where b=1;
+select * from t1;
+a b
+1 5
+2 2
+3 3
+4 4
+#
+# Executing DEFAULT function
+#
+INSERT into t1 values(default(a),10);
+INSERT into t1 values(default(a),default(a));
+update t1 set a=default(a), b=12 where b=2;
+select * from t1;
+a b
+1 5
+8 12
+3 3
+4 4
+5 10
+6 7
+select default(a), a, b from t1;
+default(a) a b
+9 1 5
+10 8 12
+11 3 3
+12 4 4
+13 5 10
+14 6 7
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+15 1 9223372036854775806 1 1 0 0 0
+select * from t1 where default(a) > 0;
+a b
+1 5
+8 12
+3 3
+4 4
+5 10
+6 7
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 9223372036854775806 1 1 0 0 0
+#
+# View
+#
+create view v1 as select * from t1;
+insert into v1 set b=20;
+select * from v1;
+a b
+1 5
+8 12
+3 3
+4 4
+5 10
+6 7
+16 20
+drop view v1;
+#
+# Alter table
+#
+CREATE SEQUENCE s2 nocache engine=myisam;
+alter table t1 add column c int default next value for s2, add column d int default previous value for s2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT nextval(`test`.`s1`),
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT nextval(`test`.`s2`),
+ `d` int(11) DEFAULT lastval(`test`.`s2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+a b c d
+1 5 1 1
+8 12 2 2
+3 3 3 3
+4 4 4 4
+5 10 5 5
+6 7 6 6
+16 20 7 7
+drop sequence s2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT nextval(`test`.`s1`),
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT nextval(`test`.`s2`),
+ `d` int(11) DEFAULT lastval(`test`.`s2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+drop sequence s1;
+#
+# LOCK TABLES
+#
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+insert into t1 (b) values (3),(4);
+LOCK TABLE t1 WRITE;
+insert into t1 (b) values (5),(6);
+ERROR HY000: Table 's1' was not locked with LOCK TABLES
+UNLOCK TABLES;
+LOCK TABLE t1 WRITE, s1 WRITE;
+insert into t1 (b) values (5),(6);
+select default(a) from t1;
+default(a)
+5
+6
+7
+8
+UNLOCK TABLES;
+LOCK TABLE t1 READ;
+insert into t1 (b) values (5),(6);
+ERROR HY000: Table 's1' was not locked with LOCK TABLES
+select default(a) from t1;
+ERROR HY000: Table 's1' was not locked with LOCK TABLES
+UNLOCK TABLES;
+LOCK TABLE t1 READ, s1 read;
+insert into t1 (b) values (5),(6);
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+select default(a) from t1;
+ERROR HY000: Table 's1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+drop table t1;
+drop sequence s1;
+#
+# Testing prepared statements
+#
+CREATE or replace SEQUENCE s1 nocache engine=myisam;
+CREATE or replace table t1 (a int default next value for s1, b int);
+PREPARE stmt FROM "insert into t1 (b) values(?)";
+execute stmt using 1;
+execute stmt using 2;
+execute stmt using 3;
+select * from t1;
+a b
+1 1
+2 2
+3 3
+drop table t1,s1;
+deallocate prepare stmt;
+#
+# Wrong usage of default
+#
+CREATE table t1 (a int default next value for s1, b int);
+ERROR 42S02: Table 'test.s1' doesn't exist
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+DROP SEQUENCE s1;
+insert into t1 (b) values (5),(6);
+ERROR 42S02: Table 'test.s1' doesn't exist
+ALTER TABLE t1 add column c int;
+ERROR 42S02: Table 'test.s1' doesn't exist
+CREATE SEQUENCE s1 nocache engine=myisam;
+ALTER TABLE t1 add column c int;
+ALTER TABLE t1 add column d int default next value for s_not_exits;
+ERROR 42S02: Table 'test.s_not_exits' doesn't exist
+drop table t1;
+drop sequence s1;
diff --git a/mysql-test/suite/sql_sequence/default.test b/mysql-test/suite/sql_sequence/default.test
new file mode 100644
index 00000000000..017165c1a80
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/default.test
@@ -0,0 +1,125 @@
+#
+# Testing sequence in DEFAULT clause
+#
+--source include/have_sequence.inc
+
+drop table if exists t1,s1,s2;
+drop view if exists v1;
+
+--echo #
+--echo # Test DEFAULT
+--echo #
+
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+show create table t1;
+insert into t1 SET b=1;
+insert into t1 SET b=2;
+insert into t1 (b) values (3),(4);
+select * from t1;
+update t1 set b=5 where a=1;
+delete from t1 where b=1;
+select * from t1;
+
+--echo #
+--echo # Executing DEFAULT function
+--echo #
+
+INSERT into t1 values(default(a),10);
+INSERT into t1 values(default(a),default(a));
+update t1 set a=default(a), b=12 where b=2;
+select * from t1;
+select default(a), a, b from t1;
+select * from s1;
+select * from t1 where default(a) > 0;
+select * from s1;
+
+--echo #
+--echo # View
+--echo #
+
+create view v1 as select * from t1;
+insert into v1 set b=20;
+select * from v1;
+drop view v1;
+
+--echo #
+--echo # Alter table
+--echo #
+
+CREATE SEQUENCE s2 nocache engine=myisam;
+alter table t1 add column c int default next value for s2, add column d int default previous value for s2;
+show create table t1;
+select * from t1;
+drop sequence s2;
+show create table t1;
+drop table t1;
+drop sequence s1;
+
+--echo #
+--echo # LOCK TABLES
+--echo #
+
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+insert into t1 (b) values (3),(4);
+LOCK TABLE t1 WRITE;
+--error ER_TABLE_NOT_LOCKED
+insert into t1 (b) values (5),(6);
+UNLOCK TABLES;
+
+LOCK TABLE t1 WRITE, s1 WRITE;
+insert into t1 (b) values (5),(6);
+select default(a) from t1;
+UNLOCK TABLES;
+
+LOCK TABLE t1 READ;
+--error ER_TABLE_NOT_LOCKED
+insert into t1 (b) values (5),(6);
+--error ER_TABLE_NOT_LOCKED
+select default(a) from t1;
+UNLOCK TABLES;
+
+LOCK TABLE t1 READ, s1 read;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+insert into t1 (b) values (5),(6);
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+select default(a) from t1;
+UNLOCK TABLES;
+
+drop table t1;
+drop sequence s1;
+
+--echo #
+--echo # Testing prepared statements
+--echo #
+
+CREATE or replace SEQUENCE s1 nocache engine=myisam;
+CREATE or replace table t1 (a int default next value for s1, b int);
+PREPARE stmt FROM "insert into t1 (b) values(?)";
+execute stmt using 1;
+execute stmt using 2;
+execute stmt using 3;
+select * from t1;
+drop table t1,s1;
+deallocate prepare stmt;
+
+--echo #
+--echo # Wrong usage of default
+--echo #
+
+--error ER_NO_SUCH_TABLE
+CREATE table t1 (a int default next value for s1, b int);
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+DROP SEQUENCE s1;
+--error ER_NO_SUCH_TABLE
+insert into t1 (b) values (5),(6);
+--error ER_NO_SUCH_TABLE
+ALTER TABLE t1 add column c int;
+CREATE SEQUENCE s1 nocache engine=myisam;
+ALTER TABLE t1 add column c int;
+--error ER_NO_SUCH_TABLE
+ALTER TABLE t1 add column d int default next value for s_not_exits;
+drop table t1;
+drop sequence s1;
diff --git a/mysql-test/suite/sql_sequence/disabled.def b/mysql-test/suite/sql_sequence/disabled.def
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/disabled.def
diff --git a/mysql-test/suite/sql_sequence/grant.result b/mysql-test/suite/sql_sequence/grant.result
new file mode 100644
index 00000000000..7085d548588
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/grant.result
@@ -0,0 +1,60 @@
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'NO_AUTO_CREATE_USER', '');
+create database mysqltest_1;
+use mysqltest_1;
+grant all on mysqltest_1.* to 'normal'@'%';
+grant select on mysqltest_1.* to 'read_only'@'%';
+grant select,insert on mysqltest_1.* to 'read_write'@'%';
+grant select,insert,alter on mysqltest_1.* to 'alter'@'%';
+grant alter on mysqltest_1.* to only_alter@'%';
+connect normal,localhost,normal,,mysqltest_1;
+connect read_only,localhost,read_only,,mysqltest_1;
+connect read_write,localhost,read_write,,mysqltest_1;
+connect alter,localhost,alter,,mysqltest_1;
+connect only_alter, localhost, only_alter,,mysqltest_1;
+connection normal;
+create sequence s1;
+select next value for s1;
+next value for s1
+1
+alter sequence s1 restart= 11;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 1 1 1000 0 0
+connection read_only;
+select next value for s1;
+ERROR 42000: INSERT command denied to user 'read_only'@'localhost' for table 's1'
+alter sequence s1 restart= 11;
+ERROR 42000: ALTER command denied to user 'read_only'@'localhost' for table 's1'
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 1 1 1000 0 0
+connection read_write;
+select next value for s1;
+next value for s1
+11
+alter sequence s1 restart= 11;
+ERROR 42000: ALTER command denied to user 'read_write'@'localhost' for table 's1'
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1011 1 9223372036854775806 1 1 1000 0 0
+connection alter;
+select next value for s1;
+next value for s1
+12
+alter sequence s1 restart= 11;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 1 1 1000 0 0
+connection only_alter;
+select next value for s1;
+ERROR 42000: INSERT command denied to user 'only_alter'@'localhost' for table 's1'
+alter sequence s1 restart= 11;
+select * from s1;
+ERROR 42000: SELECT command denied to user 'only_alter'@'localhost' for table 's1'
+connection default;
+drop database mysqltest_1;
+drop user 'normal'@'%';
+drop user 'read_only'@'%';
+drop user 'read_write'@'%';
+drop user 'alter'@'%';
+drop user 'only_alter'@'%';
diff --git a/mysql-test/suite/sql_sequence/grant.test b/mysql-test/suite/sql_sequence/grant.test
new file mode 100644
index 00000000000..3a911d79671
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/grant.test
@@ -0,0 +1,67 @@
+#
+# Test some grants with sequences
+# Note that replication.test also does some grant testing
+#
+
+# Grant tests not performed with embedded server
+-- source include/not_embedded.inc
+
+
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'NO_AUTO_CREATE_USER', '');
+create database mysqltest_1;
+use mysqltest_1;
+grant all on mysqltest_1.* to 'normal'@'%';
+grant select on mysqltest_1.* to 'read_only'@'%';
+grant select,insert on mysqltest_1.* to 'read_write'@'%';
+grant select,insert,alter on mysqltest_1.* to 'alter'@'%';
+grant alter on mysqltest_1.* to only_alter@'%';
+
+connect(normal,localhost,normal,,mysqltest_1);
+connect(read_only,localhost,read_only,,mysqltest_1);
+connect(read_write,localhost,read_write,,mysqltest_1);
+connect(alter,localhost,alter,,mysqltest_1);
+connect(only_alter, localhost, only_alter,,mysqltest_1);
+
+connection normal;
+create sequence s1;
+select next value for s1;
+alter sequence s1 restart= 11;
+select * from s1;
+
+connection read_only;
+--error ER_TABLEACCESS_DENIED_ERROR
+select next value for s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter sequence s1 restart= 11;
+select * from s1;
+
+connection read_write;
+select next value for s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter sequence s1 restart= 11;
+select * from s1;
+
+connection alter;
+select next value for s1;
+alter sequence s1 restart= 11;
+select * from s1;
+
+connection only_alter;
+--error ER_TABLEACCESS_DENIED_ERROR
+select next value for s1;
+alter sequence s1 restart= 11;
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from s1;
+
+#
+# Cleanup
+#
+
+connection default;
+drop database mysqltest_1;
+drop user 'normal'@'%';
+drop user 'read_only'@'%';
+drop user 'read_write'@'%';
+drop user 'alter'@'%';
+drop user 'only_alter'@'%';
+
diff --git a/mysql-test/suite/sql_sequence/gtid-master.opt b/mysql-test/suite/sql_sequence/gtid-master.opt
new file mode 100644
index 00000000000..dd4fb8c5f9a
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/gtid-master.opt
@@ -0,0 +1,3 @@
+--binlog_format=row
+--query_cache_type=1
+--log-slave-updates
diff --git a/mysql-test/suite/sql_sequence/gtid-slave.opt b/mysql-test/suite/sql_sequence/gtid-slave.opt
new file mode 100644
index 00000000000..dc0ff1864e0
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/gtid-slave.opt
@@ -0,0 +1,4 @@
+--binlog_format=row
+--query_cache_type=1
+--read_only=true
+--log-slave-updates
diff --git a/mysql-test/suite/sql_sequence/gtid.result b/mysql-test/suite/sql_sequence/gtid.result
new file mode 100644
index 00000000000..8ca9a397354
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/gtid.result
@@ -0,0 +1,831 @@
+include/master-slave.inc
+[connection master]
+connection master;
+create database s_db;
+grant all on s_db.* to normal_1@'%' identified by 'pass';
+grant all on test.* to normal_2@'%' identified by 'pass';
+grant all on s_db.* to normal_3@'%' identified by 'pass';
+grant all on test.* to normal_4@'%' identified by 'pass';
+grant select on test.* to normal_5@'%' identified by 'pass';
+flush status;
+connection slave;
+connect m_normal_1, 127.0.0.1, normal_1, pass, s_db, $MASTER_MYPORT;
+connect m_normal_2, 127.0.0.1, normal_2, pass, test, $MASTER_MYPORT;
+connect m_normal_3, 127.0.0.1, normal_5, pass, test, $MASTER_MYPORT;
+connect s_normal_3, 127.0.0.1, normal_3, pass, s_db, $SLAVE_MYPORT;
+connect s_normal_4, 127.0.0.1, normal_4, pass, test, $SLAVE_MYPORT;
+connection slave;
+set global read_only=on;
+###########################################
+master and slave sync sequence.
+###########################################
+connection master;
+use s_db;
+create sequence s1;
+show create table s1;
+Table Create Table
+s1 CREATE TABLE `s1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+connection slave;
+use s_db;
+show create table s1;
+Table Create Table
+s1 CREATE TABLE `s1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+connection master;
+use s_db;
+drop sequence s1;
+###########################################
+not support create table engine=sequence.
+###########################################
+connection master;
+create table t(id int)engine=sequence;
+ERROR 42000: Unknown storage engine 'sequence'
+create table t(id int)engine=innodb;
+alter table t engine=sequence;
+ERROR 42000: Unknown storage engine 'sequence'
+drop table t;
+###########################################
+not support alter sequence table.
+###########################################
+connection master;
+create sequence s2;
+alter table s2 add id int;
+ERROR HY000: Sequence 's_db.s2' table structure is invalid (Wrong number of columns)
+alter table s2 add index ind_x(start);
+ERROR HY000: Sequence 's_db.s2' table structure is invalid (Sequence tables cannot have any keys)
+drop sequence s2;
+###########################################
+Support create temporary sequence.
+###########################################
+connection master;
+create temporary sequence s2;
+drop temporary sequence s2;
+###########################################
+all invalid sequence value
+###########################################
+connection master;
+use s_db;
+create sequence s2 start with 1
+minvalue 1
+maxvalue 100000
+increment by 1
+cache 10000
+cycle;
+drop sequence s2;
+create sequence s2 start with 1
+minvalue 1
+maxvalue 100000
+increment by 1
+cache 10000
+nocycle;
+drop sequence s2;
+create sequence s2 start with 1
+minvalue 1
+maxvalue 100000
+increment by 1
+nocache
+nocycle;
+drop sequence s2;
+create sequence s2 start with 1
+minvalue 5
+maxvalue 100000
+increment by 1
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+create sequence s2 start with 1
+minvalue 5
+maxvalue 5
+increment by 1
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+create sequence s2 start with 1
+minvalue 5
+maxvalue 4
+increment by 1
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+create sequence s2 start with 1
+minvalue 5
+maxvalue 4
+increment by 0
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+###########################################
+global read lock prevent query sequence
+###########################################
+connection master;
+use s_db;
+create sequence s_db.s1;
+flush table with read lock;
+select next value for s1;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+unlock tables;
+drop sequence s_db.s1;
+###########################################
+query cache test
+###########################################
+connection master;
+use s_db;
+show global variables like 'query_cache_type';
+Variable_name Value
+query_cache_type ON
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+show status like 'Qcache_inserts';
+Variable_name Value
+Qcache_inserts 0
+###########################################
+priv test
+###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+select * from s_db.s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select next value for s_db.s1;
+next value for s_db.s1
+1
+select * from s_db.s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+create sequence s_db.s2;
+drop sequence s_db.s2;
+connection m_normal_2;
+select next value for s_db.s1;
+ERROR 42000: INSERT command denied to user 'normal_2'@'localhost' for table 's1'
+create sequence s_db.s2;
+ERROR 42000: CREATE command denied to user 'normal_2'@'localhost' for table 's2'
+connection m_normal_1;
+drop sequence s_db.s1;
+###########################################
+run out sequence value
+###########################################
+connection m_normal_1;
+use s_db;
+create sequence s_t start with 1 cache 2 maxvalue 5;
+create table t(id int);
+insert into t values(1111);
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+ERROR HY000: Sequence 's_db.s_t' has run out
+insert into t select next value for s_t;
+ERROR HY000: Sequence 's_db.s_t' has run out
+commit;
+select * from t;
+id
+1111
+1
+2
+3
+4
+5
+connection master;
+connection slave;
+connection s_normal_3;
+use s_db;
+select * from t;
+id
+1111
+1
+2
+3
+4
+5
+connection m_normal_1;
+use s_db;
+drop sequence s_t;
+drop table t;
+###########################################
+read_only prevent query sequence
+###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+show global variables like 'read_only';
+Variable_name Value
+read_only OFF
+select next value for s_db.s1;
+next value for s_db.s1
+1
+connection master;
+connection slave;
+connection s_normal_3;
+show global variables like 'read_only';
+Variable_name Value
+read_only ON
+select next value for s_db.s1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+connection m_normal_1;
+drop sequence s_db.s1;
+###########################################
+update based table
+###########################################
+connection m_normal_1;
+use s_db;
+create sequence s_t start with 1 minvalue 1 maxvalue 20 increment by 1 cache 5 cycle;
+connection master;
+connection slave;
+connection s_normal_3;
+use s_db;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 20 1 1 5 1 0
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+1
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+6 1 20 1 1 5 1 0
+connection master;
+connection slave;
+connection s_normal_3;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+6 1 20 1 1 5 1 0
+------------------------------------------
+master update nextval;
+------------------------------------------
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+2
+update s_t set next_not_cached_value= 11;
+ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
+alter sequence s_t restart=11;
+commit;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 20 1 1 5 1 0
+connection master;
+connection slave;
+------------------------------------------
+show slave nextval;
+------------------------------------------
+connection s_normal_3;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 20 1 1 5 1 0
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+11
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+connection master;
+connection slave;
+connection s_normal_3;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+------------------------------------------
+update into invalid sequence
+------------------------------------------
+connection m_normal_1;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11;
+ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
+ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11;
+ERROR HY000: Sequence 's_db.s_t' values are conflicting
+commit;
+create table t_1(id int);
+insert into t_1 value(1111);
+select next value for s_t;
+next value for s_t
+12
+insert into t_1 select next value for s_t;
+commit;
+select * from t_1;
+id
+1111
+13
+------------------------------------------
+delete sequence row
+------------------------------------------
+connection m_normal_1;
+delete from s_t;
+ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
+commit;
+select next value for s_t;
+next value for s_t
+14
+connection m_normal_1;
+drop sequence s_t;
+drop table t_1;
+###########################################
+test transaction context (innodb)
+###########################################
+------------------------------------------
+transaction table and sequence
+normal transaction commit
+------------------------------------------
+connection m_normal_1;
+use s_db;
+create sequence s_1 cache 5;
+create table t_1(id int)engine=innodb;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+select * from t_1;
+id
+1111
+1
+2
+2222
+connection master;
+connection slave;
+connection s_normal_3;
+use s_db;
+select * from t_1;
+id
+1111
+1
+2
+2222
+------------------------------------------
+normal transaction rollback
+------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+rollback;
+select * from t_1;
+id
+1111
+1
+2
+2222
+select next value for s_1;
+next value for s_1
+11
+connection master;
+connection slave;
+connection s_normal_3;
+use s_db;
+select * from t_1;
+id
+1111
+1
+2
+2222
+connection m_normal_1;
+use s_db;
+drop sequence s_1;
+drop table t_1;
+###########################################
+test transaction context (myisam)
+###########################################
+------------------------------------------
+transaction table and sequence
+normal transaction commit
+------------------------------------------
+connection m_normal_1;
+use s_db;
+create sequence s_1 cache 5;
+create table t_1(id int)engine=myisam;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+select * from t_1;
+id
+1111
+1
+2
+2222
+connection master;
+connection slave;
+connection s_normal_3;
+use s_db;
+select * from t_1;
+id
+1111
+1
+2
+2222
+------------------------------------------
+normal transaction rollback
+------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+select next value for s_1;
+next value for s_1
+11
+connection master;
+connection slave;
+connection s_normal_3;
+use s_db;
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+connection m_normal_1;
+use s_db;
+drop sequence s_1;
+drop table t_1;
+###########################################
+close binlog
+###########################################
+connection m_normal_1;
+use s_db;
+create sequence s1 cache 2;
+select next value for s1;
+next value for s1
+1
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+next value for s1
+3
+select next value for s1;
+next value for s1
+4
+commit;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 2 0 0
+connection master;
+connection slave;
+connection slave;
+use s_db;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 2 0 0
+------------------------------------------
+close session binlog.
+------------------------------------------
+connection master;
+set session sql_log_bin=off;
+select next value for s1;
+next value for s1
+5
+select next value for s1;
+next value for s1
+6
+select next value for s1;
+next value for s1
+7
+select next value for s1;
+next value for s1
+8
+set session sql_log_bin=on;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+9 1 9223372036854775806 1 1 2 0 0
+connection master;
+connection slave;
+connection slave;
+use s_db;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 2 0 0
+connection m_normal_1;
+use s_db;
+drop sequence s1;
+###########################################
+statement binlog
+###########################################
+------------------------------------------
+set binlog_format=statement
+------------------------------------------
+connection master;
+set session binlog_format=statement;
+select @@session.binlog_format;
+@@session.binlog_format
+STATEMENT
+create sequence s1 cache 2;
+select next value for s1;
+ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
+set session binlog_format=row;
+select next value for s1;
+next value for s1
+1
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 1 9223372036854775806 1 1 2 0 0
+connection master;
+connection slave;
+use s_db;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 1 9223372036854775806 1 1 2 0 0
+connection m_normal_1;
+use s_db;
+drop sequence s1;
+###########################################
+test savepoint
+###########################################
+connection master;
+set session binlog_format=row;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+begin;
+insert into t1 values(1111);
+savepoint sp1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+insert into t1 values(2222);
+select * from t1;
+id
+1111
+1
+2
+3
+2222
+rollback to sp1;
+select * from t1;
+id
+1111
+select next value for s1;
+next value for s1
+4
+commit;
+drop sequence s1;
+drop table t1;
+###########################################
+test proc
+###########################################
+connection m_normal_1;
+use s_db;
+create table t(id int)engine=innodb;
+create procedure p1()
+begin
+create sequence s1 cache 2;
+end//
+create procedure p2()
+begin
+insert into t select next value for s1;
+commit;
+end//
+call p1();
+call p2();
+call p2();
+call p2();
+call p2();
+select * from t;
+id
+1
+2
+3
+4
+connection master;
+connection slave;
+use s_db;
+select * from t;
+id
+1
+2
+3
+4
+connection m_normal_1;
+drop table t;
+drop sequence s1;
+drop procedure p1;
+drop procedure p2;
+###########################################
+test trigger
+###########################################
+connection m_normal_1;
+use s_db;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+create table t2(id int)engine=innodb;
+CREATE TRIGGER tri_1
+before INSERT ON t2 FOR EACH ROW
+BEGIN
+INSERT INTO t1 select next value for s1;
+END//
+begin;
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+select * from t2;
+id
+1111
+1111
+1111
+1111
+select * from t1;
+id
+1
+2
+3
+4
+rollback;
+select * from t2;
+id
+select * from t1;
+id
+select next value for s1;
+next value for s1
+5
+drop trigger tri_1;
+drop table t1;
+drop table t2;
+drop sequence s1;
+###########################################
+test function
+###########################################
+connection m_normal_1;
+use s_db;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+CREATE function f1() returns int
+BEGIN
+INSERT INTO t1 select next value for s1;
+return (1);
+END//
+begin;
+select f1();
+f1()
+1
+select f1();
+f1()
+1
+select f1();
+f1()
+1
+select f1();
+f1()
+1
+select * from t1;
+id
+1
+2
+3
+4
+rollback;
+select * from t1;
+id
+select next value for s1;
+next value for s1
+5
+drop function f1;
+drop table t1;
+drop sequence s1;
+##############
+Test GRANT
+##############
+connection m_normal_2;
+create table t1 (a int);
+create sequence s1;
+select next value for s1;
+next value for s1
+1
+insert into t1 values (1);
+connection m_normal_3;
+select * from t1;
+a
+1
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+select previous value for s1;
+previous value for s1
+NULL
+insert into t1 values (2);
+ERROR 42000: INSERT command denied to user 'normal_5'@'localhost' for table 't1'
+select next value for s1;
+ERROR 42000: INSERT command denied to user 'normal_5'@'localhost' for table 's1'
+do setval(s1,1000,0);
+ERROR 42000: INSERT command denied to user 'normal_5'@'localhost' for table 's1'
+connection master;
+grant insert on test.* to normal_5@'%' identified by 'pass';
+disconnect m_normal_3;
+connect m_normal_3, 127.0.0.1, normal_5, pass, test, $MASTER_MYPORT;
+insert into t1 values (2);
+select t1.*, (next value for s1) from t1;
+a (next value for s1)
+1 2
+2 3
+do setval(s1,10000,0);
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+10000 1 9223372036854775806 1 1 1000 0 0
+connection m_normal_2;
+drop table t1;
+drop sequence s1;
+#
+# Cleanup
+#
+connection master;
+use s_db;
+drop database s_db;
+drop user normal_1@'%';
+drop user normal_2@'%';
+drop user normal_3@'%';
+drop user normal_4@'%';
+drop user normal_5@'%';
+include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/gtid.test b/mysql-test/suite/sql_sequence/gtid.test
new file mode 100644
index 00000000000..63ed7ec5264
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/gtid.test
@@ -0,0 +1,708 @@
+#
+# This test is based on tests from ALISQL test suite
+#
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+connection master;
+create database s_db;
+grant all on s_db.* to normal_1@'%' identified by 'pass';
+grant all on test.* to normal_2@'%' identified by 'pass';
+grant all on s_db.* to normal_3@'%' identified by 'pass';
+grant all on test.* to normal_4@'%' identified by 'pass';
+grant select on test.* to normal_5@'%' identified by 'pass';
+flush status;
+
+--sync_slave_with_master
+
+connect(m_normal_1, 127.0.0.1, normal_1, pass, s_db, $MASTER_MYPORT);
+connect(m_normal_2, 127.0.0.1, normal_2, pass, test, $MASTER_MYPORT);
+connect(m_normal_3, 127.0.0.1, normal_5, pass, test, $MASTER_MYPORT);
+
+connect(s_normal_3, 127.0.0.1, normal_3, pass, s_db, $SLAVE_MYPORT);
+connect(s_normal_4, 127.0.0.1, normal_4, pass, test, $SLAVE_MYPORT);
+
+connection slave;
+set global read_only=on;
+
+--echo ###########################################
+--echo master and slave sync sequence.
+--echo ###########################################
+connection master;
+use s_db;
+
+create sequence s1;
+show create table s1;
+
+--sync_slave_with_master
+use s_db;
+show create table s1;
+
+connection master;
+use s_db;
+
+drop sequence s1;
+
+--echo ###########################################
+--echo not support create table engine=sequence.
+--echo ###########################################
+connection master;
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+create table t(id int)engine=sequence;
+
+create table t(id int)engine=innodb;
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+alter table t engine=sequence;
+
+drop table t;
+--echo ###########################################
+--echo not support alter sequence table.
+--echo ###########################################
+connection master;
+
+create sequence s2;
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+alter table s2 add id int;
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+alter table s2 add index ind_x(start);
+drop sequence s2;
+
+--echo ###########################################
+--echo Support create temporary sequence.
+--echo ###########################################
+connection master;
+
+create temporary sequence s2;
+drop temporary sequence s2;
+
+--echo ###########################################
+--echo all invalid sequence value
+--echo ###########################################
+
+connection master;
+use s_db;
+create sequence s2 start with 1
+ minvalue 1
+ maxvalue 100000
+ increment by 1
+ cache 10000
+ cycle;
+drop sequence s2;
+create sequence s2 start with 1
+ minvalue 1
+ maxvalue 100000
+ increment by 1
+ cache 10000
+ nocycle;
+drop sequence s2;
+create sequence s2 start with 1
+ minvalue 1
+ maxvalue 100000
+ increment by 1
+ nocache
+ nocycle;
+drop sequence s2;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 100000
+ increment by 1
+ nocache
+ nocycle;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 5
+ increment by 1
+ nocache
+ nocycle;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 4
+ increment by 1
+ nocache
+ nocycle;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 4
+ increment by 0
+ nocache
+ nocycle;
+
+--echo ###########################################
+--echo global read lock prevent query sequence
+--echo ###########################################
+connection master;
+use s_db;
+create sequence s_db.s1;
+flush table with read lock;
+--error ER_CANT_UPDATE_WITH_READLOCK
+select next value for s1;
+
+unlock tables;
+
+drop sequence s_db.s1;
+
+--echo ###########################################
+--echo query cache test
+--echo ###########################################
+connection master;
+use s_db;
+show global variables like 'query_cache_type';
+
+show status like 'Qcache_hits';
+show status like 'Qcache_inserts';
+
+--echo ###########################################
+--echo priv test
+--echo ###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+select * from s_db.s1;
+select next value for s_db.s1;
+select * from s_db.s1;
+create sequence s_db.s2;
+drop sequence s_db.s2;
+
+
+connection m_normal_2;
+--error ER_TABLEACCESS_DENIED_ERROR
+select next value for s_db.s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+create sequence s_db.s2;
+
+connection m_normal_1;
+drop sequence s_db.s1;
+
+--echo ###########################################
+--echo run out sequence value
+--echo ###########################################
+connection m_normal_1;
+use s_db;
+create sequence s_t start with 1 cache 2 maxvalue 5;
+create table t(id int);
+insert into t values(1111);
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+--error ER_SEQUENCE_RUN_OUT
+insert into t select next value for s_t;
+--error ER_SEQUENCE_RUN_OUT
+insert into t select next value for s_t;
+commit;
+select * from t;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+use s_db;
+select * from t;
+
+connection m_normal_1;
+use s_db;
+drop sequence s_t;
+drop table t;
+
+--echo ###########################################
+--echo read_only prevent query sequence
+--echo ###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+show global variables like 'read_only';
+select next value for s_db.s1;
+
+connection master;
+sync_slave_with_master;
+
+connection s_normal_3;
+show global variables like 'read_only';
+--error ER_OPTION_PREVENTS_STATEMENT
+select next value for s_db.s1;
+
+connection m_normal_1;
+drop sequence s_db.s1;
+
+--echo ###########################################
+--echo update based table
+--echo ###########################################
+connection m_normal_1;
+use s_db;
+create sequence s_t start with 1 minvalue 1 maxvalue 20 increment by 1 cache 5 cycle;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+use s_db;
+select * from s_t;
+
+connection m_normal_1;
+select next value for s_t;
+select * from s_t;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from s_t;
+
+--echo ------------------------------------------
+--echo master update nextval;
+--echo ------------------------------------------
+connection m_normal_1;
+select next value for s_t;
+--error ER_ILLEGAL_HA
+update s_t set next_not_cached_value= 11;
+alter sequence s_t restart=11;
+commit;
+
+select * from s_t;
+
+connection master;
+--sync_slave_with_master
+
+--echo ------------------------------------------
+--echo show slave nextval;
+--echo ------------------------------------------
+connection s_normal_3;
+select * from s_t;
+
+connection m_normal_1;
+select next value for s_t;
+select * from s_t;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from s_t;
+
+
+--echo ------------------------------------------
+--echo update into invalid sequence
+--echo ------------------------------------------
+connection m_normal_1;
+select * from s_t;
+--error ER_ILLEGAL_HA
+update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11;
+--error ER_SEQUENCE_INVALID_DATA
+ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11;
+commit;
+
+create table t_1(id int);
+insert into t_1 value(1111);
+select next value for s_t;
+insert into t_1 select next value for s_t;
+commit;
+
+select * from t_1;
+
+--echo ------------------------------------------
+--echo delete sequence row
+--echo ------------------------------------------
+connection m_normal_1;
+--error ER_ILLEGAL_HA
+delete from s_t;
+commit;
+
+select next value for s_t;
+
+connection m_normal_1;
+drop sequence s_t;
+drop table t_1;
+
+--echo ###########################################
+--echo test transaction context (innodb)
+--echo ###########################################
+
+--echo ------------------------------------------
+--echo transaction table and sequence
+--echo normal transaction commit
+--echo ------------------------------------------
+connection m_normal_1;
+use s_db;
+create sequence s_1 cache 5;
+
+create table t_1(id int)engine=innodb;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+
+select * from t_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+use s_db;
+select * from t_1;
+
+--echo ------------------------------------------
+--echo normal transaction rollback
+--echo ------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+
+select * from t_1;
+rollback;
+
+select * from t_1;
+select next value for s_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+use s_db;
+select * from t_1;
+
+connection m_normal_1;
+use s_db;
+drop sequence s_1;
+drop table t_1;
+
+--echo ###########################################
+--echo test transaction context (myisam)
+--echo ###########################################
+
+--echo ------------------------------------------
+--echo transaction table and sequence
+--echo normal transaction commit
+--echo ------------------------------------------
+connection m_normal_1;
+use s_db;
+create sequence s_1 cache 5;
+
+create table t_1(id int)engine=myisam;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+
+select * from t_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+use s_db;
+select * from t_1;
+
+--echo ------------------------------------------
+--echo normal transaction rollback
+--echo ------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+
+select * from t_1;
+rollback;
+
+select * from t_1;
+select next value for s_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+use s_db;
+select * from t_1;
+
+connection m_normal_1;
+use s_db;
+drop sequence s_1;
+drop table t_1;
+
+--echo ###########################################
+--echo close binlog
+--echo ###########################################
+connection m_normal_1;
+use s_db;
+create sequence s1 cache 2;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+
+commit;
+select * from s1;
+
+connection master;
+--sync_slave_with_master
+
+connection slave;
+use s_db;
+select * from s1;
+
+--echo ------------------------------------------
+--echo close session binlog.
+--echo ------------------------------------------
+connection master;
+set session sql_log_bin=off;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+
+set session sql_log_bin=on;
+select * from s1;
+
+connection master;
+--sync_slave_with_master
+
+connection slave;
+use s_db;
+select * from s1;
+
+connection m_normal_1;
+use s_db;
+drop sequence s1;
+
+--echo ###########################################
+--echo statement binlog
+--echo ###########################################
+--echo ------------------------------------------
+--echo set binlog_format=statement
+--echo ------------------------------------------
+connection master;
+set session binlog_format=statement;
+select @@session.binlog_format;
+create sequence s1 cache 2;
+--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
+select next value for s1;
+
+set session binlog_format=row;
+select next value for s1;
+select * from s1;
+
+connection master;
+--sync_slave_with_master
+
+use s_db;
+select * from s1;
+
+connection m_normal_1;
+use s_db;
+drop sequence s1;
+
+--echo ###########################################
+--echo test savepoint
+--echo ###########################################
+connection master;
+set session binlog_format=row;
+
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+
+begin;
+insert into t1 values(1111);
+savepoint sp1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+
+insert into t1 values(2222);
+
+select * from t1;
+rollback to sp1;
+select * from t1;
+select next value for s1;
+
+commit;
+
+drop sequence s1;
+drop table t1;
+
+--echo ###########################################
+--echo test proc
+--echo ###########################################
+connection m_normal_1;
+use s_db;
+create table t(id int)engine=innodb;
+
+delimiter //;
+
+create procedure p1()
+begin
+ create sequence s1 cache 2;
+end//
+
+create procedure p2()
+begin
+ insert into t select next value for s1;
+ commit;
+end//
+
+delimiter ;//
+
+call p1();
+call p2();
+call p2();
+call p2();
+call p2();
+
+select * from t;
+
+connection master;
+--sync_slave_with_master
+
+use s_db;
+select * from t;
+
+connection m_normal_1;
+drop table t;
+drop sequence s1;
+drop procedure p1;
+drop procedure p2;
+
+--echo ###########################################
+--echo test trigger
+--echo ###########################################
+connection m_normal_1;
+use s_db;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+create table t2(id int)engine=innodb;
+
+delimiter //;
+CREATE TRIGGER tri_1
+ before INSERT ON t2 FOR EACH ROW
+BEGIN
+ INSERT INTO t1 select next value for s1;
+END//
+delimiter ;//
+
+begin;
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+
+select * from t2;
+select * from t1;
+rollback;
+select * from t2;
+select * from t1;
+
+select next value for s1;
+
+
+drop trigger tri_1;
+drop table t1;
+drop table t2;
+drop sequence s1;
+
+--echo ###########################################
+--echo test function
+--echo ###########################################
+connection m_normal_1;
+use s_db;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+
+delimiter //;
+CREATE function f1() returns int
+BEGIN
+ INSERT INTO t1 select next value for s1;
+ return (1);
+END//
+delimiter ;//
+
+begin;
+select f1();
+select f1();
+select f1();
+select f1();
+
+select * from t1;
+rollback;
+select * from t1;
+
+select next value for s1;
+
+drop function f1;
+drop table t1;
+drop sequence s1;
+
+--echo ##############
+--echo Test GRANT
+--echo ##############
+
+connection m_normal_2;
+create table t1 (a int);
+create sequence s1;
+select next value for s1;
+insert into t1 values (1);
+connection m_normal_3;
+select * from t1;
+select * from s1;
+select previous value for s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into t1 values (2);
+--error ER_TABLEACCESS_DENIED_ERROR
+select next value for s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+do setval(s1,1000,0);
+connection master;
+grant insert on test.* to normal_5@'%' identified by 'pass';
+disconnect m_normal_3;
+connect(m_normal_3, 127.0.0.1, normal_5, pass, test, $MASTER_MYPORT);
+insert into t1 values (2);
+select t1.*, (next value for s1) from t1;
+do setval(s1,10000,0);
+select * from s1;
+connection m_normal_2;
+drop table t1;
+drop sequence s1;
+
+--echo #
+--echo # Cleanup
+--echo #
+
+connection master;
+use s_db;
+drop database s_db;
+drop user normal_1@'%';
+drop user normal_2@'%';
+drop user normal_3@'%';
+drop user normal_4@'%';
+drop user normal_5@'%';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/kill.result b/mysql-test/suite/sql_sequence/kill.result
new file mode 100644
index 00000000000..6d966254de3
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/kill.result
@@ -0,0 +1,12 @@
+#
+# MDEV-16929 Assertion ... in close_thread_tables upon killing connection
+# running SHOW on sequence
+#
+CREATE SEQUENCE s ENGINE=InnoDB;
+RENAME TABLE s TO s1;
+connect con1,localhost,root,,test;
+SHOW CREATE SEQUENCE s1;
+connection default;
+KILL thread_id;
+connection default;
+drop sequence s1;
diff --git a/mysql-test/suite/sql_sequence/kill.test b/mysql-test/suite/sql_sequence/kill.test
new file mode 100644
index 00000000000..9caebc57f12
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/kill.test
@@ -0,0 +1,20 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-16929 Assertion ... in close_thread_tables upon killing connection
+--echo # running SHOW on sequence
+--echo #
+
+CREATE SEQUENCE s ENGINE=InnoDB;
+RENAME TABLE s TO s1;
+--connect (con1,localhost,root,,test)
+--let $conid= `SELECT CONNECTION_ID()`
+--send
+ SHOW CREATE SEQUENCE s1;
+--connection default
+--replace_result $conid thread_id
+--eval KILL $conid
+
+# Cleanup
+--connection default
+drop sequence s1;
diff --git a/mysql-test/suite/sql_sequence/lock.result b/mysql-test/suite/sql_sequence/lock.result
new file mode 100644
index 00000000000..e92bdbffcf9
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/lock.result
@@ -0,0 +1,39 @@
+drop table if exists s1, t1, t2;
+CREATE SEQUENCE s1;
+create table t1 (a int);
+create table t2 (a int);
+LOCK TABLE s1 WRITE, t1 write;
+create or replace sequence s1;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select * from t1;
+a
+select * from t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+select * from t1;
+a
+select * from t2;
+a
+drop tables s1, t1, t2;
+CREATE SEQUENCE s1;
+LOCK TABLE s1 READ;
+SELECT NEXTVAL(s1);
+ERROR HY000: Table 's1' was locked with a READ lock and can't be updated
+SELECT NEXTVAL(s);
+ERROR HY000: Table 's' was not locked with LOCK TABLES
+DROP SEQUENCE s1;
+ERROR HY000: Table 's1' was locked with a READ lock and can't be updated
+unlock tables;
+DROP SEQUENCE s1;
+CREATE SEQUENCE seq1;
+CREATE SEQUENCE seq2;
+LOCK TABLE seq1 WRITE, seq2 WRITE;
+INSERT INTO seq1 VALUES (1, 1, 100000, 1, 1, 100, 1, 1);
+DROP SEQUENCE seq1, seq2;
+CREATE OR REPLACE SEQUENCE s1 ENGINE=MyISAM;
+LOCK TABLE s1 WRITE;
+TRUNCATE TABLE s1;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s1` doesn't have this option
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/sql_sequence/lock.test b/mysql-test/suite/sql_sequence/lock.test
new file mode 100644
index 00000000000..1cb6aa6fb54
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/lock.test
@@ -0,0 +1,64 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists s1, t1, t2;
+--enable_warnings
+
+#
+# MDEV-14831 CREATE OR REPLACE SEQUENCE under LOCK TABLE corrupts the
+# sequence, causes ER_KEY_NOT_FOUND
+#
+CREATE SEQUENCE s1;
+create table t1 (a int);
+create table t2 (a int);
+LOCK TABLE s1 WRITE, t1 write;
+create or replace sequence s1;
+select * from s1;
+select * from t1;
+--error ER_TABLE_NOT_LOCKED
+select * from t2;
+unlock tables;
+select * from t1;
+select * from t2;
+drop tables s1, t1, t2;
+
+#
+# MDEV-15742 Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type == 1' failed in handler::ha_write_row
+#
+
+CREATE SEQUENCE s1;
+LOCK TABLE s1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+SELECT NEXTVAL(s1);
+--error ER_TABLE_NOT_LOCKED
+SELECT NEXTVAL(s);
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+DROP SEQUENCE s1;
+unlock tables;
+DROP SEQUENCE s1;
+
+#
+# MDEV-15106 Unexpected ER_WRONG_INSERT_INTO_SEQUENCE upon INSERT with
+# multiple locks on sequences
+#
+
+CREATE SEQUENCE seq1;
+CREATE SEQUENCE seq2;
+LOCK TABLE seq1 WRITE, seq2 WRITE;
+INSERT INTO seq1 VALUES (1, 1, 100000, 1, 1, 100, 1, 1);
+DROP SEQUENCE seq1, seq2;
+
+#
+# MDEV-15970
+# Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failure and/or
+# ER_KEY_NOT_FOUND upon TRUNCATE sequence under lock
+#
+
+CREATE OR REPLACE SEQUENCE s1 ENGINE=MyISAM;
+LOCK TABLE s1 WRITE;
+--error ER_ILLEGAL_HA
+TRUNCATE TABLE s1;
+# Cleanup
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result
new file mode 100644
index 00000000000..5a3711ebda3
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/mysqldump.result
@@ -0,0 +1,49 @@
+CREATE SEQUENCE a1 engine=aria;
+CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
+insert into t1 values (1),(2);
+CREATE SEQUENCE x1 engine=innodb;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `a1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=Aria SEQUENCE=1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `a1` VALUES (1,1,9223372036854775806,1,1,1000,0,0);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES (1),(2);
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `x1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=InnoDB SEQUENCE=1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `x1` VALUES (1,1,9223372036854775806,1,1,1000,0,0);
+DROP TABLE a1,t1,x1;
+set default_storage_engine=InnoDB;
+create sequence t1;
+LOCK TABLES t1 READ;
+SELECT * FROM t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+unlock tables;
+drop table t1;
diff --git a/mysql-test/suite/sql_sequence/mysqldump.test b/mysql-test/suite/sql_sequence/mysqldump.test
new file mode 100644
index 00000000000..308f06d5e8d
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/mysqldump.test
@@ -0,0 +1,26 @@
+#
+# Testing mysqldump of sequences
+#
+
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+--source include/have_aria.inc
+--source include/have_innodb.inc
+
+CREATE SEQUENCE a1 engine=aria;
+CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
+insert into t1 values (1),(2);
+CREATE SEQUENCE x1 engine=innodb;
+--exec $MYSQL_DUMP --compact test
+DROP TABLE a1,t1,x1;
+
+#
+# MDEV-12887 UT_LIST_GET_LEN(trx->lock.trx_locks) == 0 when mysqldump sequence
+#
+
+set default_storage_engine=InnoDB;
+create sequence t1;
+LOCK TABLES t1 READ;
+SELECT * FROM t1;
+unlock tables;
+drop table t1;
diff --git a/mysql-test/suite/sql_sequence/next.result b/mysql-test/suite/sql_sequence/next.result
new file mode 100644
index 00000000000..b1b1bb69306
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/next.result
@@ -0,0 +1,536 @@
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 2 cycle;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+select next value for t1;
+next value for t1
+1
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+3 0
+select next value for t1;
+next value for t1
+2
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+3 0
+select next value for t1;
+next value for t1
+3
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+5 0
+select next value for t1;
+next value for t1
+4
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+5 0
+select next value for t1;
+next value for t1
+5
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+7 0
+select next value for t1;
+next value for t1
+6
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+7 0
+select next value for t1;
+next value for t1
+7
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+9 0
+select next value for t1;
+next value for t1
+8
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+9 0
+select next value for t1;
+next value for t1
+9
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+11 0
+select next value for t1;
+next value for t1
+10
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+11 0
+select next value for t1;
+next value for t1
+1
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+3 1
+select NEXT VALUE for t1,seq from seq_1_to_20;
+NEXT VALUE for t1 seq
+2 1
+3 2
+4 3
+5 4
+6 5
+7 6
+8 7
+9 8
+10 9
+1 10
+2 11
+3 12
+4 13
+5 14
+6 15
+7 16
+8 17
+9 18
+10 19
+1 20
+drop sequence t1;
+CREATE SEQUENCE t1 minvalue 1 maxvalue 10 increment by -1 cache 2 cycle engine=aria;
+select next value for t1;
+next value for t1
+10
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+8 0
+select next value for t1;
+next value for t1
+9
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+8 0
+select next value for t1;
+next value for t1
+8
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+6 0
+select next value for t1;
+next value for t1
+7
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+6 0
+select next value for t1;
+next value for t1
+6
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+4 0
+select next value for t1;
+next value for t1
+5
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+4 0
+select next value for t1;
+next value for t1
+4
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+2 0
+select next value for t1;
+next value for t1
+3
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+2 0
+select next value for t1;
+next value for t1
+2
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+0 0
+select next value for t1;
+next value for t1
+1
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+0 0
+select next value for t1;
+next value for t1
+10
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+8 1
+select NEXT VALUE for t1,seq from seq_1_to_20;
+NEXT VALUE for t1 seq
+9 1
+8 2
+7 3
+6 4
+5 5
+4 6
+3 7
+2 8
+1 9
+10 10
+9 11
+8 12
+7 13
+6 14
+5 15
+4 16
+3 17
+2 18
+1 19
+10 20
+drop sequence t1;
+CREATE SEQUENCE t1 start with 8 minvalue 1 maxvalue 10 increment by 1 cache 2 nocycle;
+select next value for t1;
+next value for t1
+8
+select next value for t1;
+next value for t1
+9
+select next value for t1;
+next value for t1
+10
+select previous value for t1;
+previous value for t1
+10
+select next value for t1;
+ERROR HY000: Sequence 'test.t1' has run out
+select previous value for t1;
+previous value for t1
+NULL
+select next value for t1;
+ERROR HY000: Sequence 'test.t1' has run out
+drop sequence t1;
+create sequence s1 start with 1 cache 2 maxvalue 5;
+select next value for s1;
+next value for s1
+1
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+next value for s1
+3
+select next value for s1;
+next value for s1
+4
+select next value for s1;
+next value for s1
+5
+select next value for s1;
+ERROR HY000: Sequence 'test.s1' has run out
+drop sequence s1;
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 100 increment by 1 cache 10;
+select next value for t1;
+next value for t1
+1
+select * from t1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 100 1 1 10 0 0
+flush tables;
+select next value for t1;
+next value for t1
+11
+select nextval(t1);
+nextval(t1)
+12
+drop sequence t1;
+CREATE SEQUENCE t9 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+select previous value for t9;
+previous value for t9
+NULL
+select next value for t9;
+next value for t9
+1
+select previous value for t9, lastval(t9);
+previous value for t9 lastval(t9)
+1 1
+select next value for t9;
+next value for t9
+2
+select previous value for t9, lastval(t9);
+previous value for t9 lastval(t9)
+2 2
+select seq, previous value for t9, NEXT VALUE for t9, previous value for t9 from seq_1_to_20;
+seq previous value for t9 NEXT VALUE for t9 previous value for t9
+1 2 3 3
+2 3 4 4
+3 4 5 5
+4 5 6 6
+5 6 7 7
+6 7 8 8
+7 8 9 9
+8 9 10 10
+9 10 1 1
+10 1 2 2
+11 2 3 3
+12 3 4 4
+13 4 5 5
+14 5 6 6
+15 6 7 7
+16 7 8 8
+17 8 9 9
+18 9 10 10
+19 10 1 1
+20 1 2 2
+select * from t9;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+6 1 10 1 1 5 1 2
+drop sequence t9;
+CREATE SEQUENCE s1 cache=0;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 0 0 0
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value from s1;
+next_not_cached_value
+2
+select next value for s1;
+next value for s1
+2
+select next_not_cached_value from s1;
+next_not_cached_value
+3
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1 cache=1;
+select next_not_cached_value from s1;
+next_not_cached_value
+1
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value from s1;
+next_not_cached_value
+2
+select next value for s1;
+next value for s1
+2
+select next_not_cached_value from s1;
+next_not_cached_value
+3
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1 cache=2;
+select next_not_cached_value from s1;
+next_not_cached_value
+1
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value from s1;
+next_not_cached_value
+3
+select next value for s1;
+next value for s1
+2
+select next_not_cached_value from s1;
+next_not_cached_value
+3
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1;
+select next value for s1;
+next value for s1
+1
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+next value for s1
+3
+select next value for s1;
+next value for s1
+4
+alter sequence s1 increment -2;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 -2 1000 0 0
+select next value for s1;
+next value for s1
+1001
+select next value for s1;
+next value for s1
+999
+alter sequence s1 restart 6;
+select next value for s1;
+next value for s1
+6
+select next value for s1;
+next value for s1
+4
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+ERROR HY000: Sequence 'test.s1' has run out
+DROP SEQUENCE s1;
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+select next value for t1;
+next value for t1
+1
+select previous value for t1;
+previous value for t1
+1
+flush tables;
+select previous value for t1;
+previous value for t1
+1
+drop sequence t1;
+select previous value for t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+select previous value for t1;
+previous value for t1
+NULL
+select next value for t1;
+next value for t1
+5
+select previous value for t1;
+previous value for t1
+5
+drop sequence t1;
+CREATE or replace SEQUENCE s1 MINVALUE 1 MAXVALUE 9999999999
+INCREMENT BY 1 START WITH 3984356 CACHE 20 CYCLE engine=innodb;
+show create table s1;
+Table Create Table
+s1 CREATE TABLE `s1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=InnoDB SEQUENCE=1
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3984356 1 9999999999 3984356 1 20 1 0
+select NEXT VALUE FOR s1;
+NEXT VALUE FOR s1
+3984356
+select NEXT VALUE FOR s1;
+NEXT VALUE FOR s1
+3984357
+select NEXT VALUE FOR s1;
+NEXT VALUE FOR s1
+3984358
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3984376 1 9999999999 3984356 1 20 1 0
+FLUSH TABLES;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3984376 1 9999999999 3984356 1 20 1 0
+select NEXT VALUE FOR s1;
+NEXT VALUE FOR s1
+3984376
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3984396 1 9999999999 3984356 1 20 1 0
+drop sequence s1;
+CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+explain select next value for t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
+explain select next value for t1, minimum_value from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+drop table t1;
+CREATE SEQUENCE s1;
+CREATE TABLE t1 (a int);
+insert into t1 values (next value for s1);
+insert into t1 values (next value for s1);
+select * from t1;
+a
+1
+2
+drop table t1,s1;
+CREATE SEQUENCE s1;
+CREATE TABLE t1 (a int primary key auto_increment, b int default 0) engine=myisam;
+insert into t1 values (),(),(),(),(),(),();
+update t1 set b= next value for s1 where a <= 3;
+select * from t1;
+a b
+1 1
+2 2
+3 3
+4 0
+5 0
+6 0
+7 0
+drop table t1,s1;
+CREATE OR REPLACE SEQUENCE s1 MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 3984356 nocache CYCLE engine='innodb';
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3984356 1 9999999999 3984356 1 0 1 0
+select next value for s1;
+next value for s1
+3984356
+explain extended select next value for s1;
+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 nextval(`test`.`s1`) AS `next value for s1`
+explain extended select previous value for s1;
+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 lastval(`test`.`s1`) AS `previous value for s1`
+drop sequence s1;
+create table t1 (a int);
+select next value for t1;
+ERROR 42S02: 'test.t1' is not a SEQUENCE
+drop table t1;
+create sequence t1;
+select next value for t1;
+next value for t1
+1
+select next value for t1, minimum_value;
+ERROR 42S22: Unknown column 'minimum_value' in 'field list'
+drop sequence t1;
+#
+# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+#
+CREATE SEQUENCE s1;
+SELECT
+NEXT VALUE FOR s1,
+PREVIOUS VALUE FOR s1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def NEXT VALUE FOR s1 8 20 1 Y 32896 0 63
+def PREVIOUS VALUE FOR s1 8 20 1 Y 32896 0 63
+NEXT VALUE FOR s1 PREVIOUS VALUE FOR s1
+1 1
+DROP SEQUENCE s1;
+#
+# MDEV-13720 ER_NOT_SEQUENCE for temporary table
+#
+create temporary table tmp (i int);
+select next value for tmp;
+ERROR 42S02: 'test.tmp' is not a SEQUENCE
+drop table tmp;
+#
+# Test negative numbers
+#
+create sequence s start with 1 minvalue=-1000 maxvalue=1000 increment -1;
+select next value for s;
+next value for s
+1
+select next value for s;
+next value for s
+0
+flush tables;
+select next value for s;
+next value for s
+-999
+drop sequence s;
diff --git a/mysql-test/suite/sql_sequence/next.test b/mysql-test/suite/sql_sequence/next.test
new file mode 100644
index 00000000000..a1f91bd7823
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/next.test
@@ -0,0 +1,282 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+#
+# Test sequence generation
+#
+
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 2 cycle;
+show create table t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+
+select NEXT VALUE for t1,seq from seq_1_to_20;
+
+drop sequence t1;
+
+CREATE SEQUENCE t1 minvalue 1 maxvalue 10 increment by -1 cache 2 cycle engine=aria;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+
+select NEXT VALUE for t1,seq from seq_1_to_20;
+
+drop sequence t1;
+
+CREATE SEQUENCE t1 start with 8 minvalue 1 maxvalue 10 increment by 1 cache 2 nocycle;
+select next value for t1;
+select next value for t1;
+select next value for t1;
+select previous value for t1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for t1;
+select previous value for t1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for t1;
+drop sequence t1;
+
+create sequence s1 start with 1 cache 2 maxvalue 5;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for s1;
+drop sequence s1;
+
+#
+# Test that flush tables jumps to next next_not_cached_value
+#
+
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 100 increment by 1 cache 10;
+select next value for t1;
+select * from t1;
+flush tables;
+select next value for t1;
+select nextval(t1);
+drop sequence t1;
+
+#
+# Test currval/previous
+#
+
+CREATE SEQUENCE t9 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+select previous value for t9;
+select next value for t9;
+select previous value for t9, lastval(t9);
+select next value for t9;
+select previous value for t9, lastval(t9);
+select seq, previous value for t9, NEXT VALUE for t9, previous value for t9 from seq_1_to_20;
+select * from t9;
+drop sequence t9;
+
+#
+# CACHE = 0 should be same as CACHE = 1
+#
+CREATE SEQUENCE s1 cache=0;
+select * from s1;
+select next value for s1;
+select next_not_cached_value from s1;
+select next value for s1;
+select next_not_cached_value from s1;
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1 cache=1;
+select next_not_cached_value from s1;
+select next value for s1;
+select next_not_cached_value from s1;
+select next value for s1;
+select next_not_cached_value from s1;
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1 cache=2;
+select next_not_cached_value from s1;
+select next value for s1;
+select next_not_cached_value from s1;
+select next value for s1;
+select next_not_cached_value from s1;
+DROP SEQUENCE s1;
+
+#
+# Negative increment for sequence
+#
+
+CREATE SEQUENCE s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+alter sequence s1 increment -2;
+select * from s1;
+select next value for s1;
+select next value for s1;
+alter sequence s1 restart 6;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for s1;
+DROP SEQUENCE s1;
+
+#
+# Check what happens when one refers to a sequence that has been closed/deleted
+#
+
+CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+select next value for t1;
+select previous value for t1;
+flush tables;
+select previous value for t1;
+drop sequence t1;
+--error ER_NO_SUCH_TABLE
+select previous value for t1;
+CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+select previous value for t1;
+select next value for t1;
+select previous value for t1;
+drop sequence t1;
+
+# This failed in an early build
+
+CREATE or replace SEQUENCE s1 MINVALUE 1 MAXVALUE 9999999999
+INCREMENT BY 1 START WITH 3984356 CACHE 20 CYCLE engine=innodb;
+show create table s1;
+select * from s1;
+select NEXT VALUE FOR s1;
+select NEXT VALUE FOR s1;
+select NEXT VALUE FOR s1;
+select * from s1;
+FLUSH TABLES;
+select * from s1;
+select NEXT VALUE FOR s1;
+select * from s1;
+drop sequence s1;
+
+#
+# Explain
+#
+
+CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
+explain select next value for t1;
+explain select next value for t1, minimum_value from t1;
+drop table t1;
+
+#
+# Using insert with NEXT VALUE
+#
+
+CREATE SEQUENCE s1;
+CREATE TABLE t1 (a int);
+insert into t1 values (next value for s1);
+insert into t1 values (next value for s1);
+select * from t1;
+drop table t1,s1;
+
+#
+# Using update with NEXT VALUE
+#
+
+CREATE SEQUENCE s1;
+CREATE TABLE t1 (a int primary key auto_increment, b int default 0) engine=myisam;
+insert into t1 values (),(),(),(),(),(),();
+update t1 set b= next value for s1 where a <= 3;
+select * from t1;
+drop table t1,s1;
+
+#
+# NO CACHE and InnoDB
+#
+
+CREATE OR REPLACE SEQUENCE s1 MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 3984356 nocache CYCLE engine='innodb';
+select * from s1;
+select next value for s1;
+explain extended select next value for s1;
+explain extended select previous value for s1;
+drop sequence s1;
+
+#
+# Some error testing
+#
+
+create table t1 (a int);
+--error ER_NOT_SEQUENCE
+select next value for t1;
+drop table t1;
+
+create sequence t1;
+select next value for t1;
+--error ER_BAD_FIELD_ERROR
+select next value for t1, minimum_value;
+drop sequence t1;
+
+--echo #
+--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+--echo #
+
+--enable_metadata
+--disable_ps_protocol
+CREATE SEQUENCE s1;
+SELECT
+ NEXT VALUE FOR s1,
+ PREVIOUS VALUE FOR s1;
+DROP SEQUENCE s1;
+--enable_ps_protocol
+--disable_metadata
+
+--echo #
+--echo # MDEV-13720 ER_NOT_SEQUENCE for temporary table
+--echo #
+
+create temporary table tmp (i int);
+--error ER_NOT_SEQUENCE
+select next value for tmp;
+drop table tmp;
+
+--echo #
+--echo # Test negative numbers
+--echo #
+
+create sequence s start with 1 minvalue=-1000 maxvalue=1000 increment -1;
+select next value for s;
+select next value for s;
+flush tables;
+select next value for s;
+drop sequence s;
diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result
new file mode 100644
index 00000000000..abc101b3c00
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/other.result
@@ -0,0 +1,303 @@
+#
+# Create and check
+#
+create sequence s1 engine=innodb;
+check table s1;
+Table Op Msg_type Msg_text
+test.s1 check note The storage engine for the table doesn't support check
+select next value for s1;
+next value for s1
+1
+flush tables;
+check table s1;
+Table Op Msg_type Msg_text
+test.s1 check note The storage engine for the table doesn't support check
+select next value for s1;
+next value for s1
+1001
+flush tables;
+repair table s1;
+Table Op Msg_type Msg_text
+test.s1 repair note The storage engine for the table doesn't support repair
+select next value for s1;
+next value for s1
+2001
+drop sequence s1;
+create or replace sequence s1 engine=innodb;
+select next value for s1;
+next value for s1
+1
+repair table s1;
+Table Op Msg_type Msg_text
+test.s1 repair note The storage engine for the table doesn't support repair
+check table s1;
+Table Op Msg_type Msg_text
+test.s1 check note The storage engine for the table doesn't support check
+select next value for s1;
+next value for s1
+1001
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2001 1 9223372036854775806 1 1 1000 0 0
+drop sequence s1;
+#
+# INSERT
+#
+create sequence s1;
+create sequence s2;
+insert into s1 (next_not_cached_value, minimum_value) values (100,1000);
+ERROR HY000: Field 'maximum_value' doesn't have a default value
+insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0);
+ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data
+insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0);
+ERROR HY000: Sequence 'test.s1' values are conflicting
+insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
+ERROR HY000: Sequence 'test.s1' values are conflicting
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+insert into s1 values(1000,1,9223372036854775806,1,1,1000,0,0);
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1000 1 9223372036854775806 1 1 1000 0 0
+select next value for s1;
+next value for s1
+1000
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2000 1 9223372036854775806 1 1 1000 0 0
+insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
+ERROR HY000: Sequence 'test.s2' values are conflicting
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2000 1 9223372036854775806 1 1 1000 0 0
+insert into s1 values (next value for s2, 1,9223372036854775806,1,1,1000,0,0);
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select * from s2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+insert into s1 select * from s2;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+drop sequence s1,s2;
+#
+# UPDATE and DELETE
+#
+create sequence s1;
+update s1 set next_not_cached_value=100;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s1` doesn't have this option
+delete from s1 where next_not_cached_value > 0;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s1` doesn't have this option
+drop sequence s1;
+#
+# SHOW TABLES
+#
+create sequence s1;
+create table t1 (a int);
+create view v1 as select * from s1;
+show full tables;
+Tables_in_test Table_type
+s1 SEQUENCE
+t1 BASE TABLE
+v1 VIEW
+SELECT TABLE_TYPE,ENGINE FROM INFORMATION_SCHEMA.TABLES where table_schema="test" ORDER BY TABLE_NAME;
+TABLE_TYPE ENGINE
+SEQUENCE MyISAM
+BASE TABLE MyISAM
+VIEW NULL
+drop table t1,s1;
+drop view v1;
+#
+# LOCK TABLES (as in mysqldump)
+#
+create sequence s1 engine=innodb;
+LOCK TABLES s1 READ;
+SELECT * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+UNLOCK TABLES;
+LOCK TABLES s1 WRITE;
+insert into s1 values (1,1,9223372036854775806, 1, 1, 1000, 0, 0);
+UNLOCK TABLES;
+drop table s1;
+#
+# Many sequence calls with innodb
+#
+create sequence s1 cache=1000 engine=innodb;
+start transaction;
+select count(nextval(s1)) from seq_1_to_2000;
+count(nextval(s1))
+2000
+commit;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2001 1 9223372036854775806 1 1 1000 0 0
+drop sequence s1;
+create sequence s1 cache=1000 engine=innodb;
+start transaction;
+select count(nextval(s1)) from seq_1_to_2000;
+count(nextval(s1))
+2000
+connect addconroot, localhost, root,,;
+connection addconroot;
+start transaction;
+select count(nextval(s1)) from seq_1_to_2000;
+count(nextval(s1))
+2000
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+4001 1 9223372036854775806 1 1 1000 0 0
+commit;
+disconnect addconroot;
+connection default;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+4001 1 9223372036854775806 1 1 1000 0 0
+commit;
+drop sequence s1;
+#
+# Flush tables with read lock
+#
+create sequence s1;
+select next value for s1;
+next value for s1
+1
+flush tables with read lock;
+create sequence s2;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+select next value for s1;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+unlock tables;
+drop sequence s1;
+#
+# MDEV-14761
+# Assertion `!mysql_parse_status || thd->is_error() ||
+# thd->get_internal_handler()' failed in parse_sql
+#
+CREATE SEQUENCE s1;
+ALTER SEQUENCE s1 MAXVALUE 100 NO MAXVALUE;
+ERROR HY000: Option 'MAXVALUE' used twice in statement
+DROP SEQUENCE s1;
+#
+# Don't allow SEQUENCE to be used with CHECK or virtual fields
+#
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int check (next value for s1 > 0));
+ERROR HY000: Function or expression 'nextval()' cannot be used in the CHECK clause of `a`
+CREATE table t1 (a int check (previous value for s1 > 0));
+ERROR HY000: Function or expression 'lastval()' cannot be used in the CHECK clause of `a`
+CREATE table t1 (a int check (setval(s1,10)));
+ERROR HY000: Function or expression 'setval()' cannot be used in the CHECK clause of `a`
+CREATE TABLE t1 (a int, b int as (next value for s1 > 0));
+ERROR HY000: Function or expression 'nextval()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+drop sequence s1;
+#
+# MDEV-13024: Server crashes in my_store_ptr upon DELETE from
+# sequence in multi-table format
+#
+CREATE SEQUENCE s;
+CREATE table t1 (a int);
+insert into t1 values (1),(2);
+DELETE s FROM s;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+delete t1,s from s,t1;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+delete s,t1 from t1,s;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+DROP SEQUENCE s;
+DROP TABLE t1;
+#
+# MDEV-20074: Lost connection on update trigger
+#
+# INSERT & table
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+INSERT INTO t2(a_p_name, a_p_first_name) VALUES(old.p_name, old.p_first_name);
+END;
+$$
+update t1 set p_first_name='Yunxi' where p_id=1;
+drop sequence s1;
+drop table t1,t2;
+# INSERT & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+INSERT INTO v2(a_p_name, a_p_first_name) VALUES(old.p_name, old.p_first_name);
+END;
+$$
+update t1 set p_first_name='Yunxi' where p_id=1;
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+# INSERT SELECT & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+INSERT INTO v2(a_p_name, a_p_first_name) SELECT old.p_name, old.p_first_name;
+END;
+$$
+update t1 set p_first_name='Yunxi' where p_id=1;
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+# REPLACE & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+REPLACE INTO v2(a_p_name, a_p_first_name) VALUES(old.p_name, old.p_first_name);
+END;
+$$
+update t1 set p_first_name='Yunxi' where p_id=1;
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+# REPLACE SELECT & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+REPLACE INTO v2(a_p_name, a_p_first_name) SELECT old.p_name, old.p_first_name;
+END;
+$$
+update t1 set p_first_name='Yunxi' where p_id=1;
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/sql_sequence/other.test b/mysql-test/suite/sql_sequence/other.test
new file mode 100644
index 00000000000..70c4efa40e5
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/other.test
@@ -0,0 +1,318 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+#
+# Test various combinations of operations on sequence
+#
+
+--echo #
+--echo # Create and check
+--echo #
+
+create sequence s1 engine=innodb;
+check table s1;
+select next value for s1;
+flush tables;
+check table s1;
+select next value for s1;
+flush tables;
+repair table s1;
+select next value for s1;
+drop sequence s1;
+
+create or replace sequence s1 engine=innodb;
+select next value for s1;
+repair table s1;
+check table s1;
+select next value for s1;
+select * from s1;
+drop sequence s1;
+
+--echo #
+--echo # INSERT
+--echo #
+
+create sequence s1;
+create sequence s2;
+--error ER_NO_DEFAULT_FOR_FIELD
+insert into s1 (next_not_cached_value, minimum_value) values (100,1000);
+--error ER_UPDATE_TABLE_USED
+insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0);
+--error ER_SEQUENCE_INVALID_DATA
+insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0);
+--error ER_SEQUENCE_INVALID_DATA
+insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
+select * from s1;
+insert into s1 values(1000,1,9223372036854775806,1,1,1000,0,0);
+select * from s1;
+select next value for s1;
+select * from s1;
+--error ER_SEQUENCE_INVALID_DATA
+insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
+
+select * from s1;
+insert into s1 values (next value for s2, 1,9223372036854775806,1,1,1000,0,0);
+select * from s1;
+select * from s2;
+insert into s1 select * from s2;
+select * from s1;
+drop sequence s1,s2;
+
+--echo #
+--echo # UPDATE and DELETE
+--echo #
+
+create sequence s1;
+--error ER_ILLEGAL_HA
+update s1 set next_not_cached_value=100;
+--error ER_ILLEGAL_HA
+delete from s1 where next_not_cached_value > 0;
+drop sequence s1;
+
+--echo #
+--echo # SHOW TABLES
+--echo #
+
+create sequence s1;
+create table t1 (a int);
+create view v1 as select * from s1;
+show full tables;
+SELECT TABLE_TYPE,ENGINE FROM INFORMATION_SCHEMA.TABLES where table_schema="test" ORDER BY TABLE_NAME;
+drop table t1,s1;
+drop view v1;
+
+--echo #
+--echo # LOCK TABLES (as in mysqldump)
+--echo #
+
+create sequence s1 engine=innodb;
+LOCK TABLES s1 READ;
+SELECT * from s1;
+UNLOCK TABLES;
+LOCK TABLES s1 WRITE;
+insert into s1 values (1,1,9223372036854775806, 1, 1, 1000, 0, 0);
+UNLOCK TABLES;
+drop table s1;
+
+--echo #
+--echo # Many sequence calls with innodb
+--echo #
+
+create sequence s1 cache=1000 engine=innodb;
+start transaction;
+select count(nextval(s1)) from seq_1_to_2000;
+commit;
+select * from s1;
+drop sequence s1;
+
+create sequence s1 cache=1000 engine=innodb;
+start transaction;
+select count(nextval(s1)) from seq_1_to_2000;
+
+connect (addconroot, localhost, root,,);
+connection addconroot;
+start transaction;
+select count(nextval(s1)) from seq_1_to_2000;
+select * from s1;
+commit;
+disconnect addconroot;
+connection default;
+select * from s1;
+commit;
+drop sequence s1;
+
+--echo #
+--echo # Flush tables with read lock
+--echo #
+
+create sequence s1;
+select next value for s1;
+flush tables with read lock;
+--error 1223
+create sequence s2;
+--error 1223
+select next value for s1;
+unlock tables;
+drop sequence s1;
+
+--echo #
+--echo # MDEV-14761
+--echo # Assertion `!mysql_parse_status || thd->is_error() ||
+--echo # thd->get_internal_handler()' failed in parse_sql
+--echo #
+
+CREATE SEQUENCE s1;
+--error ER_DUP_ARGUMENT
+ALTER SEQUENCE s1 MAXVALUE 100 NO MAXVALUE;
+DROP SEQUENCE s1;
+
+--echo #
+--echo # Don't allow SEQUENCE to be used with CHECK or virtual fields
+--echo #
+
+CREATE SEQUENCE s1 nocache engine=myisam;
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE table t1 (a int check (next value for s1 > 0));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE table t1 (a int check (previous value for s1 > 0));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE table t1 (a int check (setval(s1,10)));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE TABLE t1 (a int, b int as (next value for s1 > 0));
+drop sequence s1;
+
+
+--echo #
+--echo # MDEV-13024: Server crashes in my_store_ptr upon DELETE from
+--echo # sequence in multi-table format
+--echo #
+CREATE SEQUENCE s;
+CREATE table t1 (a int);
+insert into t1 values (1),(2);
+--error ER_ILLEGAL_HA
+DELETE s FROM s;
+--error ER_ILLEGAL_HA
+delete t1,s from s,t1;
+--error ER_ILLEGAL_HA
+delete s,t1 from t1,s;
+DROP SEQUENCE s;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-20074: Lost connection on update trigger
+--echo #
+
+--echo # INSERT & table
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+
+DELIMITER $$;
+
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+INSERT INTO t2(a_p_name, a_p_first_name) VALUES(old.p_name, old.p_first_name);
+END;
+$$
+DELIMITER ;$$
+
+update t1 set p_first_name='Yunxi' where p_id=1;
+
+drop sequence s1;
+drop table t1,t2;
+
+
+--echo # INSERT & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+
+DELIMITER $$;
+
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+INSERT INTO v2(a_p_name, a_p_first_name) VALUES(old.p_name, old.p_first_name);
+END;
+$$
+DELIMITER ;$$
+
+update t1 set p_first_name='Yunxi' where p_id=1;
+
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+
+
+--echo # INSERT SELECT & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+
+DELIMITER $$;
+
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+INSERT INTO v2(a_p_name, a_p_first_name) SELECT old.p_name, old.p_first_name;
+END;
+$$
+DELIMITER ;$$
+
+update t1 set p_first_name='Yunxi' where p_id=1;
+
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+
+
+--echo # REPLACE & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+
+DELIMITER $$;
+
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+REPLACE INTO v2(a_p_name, a_p_first_name) VALUES(old.p_name, old.p_first_name);
+END;
+$$
+DELIMITER ;$$
+
+update t1 set p_first_name='Yunxi' where p_id=1;
+
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+
+
+--echo # REPLACE SELECT & view
+create sequence s1 increment by 1 start with 1;
+create table t1 (p_id integer, p_name varchar(128), p_first_name varchar(128));
+create table t2 (a_id integer default nextval(s1), a_p_name varchar(128), a_p_first_name varchar(128), t timestamp default current_timestamp);
+create view v2 as select * from t2;
+
+insert into t1 values
+(1, 'Luo','Frank'),(2, 'Xe','Emma'),(3, 'Li','Anna'),(4, 'Lun','Serg'),(5, 'Xu','Nils'),(6, 'Ja','Ute'),(7, 'Jin','Mike'),(8, 'Lio','Carl'),(9, 'Lang','Kevin'),(10, 'Ling','Lisa'),(11, 'Fang','Frank'),(12, 'Feng','Emma'),(13, 'Tuo','Anna'),(14, 'Tua','Serg'),(15, 'Moa','Nils'),(16, 'Hua','Ute'),(17, 'Xufa','Mike'),(18, 'Lulu','Carl'),(19, 'Hoho','Kevin'),(20, 'Tata','Lisa');
+
+DELIMITER $$;
+
+CREATE TRIGGER tr_upd
+BEFORE UPDATE on t1
+FOR EACH ROW
+BEGIN
+REPLACE INTO v2(a_p_name, a_p_first_name) SELECT old.p_name, old.p_first_name;
+END;
+$$
+DELIMITER ;$$
+
+update t1 set p_first_name='Yunxi' where p_id=1;
+
+drop view v2;
+drop table t1,t2;
+drop sequence s1;
+
+--echo # End of 10.3 tests
diff --git a/mysql-test/suite/sql_sequence/partition.result b/mysql-test/suite/sql_sequence/partition.result
new file mode 100644
index 00000000000..223285ce95d
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/partition.result
@@ -0,0 +1,7 @@
+#
+# MDEV-13715 ha_partition::engine_name() segfault fix
+#
+create sequence s;
+alter table s partition by hash(start_value) partitions 2;
+ERROR HY000: Table storage engine 'partition' does not support the create option 'SEQUENCE'
+drop sequence s;
diff --git a/mysql-test/suite/sql_sequence/partition.test b/mysql-test/suite/sql_sequence/partition.test
new file mode 100644
index 00000000000..d820b46987e
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/partition.test
@@ -0,0 +1,11 @@
+--source include/have_partition.inc
+--source include/have_sequence.inc
+
+--echo #
+--echo # MDEV-13715 ha_partition::engine_name() segfault fix
+--echo #
+
+create sequence s;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+alter table s partition by hash(start_value) partitions 2;
+drop sequence s;
diff --git a/mysql-test/suite/sql_sequence/read_only.result b/mysql-test/suite/sql_sequence/read_only.result
new file mode 100644
index 00000000000..38edcc0894b
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/read_only.result
@@ -0,0 +1,38 @@
+create sequence s1 cache 2 engine=innodb;
+connection default;
+show global variables like 'innodb_read_only';
+Variable_name Value
+innodb_read_only ON
+use test;
+set session binlog_format= row;
+###########################################
+read_only create error.
+###########################################
+show global variables like 'innodb_read_only';
+Variable_name Value
+innodb_read_only ON
+use test;
+create sequence s2 cache 5 engine=innodb;
+ERROR HY000: Can't create table `test`.`s2` (errno: 165 "Table is read only")
+###########################################
+read_only query error.
+###########################################
+select next value for s1;
+ERROR HY000: Table 's1' is read only
+select next value for s1;
+ERROR HY000: Table 's1' is read only
+select next value for s1;
+ERROR HY000: Table 's1' is read only
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 2 0 0
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 2 0 0
+select next value for s1;
+next value for s1
+1
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 1 9223372036854775806 1 1 2 0 0
+drop sequence s1;
diff --git a/mysql-test/suite/sql_sequence/read_only.test b/mysql-test/suite/sql_sequence/read_only.test
new file mode 100644
index 00000000000..73103384882
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/read_only.test
@@ -0,0 +1,44 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+#
+# Test innodb read only
+#
+
+create sequence s1 cache 2 engine=innodb;
+
+--let $restart_parameters= --innodb-read-only
+--source include/restart_mysqld.inc
+
+connection default;
+show global variables like 'innodb_read_only';
+use test;
+set session binlog_format= row;
+
+--echo ###########################################
+--echo read_only create error.
+--echo ###########################################
+
+show global variables like 'innodb_read_only';
+use test;
+
+--error ER_CANT_CREATE_TABLE
+create sequence s2 cache 5 engine=innodb;
+
+--echo ###########################################
+--echo read_only query error.
+--echo ###########################################
+--error ER_OPEN_AS_READONLY
+select next value for s1;
+--error ER_OPEN_AS_READONLY
+select next value for s1;
+--error ER_OPEN_AS_READONLY
+select next value for s1;
+
+select * from s1;
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+select * from s1;
+select next value for s1;
+select * from s1;
+drop sequence s1;
diff --git a/mysql-test/suite/sql_sequence/rebuild.result b/mysql-test/suite/sql_sequence/rebuild.result
new file mode 100644
index 00000000000..c8dc47ad8fa
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/rebuild.result
@@ -0,0 +1,161 @@
+#
+# MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt
+#
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+ALTER TABLE s1 FORCE;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS;
+INSERT INTO t1 VALUES (1);
+select * from t1;
+a
+1
+select * from t2;
+b
+ALL_PLUGINS
+APPLICABLE_ROLES
+CHARACTER_SETS
+CHECK_CONSTRAINTS
+CLIENT_STATISTICS
+COLLATIONS
+COLLATION_CHARACTER_SET_APPLICABILITY
+COLUMNS
+COLUMN_PRIVILEGES
+ENABLED_ROLES
+ENGINES
+EVENTS
+FILES
+GEOMETRY_COLUMNS
+GLOBAL_STATUS
+GLOBAL_VARIABLES
+INDEX_STATISTICS
+INNODB_BUFFER_PAGE
+INNODB_BUFFER_PAGE_LRU
+INNODB_BUFFER_POOL_STATS
+INNODB_CMPMEM
+INNODB_CMP_PER_INDEX
+INNODB_LOCKS
+INNODB_LOCK_WAITS
+INNODB_METRICS
+INNODB_SYS_COLUMNS
+INNODB_SYS_FIELDS
+INNODB_SYS_FOREIGN
+INNODB_SYS_FOREIGN_COLS
+INNODB_SYS_INDEXES
+INNODB_SYS_TABLES
+INNODB_SYS_VIRTUAL
+INNODB_TRX
+KEY_CACHES
+KEY_COLUMN_USAGE
+PARAMETERS
+PARTITIONS
+PLUGINS
+PROCESSLIST
+PROFILING
+REFERENTIAL_CONSTRAINTS
+ROUTINES
+SCHEMATA
+SCHEMA_PRIVILEGES
+SESSION_STATUS
+SESSION_VARIABLES
+SPATIAL_REF_SYS
+STATISTICS
+SYSTEM_VARIABLES
+TABLES
+TABLESPACES
+TABLE_CONSTRAINTS
+TABLE_PRIVILEGES
+TABLE_STATISTICS
+TRIGGERS
+USER_PRIVILEGES
+USER_STATISTICS
+VIEWS
+accounts
+column_stats
+columns_priv
+cond_instances
+db
+event
+events_stages_current
+events_stages_history
+events_stages_history_long
+events_stages_summary_by_account_by_event_name
+events_stages_summary_by_host_by_event_name
+events_stages_summary_by_thread_by_event_name
+events_stages_summary_by_user_by_event_name
+events_stages_summary_global_by_event_name
+events_statements_current
+events_statements_history
+events_statements_history_long
+events_statements_summary_by_account_by_event_name
+events_statements_summary_by_digest
+events_statements_summary_by_host_by_event_name
+events_statements_summary_by_thread_by_event_name
+events_statements_summary_by_user_by_event_name
+events_statements_summary_global_by_event_name
+events_waits_current
+events_waits_history
+events_waits_history_long
+events_waits_summary_by_account_by_event_name
+events_waits_summary_by_host_by_event_name
+events_waits_summary_by_instance
+events_waits_summary_by_thread_by_event_name
+events_waits_summary_by_user_by_event_name
+events_waits_summary_global_by_event_name
+file_instances
+file_summary_by_event_name
+file_summary_by_instance
+func
+general_log
+global_suppressions
+gtid_slave_pos
+help_category
+help_keyword
+help_relation
+help_topic
+host
+host_cache
+hosts
+index_stats
+innodb_index_stats
+innodb_table_stats
+mutex_instances
+objects_summary_global_by_type
+performance_timers
+plugin
+proc
+procs_priv
+proxies_priv
+roles_mapping
+rwlock_instances
+s1
+servers
+session_account_connect_attrs
+session_connect_attrs
+setup_actors
+setup_consumers
+setup_instruments
+setup_objects
+setup_timers
+slow_log
+socket_instances
+socket_summary_by_event_name
+socket_summary_by_instance
+t1
+t2
+table_io_waits_summary_by_index_usage
+table_io_waits_summary_by_table
+table_lock_waits_summary_by_table
+table_stats
+tables_priv
+test_suppressions
+threads
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
+transaction_registry
+user
+users
+DROP TABLE t1, t2, s1;
diff --git a/mysql-test/suite/sql_sequence/rebuild.test b/mysql-test/suite/sql_sequence/rebuild.test
new file mode 100644
index 00000000000..2994b90c98f
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/rebuild.test
@@ -0,0 +1,21 @@
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+
+--echo #
+--echo # MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt
+--echo #
+
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+ALTER TABLE s1 FORCE;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS;
+INSERT INTO t1 VALUES (1);
+--sorted_result
+select * from t1;
+--sorted_result
+select * from t2;
+
+# Cleanup
+DROP TABLE t1, t2, s1;
+
diff --git a/mysql-test/suite/sql_sequence/rename.result b/mysql-test/suite/sql_sequence/rename.result
new file mode 100644
index 00000000000..26f529b57ef
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/rename.result
@@ -0,0 +1,6 @@
+CREATE SEQUENCE seq1;
+RENAME TABLE seq1 TO seq2, seq3 TO seq4;
+ERROR 42S02: Table 'test.seq3' doesn't exist
+LOCK TABLE seq1 READ;
+UNLOCK TABLES;
+drop table seq1;
diff --git a/mysql-test/suite/sql_sequence/rename.test b/mysql-test/suite/sql_sequence/rename.test
new file mode 100644
index 00000000000..232a1bda5ea
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/rename.test
@@ -0,0 +1,6 @@
+CREATE SEQUENCE seq1;
+--error ER_NO_SUCH_TABLE
+RENAME TABLE seq1 TO seq2, seq3 TO seq4;
+LOCK TABLE seq1 READ;
+UNLOCK TABLES;
+drop table seq1;
diff --git a/mysql-test/suite/sql_sequence/replication-master.opt b/mysql-test/suite/sql_sequence/replication-master.opt
new file mode 100644
index 00000000000..bbea8eabc91
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication-master.opt
@@ -0,0 +1 @@
+--binlog_format=row --query_cache_type=1
diff --git a/mysql-test/suite/sql_sequence/replication-slave.opt b/mysql-test/suite/sql_sequence/replication-slave.opt
new file mode 100644
index 00000000000..a4e068e4b43
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication-slave.opt
@@ -0,0 +1 @@
+--binlog_format=row --query_cache_type=1 --read_only=true
diff --git a/mysql-test/suite/sql_sequence/replication.result b/mysql-test/suite/sql_sequence/replication.result
new file mode 100644
index 00000000000..7bf0eac8c47
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication.result
@@ -0,0 +1,1094 @@
+include/master-slave.inc
+[connection master]
+connection master;
+create database s_db;
+use s_db;
+grant all on s_db.* to normal_1@'%' identified by 'pass';
+grant all on test.* to normal_2@'%' identified by 'pass';
+grant all on s_db.* to normal_3@'%' identified by 'pass';
+grant all on test.* to normal_4@'%' identified by 'pass';
+connection slave;
+connect m_normal_1, 127.0.0.1, normal_1, pass, s_db, $MASTER_MYPORT;
+connect m_normal_2, 127.0.0.1, normal_2, pass, test, $MASTER_MYPORT;
+connect s_normal_3, 127.0.0.1, normal_3, pass, s_db, $SLAVE_MYPORT;
+connect s_normal_4, 127.0.0.1, normal_4, pass, test, $SLAVE_MYPORT;
+connection slave;
+set global read_only=on;
+use s_db;
+###########################################
+master and slave sync sequence.
+###########################################
+connection master;
+create sequence s1;
+show create table s1;
+Table Create Table
+s1 CREATE TABLE `s1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+connection slave;
+show create table s1;
+Table Create Table
+s1 CREATE TABLE `s1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=MyISAM SEQUENCE=1
+connection master;
+drop sequence s1;
+###########################################
+not support create table engine=sequence.
+###########################################
+connection master;
+create table t(id int)engine=sequence;
+ERROR 42000: Unknown storage engine 'sequence'
+create table t(id int)engine=innodb;
+alter table t engine=sequence;
+ERROR 42000: Unknown storage engine 'sequence'
+drop table t;
+###########################################
+not support alter sequence table.
+###########################################
+connection master;
+create sequence s2;
+alter table s2 add id int;
+ERROR HY000: Sequence 's_db.s2' table structure is invalid (Wrong number of columns)
+alter table s2 add index ind_x(start);
+ERROR HY000: Sequence 's_db.s2' table structure is invalid (Sequence tables cannot have any keys)
+drop sequence s2;
+###########################################
+support create sequence
+###########################################
+connection master;
+create table t_1(id int);
+show create sequence t_1;
+ERROR 42S02: 's_db.t_1' is not a SEQUENCE
+drop table t_1;
+CREATE SEQUENCE `s2` (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) ENGINE=InnoDB sequence=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 '(
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT...' at line 1
+CREATE TABLE `s2` (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) ENGINE=InnoDB sequence=1;
+insert into s2 values(1, 1, 10, 1, 2, 1, 1, 0);
+commit;
+select * for s2;
+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 's2' at line 1
+select * from s2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 10 1 2 1 1 0
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+1
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+3
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+5
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+7
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+9
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+1
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+3
+select * from s2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 10 1 2 1 1 1
+commit;
+connection master;
+connection slave;
+select * from s2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 10 1 2 1 1 1
+connection master;
+drop sequence s2;
+CREATE TABLE `s2` (
+`next_not_cached_value` bigint(21) NOT NULL,
+`minimum_value` bigint(21) NOT NULL,
+`maximum_value` bigint(21) NOT NULL,
+`start_value` bigint(21) NOT NULL,
+`increment` bigint(21) NOT NULL,
+`cache_size` bigint(21) unsigned NOT NULL,
+`cycle_option` tinyint(1) unsigned NOT NULL,
+`cycle_count` bigint(21) NOT NULL
+) ENGINE=myisam DEFAULT CHARSET=latin1 sequence=1;
+show create sequence s2;
+Table Create Table
+s2 CREATE SEQUENCE `s2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+drop sequence s2;
+###########################################
+select sequence syntax test
+###########################################
+connection master;
+create sequence s2;
+create table t2 (id int);
+select * from s2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select * from t2;
+id
+insert into t2 select next value for s2;
+commit;
+select NEXT VALUE for s2;
+NEXT VALUE for s2
+2
+select NEXT VALUE for t2;
+ERROR 42S02: 's_db.t2' is not a SEQUENCE
+select * from s2, t2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count id
+1001 1 9223372036854775806 1 1 1000 0 0 1
+select * for s2;
+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 's2' at line 1
+select * for s2, t2;
+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 's2, t2' at line 1
+connection master;
+drop sequence s2;
+drop table t2;
+###########################################
+support rename, not support truncate
+###########################################
+connection master;
+create sequence s2;
+alter table s2 rename to s2_1;
+rename table s2_1 to s2_2;
+show create sequence s2_2;
+Table Create Table
+s2_2 CREATE SEQUENCE `s2_2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+select * from s2_2;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+truncate table s2_2;
+ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s2_2` doesn't have this option
+rename table s2_2 to s2;
+drop sequence s2;
+###########################################
+all invalid sequence value
+###########################################
+connection master;
+create sequence s2 start with 1
+minvalue 1
+maxvalue 100000
+increment by 1
+cache 10000
+cycle;
+drop sequence s2;
+create sequence s2 start with 1
+minvalue 1
+maxvalue 100000
+increment by 1
+cache 10000
+nocycle;
+drop sequence s2;
+create sequence s2 start with 1
+minvalue 1
+maxvalue 100000
+increment by 1
+nocache
+nocycle;
+drop sequence s2;
+create sequence s2 start with 1
+minvalue 5
+maxvalue 100000
+increment by 1
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+create sequence s2 start with 1
+minvalue 5
+maxvalue 5
+increment by 1
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+create sequence s2 start with 1
+minvalue 5
+maxvalue 4
+increment by 1
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+create sequence s2 start with 1
+minvalue 5
+maxvalue 4
+increment by 0
+nocache
+nocycle;
+ERROR HY000: Sequence 's_db.s2' values are conflicting
+###########################################
+global read lock prevent query sequence
+###########################################
+connection master;
+create sequence s_db.s1;
+flush table with read lock;
+select NEXT VALUE for s1;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+unlock tables;
+drop sequence s_db.s1;
+###########################################
+query cache test
+###########################################
+connection master;
+flush status;
+show global variables like 'query_cache_type';
+Variable_name Value
+query_cache_type ON
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+show status like 'Qcache_inserts';
+Variable_name Value
+Qcache_inserts 0
+###########################################
+priv test
+###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+select NEXT VALUE for s_db.s1;
+NEXT VALUE for s_db.s1
+1
+create sequence s_db.s2;
+drop sequence s_db.s2;
+connection m_normal_2;
+select NEXT VALUE for s_db.s1;
+ERROR 42000: INSERT command denied to user 'normal_2'@'localhost' for table 's1'
+create sequence s_db.s2;
+ERROR 42000: CREATE command denied to user 'normal_2'@'localhost' for table 's2'
+connection m_normal_1;
+drop sequence s_db.s1;
+###########################################
+run out sequence value
+###########################################
+connection m_normal_1;
+create sequence s_t start with 1 cache 2 maxvalue 5;
+create table t(id int);
+insert into t values(1111);
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+ERROR HY000: Sequence 's_db.s_t' has run out
+insert into t select next value for s_t;
+ERROR HY000: Sequence 's_db.s_t' has run out
+commit;
+select * from t;
+id
+1111
+1
+2
+3
+4
+5
+connection master;
+connection slave;
+connection s_normal_3;
+select * from t;
+id
+1111
+1
+2
+3
+4
+5
+connection m_normal_1;
+drop sequence s_t;
+drop table t;
+###########################################
+read_only prevent query sequence
+###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+show global variables like 'read_only';
+Variable_name Value
+read_only OFF
+select * from s_db.s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+connection master;
+connection slave;
+connection s_normal_3;
+show global variables like 'read_only';
+Variable_name Value
+read_only ON
+select next value for s_db.s1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+connection m_normal_1;
+drop sequence s_db.s1;
+###########################################
+update based table
+###########################################
+connection m_normal_1;
+create sequence s_t start with 1 minvalue 1 maxvalue 20 increment by 1 cache 5 cycle engine=innodb;
+connection master;
+connection slave;
+connection s_normal_3;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 20 1 1 5 1 0
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+1
+connection master;
+connection slave;
+connection s_normal_3;
+select next_not_cached_value from s_t;
+next_not_cached_value
+6
+------------------------------------------
+master ALTER SEQUENCE
+------------------------------------------
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+2
+alter sequence s_t restart= 11;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 20 1 1 5 1 0
+connection master;
+connection slave;
+------------------------------------------
+show slave nextval;
+------------------------------------------
+connection s_normal_3;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 20 1 1 5 1 0
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+11
+connection master;
+connection slave;
+connection s_normal_3;
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+------------------------------------------
+update into invalid sequence
+------------------------------------------
+connection m_normal_1;
+select next value for s_t;
+next value for s_t
+12
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+alter sequence s_t minvalue=11 maxvalue=9;
+ERROR HY000: Sequence 's_db.s_t' values are conflicting
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20;
+ERROR HY000: Sequence 's_db.s_t' values are conflicting
+select * from s_t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+16 1 20 1 1 5 1 0
+------------------------------------------
+delete sequence row
+------------------------------------------
+connection m_normal_1;
+delete from s_t;
+ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
+commit;
+select next value for s_t;
+next value for s_t
+13
+connection m_normal_1;
+drop sequence s_t;
+###########################################
+test transaction context (innodb)
+###########################################
+------------------------------------------
+transaction table and sequence
+normal transaction commit
+------------------------------------------
+connection m_normal_1;
+create sequence s_1 cache 5 engine=innodb;
+create table t_1(id int)engine=innodb;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+select * from t_1;
+id
+1111
+1
+2
+2222
+select * from s_1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+6 1 9223372036854775806 1 1 5 0 0
+connection master;
+connection slave;
+connection s_normal_3;
+select * from t_1;
+id
+1111
+1
+2
+2222
+------------------------------------------
+normal transaction rollback
+------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+rollback;
+select * from t_1;
+id
+1111
+1
+2
+2222
+select * from s_1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 1 1 5 0 0
+select next value for s_1;
+next value for s_1
+11
+connection master;
+connection slave;
+connection s_normal_3;
+select * from t_1;
+id
+1111
+1
+2
+2222
+connection m_normal_1;
+drop sequence s_1;
+drop table t_1;
+###########################################
+test transaction context (myisam)
+###########################################
+------------------------------------------
+transaction table and sequence
+normal transaction commit
+------------------------------------------
+connection m_normal_1;
+create sequence s_1 cache 5;
+create table t_1(id int)engine=myisam;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+select * from t_1;
+id
+1111
+1
+2
+2222
+connection master;
+connection slave;
+connection s_normal_3;
+select * from t_1;
+id
+1111
+1
+2
+2222
+------------------------------------------
+normal transaction rollback
+------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+select next value for s_1;
+next value for s_1
+11
+connection master;
+connection slave;
+connection s_normal_3;
+select * from t_1;
+id
+1111
+1
+2
+2222
+3333
+3
+4
+5
+6
+7
+8
+9
+10
+connection m_normal_1;
+drop sequence s_1;
+drop table t_1;
+###########################################
+close binlog
+###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+select next value for s1;
+next value for s1
+1
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+next value for s1
+3
+select next value for s1;
+next value for s1
+4
+commit;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 2 0 0
+connection master;
+connection slave;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 2 0 0
+------------------------------------------
+close session binlog.
+------------------------------------------
+connection master;
+set session sql_log_bin=off;
+select next value for s1;
+next value for s1
+5
+select next value for s1;
+next value for s1
+6
+select next value for s1;
+next value for s1
+7
+select next value for s1;
+next value for s1
+8
+set session sql_log_bin=on;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+9 1 9223372036854775806 1 1 2 0 0
+connection master;
+connection slave;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 2 0 0
+connection master;
+select next value for s1;
+next value for s1
+9
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 1 1 2 0 0
+connection slave;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+11 1 9223372036854775806 1 1 2 0 0
+connection master;
+drop sequence s1;
+###########################################
+statement binlog
+###########################################
+------------------------------------------
+set binlog_format=statement
+------------------------------------------
+connection master;
+set session binlog_format=statement;
+select @@session.binlog_format;
+@@session.binlog_format
+STATEMENT
+create sequence s1 cache 2;
+select next value for s1;
+ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
+set session binlog_format=row;
+select next value for s1;
+next value for s1
+1
+connection master;
+connection slave;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 1 9223372036854775806 1 1 2 0 0
+connection m_normal_1;
+drop sequence s1;
+------------------------------------------
+set binlog_format=mixed
+------------------------------------------
+connection master;
+set session binlog_format=mixed;
+select @@session.binlog_format;
+@@session.binlog_format
+MIXED
+create sequence s1 cache 2;
+select next value for s1;
+next value for s1
+1
+set session binlog_format=row;
+select next value for s1;
+next value for s1
+2
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 1 9223372036854775806 1 1 2 0 0
+connection master;
+connection slave;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+3 1 9223372036854775806 1 1 2 0 0
+connection m_normal_1;
+drop sequence s1;
+connection master;
+connection slave;
+###########################################
+test savepoint
+###########################################
+connection master;
+set session binlog_format=row;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+begin;
+insert into t1 values(1111);
+savepoint sp1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+insert into t1 values(2222);
+select * from t1;
+id
+1111
+1
+2
+3
+2222
+rollback to sp1;
+select * from t1;
+id
+1111
+select next value for s1;
+next value for s1
+4
+commit;
+drop sequence s1;
+drop table t1;
+connection master;
+connection slave;
+###########################################
+create as
+###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+create table t as select * from s1;
+select * from t;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 2 0 0
+drop table t;
+create table t as select next value for s1;
+select * from t;
+next value for s1
+1
+drop table t;
+drop sequence s1;
+connection master;
+connection slave;
+###########################################
+test proc
+###########################################
+connection m_normal_1;
+create table t(id int)engine=innodb;
+create procedure p1()
+begin
+create sequence s1 cache 2;
+end//
+create procedure p2()
+begin
+insert into t select next value for s1;
+commit;
+end//
+call p1();
+call p2();
+call p2();
+call p2();
+call p2();
+select * from t;
+id
+1
+2
+3
+4
+connection master;
+connection slave;
+select * from t;
+id
+1
+2
+3
+4
+connection m_normal_1;
+drop table t;
+drop sequence s1;
+drop procedure p1;
+drop procedure p2;
+###########################################
+test trigger
+###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+create table t2(id int)engine=innodb;
+CREATE TRIGGER tri_1
+before INSERT ON t2 FOR EACH ROW
+BEGIN
+INSERT INTO t1 select next value for s1;
+END//
+begin;
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+select * from t2;
+id
+1111
+1111
+1111
+1111
+select * from t1;
+id
+1
+2
+3
+4
+rollback;
+select * from t2;
+id
+select * from t1;
+id
+select next value for s1;
+next value for s1
+5
+drop trigger tri_1;
+drop table t1;
+drop table t2;
+drop sequence s1;
+###########################################
+test function
+###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+CREATE function f1() returns int
+BEGIN
+INSERT INTO t1 select next value for s1;
+return (1);
+END//
+begin;
+select f1();
+f1()
+1
+select f1();
+f1()
+1
+select f1();
+f1()
+1
+select f1();
+f1()
+1
+select * from t1;
+id
+1
+2
+3
+4
+rollback;
+select * from t1;
+id
+select next value for s1;
+next value for s1
+5
+drop function f1;
+drop table t1;
+drop sequence s1;
+###########################################
+test value boundary
+###########################################
+connection m_normal_1;
+------------------------------------------
+cycle_count increment by cycle_count
+------------------------------------------
+create sequence s1 start with 5 minvalue 2 maxvalue 7 cache 1 cycle;
+select next value for s1;
+next value for s1
+5
+select next value for s1;
+next value for s1
+6
+select next value for s1;
+next value for s1
+7
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+next value for s1
+3
+drop sequence s1;
+create sequence s1 start with 5 minvalue 2 maxvalue 7 cache 10 nocycle;
+select next value for s1;
+next value for s1
+5
+select next value for s1;
+next value for s1
+6
+select next value for s1;
+next value for s1
+7
+select next value for s1;
+ERROR HY000: Sequence 's_db.s1' has run out
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+8 2 7 5 1 10 0 0
+drop sequence s1;
+create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 nocache cycle;
+select next value for s1;
+next value for s1
+2
+select next_not_cached_value,cycle_count from s1;
+next_not_cached_value cycle_count
+4 0
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value,cycle_count from s1;
+next_not_cached_value cycle_count
+4 1
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value,cycle_count from s1;
+next_not_cached_value cycle_count
+4 2
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value,cycle_count from s1;
+next_not_cached_value cycle_count
+4 3
+select next value for s1;
+next value for s1
+1
+select next_not_cached_value,cycle_count from s1;
+next_not_cached_value cycle_count
+4 4
+drop sequence s1;
+create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 cache 2 nocycle;
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+ERROR HY000: Sequence 's_db.s1' has run out
+drop sequence s1;
+------------------------------------------
+beyond ulonglong maxvalue
+------------------------------------------
+create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 1 cycle;
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 0
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775806 0
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775804 0
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 1
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775806 1
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775804 1
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 2
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775806 2
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775804 2
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 3
+drop sequence s1;
+create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 10 cycle;
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 0
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775806 0
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775804 0
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 1
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775806 1
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775804 1
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 2
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775806 2
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775804 2
+select next value for s1, cycle_count from s1;
+next value for s1 cycle_count
+9223372036854775805 3
+drop sequence s1;
+###########################################
+test default()
+###########################################
+connection master;
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+insert into t1 (b) values (1),(2);
+select default(a) from t1;
+default(a)
+3
+4
+select * from t1;
+a b
+1 1
+2 2
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 0 0 0
+connection slave;
+connection s_normal_3;
+select * from t1;
+a b
+1 1
+2 2
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 9223372036854775806 1 1 0 0 0
+connection master;
+drop table t1,s1;
+connection master;
+drop database s_db;
+drop user normal_1@'%';
+drop user normal_2@'%';
+drop user normal_3@'%';
+drop user normal_4@'%';
+include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/replication.test b/mysql-test/suite/sql_sequence/replication.test
new file mode 100644
index 00000000000..e26fde8a329
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication.test
@@ -0,0 +1,883 @@
+#
+# This test is originally sequence.test from ALISQL by Jianwei modified for
+# MariaDB
+#
+# It tests basic sequence functionallity together with replication
+#
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+connection master;
+create database s_db;
+use s_db;
+grant all on s_db.* to normal_1@'%' identified by 'pass';
+grant all on test.* to normal_2@'%' identified by 'pass';
+grant all on s_db.* to normal_3@'%' identified by 'pass';
+grant all on test.* to normal_4@'%' identified by 'pass';
+
+--sync_slave_with_master
+
+connect(m_normal_1, 127.0.0.1, normal_1, pass, s_db, $MASTER_MYPORT);
+connect(m_normal_2, 127.0.0.1, normal_2, pass, test, $MASTER_MYPORT);
+
+connect(s_normal_3, 127.0.0.1, normal_3, pass, s_db, $SLAVE_MYPORT);
+connect(s_normal_4, 127.0.0.1, normal_4, pass, test, $SLAVE_MYPORT);
+
+connection slave;
+set global read_only=on;
+use s_db;
+
+--echo ###########################################
+--echo master and slave sync sequence.
+--echo ###########################################
+connection master;
+
+create sequence s1;
+show create table s1;
+
+--sync_slave_with_master
+
+show create table s1;
+
+connection master;
+
+drop sequence s1;
+
+--echo ###########################################
+--echo not support create table engine=sequence.
+--echo ###########################################
+connection master;
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+create table t(id int)engine=sequence;
+
+create table t(id int)engine=innodb;
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+alter table t engine=sequence;
+
+drop table t;
+--echo ###########################################
+--echo not support alter sequence table.
+--echo ###########################################
+connection master;
+
+create sequence s2;
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+alter table s2 add id int;
+
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+alter table s2 add index ind_x(start);
+drop sequence s2;
+
+--echo ###########################################
+--echo support create sequence
+--echo ###########################################
+connection master;
+
+create table t_1(id int);
+--error ER_NOT_SEQUENCE
+show create sequence t_1;
+
+drop table t_1;
+
+--error ER_PARSE_ERROR
+CREATE SEQUENCE `s2` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) ENGINE=InnoDB sequence=1;
+
+CREATE TABLE `s2` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) ENGINE=InnoDB sequence=1;
+
+insert into s2 values(1, 1, 10, 1, 2, 1, 1, 0);
+commit;
+--error ER_PARSE_ERROR
+select * for s2;
+select * from s2;
+select NEXT VALUE for s2;
+select NEXT VALUE for s2;
+select NEXT VALUE for s2;
+select NEXT VALUE for s2;
+select NEXT VALUE for s2;
+select NEXT VALUE for s2;
+select NEXT VALUE for s2;
+select * from s2;
+commit;
+
+connection master;
+--sync_slave_with_master
+select * from s2;
+
+connection master;
+drop sequence s2;
+
+CREATE TABLE `s2` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL,
+ `increment` bigint(21) NOT NULL,
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL,
+ `cycle_count` bigint(21) NOT NULL
+) ENGINE=myisam DEFAULT CHARSET=latin1 sequence=1;
+
+show create sequence s2;
+drop sequence s2;
+
+--echo ###########################################
+--echo select sequence syntax test
+--echo ###########################################
+connection master;
+create sequence s2;
+create table t2 (id int);
+
+select * from s2;
+select * from t2;
+insert into t2 select next value for s2;
+commit;
+
+select NEXT VALUE for s2;
+--error ER_NOT_SEQUENCE
+select NEXT VALUE for t2;
+
+select * from s2, t2;
+
+--error ER_PARSE_ERROR
+select * for s2;
+--error ER_PARSE_ERROR
+select * for s2, t2;
+
+connection master;
+drop sequence s2;
+drop table t2;
+
+--echo ###########################################
+--echo support rename, not support truncate
+--echo ###########################################
+connection master;
+
+create sequence s2;
+
+alter table s2 rename to s2_1;
+rename table s2_1 to s2_2;
+show create sequence s2_2;
+select * from s2_2;
+
+--error ER_ILLEGAL_HA
+truncate table s2_2;
+rename table s2_2 to s2;
+drop sequence s2;
+
+--echo ###########################################
+--echo all invalid sequence value
+--echo ###########################################
+
+connection master;
+create sequence s2 start with 1
+ minvalue 1
+ maxvalue 100000
+ increment by 1
+ cache 10000
+ cycle;
+drop sequence s2;
+create sequence s2 start with 1
+ minvalue 1
+ maxvalue 100000
+ increment by 1
+ cache 10000
+ nocycle;
+drop sequence s2;
+create sequence s2 start with 1
+ minvalue 1
+ maxvalue 100000
+ increment by 1
+ nocache
+ nocycle;
+drop sequence s2;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 100000
+ increment by 1
+ nocache
+ nocycle;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 5
+ increment by 1
+ nocache
+ nocycle;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 4
+ increment by 1
+ nocache
+ nocycle;
+
+--error ER_SEQUENCE_INVALID_DATA
+create sequence s2 start with 1
+ minvalue 5
+ maxvalue 4
+ increment by 0
+ nocache
+ nocycle;
+
+--echo ###########################################
+--echo global read lock prevent query sequence
+--echo ###########################################
+connection master;
+create sequence s_db.s1;
+flush table with read lock;
+--error ER_CANT_UPDATE_WITH_READLOCK
+select NEXT VALUE for s1;
+unlock tables;
+drop sequence s_db.s1;
+
+--echo ###########################################
+--echo query cache test
+--echo ###########################################
+connection master;
+flush status;
+show global variables like 'query_cache_type';
+
+show status like 'Qcache_hits';
+show status like 'Qcache_inserts';
+
+--echo ###########################################
+--echo priv test
+--echo ###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+select NEXT VALUE for s_db.s1;
+create sequence s_db.s2;
+drop sequence s_db.s2;
+
+
+connection m_normal_2;
+--error ER_TABLEACCESS_DENIED_ERROR
+select NEXT VALUE for s_db.s1;
+--error ER_TABLEACCESS_DENIED_ERROR
+create sequence s_db.s2;
+
+connection m_normal_1;
+drop sequence s_db.s1;
+
+--echo ###########################################
+--echo run out sequence value
+--echo ###########################################
+connection m_normal_1;
+create sequence s_t start with 1 cache 2 maxvalue 5;
+create table t(id int);
+insert into t values(1111);
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+insert into t select next value for s_t;
+--error ER_SEQUENCE_RUN_OUT
+insert into t select next value for s_t;
+--error ER_SEQUENCE_RUN_OUT
+insert into t select next value for s_t;
+commit;
+select * from t;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from t;
+
+connection m_normal_1;
+drop sequence s_t;
+drop table t;
+
+--echo ###########################################
+--echo read_only prevent query sequence
+--echo ###########################################
+connection m_normal_1;
+create sequence s_db.s1;
+show global variables like 'read_only';
+select * from s_db.s1;
+
+connection master;
+--sync_slave_with_master
+connection s_normal_3;
+
+show global variables like 'read_only';
+--error ER_OPTION_PREVENTS_STATEMENT
+select next value for s_db.s1;
+
+connection m_normal_1;
+drop sequence s_db.s1;
+
+--echo ###########################################
+--echo update based table
+--echo ###########################################
+connection m_normal_1;
+create sequence s_t start with 1 minvalue 1 maxvalue 20 increment by 1 cache 5 cycle engine=innodb;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from s_t;
+
+
+connection m_normal_1;
+select next value for s_t;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select next_not_cached_value from s_t;
+
+--echo ------------------------------------------
+--echo master ALTER SEQUENCE
+--echo ------------------------------------------
+connection m_normal_1;
+select next value for s_t;
+alter sequence s_t restart= 11;
+
+select * from s_t;
+
+connection master;
+--sync_slave_with_master
+
+--echo ------------------------------------------
+--echo show slave nextval;
+--echo ------------------------------------------
+connection s_normal_3;
+select * from s_t;
+
+connection m_normal_1;
+select next value for s_t;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from s_t;
+
+
+--echo ------------------------------------------
+--echo update into invalid sequence
+--echo ------------------------------------------
+connection m_normal_1;
+select next value for s_t;
+select * from s_t;
+--error ER_SEQUENCE_INVALID_DATA
+alter sequence s_t minvalue=11 maxvalue=9;
+select * from s_t;
+--error ER_SEQUENCE_INVALID_DATA
+alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20;
+select * from s_t;
+
+--echo ------------------------------------------
+--echo delete sequence row
+--echo ------------------------------------------
+connection m_normal_1;
+--error ER_ILLEGAL_HA
+delete from s_t;
+commit;
+
+select next value for s_t;
+
+connection m_normal_1;
+drop sequence s_t;
+
+--echo ###########################################
+--echo test transaction context (innodb)
+--echo ###########################################
+
+--echo ------------------------------------------
+--echo transaction table and sequence
+--echo normal transaction commit
+--echo ------------------------------------------
+connection m_normal_1;
+create sequence s_1 cache 5 engine=innodb;
+
+create table t_1(id int)engine=innodb;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+
+select * from t_1;
+select * from s_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from t_1;
+
+--echo ------------------------------------------
+--echo normal transaction rollback
+--echo ------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+
+select * from t_1;
+rollback;
+
+select * from t_1;
+select * from s_1;
+select next value for s_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from t_1;
+
+connection m_normal_1;
+drop sequence s_1;
+drop table t_1;
+
+--echo ###########################################
+--echo test transaction context (myisam)
+--echo ###########################################
+
+--echo ------------------------------------------
+--echo transaction table and sequence
+--echo normal transaction commit
+--echo ------------------------------------------
+connection m_normal_1;
+create sequence s_1 cache 5;
+
+create table t_1(id int)engine=myisam;
+begin;
+insert into t_1 values(1111);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 values(2222);
+commit;
+
+select * from t_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from t_1;
+
+--echo ------------------------------------------
+--echo normal transaction rollback
+--echo ------------------------------------------
+connection m_normal_1;
+begin;
+insert into t_1 values(3333);
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+insert into t_1 select next value for s_1;
+
+select * from t_1;
+rollback;
+
+select * from t_1;
+select next value for s_1;
+
+connection master;
+--sync_slave_with_master
+
+connection s_normal_3;
+select * from t_1;
+
+connection m_normal_1;
+drop sequence s_1;
+drop table t_1;
+
+--echo ###########################################
+--echo close binlog
+--echo ###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+
+commit;
+select * from s1;
+
+connection master;
+--sync_slave_with_master
+
+select * from s1;
+
+--echo ------------------------------------------
+--echo close session binlog.
+--echo ------------------------------------------
+connection master;
+set session sql_log_bin=off;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+
+set session sql_log_bin=on;
+select * from s1;
+
+connection master;
+--sync_slave_with_master
+
+select * from s1;
+
+connection master;
+select next value for s1;
+select * from s1;
+--sync_slave_with_master
+
+select * from s1;
+connection master;
+
+drop sequence s1;
+
+--echo ###########################################
+--echo statement binlog
+--echo ###########################################
+--echo ------------------------------------------
+--echo set binlog_format=statement
+--echo ------------------------------------------
+connection master;
+set session binlog_format=statement;
+select @@session.binlog_format;
+create sequence s1 cache 2;
+--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
+select next value for s1;
+
+set session binlog_format=row;
+select next value for s1;
+
+connection master;
+--sync_slave_with_master
+
+select * from s1;
+
+connection m_normal_1;
+drop sequence s1;
+
+--echo ------------------------------------------
+--echo set binlog_format=mixed
+--echo ------------------------------------------
+connection master;
+set session binlog_format=mixed;
+select @@session.binlog_format;
+create sequence s1 cache 2;
+select next value for s1;
+
+set session binlog_format=row;
+select next value for s1;
+select * from s1;
+
+connection master;
+--sync_slave_with_master
+
+select * from s1;
+
+connection m_normal_1;
+drop sequence s1;
+connection master;
+--sync_slave_with_master
+
+--echo ###########################################
+--echo test savepoint
+--echo ###########################################
+
+connection master;
+set session binlog_format=row;
+
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+
+begin;
+insert into t1 values(1111);
+savepoint sp1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+insert into t1 select next value for s1;
+
+insert into t1 values(2222);
+
+select * from t1;
+rollback to sp1;
+select * from t1;
+select next value for s1;
+
+commit;
+
+drop sequence s1;
+drop table t1;
+
+connection master;
+--sync_slave_with_master
+
+--echo ###########################################
+--echo create as
+--echo ###########################################
+connection m_normal_1;
+
+create sequence s1 cache 2;
+create table t as select * from s1;
+select * from t;
+drop table t;
+create table t as select next value for s1;
+select * from t;
+drop table t;
+
+drop sequence s1;
+
+connection master;
+--sync_slave_with_master
+
+--echo ###########################################
+--echo test proc
+--echo ###########################################
+connection m_normal_1;
+create table t(id int)engine=innodb;
+
+delimiter //;
+
+create procedure p1()
+begin
+ create sequence s1 cache 2;
+end//
+
+create procedure p2()
+begin
+ insert into t select next value for s1;
+ commit;
+end//
+
+delimiter ;//
+
+call p1();
+call p2();
+call p2();
+call p2();
+call p2();
+
+select * from t;
+
+connection master;
+--sync_slave_with_master
+
+select * from t;
+
+connection m_normal_1;
+drop table t;
+drop sequence s1;
+drop procedure p1;
+drop procedure p2;
+
+--echo ###########################################
+--echo test trigger
+--echo ###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+create table t2(id int)engine=innodb;
+
+delimiter //;
+CREATE TRIGGER tri_1
+ before INSERT ON t2 FOR EACH ROW
+BEGIN
+ INSERT INTO t1 select next value for s1;
+END//
+delimiter ;//
+
+begin;
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+insert into t2 values(1111);
+
+select * from t2;
+select * from t1;
+rollback;
+select * from t2;
+select * from t1;
+
+select next value for s1;
+
+
+drop trigger tri_1;
+drop table t1;
+drop table t2;
+drop sequence s1;
+
+--echo ###########################################
+--echo test function
+--echo ###########################################
+connection m_normal_1;
+create sequence s1 cache 2;
+create table t1(id int)engine=innodb;
+
+delimiter //;
+CREATE function f1() returns int
+BEGIN
+ INSERT INTO t1 select next value for s1;
+ return (1);
+END//
+delimiter ;//
+
+begin;
+select f1();
+select f1();
+select f1();
+select f1();
+
+select * from t1;
+rollback;
+select * from t1;
+
+select next value for s1;
+
+drop function f1;
+drop table t1;
+drop sequence s1;
+
+--echo ###########################################
+--echo test value boundary
+--echo ###########################################
+connection m_normal_1;
+
+--echo ------------------------------------------
+--echo cycle_count increment by cycle_count
+--echo ------------------------------------------
+create sequence s1 start with 5 minvalue 2 maxvalue 7 cache 1 cycle;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+drop sequence s1;
+
+create sequence s1 start with 5 minvalue 2 maxvalue 7 cache 10 nocycle;
+select next value for s1;
+select next value for s1;
+select next value for s1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for s1;
+select * from s1;
+drop sequence s1;
+
+create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 nocache cycle;
+select next value for s1;
+select next_not_cached_value,cycle_count from s1;
+select next value for s1;
+select next_not_cached_value,cycle_count from s1;
+select next value for s1;
+select next_not_cached_value,cycle_count from s1;
+select next value for s1;
+select next_not_cached_value,cycle_count from s1;
+select next value for s1;
+select next_not_cached_value,cycle_count from s1;
+drop sequence s1;
+
+create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 cache 2 nocycle;
+select next value for s1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for s1;
+drop sequence s1;
+
+--echo ------------------------------------------
+--echo beyond ulonglong maxvalue
+--echo ------------------------------------------
+create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 1 cycle;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+drop sequence s1;
+
+create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 10 cycle;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+select next value for s1, cycle_count from s1;
+drop sequence s1;
+
+--echo ###########################################
+--echo test default()
+--echo ###########################################
+connection master;
+
+CREATE SEQUENCE s1 nocache engine=myisam;
+CREATE table t1 (a int default next value for s1, b int);
+insert into t1 (b) values (1),(2);
+select default(a) from t1;
+select * from t1;
+select * from s1;
+--sync_slave_with_master
+connection s_normal_3;
+select * from t1;
+select * from s1;
+connection master;
+drop table t1,s1;
+
+#
+# Cleanup
+#
+
+connection master;
+drop database s_db;
+drop user normal_1@'%';
+drop user normal_2@'%';
+drop user normal_3@'%';
+drop user normal_4@'%';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/replication_drop.result b/mysql-test/suite/sql_sequence/replication_drop.result
new file mode 100644
index 00000000000..1cd7022765e
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication_drop.result
@@ -0,0 +1,5 @@
+CREATE SEQUENCE seq ENGINE=InnoDB;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+INSERT INTO seq VALUES (1,1,100,1,1,1,1,1);
+ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
+DROP SEQUENCE seq;
diff --git a/mysql-test/suite/sql_sequence/replication_drop.test b/mysql-test/suite/sql_sequence/replication_drop.test
new file mode 100644
index 00000000000..ca050246391
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication_drop.test
@@ -0,0 +1,17 @@
+#
+# Test for MDEV-15812
+# Assertion `m_lock_type == 2' failed in
+# handler::~handler on dropping a sequence after
+# ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
+#
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+
+CREATE SEQUENCE seq ENGINE=InnoDB;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
+INSERT INTO seq VALUES (1,1,100,1,1,1,1,1);
+
+# Cleanup
+DROP SEQUENCE seq;
diff --git a/mysql-test/suite/sql_sequence/replication_mixed.result b/mysql-test/suite/sql_sequence/replication_mixed.result
new file mode 100644
index 00000000000..f581d59fc30
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication_mixed.result
@@ -0,0 +1,35 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-16234
+# CREATE TABLE .. SELECT LASTVAL is written to binlog as single
+# statement, causes discrepancy between master and slave
+#
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+1
+CREATE TABLE t1 ENGINE=InnoDB SELECT LASTVAL(s1) AS a;
+INSERT INTO t1 VALUES (NEXTVAL(s1));
+INSERT INTO t1 VALUES (LASTVAL(s1));
+SELECT * FROM t1;
+a
+1
+2
+2
+SELECT * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+connection slave;
+SELECT * FROM t1;
+a
+1
+2
+2
+SELECT * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+connection master;
+DROP TABLE t1;
+DROP SEQUENCE s1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/replication_mixed.test b/mysql-test/suite/sql_sequence/replication_mixed.test
new file mode 100644
index 00000000000..0096ab5acd8
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/replication_mixed.test
@@ -0,0 +1,27 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-16234
+--echo # CREATE TABLE .. SELECT LASTVAL is written to binlog as single
+--echo # statement, causes discrepancy between master and slave
+--echo #
+
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+SELECT NEXTVAL(s1);
+CREATE TABLE t1 ENGINE=InnoDB SELECT LASTVAL(s1) AS a;
+INSERT INTO t1 VALUES (NEXTVAL(s1));
+INSERT INTO t1 VALUES (LASTVAL(s1));
+SELECT * FROM t1;
+SELECT * from s1;
+--sync_slave_with_master
+SELECT * FROM t1;
+SELECT * from s1;
+
+# Cleanup
+--connection master
+DROP TABLE t1;
+DROP SEQUENCE s1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/setval.result b/mysql-test/suite/sql_sequence/setval.result
new file mode 100644
index 00000000000..504d460fea5
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/setval.result
@@ -0,0 +1,271 @@
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+#
+# Test setval function
+#
+CREATE SEQUENCE t1 cache 10 engine=myisam;
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+1 0
+do setval(t1,10);
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+11 0
+select next value for t1;
+next value for t1
+11
+do setval(t1,12,1);
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+21 0
+select next value for t1;
+next value for t1
+13
+do setval(t1,15,0);
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+21 0
+select next value for t1;
+next value for t1
+15
+select setval(t1,16,0);
+setval(t1,16,0)
+16
+select next value for t1;
+next value for t1
+16
+do setval(t1,1000,0);
+select next value for t1;
+next value for t1
+1000
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+1010 0
+do setval(t1,2000,0);
+select next value for t1;
+next value for t1
+2000
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+2010 0
+select setval(t1,1000,0);
+setval(t1,1000,0)
+NULL
+select next value for t1;
+next value for t1
+2001
+select setval(t1,1000,TRUE);
+setval(t1,1000,TRUE)
+NULL
+select next value for t1;
+next value for t1
+2002
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+2010 0
+select setval(t1,2002,0);
+setval(t1,2002,0)
+NULL
+select next value for t1;
+next value for t1
+2003
+select setval(t1,2010,0);
+setval(t1,2010,0)
+2010
+select next value for t1;
+next value for t1
+2010
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+2020 0
+drop sequence t1;
+#
+# Testing with cycle
+#
+CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb;
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+1 0
+select setval(t1,100,0);
+setval(t1,100,0)
+100
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+100 0
+select next value for t1;
+next value for t1
+100
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+101 0
+select setval(t1,100,0);
+setval(t1,100,0)
+NULL
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+101 0
+select next value for t1;
+next value for t1
+1
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+11 1
+select next value for t1;
+next value for t1
+2
+select setval(t1,100,0,1);
+setval(t1,100,0,1)
+100
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+100 1
+select next value for t1;
+next value for t1
+100
+select setval(t1,100,1,2);
+setval(t1,100,1,2)
+100
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+101 2
+select next value for t1;
+next value for t1
+1
+select setval(t1,100,0,3);
+setval(t1,100,0,3)
+100
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+100 3
+select next value for t1;
+next value for t1
+100
+drop sequence t1;
+#
+# Testing extreme values
+#
+CREATE SEQUENCE t1 cache=10 maxvalue=100 engine=innodb;
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+1 0
+select setval(t1,200);
+setval(t1,200)
+200
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+101 0
+select next value for t1;
+ERROR HY000: Sequence 'test.t1' has run out
+drop sequence t1;
+CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb;
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+1 0
+select setval(t1,200);
+setval(t1,200)
+200
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+101 0
+select next value for t1;
+next value for t1
+1
+drop sequence t1;
+CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10;
+select setval(t1,-10);
+setval(t1,-10)
+-10
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+-20 0
+select next value for t1;
+next value for t1
+-20
+select setval(t1,-15);
+setval(t1,-15)
+NULL
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+-120 0
+select next value for t1;
+next value for t1
+-30
+select setval(t1,-500,FALSE);
+setval(t1,-500,FALSE)
+-500
+select next value for t1;
+next value for t1
+-500
+select next value for t1;
+next value for t1
+-510
+select setval(t1,-525,0);
+setval(t1,-525,0)
+-525
+select next value for t1;
+next value for t1
+-525
+select next value for t1;
+next value for t1
+-535
+drop sequence t1;
+CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10;
+select setval(t1,-10,0);
+setval(t1,-10,0)
+-10
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+-10 0
+select next value for t1;
+next value for t1
+-10
+drop sequence t1;
+#
+# Other testing
+#
+CREATE SEQUENCE t1;
+select setval(t1,10,0),setval(t1,15,1),setval(t1,5,1);
+setval(t1,10,0) setval(t1,15,1) setval(t1,5,1)
+10 15 NULL
+select next value for t1;
+next value for t1
+16
+select next_not_cached_value,cycle_count from t1;
+next_not_cached_value cycle_count
+1016 0
+explain extended select setval(t1,100),setval(t1,100,TRUE),setval(t1,100,FALSE,50);
+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 setval(`test`.`t1`,100,1,0) AS `setval(t1,100)`,setval(`test`.`t1`,100,1,0) AS `setval(t1,100,TRUE)`,setval(`test`.`t1`,100,0,50) AS `setval(t1,100,FALSE,50)`
+drop sequence t1;
+create table t1 (a int);
+select setval(t1,10);
+ERROR 42S02: 'test.t1' is not a SEQUENCE
+drop table t1;
+#
+# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+#
+CREATE SEQUENCE s1;
+SELECT SETVAL(s1,10);
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def SETVAL(s1,10) 8 20 2 Y 32896 0 63
+SETVAL(s1,10)
+10
+DROP SEQUENCE s1;
+#
+# MDEV-15732: Assertion `next_free_value % real_increment == offset &&
+# next_free_value >= reserved_until' failed in
+# sequence_definition::adjust_values upon SETVAL for sequence with
+# INCREMENT 0
+#
+CREATE SEQUENCE s INCREMENT 0;
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+1
+SELECT SETVAL(s, 10);
+SETVAL(s, 10)
+10
+DROP SEQUENCE s;
+# End of 10.3 tests
diff --git a/mysql-test/suite/sql_sequence/setval.test b/mysql-test/suite/sql_sequence/setval.test
new file mode 100644
index 00000000000..1993bdbe077
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/setval.test
@@ -0,0 +1,156 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+drop table if exists t1;
+
+--echo #
+--echo # Test setval function
+--echo #
+
+CREATE SEQUENCE t1 cache 10 engine=myisam;
+select next_not_cached_value,cycle_count from t1;
+do setval(t1,10);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+do setval(t1,12,1);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+do setval(t1,15,0);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select setval(t1,16,0);
+select next value for t1;
+do setval(t1,1000,0);
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+do setval(t1,2000,0);
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+# Set smaller value
+select setval(t1,1000,0);
+select next value for t1;
+select setval(t1,1000,TRUE);
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select setval(t1,2002,0);
+select next value for t1;
+select setval(t1,2010,0);
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+drop sequence t1;
+
+--echo #
+--echo # Testing with cycle
+--echo #
+
+CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb;
+select next_not_cached_value,cycle_count from t1;
+select setval(t1,100,0);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select setval(t1,100,0);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select setval(t1,100,0,1);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select setval(t1,100,1,2);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select setval(t1,100,0,3);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+drop sequence t1;
+
+--echo #
+--echo # Testing extreme values
+--echo #
+
+CREATE SEQUENCE t1 cache=10 maxvalue=100 engine=innodb;
+select next_not_cached_value,cycle_count from t1;
+select setval(t1,200);
+select next_not_cached_value,cycle_count from t1;
+--error ER_SEQUENCE_RUN_OUT
+select next value for t1;
+drop sequence t1;
+
+CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb;
+select next_not_cached_value,cycle_count from t1;
+select setval(t1,200);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+drop sequence t1;
+
+CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10;
+select setval(t1,-10);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select setval(t1,-15);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+select setval(t1,-500,FALSE);
+select next value for t1;
+select next value for t1;
+select setval(t1,-525,0);
+select next value for t1;
+select next value for t1;
+drop sequence t1;
+
+CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10;
+select setval(t1,-10,0);
+select next_not_cached_value,cycle_count from t1;
+select next value for t1;
+drop sequence t1;
+
+--echo #
+--echo # Other testing
+--echo #
+
+CREATE SEQUENCE t1;
+select setval(t1,10,0),setval(t1,15,1),setval(t1,5,1);
+select next value for t1;
+select next_not_cached_value,cycle_count from t1;
+explain extended select setval(t1,100),setval(t1,100,TRUE),setval(t1,100,FALSE,50);
+drop sequence t1;
+
+#
+# Some error testing
+#
+
+create table t1 (a int);
+--error ER_NOT_SEQUENCE
+select setval(t1,10);
+drop table t1;
+
+
+--echo #
+--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
+--echo #
+
+--enable_metadata
+--disable_ps_protocol
+CREATE SEQUENCE s1;
+SELECT SETVAL(s1,10);
+DROP SEQUENCE s1;
+--enable_ps_protocol
+--disable_metadata
+
+--echo #
+--echo # MDEV-15732: Assertion `next_free_value % real_increment == offset &&
+--echo # next_free_value >= reserved_until' failed in
+--echo # sequence_definition::adjust_values upon SETVAL for sequence with
+--echo # INCREMENT 0
+--echo #
+
+CREATE SEQUENCE s INCREMENT 0;
+SELECT NEXTVAL(s);
+SELECT SETVAL(s, 10);
+
+# Cleanup
+DROP SEQUENCE s;
+
+
+--echo # End of 10.3 tests
diff --git a/mysql-test/suite/sql_sequence/slave_nextval.result b/mysql-test/suite/sql_sequence/slave_nextval.result
new file mode 100644
index 00000000000..bfbc472e117
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/slave_nextval.result
@@ -0,0 +1,108 @@
+include/master-slave.inc
+[connection master]
+CREATE SEQUENCE s;
+INSERT INTO s VALUES (1,1,4,1,1,1,0,0);
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 4 increment by 1 cache 1 nocycle ENGINE=MyISAM
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+1
+connection slave;
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+2
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+3
+connection master;
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+2
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+3
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+4
+select * from s;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 4 1 1 1 0 0
+connection slave;
+select * from s;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+5 1 4 1 1 1 0 0
+connection master;
+DROP SEQUENCE s;
+CREATE SEQUENCE s;
+INSERT INTO s VALUES (1,1,3,1,1,1,1,0);
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 3 increment by 1 cache 1 cycle ENGINE=MyISAM
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+1
+connection slave;
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+2
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+3
+connection master;
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+2
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+3
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+1
+select * from s;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2 1 3 1 1 1 1 1
+connection slave;
+select * from s;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+2 1 3 1 1 1 1 1
+connection master;
+DROP SEQUENCE s;
+CREATE SEQUENCE s;
+INSERT INTO s VALUES (1,1,3,1,1,1,1,0);
+SELECT NEXTVAL(s);
+NEXTVAL(s)
+1
+CREATE PROCEDURE pr(n INT)
+BEGIN
+DECLARE i INT DEFAULT 0;
+WHILE i < n
+DO
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+SET i= i+1;
+END WHILE;
+END $
+connect con1,localhost,root,,;
+CALL pr(100);
+connect con2,localhost,root,,;
+CALL pr(100);
+connect con3,localhost,root,,;
+CALL pr(100);
+connect con4,localhost,root,,;
+CALL pr(100);
+connect con5,localhost,root,,;
+CALL pr(100);
+connect con6,localhost,root,,;
+CALL pr(100);
+connect con7,localhost,root,,;
+CALL pr(100);
+connect con8,localhost,root,,;
+CALL pr(100);
+connection master;
+connection slave;
+connection master;
+DROP SEQUENCE s;
+DROP PROCEDURE pr;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/slave_nextval.test b/mysql-test/suite/sql_sequence/slave_nextval.test
new file mode 100644
index 00000000000..70da1044540
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/slave_nextval.test
@@ -0,0 +1,132 @@
+--source include/master-slave.inc
+--source include/have_binlog_format_row.inc
+
+#
+# MDEV-14092 NEXTVAL() fails on slave
+#
+
+CREATE SEQUENCE s;
+INSERT INTO s VALUES (1,1,4,1,1,1,0,0);
+show create sequence s;
+SELECT NEXTVAL(s);
+
+--sync_slave_with_master
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+
+--connection master
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+
+select * from s;
+
+--sync_slave_with_master
+
+select * from s;
+--connection master
+DROP SEQUENCE s;
+
+#
+# Same as above, but with cycles
+#
+
+CREATE SEQUENCE s;
+INSERT INTO s VALUES (1,1,3,1,1,1,1,0);
+show create sequence s;
+SELECT NEXTVAL(s);
+
+--sync_slave_with_master
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+
+--connection master
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+
+select * from s;
+
+--sync_slave_with_master
+
+select * from s;
+
+--connection master
+DROP SEQUENCE s;
+
+# Here is a bit more complicated concurrent scenario that
+# causes the same effect without any updates on the slave. You might
+# need to replace 100 with a bigger value if it doesn't happen on your
+# machine right away.
+
+CREATE SEQUENCE s;
+INSERT INTO s VALUES (1,1,3,1,1,1,1,0);
+SELECT NEXTVAL(s);
+
+--delimiter $
+CREATE PROCEDURE pr(n INT)
+BEGIN
+DECLARE i INT DEFAULT 0;
+WHILE i < n
+DO
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+SELECT NEXTVAL(s);
+SET i= i+1;
+END WHILE;
+END $
+--delimiter ;
+
+--connect (con1,localhost,root,,)
+--send CALL pr(100)
+--connect (con2,localhost,root,,)
+--send CALL pr(100)
+--connect (con3,localhost,root,,)
+--send CALL pr(100)
+--connect (con4,localhost,root,,)
+--send CALL pr(100)
+--connect (con5,localhost,root,,)
+--send CALL pr(100)
+--connect (con6,localhost,root,,)
+--send CALL pr(100)
+--connect (con7,localhost,root,,)
+--send CALL pr(100)
+--connect (con8,localhost,root,,)
+--send CALL pr(100)
+
+
+--disable_query_log
+--disable_result_log
+
+--connection con1
+--reap
+--connection con2
+--reap
+--connection con3
+--reap
+--connection con4
+--reap
+--connection con5
+--reap
+--connection con6
+--reap
+--connection con7
+--reap
+--connection con8
+--reap
+
+--enable_query_log
+--enable_result_log
+
+--connection master
+
+--sync_slave_with_master
+
+--connection master
+DROP SEQUENCE s;
+DROP PROCEDURE pr;
+
+#
+# Cleanup
+#
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/temporary.result b/mysql-test/suite/sql_sequence/temporary.result
new file mode 100644
index 00000000000..b5c70fd3a50
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/temporary.result
@@ -0,0 +1,43 @@
+#
+# Create
+#
+create temporary sequence s1 engine=innodb;
+alter table s1 engine myisam;
+select nextval(s1);
+nextval(s1)
+1
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1001 1 9223372036854775806 1 1 1000 0 0
+drop temporary sequence s1;
+#
+# MDEV-14762 Server crashes in MDL_ticket::has_stronger_or_equal_type
+# upon inserting into temporary sequence
+#
+CREATE TEMPORARY SEQUENCE s1 ENGINE=InnoDB;
+INSERT INTO s1 VALUES (1, 1, 1000, 1, 1, 1, 1, 0);
+DROP TEMPORARY SEQUENCE s1;
+#
+# MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong
+#
+create temporary sequence s1 engine=aria;
+alter table s1 engine myisam;
+select nextval(s1);
+nextval(s1)
+1
+drop temporary sequence s1;
+create temporary sequence s1 engine=innodb;
+alter table s1 engine myisam;
+select nextval(s1);
+nextval(s1)
+1
+drop temporary sequence s1;
+create temporary sequence s1;
+alter table s1 engine innodb;
+select nextval(s1);
+nextval(s1)
+1
+select nextval(s1);
+nextval(s1)
+2
+drop temporary sequence s1;
diff --git a/mysql-test/suite/sql_sequence/temporary.test b/mysql-test/suite/sql_sequence/temporary.test
new file mode 100644
index 00000000000..aeacf6e9497
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/temporary.test
@@ -0,0 +1,43 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+#
+# Test temporary sequences
+#
+
+--echo #
+--echo # Create
+--echo #
+
+create temporary sequence s1 engine=innodb;
+alter table s1 engine myisam;
+select nextval(s1);
+select * from s1;
+drop temporary sequence s1;
+
+--echo #
+--echo # MDEV-14762 Server crashes in MDL_ticket::has_stronger_or_equal_type
+--echo # upon inserting into temporary sequence
+--echo #
+
+CREATE TEMPORARY SEQUENCE s1 ENGINE=InnoDB;
+INSERT INTO s1 VALUES (1, 1, 1000, 1, 1, 1, 1, 0);
+DROP TEMPORARY SEQUENCE s1;
+
+--echo #
+--echo # MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong
+--echo #
+
+create temporary sequence s1 engine=aria;
+alter table s1 engine myisam;
+select nextval(s1);
+drop temporary sequence s1;
+create temporary sequence s1 engine=innodb;
+alter table s1 engine myisam;
+select nextval(s1);
+drop temporary sequence s1;
+create temporary sequence s1;
+alter table s1 engine innodb;
+select nextval(s1);
+select nextval(s1);
+drop temporary sequence s1;
diff --git a/mysql-test/suite/sql_sequence/view.result b/mysql-test/suite/sql_sequence/view.result
new file mode 100644
index 00000000000..0f39a637deb
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/view.result
@@ -0,0 +1,36 @@
+create sequence s1;
+create view v1 as select * from s1;
+create view v2 as select next value for s1;
+select * from v1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select * from v2;
+next value for s1
+1
+select * from v2;
+next value for s1
+2
+select next value for v1;
+ERROR 42S02: 'test.v1' is not a SEQUENCE
+drop sequence s1;
+drop view v1,v2;
+#
+# MDEV 13020 Server crashes in Item_func_nextval::val_int upon
+# selecting NEXT or PREVIOUS VALUE for a view
+#
+CREATE OR REPLACE VIEW v1 AS SELECT 1 AS f;
+SELECT NEXT VALUE FOR v1;
+ERROR 42S02: 'test.v1' is not a SEQUENCE
+SELECT PREVIOUS VALUE FOR v1;
+ERROR 42S02: 'test.v1' is not a SEQUENCE
+drop view v1;
+#
+# MDEV 17978 Server crashes in mysqld_show_create_get_fields
+# upon SHOW CREATE SEQUENCE on a broken view
+#
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP TABLE t1;
+SHOW CREATE SEQUENCE v1;
+ERROR 42S02: 'test.v1' is not a SEQUENCE
+DROP VIEW v1;
diff --git a/mysql-test/suite/sql_sequence/view.test b/mysql-test/suite/sql_sequence/view.test
new file mode 100644
index 00000000000..5b970432a34
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/view.test
@@ -0,0 +1,40 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+#
+# Test sequences with views
+#
+
+create sequence s1;
+create view v1 as select * from s1;
+create view v2 as select next value for s1;
+select * from v1;
+select * from v2;
+select * from v2;
+--error ER_NOT_SEQUENCE
+select next value for v1;
+drop sequence s1;
+drop view v1,v2;
+
+--echo #
+--echo # MDEV 13020 Server crashes in Item_func_nextval::val_int upon
+--echo # selecting NEXT or PREVIOUS VALUE for a view
+--echo #
+
+CREATE OR REPLACE VIEW v1 AS SELECT 1 AS f;
+--error ER_NOT_SEQUENCE
+SELECT NEXT VALUE FOR v1;
+--error ER_NOT_SEQUENCE
+SELECT PREVIOUS VALUE FOR v1;
+drop view v1;
+
+--echo #
+--echo # MDEV 17978 Server crashes in mysqld_show_create_get_fields
+--echo # upon SHOW CREATE SEQUENCE on a broken view
+--echo #
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP TABLE t1;
+--error ER_NOT_SEQUENCE
+SHOW CREATE SEQUENCE v1;
+DROP VIEW v1;
diff --git a/mysql-test/suite/storage_engine/alter_table_online.result b/mysql-test/suite/storage_engine/alter_table_online.result
index 574c46f8cda..2a27c5d108e 100644
--- a/mysql-test/suite/storage_engine/alter_table_online.result
+++ b/mysql-test/suite/storage_engine/alter_table_online.result
@@ -24,7 +24,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAG
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>;
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
+ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type. Try LOCK=SHARED.
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
DROP TABLE t1;
diff --git a/mysql-test/suite/storage_engine/autoincrement.result b/mysql-test/suite/storage_engine/autoincrement.result
index 44cb8650441..541486e44de 100644
--- a/mysql-test/suite/storage_engine/autoincrement.result
+++ b/mysql-test/suite/storage_engine/autoincrement.result
@@ -51,15 +51,15 @@ LAST_INSERT_ID()
5
SET sql_mode = '<INITIAL_SQL_MODE>';
SHOW TABLE STATUS FROM test 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 <STORAGE_ENGINE> # # # # # # # # 6 # # # # # # #
+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 Max_index_length Temporary
+t1 <STORAGE_ENGINE> # # # # # # # # 6 # # # # # # # # N
INSERT INTO t1 (a,b) VALUES (6,'g'),(7,'h');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
5
SHOW TABLE STATUS FROM test 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 # # # # # # # # # 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 Max_index_length Temporary
+t1 # # # # # # # # # 8 # # # # # # # # N
INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j');
SELECT a,b FROM t1 ORDER BY a;
a b
@@ -77,12 +77,12 @@ SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
8
SHOW TABLE STATUS FROM test 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 # # # # # # # # # 10 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 10 # # # # # # # # N
INSERT INTO t1 (a,b) VALUES (20,'k');
SHOW TABLE STATUS FROM test 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 # # # # # # # # # 21 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 21 # # # # # # # # N
INSERT INTO t1 (a,b) VALUES (NULL,'l');
SELECT a,b FROM t1 ORDER BY a;
a b
@@ -102,8 +102,8 @@ SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
21
SHOW TABLE STATUS FROM test 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 # # # # # # # # # 22 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 22 # # # # # # # # N
INSERT INTO t1 (a,b) VALUES (-5,'m');
SELECT a,b FROM t1 ORDER BY a;
a b
diff --git a/mysql-test/suite/storage_engine/autoincrement.test b/mysql-test/suite/storage_engine/autoincrement.test
index ddb0ab1b464..1ca0b650039 100644
--- a/mysql-test/suite/storage_engine/autoincrement.test
+++ b/mysql-test/suite/storage_engine/autoincrement.test
@@ -50,7 +50,7 @@ if (!$mysql_errname)
# SHOW TABLE STATUS shows the auto-increment value in column 11,
# that's all we need here and further
--source mask_engine.inc
- --replace_column 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS FROM test LIKE 't1';
# Mix of automatic and explicit values
@@ -58,7 +58,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (6,'g'),(7,'h');
SELECT LAST_INSERT_ID();
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS FROM test LIKE 't1';
@@ -66,21 +66,21 @@ if (!$mysql_errname)
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS FROM test LIKE 't1';
# Creating a gap in the sequence
INSERT INTO t1 (a,b) VALUES (20,'k');
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS FROM test LIKE 't1';
INSERT INTO t1 (a,b) VALUES (NULL,'l');
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS FROM test LIKE 't1';
# Negative values: we will try to insert one just to check that it does not cause a crash,
diff --git a/mysql-test/suite/storage_engine/create_table.result b/mysql-test/suite/storage_engine/create_table.result
index 6936854eb65..2ca144fe50c 100644
--- a/mysql-test/suite/storage_engine/create_table.result
+++ b/mysql-test/suite/storage_engine/create_table.result
@@ -27,7 +27,7 @@ CREATE TABLE t1 ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AS SELECT 1 UNION
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `1` bigint(20) NOT NULL DEFAULT 0
+ `1` int(1) NOT NULL DEFAULT 0
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1
SELECT * FROM t1;
1
diff --git a/mysql-test/suite/storage_engine/misc.result b/mysql-test/suite/storage_engine/misc.result
index 3643611aa49..43d6a131b3a 100644
--- a/mysql-test/suite/storage_engine/misc.result
+++ b/mysql-test/suite/storage_engine/misc.result
@@ -94,5 +94,7 @@ time_zone_transition Time_zone_id NULL NULL
time_zone_transition Transition_time NULL NULL
time_zone_transition_type Time_zone_id NULL NULL
time_zone_transition_type Transition_type_id NULL NULL
+transaction_registry commit_id NULL NULL
+transaction_registry transaction_id NULL NULL
user Host NULL NULL
user User NULL NULL
diff --git a/mysql-test/suite/storage_engine/parts/repair_table.result b/mysql-test/suite/storage_engine/parts/repair_table.result
index 727c648ef6f..63131250a01 100644
--- a/mysql-test/suite/storage_engine/parts/repair_table.result
+++ b/mysql-test/suite/storage_engine/parts/repair_table.result
@@ -101,6 +101,7 @@ INSERT INTO t1 (a,b) VALUES (10,'j');
REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
test.t1 repair status OK
+db.opt
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
@@ -125,7 +126,6 @@ a b
15 o
Warnings:
Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired
-Error 1194 Table 't1' is marked as crashed and should be repaired
Error 1034 Number of rows changed from 3 to 2
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
@@ -151,7 +151,6 @@ a b
15 o
Warnings:
Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired
-Error 1194 Table 't1' is marked as crashed and should be repaired
Error 1034 Number of rows changed from 2 to 3
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
@@ -176,7 +175,6 @@ a b
15 o
Warnings:
Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired
-Error 1194 Table 't1' is marked as crashed and should be repaired
Error 1034 Number of rows changed from 4 to 3
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
@@ -205,7 +203,6 @@ a b
15 o
Warnings:
Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired
-Error 1194 Table 't1' is marked as crashed and should be repaired
Error 1034 Number of rows changed from 3 to 4
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
diff --git a/mysql-test/suite/storage_engine/repair_table.result b/mysql-test/suite/storage_engine/repair_table.result
index d518e47756f..cbd861647ea 100644
--- a/mysql-test/suite/storage_engine/repair_table.result
+++ b/mysql-test/suite/storage_engine/repair_table.result
@@ -73,6 +73,7 @@ REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 3
test.t1 repair status OK
+db.opt
t1.MYD
t1.MYI
t1.frm
diff --git a/mysql-test/suite/storage_engine/show_table_status.result b/mysql-test/suite/storage_engine/show_table_status.result
index 98de48f816b..b020bbe6a00 100644
--- a/mysql-test/suite/storage_engine/show_table_status.result
+++ b/mysql-test/suite/storage_engine/show_table_status.result
@@ -23,6 +23,8 @@ Collation latin1_swedish_ci
Checksum NULL
Create_options
Comment
+Max_index_length ###
+Temporary N
Name t2
Engine <STORAGE_ENGINE>
Version 10
@@ -41,6 +43,8 @@ Collation latin1_swedish_ci
Checksum NULL
Create_options
Comment
+Max_index_length ###
+Temporary N
Name t3
Engine <STORAGE_ENGINE>
Version 10
@@ -59,4 +63,6 @@ Collation utf8_general_ci
Checksum NULL
Create_options
Comment
+Max_index_length ###
+Temporary N
DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/storage_engine/show_table_status.test b/mysql-test/suite/storage_engine/show_table_status.test
index 469d7e33a20..2fd5c6a706a 100644
--- a/mysql-test/suite/storage_engine/show_table_status.test
+++ b/mysql-test/suite/storage_engine/show_table_status.test
@@ -22,7 +22,7 @@ INSERT INTO t2 (a,b) VALUES (1,'bar');
--let $table_options = CHARACTER SET utf8
--source create_table.inc
---replace_column 2 <STORAGE_ENGINE> 4 ### 6 ### 7 ### 8 ### 9 ### 10 ### 12 ### 13 ###
+--replace_column 2 <STORAGE_ENGINE> 4 ### 6 ### 7 ### 8 ### 9 ### 10 ### 12 ### 13 ### 19 ###
--query_vertical SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' )
DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/storage_engine/truncate_table.result b/mysql-test/suite/storage_engine/truncate_table.result
index d8dc5046442..eac58272e48 100644
--- a/mysql-test/suite/storage_engine/truncate_table.result
+++ b/mysql-test/suite/storage_engine/truncate_table.result
@@ -8,20 +8,20 @@ a b
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
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 # # # # # # # # # 1 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 1 # # # # # # # # N
INSERT INTO t1 (c) VALUES ('a'),('b'),('c');
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 # # # # # # # # # 4 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 4 # # # # # # # # N
TRUNCATE TABLE t1;
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 # # # # # # # # # 1 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 1 # # # # # # # # N
INSERT INTO t1 (c) VALUES ('d');
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 # # # # # # # # # 2 # # # # # # #
+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 Max_index_length Temporary
+t1 # # # # # # # # # 2 # # # # # # # # N
SELECT a,c FROM t1;
a c
1 d
diff --git a/mysql-test/suite/storage_engine/truncate_table.test b/mysql-test/suite/storage_engine/truncate_table.test
index a9277b39619..6a6301f4be0 100644
--- a/mysql-test/suite/storage_engine/truncate_table.test
+++ b/mysql-test/suite/storage_engine/truncate_table.test
@@ -36,19 +36,19 @@ if ($mysql_errname)
}
if (!$mysql_errname)
{
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS LIKE 't1';
INSERT INTO t1 (c) VALUES ('a'),('b'),('c');
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS LIKE 't1';
TRUNCATE TABLE t1;
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS LIKE 't1';
INSERT INTO t1 (c) VALUES ('d');
- --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+ --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 #
SHOW TABLE STATUS LIKE 't1';
SELECT a,c FROM t1;
diff --git a/mysql-test/suite/sys_vars/disabled.def b/mysql-test/suite/sys_vars/disabled.def
index 872474cb1e9..24c3c7a26c6 100644
--- a/mysql-test/suite/sys_vars/disabled.def
+++ b/mysql-test/suite/sys_vars/disabled.def
@@ -10,6 +10,5 @@
#
##############################################################################
-innodb_flush_checkpoint_debug_basic: removed from XtraDB-26.0
all_vars: obsolete, see sysvars_* tests
innodb_buffer_pool_dump_pct_function: MDEV-11454 follow-up needed (unstable)
diff --git a/mysql-test/suite/sys_vars/inc/secure_timestamp_func.inc b/mysql-test/suite/sys_vars/inc/secure_timestamp_func.inc
new file mode 100644
index 00000000000..8bc3e42df59
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/secure_timestamp_func.inc
@@ -0,0 +1,49 @@
+#
+# MDEV-15923 option to control who can set session @@timestamp
+#
+source include/have_binlog_format_statement.inc;
+source include/master-slave.inc;
+
+connection slave;
+select @@secure_timestamp;
+
+### SUPER
+disable_abort_on_error;
+set timestamp=1234567890.101112;
+enable_abort_on_error;
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'SUPER';
+
+### non-privileged user
+create user foo@127.0.0.1;
+connect con2,127.0.0.1,foo,,test,$SLAVE_MYPORT;
+disable_abort_on_error;
+set timestamp=1234567890.101112;
+enable_abort_on_error;
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'non-privileged';
+disconnect con2;
+connection slave;
+drop user foo@127.0.0.1;
+
+### replication
+connection master;
+set time_zone='+00:00';
+set timestamp=1234567890.101112;
+select @@timestamp, now(6);
+
+create table t1 (b varchar(20), a timestamp(6) default current_timestamp(6));
+insert t1 (b) values ('replicated');
+sync_slave_with_master;
+create trigger t1rbr before insert on t1 for each row set new.a=now(6);
+set @@global.slave_run_triggers_for_rbr= yes;
+binlog 'LQfqWg8BAAAA/AAAAAABAAABAAQAMTAuMy42LU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtB+paEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEwQADQgICAoKCgFlBcaR';
+binlog '0gKWSRMBAAAAMQAAAHQDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIPEQMUAAYBQFUzwA==0gKWSRcBAAAAMAAAAKQDAAAAAB8AAAAAAAEAAv/8BmJpbmxvZ0mWAtIBivg3mwo+';
+set @@global.slave_run_triggers_for_rbr= default;
+select b, if(a > 20100101, 'READONLY', 'EDITABLE') as 'REPLICATION' from t1;
+connection master;
+#set binlog_format=row;
+#insert t1 (b) values ('binlog');
+#let datadir=`select @@datadir`;
+#exec $MYSQL_BINLOG $datadir/master-bin.000001;
+drop table t1;
+
+source include/rpl_end.inc;
diff --git a/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result b/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result
new file mode 100644
index 00000000000..39cfad4d35c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result
@@ -0,0 +1,89 @@
+SET @start_global_value = @@global.alter_algorithm;
+SET GLOBAL alter_algorithm=1.1;
+ERROR 42000: Incorrect argument type to variable 'alter_algorithm'
+SET GLOBAL alter_algorithm=-1;
+ERROR 42000: Variable 'alter_algorithm' can't be set to the value of '-1'
+SET GLOBAL alter_algorithm=weird;
+ERROR 42000: Variable 'alter_algorithm' can't be set to the value of 'weird'
+SET GLOBAL alter_algorithm=4;
+SELECT @@global.alter_algorithm;
+@@global.alter_algorithm
+INSTANT
+SET GLOBAL alter_algorithm=3;
+SELECT @@global.alter_algorithm;
+@@global.alter_algorithm
+NOCOPY
+SET GLOBAL alter_algorithm=0;
+SELECT @@global.alter_algorithm;
+@@global.alter_algorithm
+DEFAULT
+SET GLOBAL alter_algorithm=1;
+SELECT @@global.alter_algorithm;
+@@global.alter_algorithm
+COPY
+SET GLOBAL alter_algorithm=2;
+SELECT @@global.alter_algorithm;
+@@global.alter_algorithm
+INPLACE
+SET GLOBAL alter_algorithm=5;
+ERROR 42000: Variable 'alter_algorithm' can't be set to the value of '5'
+SELECT @@global.alter_algorithm;
+@@global.alter_algorithm
+INPLACE
+SET GLOBAL alter_algorithm=NOCOPY;
+SET alter_algorithm=1.1;
+ERROR 42000: Incorrect argument type to variable 'alter_algorithm'
+SET alter_algorithm=-1;
+ERROR 42000: Variable 'alter_algorithm' can't be set to the value of '-1'
+SET alter_algorithm=weird;
+ERROR 42000: Variable 'alter_algorithm' can't be set to the value of 'weird'
+SET alter_algorithm=4;
+SELECT @@alter_algorithm;
+@@alter_algorithm
+INSTANT
+SET alter_algorithm=3;
+SELECT @@alter_algorithm;
+@@alter_algorithm
+NOCOPY
+SET alter_algorithm=0;
+SELECT @@alter_algorithm;
+@@alter_algorithm
+DEFAULT
+SET alter_algorithm=1;
+SELECT @@alter_algorithm;
+@@alter_algorithm
+COPY
+SET alter_algorithm=2;
+SELECT @@alter_algorithm;
+@@alter_algorithm
+INPLACE
+SET alter_algorithm=5;
+ERROR 42000: Variable 'alter_algorithm' can't be set to the value of '5'
+SELECT @@alter_algorithm;
+@@alter_algorithm
+INPLACE
+SET SESSION alter_algorithm=INSTANT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+Variable_name Value
+alter_algorithm INSTANT
+SET SESSION alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+Variable_name Value
+alter_algorithm NOCOPY
+SET SESSION alter_algorithm='DEFAULT';
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+Variable_name Value
+alter_algorithm DEFAULT
+SET SESSION alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+Variable_name Value
+alter_algorithm NOCOPY
+SET GLOBAL alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+Variable_name Value
+alter_algorithm NOCOPY
+SET SESSION alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+Variable_name Value
+alter_algorithm DEFAULT
+SET GLOBAL alter_algorithm = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
index 98072169fc9..760cca25497 100644
--- a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
+++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
@@ -84,12 +84,8 @@ SELECT @@automatic_sp_privileges = @@global.automatic_sp_privileges;
'#---------------------FN_DYNVARS_004_10----------------------#'
SET automatic_sp_privileges = 1;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should be set with SET GLOBAL
-SET local.automatic_sp_privileges = 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 'automatic_sp_privileges = 1' at line 1
SELECT local.automatic_sp_privileges;
ERROR 42S02: Unknown table 'local' in field list
-SET global.automatic_sp_privileges = 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 'automatic_sp_privileges = 1' at line 1
SELECT global.automatic_sp_privileges;
ERROR 42S02: Unknown table 'global' in field list
SELECT automatic_sp_privileges = @@session.automatic_sp_privileges;
diff --git a/mysql-test/suite/sys_vars/r/big_tables_basic.result b/mysql-test/suite/sys_vars/r/big_tables_basic.result
index 4ff5774812a..29781987d47 100644
--- a/mysql-test/suite/sys_vars/r/big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/big_tables_basic.result
@@ -86,12 +86,8 @@ SET big_tables = 1;
SELECT @@big_tables;
@@big_tables
1
-SET local.big_tables = 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 'big_tables = 1' at line 1
SELECT local.big_tables;
ERROR 42S02: Unknown table 'local' in field list
-SET session.big_tables = 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 'big_tables = 1' at line 1
SELECT session.big_tables;
ERROR 42S02: Unknown table 'session' in field list
select big_tables;
diff --git a/mysql-test/suite/sys_vars/r/bind_address_basic.result b/mysql-test/suite/sys_vars/r/bind_address_basic.result
new file mode 100644
index 00000000000..f360433a90c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/bind_address_basic.result
@@ -0,0 +1,57 @@
+'#---------------------BS_STVARS_001_01----------------------#'
+SELECT COUNT(@@GLOBAL.bind_address);
+COUNT(@@GLOBAL.bind_address)
+1
+1 Expected
+'#---------------------BS_STVARS_001_02----------------------#'
+SET @@GLOBAL.bind_address=1;
+ERROR HY000: Variable 'bind_address' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.bind_address);
+COUNT(@@GLOBAL.bind_address)
+1
+1 Expected
+'#---------------------BS_STVARS_001_03----------------------#'
+SELECT VARIABLE_VALUE = ''
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='bind_address';
+VARIABLE_VALUE = ''
+0
+0 Expected
+SELECT COUNT(@@GLOBAL.bind_address);
+COUNT(@@GLOBAL.bind_address)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='bind_address';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_001_04----------------------#'
+SELECT @@bind_address is NULL AND @@GLOBAL.bind_address is NULL;
+@@bind_address is NULL AND @@GLOBAL.bind_address is NULL
+0
+0 Expected
+SELECT @@bind_address is NOT NULL AND @@GLOBAL.bind_address is NOT NULL;
+@@bind_address is NOT NULL AND @@GLOBAL.bind_address is NOT NULL
+1
+1 Expected
+'#---------------------BS_STVARS_001_05----------------------#'
+SELECT COUNT(@@bind_address);
+COUNT(@@bind_address)
+1
+1 Expected
+SELECT COUNT(@@local.bind_address);
+ERROR HY000: Variable 'bind_address' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.bind_address);
+ERROR HY000: Variable 'bind_address' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.bind_address);
+COUNT(@@GLOBAL.bind_address)
+1
+1 Expected
+SELECT bind_address = @@SESSION.bind_address;
+ERROR 42S22: Unknown column 'bind_address' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result
index fd4d036f3e9..faa21da6879 100644
--- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result
@@ -97,8 +97,6 @@ SELECT @@binlog_cache_size = @@global.binlog_cache_size;
'#---------------------FN_DYNVARS_006_09----------------------#'
SET binlog_cache_size = 1;
ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.binlog_cache_size = 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 'binlog_cache_size = 1' at line 1
SELECT global.binlog_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT binlog_cache_size = @@session.binlog_cache_size;
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result
index 20c45d5ace8..74cce393dbc 100644
--- a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result
@@ -97,8 +97,6 @@ SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
'#---------------------FN_DYNVARS_006_09----------------------#'
SET binlog_stmt_cache_size = 1;
ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.binlog_stmt_cache_size = 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 'binlog_stmt_cache_size = 1' at line 1
SELECT global.binlog_stmt_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result
index 1b8e000ad81..97083da7033 100644
--- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result
@@ -133,12 +133,8 @@ SET bulk_insert_buffer_size = 1;
SELECT @@bulk_insert_buffer_size;
@@bulk_insert_buffer_size
1
-SET local.bulk_insert_buffer_size = 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 'bulk_insert_buffer_size = 1' at line 1
SELECT local.bulk_insert_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
-SET session.bulk_insert_buffer_size = 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 'bulk_insert_buffer_size = 1' at line 1
SELECT session.bulk_insert_buffer_size;
ERROR 42S02: Unknown table 'session' in field list
SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
index 2c73d220dd3..1464c35cc20 100644
--- a/mysql-test/suite/sys_vars/r/character_set_client_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
@@ -19,8 +19,6 @@ SET character_set_client=utf8;
SELECT @@session.character_set_client;
@@session.character_set_client
utf8
-SET global.character_set_client=utf8;
-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 'character_set_client=utf8' at line 1
SET session character_set_client=utf8;
SELECT session character_set_client;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
index b7e70d91c15..bb8273353fc 100644
--- a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
@@ -20,8 +20,6 @@ SET character_set_connection=utf8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
utf8
-SET global.character_set_connection=utf8;
-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 'character_set_connection=utf8' at line 1
SET session character_set_connection=utf8;
SELECT session character_set_connection;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/character_set_database_basic.result b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
index 819468ee909..9eb987381c6 100644
--- a/mysql-test/suite/sys_vars/r/character_set_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
@@ -22,8 +22,6 @@ SET character_set_database=utf8;
SELECT @@session.character_set_database;
@@session.character_set_database
utf8
-SET global.character_set_database=utf8;
-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 'character_set_database=utf8' at line 1
SET session character_set_database=utf8;
SELECT session character_set_database;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
index c1a77b73fb3..7a32f92deeb 100644
--- a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
@@ -21,8 +21,6 @@ SET character_set_filesystem=utf8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
utf8
-SET global.character_set_filesystem=utf8;
-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 'character_set_filesystem=utf8' at line 1
SET session character_set_filesystem=utf8;
SELECT session character_set_filesystem;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
index ff9d030a686..fc109940c41 100644
--- a/mysql-test/suite/sys_vars/r/character_set_results_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
Binary files differ
diff --git a/mysql-test/suite/sys_vars/r/character_set_server_basic.result b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
index 282252f55d1..c91c53e30c6 100644
--- a/mysql-test/suite/sys_vars/r/character_set_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
@@ -22,8 +22,6 @@ SET character_set_server=utf8;
SELECT @@session.character_set_server;
@@session.character_set_server
utf8
-SET global.character_set_server=utf8;
-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 'character_set_server=utf8' at line 1
SET session character_set_server=utf8;
SELECT session character_set_server;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/collation_connection_basic.result b/mysql-test/suite/sys_vars/r/collation_connection_basic.result
index 882366e6ed7..31c15a68f1c 100644
--- a/mysql-test/suite/sys_vars/r/collation_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_connection_basic.result
@@ -22,8 +22,6 @@ SET collation_connection=utf8_unicode_ci;
SELECT @@session.collation_connection;
@@session.collation_connection
utf8_unicode_ci
-SET global.collation_connection=utf8_unicode_ci;
-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 'collation_connection=utf8_unicode_ci' at line 1
SET session collation_connection=utf8_unicode_ci;
SELECT session collation_connection;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/collation_database_basic.result b/mysql-test/suite/sys_vars/r/collation_database_basic.result
index 5bd4afb81aa..ac2fcbe07fc 100644
--- a/mysql-test/suite/sys_vars/r/collation_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_basic.result
@@ -22,8 +22,6 @@ SET collation_database=utf8_unicode_ci;
SELECT @@session.collation_database;
@@session.collation_database
utf8_unicode_ci
-SET global.collation_database=utf8_unicode_ci;
-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 'collation_database=utf8_unicode_ci' at line 1
SET session collation_database=utf8_unicode_ci;
SELECT session collation_database;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/collation_server_basic.result b/mysql-test/suite/sys_vars/r/collation_server_basic.result
index a908b6f729b..13712622a33 100644
--- a/mysql-test/suite/sys_vars/r/collation_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_server_basic.result
@@ -19,8 +19,6 @@ SET collation_server=utf8_unicode_ci;
SELECT @@session.collation_server;
@@session.collation_server
utf8_unicode_ci
-SET global.collation_server=utf8_unicode_ci;
-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 'collation_server=utf8_unicode_ci' at line 1
SET session collation_server=utf8_unicode_ci;
SELECT session collation_server;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/completion_type_basic.result b/mysql-test/suite/sys_vars/r/completion_type_basic.result
index 9470a7e6100..7f468121219 100644
--- a/mysql-test/suite/sys_vars/r/completion_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/completion_type_basic.result
@@ -118,12 +118,8 @@ SET completion_type = 1;
SELECT @@completion_type;
@@completion_type
CHAIN
-SET local.completion_type = 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 'completion_type = 1' at line 1
SELECT local.completion_type;
ERROR 42S02: Unknown table 'local' in field list
-SET session.completion_type = 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 'completion_type = 1' at line 1
SELECT session.completion_type;
ERROR 42S02: Unknown table 'session' in field list
SELECT completion_type = @@session.completion_type;
diff --git a/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result b/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
index af3d25ff58e..92e6a167c01 100644
--- a/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
+++ b/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
@@ -101,8 +101,6 @@ ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set
SELECT @@concurrent_insert;
@@concurrent_insert
AUTO
-SET global.concurrent_insert = 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 'concurrent_insert = 1' at line 1
SELECT global.concurrent_insert;
ERROR 42S02: Unknown table 'global' in field list
SELECT concurrent_insert = @@session.concurrent_insert;
diff --git a/mysql-test/suite/sys_vars/r/connect_timeout_basic.result b/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
index 985ca925491..d0a6a650e21 100644
--- a/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
@@ -81,8 +81,6 @@ SELECT @@connect_timeout = @@global.connect_timeout;
'#---------------------FN_DYNVARS_019_09----------------------#'
SET connect_timeout = 1;
ERROR HY000: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.connect_timeout = 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 'connect_timeout = 1' at line 1
SELECT global.connect_timeout;
ERROR 42S02: Unknown table 'global' in field list
SELECT connect_timeout = @@session.connect_timeout;
diff --git a/mysql-test/suite/sys_vars/r/default_master_connection_basic.result b/mysql-test/suite/sys_vars/r/default_master_connection_basic.result
index 78425049324..bb82e3d5bd6 100644
--- a/mysql-test/suite/sys_vars/r/default_master_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_master_connection_basic.result
@@ -78,12 +78,8 @@ SET default_master_connection = 'foo';
SELECT @@default_master_connection;
@@default_master_connection
foo
-SET local.default_master_connection = 'foo';
-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 'default_master_connection = 'foo'' at line 1
SELECT local.default_master_connection;
ERROR 42S02: Unknown table 'local' in field list
-SET session.default_master_connection = 'foo';
-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 'default_master_connection = 'foo'' at line 1
SELECT session.default_master_connection;
ERROR 42S02: Unknown table 'session' in field list
SELECT default_master_connection = @@session.default_master_connection;
diff --git a/mysql-test/suite/sys_vars/r/default_week_format_basic.result b/mysql-test/suite/sys_vars/r/default_week_format_basic.result
index 1ba931734e9..4e9ee26ef9a 100644
--- a/mysql-test/suite/sys_vars/r/default_week_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_week_format_basic.result
@@ -151,12 +151,8 @@ SET default_week_format = 1;
SELECT @@default_week_format;
@@default_week_format
1
-SET local.default_week_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 'default_week_format = 1' at line 1
SELECT local.default_week_format;
ERROR 42S02: Unknown table 'local' in field list
-SET session.default_week_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 'default_week_format = 1' at line 1
SELECT session.default_week_format;
ERROR 42S02: Unknown table 'session' in field list
SELECT default_week_format = @@session.default_week_format;
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic.result
index 6acc2398bbd..f57fe02f810 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic.result
@@ -95,12 +95,8 @@ ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be
SELECT @@delayed_insert_limit;
@@delayed_insert_limit
1
-SET local.delayed_insert_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 'delayed_insert_limit = 1' at line 1
SELECT local.delayed_insert_limit;
ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_insert_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 'delayed_insert_limit = 1' at line 1
SELECT global.delayed_insert_limit;
ERROR 42S02: Unknown table 'global' in field list
SELECT delayed_insert_limit = @@session.delayed_insert_limit;
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result b/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
index 7b2f98e3682..f9978929698 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
@@ -93,12 +93,8 @@ ERROR HY000: Variable 'delayed_insert_timeout' is a GLOBAL variable and should b
SELECT @@delayed_insert_timeout;
@@delayed_insert_timeout
1
-SET local.delayed_insert_timeout = 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 'delayed_insert_timeout = 1' at line 1
SELECT local.delayed_insert_timeout;
ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_insert_timeout = 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 'delayed_insert_timeout = 1' at line 1
SELECT global.delayed_insert_timeout;
ERROR 42S02: Unknown table 'global' in field list
SELECT delayed_insert_timeout = @@session.delayed_insert_timeout;
diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic.result
index 04aad26f0e8..61bd04965fe 100644
--- a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic.result
@@ -93,12 +93,8 @@ ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be se
SELECT @@delayed_queue_size;
@@delayed_queue_size
1
-SET local.delayed_queue_size = 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 'delayed_queue_size = 1' at line 1
SELECT local.delayed_queue_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_queue_size = 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 'delayed_queue_size = 1' at line 1
SELECT global.delayed_queue_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT delayed_queue_size = @@session.delayed_queue_size;
diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
index 570824f8df6..db2fb18562f 100644
--- a/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
@@ -167,12 +167,8 @@ SET div_precision_increment = 1;
SELECT @@div_precision_increment;
@@div_precision_increment
1
-SET local.div_precision_increment = 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 'div_precision_increment = 1' at line 1
SELECT local.div_precision_increment;
ERROR 42S02: Unknown table 'local' in field list
-SET session.div_precision_increment = 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 'div_precision_increment = 1' at line 1
SELECT session.div_precision_increment;
ERROR 42S02: Unknown table 'session' in field list
SELECT div_precision_increment = @@session.div_precision_increment;
diff --git a/mysql-test/suite/sys_vars/r/event_scheduler_basic.result b/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
index 04d3f5e5888..920b9ebbbfa 100644
--- a/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
+++ b/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
@@ -83,12 +83,8 @@ SELECT @@event_scheduler = @@global.event_scheduler;
'#---------------------FN_DYNVARS_004_09----------------------#'
SET event_scheduler = ON;
ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
-SET local.event_scheduler = 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 'event_scheduler = OFF' at line 1
SELECT local.event_scheduler;
ERROR 42S02: Unknown table 'local' in field list
-SET global.event_scheduler = ON;
-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 'event_scheduler = ON' at line 1
SELECT global.event_scheduler;
ERROR 42S02: Unknown table 'global' in field list
SELECT event_scheduler = @@session.event_scheduler;
diff --git a/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result b/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
index 72ecb980161..ea6f29767d9 100644
--- a/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
+++ b/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
@@ -110,12 +110,8 @@ ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set
SELECT @@expire_logs_days;
@@expire_logs_days
1
-SET local.expire_logs_days = 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 'expire_logs_days = 1' at line 1
SELECT local.expire_logs_days;
ERROR 42S02: Unknown table 'local' in field list
-SET global.expire_logs_days = 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 'expire_logs_days = 1' at line 1
SELECT global.expire_logs_days;
ERROR 42S02: Unknown table 'global' in field list
SELECT expire_logs_days = @@session.expire_logs_days;
diff --git a/mysql-test/suite/sys_vars/r/flush_basic.result b/mysql-test/suite/sys_vars/r/flush_basic.result
index fabbf476052..78a2875f89e 100644
--- a/mysql-test/suite/sys_vars/r/flush_basic.result
+++ b/mysql-test/suite/sys_vars/r/flush_basic.result
@@ -83,8 +83,6 @@ SELECT @@flush = @@global.flush;
'#---------------------FN_DYNVARS_030_09----------------------#'
SET flush = 1;
ERROR HY000: Variable 'flush' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.flush = 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 'flush = 1' at line 1
SELECT global.flush;
ERROR 42S02: Unknown table 'global' in field list
SELECT flush = @@session.flush;
diff --git a/mysql-test/suite/sys_vars/r/general_log_basic.result b/mysql-test/suite/sys_vars/r/general_log_basic.result
index 1d16bc7c4d5..fe8e08e5e3b 100644
--- a/mysql-test/suite/sys_vars/r/general_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/general_log_basic.result
@@ -78,12 +78,8 @@ SELECT @@general_log = @@global.general_log;
'#---------------------FN_DYNVARS_004_09----------------------#'
SET general_log = ON;
ERROR HY000: Variable 'general_log' is a GLOBAL variable and should be set with SET GLOBAL
-SET local.general_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 'general_log = OFF' at line 1
SELECT local.general_log;
ERROR 42S02: Unknown table 'local' in field list
-SET global.general_log = ON;
-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 'general_log = ON' at line 1
SELECT global.general_log;
ERROR 42S02: Unknown table 'global' in field list
SELECT general_log = @@session.general_log;
diff --git a/mysql-test/suite/sys_vars/r/identity_basic.result b/mysql-test/suite/sys_vars/r/identity_basic.result
index 40111ead253..6238f7db3b8 100644
--- a/mysql-test/suite/sys_vars/r/identity_basic.result
+++ b/mysql-test/suite/sys_vars/r/identity_basic.result
@@ -108,12 +108,8 @@ SET identity = 1;
SELECT @@identity;
@@identity
1
-SET local.identity = 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 'identity = 1' at line 1
SELECT local.identity;
ERROR 42S02: Unknown table 'local' in field list
-SET session.identity = 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 'identity = 1' at line 1
SELECT session.identity;
ERROR 42S02: Unknown table 'session' in field list
SELECT identity = @@session.identity;
diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_method_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_method_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_method_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_partitions_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_partitions_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_partitions_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_blocking_buffer_pool_restore_basic.result b/mysql-test/suite/sys_vars/r/innodb_blocking_buffer_pool_restore_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_blocking_buffer_pool_restore_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_abort_loads.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_abort_loads.result
new file mode 100644
index 00000000000..1e2beea707e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_abort_loads.result
@@ -0,0 +1,95 @@
+
+# innodb_buffer_pool_load_incomplete defaults 0
+SELECT variable_name, variable_value
+FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_incomplete';
+variable_name variable_value
+INNODB_BUFFER_POOL_LOAD_INCOMPLETE OFF
+
+# populate with data
+CREATE TABLE t1 (
+c01 blob, c02 blob, c03 blob, c04 blob, c05 blob,
+c06 blob, c07 blob, c08 blob, c09 blob, c10 blob,
+c11 blob, c12 blob, c13 blob, c14 blob, c15 blob,
+c16 blob, c17 blob, c18 blob, c19 blob, c20 blob,
+c21 blob, c22 blob, c23 blob, c24 blob, c25 blob,
+c26 blob, c27 blob, c28 blob, c29 blob, c30 blob,
+c31 blob, c32 blob, c33 blob, c34 blob, c35 blob,
+c36 blob, c37 blob, c38 blob, c39 blob, c40 blob,
+c41 blob, c42 blob, c43 blob, c44 blob, c45 blob,
+c46 blob, c47 blob, c48 blob, c49 blob, c50 blob,
+c51 blob, c52 blob, c53 blob, c54 blob, c55 blob,
+c56 blob, c57 blob, c58 blob, c59 blob, c60 blob,
+c61 blob, c62 blob, c63 blob, c64 blob
+) ROW_FORMAT=dynamic;
+SET @a = repeat('a', 16 * 1024);
+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
+);
+SET GLOBAL innodb_buffer_pool_dump_now=1;
+
+# Restart server
+
+# Abort after 16 pages
+SET GLOBAL innodb_buffer_pool_load_pages_abort=16,
+GLOBAL innodb_buffer_pool_load_now=1,
+GLOBAL innodb_buffer_pool_dump_at_shutdown=1;
+SELECT variable_name, SUBSTR(variable_value, 1, 38) as VALUE
+FROM information_schema.global_status
+WHERE LOWER(variable_name) IN ('innodb_buffer_pool_load_incomplete','innodb_buffer_pool_load_status')
+ORDER BY variable_name;
+variable_name VALUE
+INNODB_BUFFER_POOL_LOAD_INCOMPLETE ON
+INNODB_BUFFER_POOL_LOAD_STATUS Buffer pool(s) load aborted on request
+
+# Restart server
+
+# Load buffer pool
+SET GLOBAL innodb_buffer_pool_load_now=1;
+
+# Should be more than previous as we didn't overwrite our save file
+select count(*) > Previous_loaded as Loaded_more from information_schema.INNODB_BUFFER_PAGE WHERE PAGE_TYPE='BLOB' group by PAGE_TYPE;;
+Loaded_more
+1
+
+# Successful, so innodb_buffer_pool_load_incomplete should be FALSE
+SELECT variable_name, SUBSTR(variable_value, 1, 33) as VALUE
+FROM information_schema.global_status
+WHERE LOWER(variable_name) IN ('innodb_buffer_pool_load_incomplete','innodb_buffer_pool_load_status')
+ORDER BY variable_name;
+variable_name VALUE
+INNODB_BUFFER_POOL_LOAD_INCOMPLETE OFF
+INNODB_BUFFER_POOL_LOAD_STATUS Buffer pool(s) load completed at
+
+# innodb_buffer_pool_dump_now=1 should reset the innodb_buffer_pool_load_incomplete status
+SET GLOBAL innodb_buffer_pool_dump_now=1;
+SELECT variable_name, SUBSTR(variable_value, 1, 33) as VALUE
+FROM information_schema.global_status
+WHERE LOWER(variable_name) IN ('innodb_buffer_pool_load_incomplete', 'innodb_buffer_pool_dump_status');
+variable_name VALUE
+INNODB_BUFFER_POOL_DUMP_STATUS Buffer pool(s) dump completed at
+INNODB_BUFFER_POOL_LOAD_INCOMPLETE OFF
+
+# Restart server
+
+# Load buffer pool
+SET GLOBAL innodb_buffer_pool_load_now=1;
+
+# Should be same amount
+select abs(Previously_dumped - count(*)) <= 2 as Loaded_about_same_size from information_schema.INNODB_BUFFER_PAGE WHERE PAGE_TYPE='BLOB' group by PAGE_TYPE;;
+Loaded_about_same_size
+1
+
+# Clean up
+DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_restore_at_startup_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_restore_at_startup_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_restore_at_startup_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_checksum_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_checksum_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_checksum_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_key_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_key_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_shm_key_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result
index f80ed54100f..92e22c6aa34 100644
--- a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result
@@ -50,9 +50,11 @@ ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable and should
set global innodb_change_buffering=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering'
set global innodb_change_buffering=1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering'
+SELECT @@global.innodb_change_buffering;
+@@global.innodb_change_buffering
+inserts
set global innodb_change_buffering=-2;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering'
+ERROR 42000: Variable 'innodb_change_buffering' can't be set to the value of '-2'
set global innodb_change_buffering=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering'
set global innodb_change_buffering='some';
diff --git a/mysql-test/suite/sys_vars/r/innodb_checkpoint_age_target_basic.result b/mysql-test/suite/sys_vars/r/innodb_checkpoint_age_target_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_checkpoint_age_target_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_corrupt_table_action_basic.result b/mysql-test/suite/sys_vars/r/innodb_corrupt_table_action_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_corrupt_table_action_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_dict_size_limit_basic.result b/mysql-test/suite/sys_vars/r/innodb_dict_size_limit_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_dict_size_limit_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_doublewrite_file_basic.result b/mysql-test/suite/sys_vars/r/innodb_doublewrite_file_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_doublewrite_file_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_fake_changes_basic.result b/mysql-test/suite/sys_vars/r/innodb_fake_changes_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_fake_changes_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_fast_checksum_basic.result b/mysql-test/suite/sys_vars/r/innodb_fast_checksum_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_fast_checksum_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
index 38d5365b3f3..7d0b48f2947 100644
--- a/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
@@ -33,6 +33,10 @@ SET @@global.innodb_fast_shutdown = 2;
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
2
+SET @@global.innodb_fast_shutdown = 3;
+SELECT @@global.innodb_fast_shutdown;
+@@global.innodb_fast_shutdown
+3
'#--------------------FN_DYNVARS_042_04-------------------------#'
SET @@global.innodb_fast_shutdown = -1;
Warnings:
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
deleted file mode 100644
index 0b2cbb97d25..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
+++ /dev/null
@@ -1,65 +0,0 @@
-SET @start_global_value = @@global.innodb_file_format;
-SELECT @start_global_value;
-@start_global_value
-Barracuda
-Valid values are 'Antelope' and 'Barracuda'
-select @@global.innodb_file_format in ('Antelope', 'Barracuda');
-@@global.innodb_file_format in ('Antelope', 'Barracuda')
-1
-select @@global.innodb_file_format;
-@@global.innodb_file_format
-Barracuda
-select @@session.innodb_file_format;
-ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable
-show global variables like 'innodb_file_format';
-Variable_name Value
-innodb_file_format Barracuda
-show session variables like 'innodb_file_format';
-Variable_name Value
-innodb_file_format Barracuda
-select * from information_schema.global_variables where variable_name='innodb_file_format';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Barracuda
-select * from information_schema.session_variables where variable_name='innodb_file_format';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Barracuda
-set global innodb_file_format='Antelope';
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@global.innodb_file_format;
-@@global.innodb_file_format
-Antelope
-select * from information_schema.global_variables where variable_name='innodb_file_format';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Antelope
-select * from information_schema.session_variables where variable_name='innodb_file_format';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Antelope
-set @@global.innodb_file_format='Barracuda';
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@global.innodb_file_format;
-@@global.innodb_file_format
-Barracuda
-select * from information_schema.global_variables where variable_name='innodb_file_format';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Barracuda
-select * from information_schema.session_variables where variable_name='innodb_file_format';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Barracuda
-set session innodb_file_format='Salmon';
-ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable and should be set with SET GLOBAL
-set @@session.innodb_file_format='Salmon';
-ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_file_format=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format'
-set global innodb_file_format=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format'
-set global innodb_file_format='Salmon';
-ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Salmon'
-SET @@global.innodb_file_format = @start_global_value;
-Warnings:
-Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@global.innodb_file_format;
-@@global.innodb_file_format
-Barracuda
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
deleted file mode 100644
index 9167585f1d6..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
+++ /dev/null
@@ -1,80 +0,0 @@
-SET @start_global_value = @@global.innodb_file_format_check;
-SELECT @start_global_value;
-@start_global_value
-1
-Valid values are 'ON' and 'OFF'
-SELECT @@global.innodb_file_format_check in (0, 1);
-@@global.innodb_file_format_check in (0, 1)
-1
-SELECT @@global.innodb_file_format_check;
-@@global.innodb_file_format_check
-1
-SELECT @@session.innodb_file_format_check;
-ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
-SHOW global variables LIKE 'innodb_file_format_check';
-Variable_name Value
-innodb_file_format_check ON
-SHOW session variables LIKE 'innodb_file_format_check';
-Variable_name Value
-innodb_file_format_check ON
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_check';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_CHECK ON
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_check';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_CHECK ON
-SET @@global.innodb_file_format_check='Off';
-ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
-Expected error 'Read only variable'
-SET @@global.innodb_file_format_check=1;
-ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
-Expected error 'Read only variable'
-SET @@global.innodb_file_format_check=0;
-ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
-Expected error 'Read only variable'
-SET @@global.innodb_file_format_check='On';
-ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
-Expected error 'Read only variable'
-SET session innodb_large_prefix='OFF';
-ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.innodb_stats_on_metadata='ON';
-ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_file_format_check';
-IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.innodb_file_format_check);
-COUNT(@@GLOBAL.innodb_file_format_check)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_file_format_check';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-SELECT @@innodb_file_format_check = @@GLOBAL.innodb_file_format_check;
-@@innodb_file_format_check = @@GLOBAL.innodb_file_format_check
-1
-1 Expected
-SELECT COUNT(@@innodb_file_format_check);
-COUNT(@@innodb_file_format_check)
-1
-1 Expected
-SELECT COUNT(@@local.innodb_file_format_check);
-ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.innodb_file_format_check);
-ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_file_format_check);
-COUNT(@@GLOBAL.innodb_file_format_check)
-1
-1 Expected
-SELECT innodb_file_format_check = @@SESSION.innodb_file_format_check;
-ERROR 42S22: Unknown column 'innodb_file_format_check' in 'field list'
-Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
deleted file mode 100644
index d36a17933d4..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
+++ /dev/null
@@ -1,71 +0,0 @@
-SET @start_global_value = @@global.innodb_file_format_max;
-SELECT @start_global_value;
-@start_global_value
-Barracuda
-Valid values are 'Antelope' and 'Barracuda'
-SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
-@@global.innodb_file_format_max in ('Antelope', 'Barracuda')
-1
-SELECT @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Barracuda
-SELECT @@session.innodb_file_format_max;
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable
-SHOW global variables LIKE 'innodb_file_format_max';
-Variable_name Value
-innodb_file_format_max Barracuda
-SHOW session variables LIKE 'innodb_file_format_max';
-Variable_name Value
-innodb_file_format_max Barracuda
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-SET global innodb_file_format_max='Antelope';
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-SET @@global.innodb_file_format_max='Barracuda';
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Barracuda
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-SET session innodb_file_format_max='Salmon';
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.innodb_file_format_max='Salmon';
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
-SET global innodb_file_format_max=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
-SET global innodb_file_format_max=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
-SET global innodb_file_format_max='Salmon';
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
-SET @@global.innodb_file_format_max = @start_global_value;
-Warnings:
-Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Barracuda
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_checkpoint_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_checkpoint_debug_basic.result
deleted file mode 100644
index e543cc30975..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_flush_checkpoint_debug_basic.result
+++ /dev/null
@@ -1,15 +0,0 @@
-SELECT @@global.innodb_flush_checkpoint_debug;
-@@global.innodb_flush_checkpoint_debug
-0
-SET @@global.innodb_flush_checkpoint_debug=1;
-SELECT @@global.innodb_flush_checkpoint_debug;
-@@global.innodb_flush_checkpoint_debug
-1
-SET @@global.innodb_flush_checkpoint_debug=0;
-SELECT @@global.innodb_flush_checkpoint_debug;
-@@global.innodb_flush_checkpoint_debug
-0
-SET @@session.innodb_flush_checkpoint_debug=1;
-ERROR HY000: Variable 'innodb_flush_checkpoint_debug' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.innodb_flush_checkpoint_debug;
-ERROR HY000: Variable 'innodb_flush_checkpoint_debug' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result
index 4a85748092d..21d56208141 100644
--- a/mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result
@@ -1,27 +1,27 @@
'#---------------------BS_STVARS_029_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
-0 Expected
+1
+1 Expected
'#---------------------BS_STVARS_029_02----------------------#'
SET @@GLOBAL.innodb_flush_method=1;
ERROR HY000: Variable 'innodb_flush_method' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
-0 Expected
+1
+1 Expected
'#---------------------BS_STVARS_029_03----------------------#'
SELECT @@GLOBAL.innodb_flush_method = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_flush_method';
@@GLOBAL.innodb_flush_method = VARIABLE_VALUE
-NULL
+1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
-0 Expected
+1
+1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_flush_method';
@@ -31,13 +31,13 @@ COUNT(VARIABLE_VALUE)
'#---------------------BS_STVARS_029_04----------------------#'
SELECT @@innodb_flush_method = @@GLOBAL.innodb_flush_method;
@@innodb_flush_method = @@GLOBAL.innodb_flush_method
-NULL
+1
1 Expected
'#---------------------BS_STVARS_029_05----------------------#'
SELECT COUNT(@@innodb_flush_method);
COUNT(@@innodb_flush_method)
-0
-0 Expected
+1
+1 Expected
SELECT COUNT(@@local.innodb_flush_method);
ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
@@ -46,8 +46,8 @@ ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
-0 Expected
+1
+1 Expected
SELECT innodb_flush_method = @@SESSION.innodb_flush_method;
ERROR 42S22: Unknown column 'innodb_flush_method' in 'field list'
Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_method_func.result b/mysql-test/suite/sys_vars/r/innodb_flush_method_func.result
new file mode 100644
index 00000000000..a7c8a2d3cc6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_method_func.result
@@ -0,0 +1,15 @@
+call mtr.add_suppression("InnoDB: Failed to set .*DIRECT");
+select @@innodb_flush_method;
+@@innodb_flush_method
+fsync
+create table t(a serial) engine=innodb;
+FLUSH TABLES;
+select @@innodb_flush_method;
+@@innodb_flush_method
+O_DIRECT_NO_FSYNC
+insert into t values(0);
+FLUSH TABLES;
+select @@innodb_flush_method;
+@@innodb_flush_method
+fsync
+drop table t;
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_neighbor_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_neighbor_pages_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_flush_neighbor_pages_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_ibuf_accel_rate_basic.result b/mysql-test/suite/sys_vars/r/innodb_ibuf_accel_rate_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_ibuf_accel_rate_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_ibuf_active_contract_basic.result b/mysql-test/suite/sys_vars/r/innodb_ibuf_active_contract_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_ibuf_active_contract_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_ibuf_max_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_ibuf_max_size_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_ibuf_max_size_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_import_table_from_xtrabackup_basic.result b/mysql-test/suite/sys_vars/r/innodb_import_table_from_xtrabackup_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_import_table_from_xtrabackup_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_instant_alter_column_allowed_basic.result b/mysql-test/suite/sys_vars/r/innodb_instant_alter_column_allowed_basic.result
new file mode 100644
index 00000000000..657fbcbbe67
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_instant_alter_column_allowed_basic.result
@@ -0,0 +1,45 @@
+SET @start_global_value = @@global.innodb_instant_alter_column_allowed;
+SET GLOBAL innodb_instant_alter_column_allowed=never;
+select @@session.innodb_instant_alter_column_allowed;
+ERROR HY000: Variable 'innodb_instant_alter_column_allowed' is a GLOBAL variable
+show global variables like 'innodb_instant_alter_column_allowed';
+Variable_name Value
+innodb_instant_alter_column_allowed never
+show session variables like 'innodb_instant_alter_column_allowed';
+Variable_name Value
+innodb_instant_alter_column_allowed never
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_instant_alter_column_allowed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_INSTANT_ALTER_COLUMN_ALLOWED never
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_instant_alter_column_allowed';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_INSTANT_ALTER_COLUMN_ALLOWED never
+set global innodb_instant_alter_column_allowed=no;
+ERROR 42000: Variable 'innodb_instant_alter_column_allowed' can't be set to the value of 'no'
+set global innodb_instant_alter_column_allowed=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_instant_alter_column_allowed'
+set global innodb_instant_alter_column_allowed=-1;
+ERROR 42000: Variable 'innodb_instant_alter_column_allowed' can't be set to the value of '-1'
+select @@global.innodb_instant_alter_column_allowed;
+@@global.innodb_instant_alter_column_allowed
+never
+set global innodb_instant_alter_column_allowed=2;
+ERROR 42000: Variable 'innodb_instant_alter_column_allowed' can't be set to the value of '2'
+select @@global.innodb_instant_alter_column_allowed;
+@@global.innodb_instant_alter_column_allowed
+never
+set global innodb_instant_alter_column_allowed=1;
+select @@global.innodb_instant_alter_column_allowed;
+@@global.innodb_instant_alter_column_allowed
+add_last
+set global innodb_instant_alter_column_allowed=0;
+select @@global.innodb_instant_alter_column_allowed;
+@@global.innodb_instant_alter_column_allowed
+never
+set global innodb_instant_alter_column_allowed=default;
+select @@global.innodb_instant_alter_column_allowed;
+@@global.innodb_instant_alter_column_allowed
+add_last
+SET GLOBAL innodb_instant_alter_column_allowed = @start_global_value;
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
deleted file mode 100644
index 561ddeb5a84..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# 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;
-Warnings:
-Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-0
-SET @@global.innodb_instrument_semaphores=ON;
-Warnings:
-Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-1
-
-# valid values
-SET @@global.innodb_instrument_semaphores='OFF';
-Warnings:
-Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-0
-SET @@global.innodb_instrument_semaphores=ON;
-Warnings:
-Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-1
-SET @@global.innodb_instrument_semaphores=default;
-Warnings:
-Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-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;
-Warnings:
-Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-# End of test
diff --git a/mysql-test/suite/sys_vars/r/innodb_kill_idle_transaction_basic.result b/mysql-test/suite/sys_vars/r/innodb_kill_idle_transaction_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_kill_idle_transaction_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
deleted file mode 100644
index 17a23081096..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
+++ /dev/null
@@ -1,102 +0,0 @@
-SET @start_global_value = @@global.innodb_large_prefix;
-SELECT @start_global_value;
-@start_global_value
-1
-Valid values are 'ON' and 'OFF'
-select @@global.innodb_large_prefix in (0, 1);
-@@global.innodb_large_prefix in (0, 1)
-1
-select @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-1
-select @@session.innodb_large_prefix;
-ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable
-show global variables like 'innodb_large_prefix';
-Variable_name Value
-innodb_large_prefix ON
-show session variables like 'innodb_large_prefix';
-Variable_name Value
-innodb_large_prefix ON
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-set global innodb_large_prefix='OFF';
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-0
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX OFF
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX OFF
-set @@global.innodb_large_prefix=1;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-1
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-set global innodb_large_prefix=0;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-0
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX OFF
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX OFF
-set @@global.innodb_large_prefix='ON';
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-select @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-1
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-set session innodb_large_prefix='OFF';
-ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
-set @@session.innodb_large_prefix='ON';
-ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_large_prefix=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
-set global innodb_large_prefix=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
-set global innodb_large_prefix=2;
-ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2'
-set global innodb_large_prefix=-3;
-ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '-3'
-select @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-1
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LARGE_PREFIX ON
-set global innodb_large_prefix='AUTO';
-ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
-SET @@global.innodb_large_prefix = @start_global_value;
-Warnings:
-Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
-SELECT @@global.innodb_large_prefix;
-@@global.innodb_large_prefix
-1
diff --git a/mysql-test/suite/sys_vars/r/innodb_lazy_drop_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_lazy_drop_table_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_lazy_drop_table_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
index 74b1d21d475..3218c096c2b 100644
--- a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
@@ -99,7 +99,7 @@ Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '-1024'
SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout
-1
+0
SET @@global.innodb_lock_wait_timeout=1073741825;
Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073741825'
@@ -131,7 +131,7 @@ Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '-1024'
SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout
-1
+0
SET @@session.innodb_lock_wait_timeout=1073999999;
Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073999999'
diff --git a/mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result b/mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_block_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_block_size_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_log_block_size_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_changed_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_changed_pages_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_max_changed_pages_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
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
deleted file mode 100644
index 75a1cc5262e..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_mtflush_threads_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-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_page_cleaners_basic.result b/mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result
index 5a89af5ca88..3113d77668c 100644
--- a/mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result
@@ -2,13 +2,42 @@ SELECT COUNT(@@GLOBAL.innodb_page_cleaners);
COUNT(@@GLOBAL.innodb_page_cleaners)
1
1 Expected
-SELECT COUNT(@@innodb_page_cleaners);
-COUNT(@@innodb_page_cleaners)
+SELECT @@innodb_page_cleaners;
+@@innodb_page_cleaners
1
1 Expected
+SET @@GLOBAL.innodb_page_cleaners=2;
+Expected to pass
+SELECT @@innodb_page_cleaners;
+@@innodb_page_cleaners
+2
+2 Expected
SET @@GLOBAL.innodb_page_cleaners=1;
-ERROR HY000: Variable 'innodb_page_cleaners' is a read only variable
-Expected error 'Read-only variable'
+Expected to pass
+SELECT @@innodb_page_cleaners;
+@@innodb_page_cleaners
+1
+1 Expected
+SET @@GLOBAL.innodb_page_cleaners=6;
+Expected to pass
+SELECT @@innodb_page_cleaners;
+@@innodb_page_cleaners
+6
+6 Expected
+SET @@GLOBAL.innodb_page_cleaners=4;
+Expected to pass
+SELECT @@innodb_page_cleaners;
+@@innodb_page_cleaners
+4
+4 Expected
+SET @@GLOBAL.innodb_page_cleaners=0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_page_cleaners value: '0'
+Warning expected
+SELECT @@innodb_page_cleaners;
+@@innodb_page_cleaners
+1
+1 Expected
SELECT innodb_page_cleaners = @@SESSION.innodb_page_cleaners;
ERROR 42S22: Unknown column 'innodb_page_cleaners' in 'field list'
Expected error 'Read-only variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_print_lock_wait_timeout_info_basic.result b/mysql-test/suite/sys_vars/r/innodb_print_lock_wait_timeout_info_basic.result
deleted file mode 100644
index cc035e4f8bc..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_print_lock_wait_timeout_info_basic.result
+++ /dev/null
@@ -1,104 +0,0 @@
-SET @start_global_value = @@global.innodb_print_lock_wait_timeout_info;
-SELECT @start_global_value;
-@start_global_value
-0
-Valid values are 'ON' and 'OFF'
-SELECT @@global.innodb_print_lock_wait_timeout_info in (0, 1);
-@@global.innodb_print_lock_wait_timeout_info in (0, 1)
-1
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-0
-SELECT @@session.innodb_print_lock_wait_timeout_info;
-ERROR HY000: Variable 'innodb_print_lock_wait_timeout_info' is a GLOBAL variable
-SHOW global variables LIKE 'innodb_print_lock_wait_timeout_info';
-Variable_name Value
-innodb_print_lock_wait_timeout_info OFF
-SHOW session variables LIKE 'innodb_print_lock_wait_timeout_info';
-Variable_name Value
-innodb_print_lock_wait_timeout_info OFF
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO OFF
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO OFF
-SET global innodb_print_lock_wait_timeout_info='OFF';
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-0
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO OFF
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO OFF
-SET @@global.innodb_print_lock_wait_timeout_info=1;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-1
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO ON
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO ON
-SET global innodb_print_lock_wait_timeout_info=0;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-0
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO OFF
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO OFF
-SET @@global.innodb_print_lock_wait_timeout_info='ON';
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-1
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO ON
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO ON
-SET session innodb_print_lock_wait_timeout_info='OFF';
-ERROR HY000: Variable 'innodb_print_lock_wait_timeout_info' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.innodb_print_lock_wait_timeout_info='ON';
-ERROR HY000: Variable 'innodb_print_lock_wait_timeout_info' is a GLOBAL variable and should be set with SET GLOBAL
-SET global innodb_print_lock_wait_timeout_info=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_print_lock_wait_timeout_info'
-SET global innodb_print_lock_wait_timeout_info=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_print_lock_wait_timeout_info'
-SET global innodb_print_lock_wait_timeout_info=2;
-ERROR 42000: Variable 'innodb_print_lock_wait_timeout_info' can't be set to the value of '2'
-SET global innodb_print_lock_wait_timeout_info=-3;
-ERROR 42000: Variable 'innodb_print_lock_wait_timeout_info' can't be set to the value of '-3'
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-1
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO ON
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO ON
-SET global innodb_print_lock_wait_timeout_info='AUTO';
-ERROR 42000: Variable 'innodb_print_lock_wait_timeout_info' can't be set to the value of 'AUTO'
-SET @@global.innodb_print_lock_wait_timeout_info = @start_global_value;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
-@@global.innodb_print_lock_wait_timeout_info
-0
diff --git a/mysql-test/suite/sys_vars/r/innodb_read_ahead_basic.result b/mysql-test/suite/sys_vars/r/innodb_read_ahead_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_read_ahead_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_recovery_stats_basic.result b/mysql-test/suite/sys_vars/r/innodb_recovery_stats_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_recovery_stats_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_recovery_update_relay_log_basic.result b/mysql-test/suite/sys_vars/r/innodb_recovery_update_relay_log_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_recovery_update_relay_log_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result
deleted file mode 100644
index f2bfaf2ed61..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result
+++ /dev/null
@@ -1,30 +0,0 @@
-SET GLOBAL innodb_sched_priority_cleaner=39;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-@@GLOBAL.innodb_sched_priority_cleaner
-19
-SELECT @@SESSION.innodb_sched_priority_cleaner;
-ERROR HY000: Variable 'innodb_sched_priority_cleaner' is a GLOBAL variable
-SET GLOBAL innodb_sched_priority_cleaner=19;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-@@GLOBAL.innodb_sched_priority_cleaner
-19
-SET GLOBAL innodb_sched_priority_cleaner=5;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-@@GLOBAL.innodb_sched_priority_cleaner
-5
-SET GLOBAL innodb_sched_priority_cleaner=0;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-@@GLOBAL.innodb_sched_priority_cleaner
-0
-SET GLOBAL innodb_sched_priority_cleaner=-1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_sched_priority_cleaner value: '-1'
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-@@GLOBAL.innodb_sched_priority_cleaner
-0
-SET GLOBAL innodb_sched_priority_cleaner=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner'
-SET GLOBAL innodb_sched_priority_cleaner=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner'
-SET GLOBAL innodb_sched_priority_cleaner='foo';
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result
deleted file mode 100644
index 5fd7705bfaf..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result
+++ /dev/null
@@ -1,30 +0,0 @@
-SET @start_value = @@GLOBAL.innodb_sched_priority_io;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-@@GLOBAL.innodb_sched_priority_io
-19
-SELECT @@SESSION.innodb_sched_priority_io;
-ERROR HY000: Variable 'innodb_sched_priority_io' is a GLOBAL variable
-SET GLOBAL innodb_sched_priority_io=19;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-@@GLOBAL.innodb_sched_priority_io
-19
-SET GLOBAL innodb_sched_priority_io=5;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-@@GLOBAL.innodb_sched_priority_io
-5
-SET GLOBAL innodb_sched_priority_io=0;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-@@GLOBAL.innodb_sched_priority_io
-0
-SET GLOBAL innodb_sched_priority_io=-1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_sched_priority_io value: '-1'
-SELECT @@GLOBAL.innodb_sched_priority_io;
-@@GLOBAL.innodb_sched_priority_io
-0
-SET GLOBAL innodb_sched_priority_io=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io'
-SET GLOBAL innodb_sched_priority_io=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io'
-SET GLOBAL innodb_sched_priority_io='foo';
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result
deleted file mode 100644
index caa72f58369..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result
+++ /dev/null
@@ -1,30 +0,0 @@
-SET @start_value = @@GLOBAL.innodb_sched_priority_master;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-@@GLOBAL.innodb_sched_priority_master
-19
-SELECT @@SESSION.innodb_sched_priority_master;
-ERROR HY000: Variable 'innodb_sched_priority_master' is a GLOBAL variable
-SET GLOBAL innodb_sched_priority_master=19;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-@@GLOBAL.innodb_sched_priority_master
-19
-SET GLOBAL innodb_sched_priority_master=5;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-@@GLOBAL.innodb_sched_priority_master
-5
-SET GLOBAL innodb_sched_priority_master=0;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-@@GLOBAL.innodb_sched_priority_master
-0
-SET GLOBAL innodb_sched_priority_master=-1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_sched_priority_master value: '-1'
-SELECT @@GLOBAL.innodb_sched_priority_master;
-@@GLOBAL.innodb_sched_priority_master
-0
-SET GLOBAL innodb_sched_priority_master=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master'
-SET GLOBAL innodb_sched_priority_master=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master'
-SET GLOBAL innodb_sched_priority_master='foo';
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result
deleted file mode 100644
index e3b9c627214..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result
+++ /dev/null
@@ -1,30 +0,0 @@
-SET @start_value = @@GLOBAL.innodb_sched_priority_purge;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-@@GLOBAL.innodb_sched_priority_purge
-19
-SELECT @@SESSION.innodb_sched_priority_purge;
-ERROR HY000: Variable 'innodb_sched_priority_purge' is a GLOBAL variable
-SET GLOBAL innodb_sched_priority_purge=19;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-@@GLOBAL.innodb_sched_priority_purge
-19
-SET GLOBAL innodb_sched_priority_purge=5;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-@@GLOBAL.innodb_sched_priority_purge
-5
-SET GLOBAL innodb_sched_priority_purge=0;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-@@GLOBAL.innodb_sched_priority_purge
-0
-SET GLOBAL innodb_sched_priority_purge=-1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_sched_priority_purge value: '-1'
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-@@GLOBAL.innodb_sched_priority_purge
-0
-SET GLOBAL innodb_sched_priority_purge=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge'
-SET GLOBAL innodb_sched_priority_purge=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge'
-SET GLOBAL innodb_sched_priority_purge='foo';
-ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge'
diff --git a/mysql-test/suite/sys_vars/r/innodb_show_locks_held_basic.result b/mysql-test/suite/sys_vars/r/innodb_show_locks_held_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_show_locks_held_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_show_verbose_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_show_verbose_locks_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_show_verbose_locks_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_auto_update_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_auto_update_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_stats_auto_update_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_update_need_lock_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_update_need_lock_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_stats_update_need_lock_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
deleted file mode 100644
index 8384ee3d361..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
+++ /dev/null
@@ -1,227 +0,0 @@
-SET @session_start_value = @@session.innodb_support_xa;
-SELECT @session_start_value;
-@session_start_value
-1
-SET @global_start_value = @@global.innodb_support_xa;
-SELECT @global_start_value;
-@global_start_value
-1
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@session.innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SET @@session.innodb_support_xa = DEFAULT;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@global.innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SET @@global.innodb_support_xa = DEFAULT;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@innodb_support_xa;
-@@innodb_support_xa
-1
-SELECT session.innodb_support_xa;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT local.innodb_support_xa;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.innodb_support_xa;
-ERROR 42S02: Unknown table 'global' in field list
-SET session innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET global innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@session.innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@session.innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@global.innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SET @@global.innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@session.innodb_support_xa = -0.6;
-ERROR 42000: Incorrect argument type to variable 'innodb_support_xa'
-SET @@session.innodb_support_xa = 1.6;
-ERROR 42000: Incorrect argument type to variable 'innodb_support_xa'
-SET @@session.innodb_support_xa = "T";
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'T'
-SET @@session.innodb_support_xa = "Y";
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'Y'
-SET @@session.innodb_support_xa = TRÜE;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'TRÜE'
-SET @@session.innodb_support_xa = ÕN;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÕN'
-SET @@session.innodb_support_xa = OF;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@session.innodb_support_xa = ÓFF;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF'
-SET @@global.innodb_support_xa = -1;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of '-1'
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SET @@global.innodb_support_xa = 2;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of '2'
-SET @@global.innodb_support_xa = "T";
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'T'
-SET @@global.innodb_support_xa = "Y";
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'Y'
-SET @@global.innodb_support_xa = TRÜE;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'TRÜE'
-SET @@global.innodb_support_xa = ÕN;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÕN'
-SET @@global.innodb_support_xa = OF;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SET @@global.innodb_support_xa = ÓFF;
-ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF'
-'#-------------------FN_DYNVARS_046_05----------------------------#'
-SET @@global.innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SET @@session.innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@global.innodb_support_xa AS res_is_0;
-res_is_0
-1
-SET @@global.innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@session.innodb_support_xa AS res_is_1;
-res_is_1
-1
-'#----------------------FN_DYNVARS_046_06------------------------#'
-SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_support_xa';
-IF(@@global.innodb_support_xa, "ON", "OFF") =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_support_xa';
-VARIABLE_VALUE
-ON
-'#----------------------FN_DYNVARS_046_07------------------------#'
-SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='innodb_support_xa';
-IF(@@session.innodb_support_xa, "ON", "OFF") =
-VARIABLE_VALUE
-1
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='innodb_support_xa';
-VARIABLE_VALUE
-ON
-'#---------------------FN_DYNVARS_046_08-------------------------#'
-SET @@session.innodb_support_xa = OFF;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@session.innodb_support_xa = ON;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@global.innodb_support_xa = OFF;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SET @@global.innodb_support_xa = ON;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-'#---------------------FN_DYNVARS_046_09----------------------#'
-SET @@session.innodb_support_xa = TRUE;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@session.innodb_support_xa = FALSE;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@global.innodb_support_xa = TRUE;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SET @@global.innodb_support_xa = FALSE;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SET @@session.innodb_support_xa = @session_start_value;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-SET @@global.innodb_support_xa = @global_start_value;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
deleted file mode 100644
index 376cc7dd076..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
+++ /dev/null
@@ -1,90 +0,0 @@
-'#--------------------FN_DYNVARS_046_01-------------------------#'
-SET @@global.innodb_support_xa = OFF;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-connect con1,localhost,root,,,,;
-connection con1;
-SELECT @@global.innodb_support_xa;
-@@global.innodb_support_xa
-1
-SELECT @@session.innodb_support_xa;
-@@session.innodb_support_xa
-1
-disconnect con1;
-'#--------------------FN_DYNVARS_046_01-------------------------#'
-connection default;
-SET @@global.innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-drop table if exists t1, t2;
-create table t1 (a int) engine=innodb;
-'---check when innodb_support_xa is 1---'
-SET @@innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-xa start 'test1';
-INSERT t1 values (10);
-xa end 'test1';
-xa prepare 'test1';
-xa rollback 'test1';
-SELECT * from t1;
-a
-'---check when innodb_support_xa is 0---'
-SET @@innodb_support_xa = 0;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
-xa start 'test1';
-INSERT t1 values (10);
-xa end 'test1';
-xa prepare 'test1';
-xa rollback 'test1';
-SELECT * from t1;
-a
-'------general xa testing--------'
-SET @@global.innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-SET @@innodb_support_xa = 1;
-Warnings:
-Warning 131 Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
-xa start 'testa','testb';
-INSERT t1 values (30);
-COMMIT;
-ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
-xa end 'testa','testb';
-BEGIN;
-ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
-CREATE table t2 (a int);
-ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
-CONNECT con1,localhost,root,,,,;
-connection con1;
-xa start 'testa','testb';
-ERROR XAE08: XAER_DUPID: The XID already exists
-xa start 'testa','testb', 123;
-ERROR XAE08: XAER_DUPID: The XID already exists
-xa start 0x7465737462, 0x2030405060, 0xb;
-INSERT t1 values (40);
-xa end 'testb',' 0@P`',11;
-xa prepare 'testb',0x2030405060,11;
-START TRANSACTION;
-ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
-xa recover;
-formatID gtrid_length bqual_length data
-11 5 5 testb 0@P`
-connection default;
-xa prepare 'testa','testb';
-xa recover;
-formatID gtrid_length bqual_length data
-11 5 5 testb 0@P`
-1 5 5 testatestb
-xa commit 'testb',0x2030405060,11;
-ERROR XAE04: XAER_NOTA: Unknown XID
-xa commit 'testa','testb';
-connection con1;
-xa rollback 'testb',0x2030405060,11;
-SELECT * from t1;
-a
-30
-disconnect con1;
-connection default;
-DROP table t1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_timer_based_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_timer_based_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_timer_based_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_track_changed_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_track_changed_pages_basic.result
deleted file mode 100644
index f5d94ee0d18..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_track_changed_pages_basic.result
+++ /dev/null
@@ -1,19 +0,0 @@
-SELECT COUNT(@@GLOBAL.innodb_track_changed_pages);
-COUNT(@@GLOBAL.innodb_track_changed_pages)
-1
-SELECT @@GLOBAL.innodb_track_changed_pages = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_track_changed_pages';
-@@GLOBAL.innodb_track_changed_pages = VARIABLE_VALUE
-1
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'OFF'
-SELECT @@innodb_track_changed_pages = @@GLOBAL.innodb_track_changed_pages;
-@@innodb_track_changed_pages = @@GLOBAL.innodb_track_changed_pages
-1
-SELECT COUNT(@@SESSION.innodb_track_changed_pages);
-ERROR HY000: Variable 'innodb_track_changed_pages' is a GLOBAL variable
-SELECT COUNT(@@LOCAL.innodb_track_changed_pages);
-ERROR HY000: Variable 'innodb_track_changed_pages' is a GLOBAL variable
-SELECT innodb_track_changed_pages = @@SESSION.innodb_track_changed_pages;
-ERROR 42S22: Unknown column 'innodb_track_changed_pages' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/innodb_track_redo_log_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_track_redo_log_now_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_track_redo_log_now_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_global_flush_log_at_trx_commit_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_global_flush_log_at_trx_commit_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_global_flush_log_at_trx_commit_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
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
deleted file mode 100644
index f77abba7ac9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_mtflush_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-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_stacktrace_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_stacktrace_basic.result
deleted file mode 100644
index 5db1880219d..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_stacktrace_basic.result
+++ /dev/null
@@ -1,48 +0,0 @@
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
-COUNT(@@GLOBAL.innodb_use_stacktrace)
-1
-1 Expected
-SET @@GLOBAL.innodb_use_stacktrace=1;
-ERROR HY000: Variable 'innodb_use_stacktrace' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
-COUNT(@@GLOBAL.innodb_use_stacktrace)
-1
-1 Expected
-SELECT IF(@@GLOBAL.innodb_use_stacktrace, 'ON', 'OFF') = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_use_stacktrace';
-IF(@@GLOBAL.innodb_use_stacktrace, 'ON', 'OFF') = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
-COUNT(@@GLOBAL.innodb_use_stacktrace)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_use_stacktrace';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-SELECT @@innodb_use_stacktrace = @@GLOBAL.innodb_use_stacktrace;
-@@innodb_use_stacktrace = @@GLOBAL.innodb_use_stacktrace
-1
-1 Expected
-SELECT COUNT(@@innodb_use_stacktrace);
-COUNT(@@innodb_use_stacktrace)
-1
-1 Expected
-SELECT COUNT(@@local.innodb_use_stacktrace);
-ERROR HY000: Variable 'innodb_use_stacktrace' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.innodb_use_stacktrace);
-ERROR HY000: Variable 'innodb_use_stacktrace' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
-COUNT(@@GLOBAL.innodb_use_stacktrace)
-1
-1 Expected
-SELECT innodb_use_stacktrace = @@SESSION.innodb_use_stacktrace;
-ERROR 42S22: Unknown column 'innodb_use_stacktrace' in 'field list'
-Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_sys_stats_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_sys_stats_table_basic.result
deleted file mode 100644
index d9d067c2cf9..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_sys_stats_table_basic.result
+++ /dev/null
@@ -1 +0,0 @@
-XtraDB extension
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
deleted file mode 100644
index 855bccad522..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result
+++ /dev/null
@@ -1,37 +0,0 @@
-SET @start_use_trim = @@global.innodb_use_trim;
-SELECT @start_use_trim;
-@start_use_trim
-1
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
-COUNT(@@GLOBAL.innodb_use_trim)
-1
-1 Expected
-SET @@GLOBAL.innodb_use_trim=1;
-Warnings:
-Warning 131 Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3.
-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;
-Warnings:
-Warning 131 Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_use_trim;
-@@global.innodb_use_trim
-1
diff --git a/mysql-test/suite/sys_vars/r/insert_id_basic.result b/mysql-test/suite/sys_vars/r/insert_id_basic.result
index 318563f7e42..f8ae8994120 100644
--- a/mysql-test/suite/sys_vars/r/insert_id_basic.result
+++ b/mysql-test/suite/sys_vars/r/insert_id_basic.result
@@ -108,12 +108,8 @@ SET insert_id = 1;
SELECT @@insert_id;
@@insert_id
1
-SET local.insert_id = 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 'insert_id = 1' at line 1
SELECT local.insert_id;
ERROR 42S02: Unknown table 'local' in field list
-SET session.insert_id = 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 'insert_id = 1' at line 1
SELECT session.insert_id;
ERROR 42S02: Unknown table 'session' in field list
SELECT insert_id = @@session.insert_id;
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
index 4a63be5fd22..084e342dc2d 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
@@ -62,12 +62,8 @@ SELECT @@key_buffer_size = @@global.key_buffer_size;
'#---------------------FN_DYNVARS_055_09----------------------#'
SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET local.key_buffer_size = 10;
-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 'key_buffer_size = 10' at line 1
SELECT local.key_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.key_buffer_size = 10;
-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 'key_buffer_size = 10' at line 1
SELECT global.key_buffer_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic.result
index f2a59e419e4..df339d7e3ab 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic.result
@@ -115,12 +115,8 @@ ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should
SELECT @@key_cache_age_threshold;
@@key_cache_age_threshold
100
-SET local.key_cache_age_threshold = 10;
-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 'key_cache_age_threshold = 10' at line 1
SELECT local.key_cache_age_threshold;
ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_age_threshold = 10;
-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 'key_cache_age_threshold = 10' at line 1
SELECT global.key_cache_age_threshold;
ERROR 42S02: Unknown table 'global' in field list
SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result
index db8273ceed5..7271a307b7b 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result
@@ -125,12 +125,8 @@ ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be
SELECT @@key_cache_block_size;
@@key_cache_block_size
1024
-SET local.key_cache_block_size = 10;
-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 'key_cache_block_size = 10' at line 1
SELECT local.key_cache_block_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_block_size = 10;
-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 'key_cache_block_size = 10' at line 1
SELECT global.key_cache_block_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT key_cache_block_size = @@session.key_cache_block_size;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result
index 83dcea6d096..df17e92f702 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result
@@ -119,12 +119,8 @@ ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should
SELECT @@key_cache_division_limit;
@@key_cache_division_limit
90
-SET local.key_cache_division_limit = 10;
-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 'key_cache_division_limit = 10' at line 1
SELECT local.key_cache_division_limit;
ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_division_limit = 10;
-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 'key_cache_division_limit = 10' at line 1
SELECT global.key_cache_division_limit;
ERROR 42S02: Unknown table 'global' in field list
SELECT key_cache_division_limit = @@session.key_cache_division_limit;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result b/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result
index 52ebfc98cdc..6ee871f791e 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result
@@ -98,12 +98,8 @@ ERROR HY000: Variable 'key_cache_file_hash_size' is a GLOBAL variable and should
SELECT @@key_cache_file_hash_size;
@@key_cache_file_hash_size
150
-SET local.key_cache_file_hash_size = 10;
-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 'key_cache_file_hash_size = 10' at line 1
SELECT local.key_cache_file_hash_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_file_hash_size = 10;
-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 'key_cache_file_hash_size = 10' at line 1
SELECT global.key_cache_file_hash_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT key_cache_file_hash_size = @@session.key_cache_file_hash_size;
diff --git a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
index ed03c3e6d94..7d98f44f27b 100644
--- a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
+++ b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
@@ -21,8 +21,6 @@ SET lc_time_names=ar_AE;
SELECT @@session.lc_time_names;
@@session.lc_time_names
ar_AE
-SET global.lc_time_names=ar_AE;
-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 'lc_time_names=ar_AE' at line 1
SET session lc_time_names=ar_AE;
SELECT session lc_time_names;
ERROR 42S22: Unknown column 'session' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/local_infile_basic.result b/mysql-test/suite/sys_vars/r/local_infile_basic.result
index f74a394cff9..81a7a39ef21 100644
--- a/mysql-test/suite/sys_vars/r/local_infile_basic.result
+++ b/mysql-test/suite/sys_vars/r/local_infile_basic.result
@@ -87,8 +87,6 @@ ERROR HY000: Variable 'local_infile' is a GLOBAL variable and should be set with
SELECT @@local_infile;
@@local_infile
1
-SET global.local_infile = 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 'local_infile = 1' at line 1
SELECT global.local_infile;
ERROR 42S02: Unknown table 'global' in field list
SELECT local_infile = @@session.local_infile;
diff --git a/mysql-test/suite/sys_vars/r/lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/lock_wait_timeout_basic.result
index bc127bf339a..f5d66b7c561 100644
--- a/mysql-test/suite/sys_vars/r/lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/lock_wait_timeout_basic.result
@@ -54,17 +54,15 @@ SELECT @@session.lock_wait_timeout;
65535
'#------------------FN_DYNVARS_002_05-----------------------#'
SET @@global.lock_wait_timeout = 0;
-Warnings:
-Warning 1292 Truncated incorrect lock_wait_timeout value: '0'
SELECT @@global.lock_wait_timeout;
@@global.lock_wait_timeout
-1
+0
SET @@global.lock_wait_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect lock_wait_timeout value: '-1024'
SELECT @@global.lock_wait_timeout;
@@global.lock_wait_timeout
-1
+0
SET @@global.lock_wait_timeout = 31536001;
Warnings:
Warning 1292 Truncated incorrect lock_wait_timeout value: '31536001'
@@ -87,17 +85,15 @@ SELECT @@global.lock_wait_timeout;
@@global.lock_wait_timeout
31536000
SET @@session.lock_wait_timeout = 0;
-Warnings:
-Warning 1292 Truncated incorrect lock_wait_timeout value: '0'
SELECT @@session.lock_wait_timeout;
@@session.lock_wait_timeout
-1
+0
SET @@session.lock_wait_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect lock_wait_timeout value: '-2'
SELECT @@session.lock_wait_timeout;
@@session.lock_wait_timeout
-1
+0
SET @@session.lock_wait_timeout = 31537000;
Warnings:
Warning 1292 Truncated incorrect lock_wait_timeout value: '31537000'
@@ -137,11 +133,9 @@ SELECT @@global.lock_wait_timeout;
@@global.lock_wait_timeout
1
SET @@global.lock_wait_timeout = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect lock_wait_timeout value: '0'
SELECT @@global.lock_wait_timeout;
@@global.lock_wait_timeout
-1
+0
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.lock_wait_timeout = 10;
SET @@session.lock_wait_timeout = 11;
diff --git a/mysql-test/suite/sys_vars/r/log_disabled_statements_basic.result b/mysql-test/suite/sys_vars/r/log_disabled_statements_basic.result
new file mode 100644
index 00000000000..72bc8449f13
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_disabled_statements_basic.result
@@ -0,0 +1,60 @@
+SET @start_global_value = @@global.log_disabled_statements;
+select @@global.log_disabled_statements;
+@@global.log_disabled_statements
+sp
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+sp
+show global variables like 'log_disabled_statements';
+Variable_name Value
+log_disabled_statements sp
+show session variables like 'log_disabled_statements';
+Variable_name Value
+log_disabled_statements sp
+select * from information_schema.global_variables where variable_name='log_disabled_statements';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_DISABLED_STATEMENTS sp
+select * from information_schema.session_variables where variable_name='log_disabled_statements';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_DISABLED_STATEMENTS sp
+set global log_disabled_statements=1;
+select @@global.log_disabled_statements;
+@@global.log_disabled_statements
+slave
+set session log_disabled_statements=1;
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+slave
+set session log_disabled_statements=1;
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+slave
+set session log_disabled_statements=2;
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+sp
+set session log_disabled_statements='slave';
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+slave
+set session log_disabled_statements='sp';
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+sp
+set session log_disabled_statements='slave,sp';
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+slave,sp
+set session log_disabled_statements='';
+select @@session.log_disabled_statements;
+@@session.log_disabled_statements
+
+set session log_disabled_statements=1.1;
+ERROR 42000: Incorrect argument type to variable 'log_disabled_statements'
+set session log_disabled_statements=1e1;
+ERROR 42000: Incorrect argument type to variable 'log_disabled_statements'
+set session log_disabled_statements="foo";
+ERROR 42000: Variable 'log_disabled_statements' can't be set to the value of 'foo'
+set session log_disabled_statements=1024;
+ERROR 42000: Variable 'log_disabled_statements' can't be set to the value of '1024'
+SET @@global.log_disabled_statements = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/log_disabled_statements_func.result b/mysql-test/suite/sys_vars/r/log_disabled_statements_func.result
new file mode 100644
index 00000000000..4cfb2adbaac
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_disabled_statements_func.result
@@ -0,0 +1,82 @@
+SET @old_log_output= @@global.log_output;
+SET @old_log_disable_statements= @@global.log_disabled_statements;
+CREATE TABLE t1 (i INT PRIMARY KEY AUTO_INCREMENT, j VARCHAR(255) ) ENGINE=MyISAM;
+insert into t1 (j) values ('a'),('b'),('c'),('d');
+SET GLOBAL log_output = 'file,table';
+CREATE PROCEDURE slow()
+BEGIN
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b';
+SELECT count(*) from t1 where j>'a';
+END
+$
+select @@log_disabled_statements;
+@@log_disabled_statements
+sp
+TRUNCATE TABLE mysql.general_log;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CALL slow();
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%";
+argument
+check table t1
+CALL slow()
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2'
+<--
+TRUNCATE TABLE mysql.general_log;
+SET SESSION log_disabled_statements="";
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CALL slow();
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%";
+argument
+SET SESSION log_disabled_statements=""
+check table t1
+CALL slow()
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b'
+SELECT count(*) from t1 where j>'a'
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3'
+<--
+TRUNCATE TABLE mysql.general_log;
+SET SESSION log_disabled_statements="sp,slave";
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CALL slow();
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%";
+argument
+SET SESSION log_disabled_statements="sp,slave"
+check table t1
+CALL slow()
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4'
+<--
+DROP TABLE t1;
+DROP PROCEDURE slow;
+TRUNCATE TABLE mysql.general_log;
+SET @@global.log_output= @old_log_output;
+SET @@global.log_disabled_statements= @old_log_disable_statements;
diff --git a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
index fcb5abbcf91..ce0ebb62b46 100644
--- a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
@@ -1,4 +1,9 @@
SET @start_value= @@global.log_queries_not_using_indexes;
+SET @filter_start_value= @@global.log_slow_filter;
+SET @@global.log_queries_not_using_indexes= TRUE;
+SET @@session.log_queries_not_using_indexes= TRUE;
+SET @@global.log_queries_not_using_indexes= FALSE;
+SET @@session.log_queries_not_using_indexes= FALSE;
SET @@global.log_queries_not_using_indexes= DEFAULT;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
@@ -61,16 +66,41 @@ SET @@global.log_queries_not_using_indexes= @badvar;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'true'
SET GLOBAL log_queries_not_using_indexes= 'DEFAULT';
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'DEFAULT'
-SET log_queries_not_using_indexes= TRUE;
-ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION log_queries_not_using_indexes= TRUE;
-ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.log_queries_not_using_indexes= TRUE;
-ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
-SET LOCAL log_queries_not_using_indexes= TRUE;
-ERROR HY000: Variable 'log_queries_not_using_indexes' is a GLOBAL variable and should be set with SET GLOBAL
SET @@global log_queries_not_using_indexes= TRUE;
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 'log_queries_not_using_indexes= TRUE' at line 1
SET @@SESSION log_queries_not_using_indexes= TRUE;
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 'log_queries_not_using_indexes= TRUE' at line 1
+SET @@SESSION.log_queries_not_using_indexes= TRUE;
+select @@SESSION.log_slow_filter;
+@@SESSION.log_slow_filter
+admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,not_using_index,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+SET @@SESSION.log_queries_not_using_indexes= FALSE;
+select @@SESSION.log_slow_filter;
+@@SESSION.log_slow_filter
+admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+SET @@GLOBAL.log_queries_not_using_indexes= TRUE;
+select @@GLOBAL.log_slow_filter;
+@@GLOBAL.log_slow_filter
+admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,not_using_index,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+SET @@GLOBAL.log_queries_not_using_indexes= FALSE;
+select @@GLOBAL.log_slow_filter;
+@@GLOBAL.log_slow_filter
+admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+SET @@SESSION.log_slow_filter="";
+select @@SESSION.log_queries_not_using_indexes;
+@@SESSION.log_queries_not_using_indexes
+0
+SET @@SESSION.log_slow_filter="not_using_index";
+select @@SESSION.log_queries_not_using_indexes;
+@@SESSION.log_queries_not_using_indexes
+1
+SET @@GLOBAL.log_slow_filter="";
+select @@GLOBAL.log_queries_not_using_indexes;
+@@GLOBAL.log_queries_not_using_indexes
+0
+SET @@GLOBAL.log_slow_filter="not_using_index";
+select @@GLOBAL.log_queries_not_using_indexes;
+@@GLOBAL.log_queries_not_using_indexes
+1
SET @@global.log_queries_not_using_indexes= @start_value;
+SET @@global.log_slow_filter= @filter_start_value;
diff --git a/mysql-test/suite/sys_vars/r/log_result_errors_basic.result b/mysql-test/suite/sys_vars/r/log_result_errors_basic.result
new file mode 100644
index 00000000000..5d3696901a6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_result_errors_basic.result
@@ -0,0 +1,148 @@
+SET @start_global_value = @@global.log_result_errors;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.log_result_errors;
+SELECT @start_session_value;
+@start_session_value
+0
+'#--------------------FN_DYNVARS_067_01-------------------------#'
+SET @@global.log_result_errors = 1;
+SET @@global.log_result_errors = DEFAULT;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+0
+SET @@session.log_result_errors = 2;
+SET @@session.log_result_errors = DEFAULT;
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+0
+'#--------------------FN_DYNVARS_067_02-------------------------#'
+SET @@global.log_result_errors = DEFAULT;
+SELECT @@global.log_result_errors = 0;
+@@global.log_result_errors = 0
+1
+SET @@session.log_result_errors = DEFAULT;
+SELECT @@session.log_result_errors = 0;
+@@session.log_result_errors = 0
+1
+'#--------------------FN_DYNVARS_067_03-------------------------#'
+SET @@global.log_result_errors = 0;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+0
+SET @@global.log_result_errors = 1;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+1
+SET @@global.log_result_errors = 3;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+3
+'#--------------------FN_DYNVARS_067_04-------------------------#'
+SET @@session.log_result_errors = 0;
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+0
+SET @@session.log_result_errors = 1;
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+1
+SET @@session.log_result_errors = 3;
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+3
+'#------------------FN_DYNVARS_067_05-----------------------#'
+SET @@global.log_result_errors = 4;
+Warnings:
+Warning 1292 Truncated incorrect log_result_errors value: '4'
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+3
+SET @@global.log_result_errors = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'log_result_errors'
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+3
+SET @@global.log_result_errors = test;
+ERROR 42000: Incorrect argument type to variable 'log_result_errors'
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+3
+SET @@session.log_result_errors = -2;
+Warnings:
+Warning 1292 Truncated incorrect log_result_errors value: '-2'
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+0
+SET @@session.log_result_errors = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'log_result_errors'
+SET @@session.log_result_errors = test;
+ERROR 42000: Incorrect argument type to variable 'log_result_errors'
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+0
+'#------------------FN_DYNVARS_067_06-----------------------#'
+SELECT @@global.log_result_errors = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='log_result_errors';
+@@global.log_result_errors = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_067_07-----------------------#'
+SELECT @@session.log_result_errors = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='log_result_errors';
+@@session.log_result_errors = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_067_08-----------------------#'
+SET @@global.log_result_errors = TRUE;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+1
+SET @@global.log_result_errors = FALSE;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+0
+'#---------------------FN_DYNVARS_067_09----------------------#'
+SET @@session.log_result_errors = 1;
+SET @@global.log_result_errors = 2;
+SELECT @@log_result_errors = @@global.log_result_errors;
+@@log_result_errors = @@global.log_result_errors
+0
+'#---------------------FN_DYNVARS_067_10----------------------#'
+SET @@session.log_result_errors = 1;
+SET @@global.log_result_errors = 2;
+SELECT @@log_result_errors = @@local.log_result_errors;
+@@log_result_errors = @@local.log_result_errors
+1
+SELECT @@local.log_result_errors = @@session.log_result_errors;
+@@local.log_result_errors = @@session.log_result_errors
+1
+SET @@session.log_result_errors = 1;
+create table t1(a int primary key);
+insert into t1 values(1);
+insert into t1 values(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+insert ignore into t1 values(1);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+SET @@session.log_result_errors = 3;
+insert ignore into t1 values(1);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+drop table t1;
+SET @@global.log_result_errors = @start_global_value;
+SELECT @@global.log_result_errors;
+@@global.log_result_errors
+0
+SET @@session.log_result_errors = @start_session_value;
+SELECT @@session.log_result_errors;
+@@session.log_result_errors
+0
+[WARN RESULT] affected_rows: 0 status: 2 warning_count: 1
+[WARN RESULT] Level: Warning Code: 1292 'Truncated incorrect log_result_errors value: '4''
+[ERROR RESULT] Code: 1232 'Incorrect argument type to variable 'log_result_errors''
+[ERROR RESULT] Code: 1232 'Incorrect argument type to variable 'log_result_errors''
+[ERROR RESULT] Code: 1062 'Duplicate entry '1' for key 'PRIMARY''
+[WARN RESULT] affected_rows: 0 status: 2 warning_count: 1
+[WARN RESULT] Level: Warning Code: 1062 'Duplicate entry '1' for key 'PRIMARY''
diff --git a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
index daddc4af627..95916d8ce15 100644
--- a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
+++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
@@ -10,7 +10,7 @@ j VARCHAR(255)
SET GLOBAL log_output = 'file,table';
SET GLOBAL slow_query_log = on;
SET SESSION long_query_time = 0;
-SET GLOBAL log_slow_admin_statements = on;
+SET SESSION log_slow_admin_statements = on;
ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
CREATE PROCEDURE add_rows()
BEGIN
@@ -44,3 +44,37 @@ SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
DROP PROCEDURE add_rows;
TRUNCATE TABLE mysql.slow_log;
+SET @save_log_slow_disabled_statements= @@global.log_slow_disabled_statements;
+SET @@SESSION.log_slow_admin_statements= TRUE;
+select @@SESSION.log_slow_disabled_statements;
+@@SESSION.log_slow_disabled_statements
+sp
+SET @@SESSION.log_slow_admin_statements= FALSE;
+select @@SESSION.log_slow_disabled_statements;
+@@SESSION.log_slow_disabled_statements
+admin,sp
+SET @@GLOBAL.log_slow_admin_statements= TRUE;
+select @@GLOBAL.log_slow_disabled_statements;
+@@GLOBAL.log_slow_disabled_statements
+sp
+SET @@GLOBAL.log_slow_admin_statements= FALSE;
+select @@GLOBAL.log_slow_disabled_statements;
+@@GLOBAL.log_slow_disabled_statements
+admin,sp
+SET @@SESSION.log_slow_disabled_statements="";
+select @@SESSION.log_slow_admin_statements;
+@@SESSION.log_slow_admin_statements
+1
+SET @@SESSION.log_slow_disabled_statements="admin";
+select @@SESSION.log_slow_admin_statements;
+@@SESSION.log_slow_admin_statements
+0
+SET @@GLOBAL.log_slow_disabled_statements="";
+select @@GLOBAL.log_slow_admin_statements;
+@@GLOBAL.log_slow_admin_statements
+1
+SET @@GLOBAL.log_slow_disabled_statements="admin";
+select @@GLOBAL.log_slow_admin_statements;
+@@GLOBAL.log_slow_admin_statements
+0
+SET @@global.log_slow_disabled_statements= @save_log_slow_disabled_statements;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_disabled_statements_basic.result b/mysql-test/suite/sys_vars/r/log_slow_disabled_statements_basic.result
new file mode 100644
index 00000000000..7ef4931a288
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_disabled_statements_basic.result
@@ -0,0 +1,72 @@
+SET @start_global_value = @@global.log_slow_disabled_statements;
+select @@global.log_slow_disabled_statements;
+@@global.log_slow_disabled_statements
+sp
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+sp
+show global variables like 'log_slow_disabled_statements';
+Variable_name Value
+log_slow_disabled_statements sp
+show session variables like 'log_slow_disabled_statements';
+Variable_name Value
+log_slow_disabled_statements sp
+select * from information_schema.global_variables where variable_name='log_slow_disabled_statements';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_DISABLED_STATEMENTS sp
+select * from information_schema.session_variables where variable_name='log_slow_disabled_statements';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_DISABLED_STATEMENTS sp
+set global log_slow_disabled_statements=1;
+select @@global.log_slow_disabled_statements;
+@@global.log_slow_disabled_statements
+admin
+set session log_slow_disabled_statements=1;
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+admin
+set session log_slow_disabled_statements=1;
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+admin
+set session log_slow_disabled_statements=2;
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+call
+set session log_slow_disabled_statements=5;
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+admin,slave
+set session log_slow_disabled_statements='admin';
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+admin
+set session log_slow_disabled_statements='slave';
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+slave
+set session log_slow_disabled_statements='call';
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+call
+set session log_slow_disabled_statements='sp';
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+sp
+set session log_slow_disabled_statements='admin,sp,call,slave';
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+admin,call,slave,sp
+set session log_slow_disabled_statements='';
+select @@session.log_slow_disabled_statements;
+@@session.log_slow_disabled_statements
+
+set session log_slow_disabled_statements=1.1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_disabled_statements'
+set session log_slow_disabled_statements=1e1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_disabled_statements'
+set session log_slow_disabled_statements="foo";
+ERROR 42000: Variable 'log_slow_disabled_statements' can't be set to the value of 'foo'
+set session log_slow_disabled_statements=1024;
+ERROR 42000: Variable 'log_slow_disabled_statements' can't be set to the value of '1024'
+SET @@global.log_slow_disabled_statements = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_disabled_statements_func.result b/mysql-test/suite/sys_vars/r/log_slow_disabled_statements_func.result
new file mode 100644
index 00000000000..80a723a305d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_disabled_statements_func.result
@@ -0,0 +1,166 @@
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_long_query_time= @@session.long_query_time;
+SET @old_log_slow_disable_statements= @@global.log_slow_disabled_statements;
+SET @@session.log_slow_verbosity="explain,innodb,query_plan";
+CREATE TABLE t1 (i INT PRIMARY KEY AUTO_INCREMENT, j blob) ENGINE=MyISAM;
+insert into t1 (j) values ('a'),('b'),('c'),('d');
+create table t2 (a int auto_increment primary key) engine=myisam;
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+CREATE PROCEDURE slow()
+BEGIN
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b';
+SELECT count(*) from t1 where j>'a';
+insert into t2 () values();
+END
+$
+CREATE PROCEDURE slow2()
+BEGIN
+SELECT j,count(*) from t1 group by j;
+create temporary table t3 (a int);
+alter table t3 add column (b int);
+call slow();
+drop temporary table t3;
+SELECT j,count(*)+1 from t1 group by j,i;
+END
+$
+SET SESSION long_query_time = 0;
+SELECT @@log_slow_disabled_statements;
+@@log_slow_disabled_statements
+sp
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra int;
+CALL slow2();
+j count(*)
+a 1
+b 1
+c 1
+d 1
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+j count(*)+1
+a 2
+b 2
+c 2
+d 2
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+sql_text
+TRUNCATE TABLE mysql.slow_log
+ALTER TABLE t1 add column extra int
+CALL slow2()
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2'
+<--
+SET SESSION log_slow_disabled_statements="call,admin";
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra2 int;
+CALL slow2();
+j count(*)
+a 1
+b 1
+c 1
+d 1
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+j count(*)+1
+a 2
+b 2
+c 2
+d 2
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+sql_text
+TRUNCATE TABLE mysql.slow_log
+SELECT j,count(*) from t1 group by j
+create temporary table t3 (a int)
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b'
+SELECT count(*) from t1 where j>'a'
+insert into t2 () values()
+drop temporary table t3
+SELECT j,count(*)+1 from t1 group by j,i
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3'
+<--
+SET SESSION log_slow_disabled_statements="";
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra3 int;
+CALL slow2();
+j count(*)
+a 1
+b 1
+c 1
+d 1
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+j count(*)+1
+a 2
+b 2
+c 2
+d 2
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+sql_text
+TRUNCATE TABLE mysql.slow_log
+ALTER TABLE t1 add column extra3 int
+SELECT j,count(*) from t1 group by j
+create temporary table t3 (a int)
+alter table t3 add column (b int)
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b'
+SELECT count(*) from t1 where j>'a'
+insert into t2 () values()
+call slow()
+drop temporary table t3
+SELECT j,count(*)+1 from t1 group by j,i
+CALL slow2()
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4'
+<--
+SET SESSION log_slow_disabled_statements="call,admin,slave,sp";
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra4 int;
+CALL slow2();
+j count(*)
+a 1
+b 1
+c 1
+d 1
+count(if(sleep(1) >= 0,0,NULL))
+2
+count(*)
+3
+j count(*)+1
+a 2
+b 2
+c 2
+d 2
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part5';
+count(if(sleep(1) >= 0,0,NULL))
+2
+-->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+sql_text
+TRUNCATE TABLE mysql.slow_log
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part5'
+<--
+DROP TABLE t1,t2;
+DROP PROCEDURE slow;
+DROP PROCEDURE slow2;
+SET @@session.long_query_time= @old_long_query_time;
+TRUNCATE TABLE mysql.slow_log;
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@global.log_slow_disabled_statements= @old_log_slow_disable_statements;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result b/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result
index 5b6eccf2185..93558fb6dd9 100644
--- a/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result
@@ -1,22 +1,22 @@
SET @start_global_value = @@global.log_slow_filter;
select @@global.log_slow_filter;
@@global.log_slow_filter
-admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
select @@session.log_slow_filter;
@@session.log_slow_filter
-admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
show global variables like 'log_slow_filter';
Variable_name Value
-log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+log_slow_filter admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
show session variables like 'log_slow_filter';
Variable_name Value
-log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+log_slow_filter admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
select * from information_schema.global_variables where variable_name='log_slow_filter';
VARIABLE_NAME VARIABLE_VALUE
-LOG_SLOW_FILTER admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+LOG_SLOW_FILTER admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
select * from information_schema.session_variables where variable_name='log_slow_filter';
VARIABLE_NAME VARIABLE_VALUE
-LOG_SLOW_FILTER admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+LOG_SLOW_FILTER admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
set global log_slow_filter=1;
select @@global.log_slow_filter;
@@global.log_slow_filter
@@ -57,6 +57,10 @@ set session log_slow_filter='full_scan';
select @@session.log_slow_filter;
@@session.log_slow_filter
full_scan
+set session log_slow_filter='not_using_index';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+not_using_index
set session log_slow_filter='query_cache';
select @@session.log_slow_filter;
@@session.log_slow_filter
@@ -77,10 +81,10 @@ set session log_slow_filter='filesort,query_cache';
select @@session.log_slow_filter;
@@session.log_slow_filter
filesort,query_cache
-set session log_slow_filter='admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk';
+set session log_slow_filter='admin,not_using_index,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk';
select @@session.log_slow_filter;
@@session.log_slow_filter
-admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+admin,filesort,filesort_on_disk,full_join,full_scan,not_using_index,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
set session log_slow_filter='';
select @@session.log_slow_filter;
@@session.log_slow_filter
@@ -91,6 +95,6 @@ set session log_slow_filter=1e1;
ERROR 42000: Incorrect argument type to variable 'log_slow_filter'
set session log_slow_filter="foo";
ERROR 42000: Variable 'log_slow_filter' can't be set to the value of 'foo'
-set session log_slow_filter=1024;
-ERROR 42000: Variable 'log_slow_filter' can't be set to the value of '1024'
+set session log_slow_filter=16384;
+ERROR 42000: Variable 'log_slow_filter' can't be set to the value of '16384'
SET @@global.log_slow_filter = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
index d6a7487c162..e84c2aa40dd 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
@@ -137,12 +137,8 @@ ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be
SELECT @@max_binlog_cache_size;
@@max_binlog_cache_size
4096
-SET local.max_binlog_cache_size = 7000;
-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 'max_binlog_cache_size = 7000' at line 1
SELECT local.max_binlog_cache_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_binlog_cache_size = 8000;
-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 'max_binlog_cache_size = 8000' at line 1
SELECT global.max_binlog_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
index 87883351eb6..4a1e3beda67 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
@@ -136,12 +136,8 @@ ERROR HY000: Variable 'max_binlog_size' is a GLOBAL variable and should be set w
SELECT @@max_binlog_size;
@@max_binlog_size
4096
-SET local.max_binlog_size = 7000;
-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 'max_binlog_size = 7000' at line 1
SELECT local.max_binlog_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_binlog_size = 8000;
-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 'max_binlog_size = 8000' at line 1
SELECT global.max_binlog_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_binlog_size = @@session.max_binlog_size;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
index 98e595cc4c3..5f4c5e3fd71 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
@@ -137,12 +137,8 @@ ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and shou
SELECT @@max_binlog_stmt_cache_size;
@@max_binlog_stmt_cache_size
4096
-SET local.max_binlog_stmt_cache_size = 7000;
-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 'max_binlog_stmt_cache_size = 7000' at line 1
SELECT local.max_binlog_stmt_cache_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_binlog_stmt_cache_size = 8000;
-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 'max_binlog_stmt_cache_size = 8000' at line 1
SELECT global.max_binlog_stmt_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size;
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result
index 469bd8ea072..e37463fa465 100644
--- a/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result
@@ -115,12 +115,8 @@ ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be se
SELECT @@max_connect_errors;
@@max_connect_errors
5000
-SET local.max_connect_errors = 7000;
-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 'max_connect_errors = 7000' at line 1
SELECT local.max_connect_errors;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_connect_errors = 8000;
-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 'max_connect_errors = 8000' at line 1
SELECT global.max_connect_errors;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_connect_errors = @@session.max_connect_errors;
diff --git a/mysql-test/suite/sys_vars/r/max_connections_basic.result b/mysql-test/suite/sys_vars/r/max_connections_basic.result
index 851592e7e5b..048fb99b3f5 100644
--- a/mysql-test/suite/sys_vars/r/max_connections_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_connections_basic.result
@@ -124,12 +124,8 @@ ERROR HY000: Variable 'max_connections' is a GLOBAL variable and should be set w
SELECT @@max_connections;
@@max_connections
5000
-SET local.max_connections = 7000;
-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 'max_connections = 7000' at line 1
SELECT local.max_connections;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_connections = 8000;
-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 'max_connections = 8000' at line 1
SELECT global.max_connections;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_connections = @@session.max_connections;
diff --git a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
index d3de7707f84..453f6953406 100644
--- a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
@@ -116,12 +116,8 @@ ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should
SELECT @@max_prepared_stmt_count;
@@max_prepared_stmt_count
5000
-SET local.max_prepared_stmt_count = 7000;
-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 'max_prepared_stmt_count = 7000' at line 1
SELECT local.max_prepared_stmt_count;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_prepared_stmt_count = 8000;
-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 'max_prepared_stmt_count = 8000' at line 1
SELECT global.max_prepared_stmt_count;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_prepared_stmt_count = @@session.max_prepared_stmt_count;
diff --git a/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
index 6025e28ccaa..efa2e05c59b 100644
--- a/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
@@ -133,12 +133,8 @@ Warning 1292 Truncated incorrect max_relay_log_size value: '6000'
SELECT @@max_relay_log_size;
@@max_relay_log_size
4096
-SET local.max_relay_log_size = 7000;
-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 'max_relay_log_size = 7000' at line 1
SELECT local.max_relay_log_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.max_relay_log_size = 8000;
-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 'max_relay_log_size = 8000' at line 1
SELECT global.max_relay_log_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT max_relay_log_size = @@session.max_relay_log_size;
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 e9150338317..19d7ba6ffb6 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
@@ -105,10 +105,6 @@ SELECT @@global.myisam_stats_method;
NULLS_UNEQUAL
'#---------------------FN_DYNVARS_097_09----------------------#'
SET myisam_stats_method = 'nulls_equal';
-SET session.myisam_stats_method = 'nulls_equal';
-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 'myisam_stats_method = 'nulls_equal'' at line 1
-SET global.myisam_stats_method = 'nulls_equal';
-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 'myisam_stats_method = 'nulls_equal'' at line 1
SET session myisam_stats_method = 'nulls_equal';
SELECT @@myisam_stats_method;
@@myisam_stats_method
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
index 8f4500b2650..7181cba99a1 100644
--- a/mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/mysql56_temporal_format_basic.result
@@ -83,8 +83,6 @@ SELECT @@mysql56_temporal_format = @@global.mysql56_temporal_format;
'#---------------------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;
diff --git a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
index 5cc17917242..8b668340d1a 100644
--- a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
@@ -1,45 +1,105 @@
SET @start_global_value = @@global.old_alter_table;
SELECT @start_global_value;
@start_global_value
-0
+DEFAULT
select @@global.old_alter_table;
@@global.old_alter_table
-0
+DEFAULT
select @@session.old_alter_table;
@@session.old_alter_table
-0
+DEFAULT
show global variables like 'old_alter_table';
Variable_name Value
-old_alter_table OFF
+old_alter_table DEFAULT
show session variables like 'old_alter_table';
Variable_name Value
-old_alter_table OFF
+old_alter_table DEFAULT
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE OFF
+OLD_ALTER_TABLE DEFAULT
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE OFF
+OLD_ALTER_TABLE DEFAULT
set global old_alter_table=1;
-set session old_alter_table=ON;
+set session old_alter_table=1;
select @@global.old_alter_table;
@@global.old_alter_table
-1
+COPY
select @@session.old_alter_table;
@@session.old_alter_table
-1
+COPY
show global variables like 'old_alter_table';
Variable_name Value
-old_alter_table ON
+old_alter_table COPY
show session variables like 'old_alter_table';
Variable_name Value
-old_alter_table ON
+old_alter_table COPY
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE ON
+OLD_ALTER_TABLE COPY
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE ON
+OLD_ALTER_TABLE COPY
+set global old_alter_table=2;
+set session old_alter_table=2;
+select @@global.old_alter_table;
+@@global.old_alter_table
+INPLACE
+select @@session.old_alter_table;
+@@session.old_alter_table
+INPLACE
+show global variables like 'old_alter_table';
+Variable_name Value
+old_alter_table INPLACE
+show session variables like 'old_alter_table';
+Variable_name Value
+old_alter_table INPLACE
+select * from information_schema.global_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE INPLACE
+select * from information_schema.session_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE INPLACE
+set global old_alter_table=3;
+set session old_alter_table=3;
+select @@global.old_alter_table;
+@@global.old_alter_table
+NOCOPY
+select @@session.old_alter_table;
+@@session.old_alter_table
+NOCOPY
+show global variables like 'old_alter_table';
+Variable_name Value
+old_alter_table NOCOPY
+show session variables like 'old_alter_table';
+Variable_name Value
+old_alter_table NOCOPY
+select * from information_schema.global_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE NOCOPY
+select * from information_schema.session_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE NOCOPY
+set global old_alter_table=4;
+set session old_alter_table=4;
+select @@global.old_alter_table;
+@@global.old_alter_table
+INSTANT
+select @@session.old_alter_table;
+@@session.old_alter_table
+INSTANT
+show global variables like 'old_alter_table';
+Variable_name Value
+old_alter_table INSTANT
+show session variables like 'old_alter_table';
+Variable_name Value
+old_alter_table INSTANT
+select * from information_schema.global_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE INSTANT
+select * from information_schema.session_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE INSTANT
set global old_alter_table=1.1;
ERROR 42000: Incorrect argument type to variable 'old_alter_table'
set global old_alter_table=1e1;
@@ -49,4 +109,4 @@ ERROR 42000: Variable 'old_alter_table' can't be set to the value of 'foo'
SET @@global.old_alter_table = @start_global_value;
SELECT @@global.old_alter_table;
@@global.old_alter_table
-0
+DEFAULT
diff --git a/mysql-test/suite/sys_vars/r/old_mode_basic.result b/mysql-test/suite/sys_vars/r/old_mode_basic.result
index 052221d796e..39c8e554be2 100644
--- a/mysql-test/suite/sys_vars/r/old_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_mode_basic.result
@@ -132,10 +132,6 @@ SELECT @@global.old_mode;
'#---------------------FN_DYNVARS_152_09----------------------#'
SET old_mode = 'NO_PROGRESS_INFO';
-SET session.old_mode = 'ANSI';
-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 'old_mode = 'ANSI'' at line 1
-SET global.old_mode = 'ANSI';
-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 'old_mode = 'ANSI'' at line 1
SET session old_mode = 1;
SELECT @@old_mode;
@@old_mode
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 d813f515f83..fe752e28d56 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -1,60 +1,60 @@
set @@global.optimizer_switch=@@optimizer_switch;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
set global optimizer_switch=4101;
set session optimizer_switch=2058;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off
set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=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,orderby_uses_equalities=on,condition_pushdown_for_derived=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic.result
index 892bc306bcb..ba70a76ae55 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic.result
@@ -113,12 +113,8 @@ ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set
SELECT @@query_cache_limit;
@@query_cache_limit
1
-SET local.query_cache_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 'query_cache_limit = 1' at line 1
SELECT local.query_cache_limit;
ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_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 'query_cache_limit = 1' at line 1
SELECT global.query_cache_limit;
ERROR 42S02: Unknown table 'global' in field list
SELECT query_cache_limit = @@session.query_cache_limit;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic.result
index bc93f966376..a46476f0fdd 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic.result
@@ -133,12 +133,8 @@ ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should
SELECT @@query_cache_min_res_unit;
@@query_cache_min_res_unit
512
-SET local.query_cache_min_res_unit = 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 'query_cache_min_res_unit = 1' at line 1
SELECT local.query_cache_min_res_unit;
ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_min_res_unit = 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 'query_cache_min_res_unit = 1' at line 1
SELECT global.query_cache_min_res_unit;
ERROR 42S02: Unknown table 'global' in field list
SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
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 ee959a45fa0..5d4e0a54ad9 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
@@ -120,12 +120,8 @@ ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set
SELECT @@query_cache_size;
@@query_cache_size
0
-SET local.query_cache_size = 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 'query_cache_size = 1' at line 1
SELECT local.query_cache_size;
ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_size = 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 'query_cache_size = 1' at line 1
SELECT global.query_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT query_cache_size = @@session.query_cache_size;
diff --git a/mysql-test/suite/sys_vars/r/read_only_basic.result b/mysql-test/suite/sys_vars/r/read_only_basic.result
index 6c2c50ced46..4048e9754c4 100644
--- a/mysql-test/suite/sys_vars/r/read_only_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_only_basic.result
@@ -102,12 +102,8 @@ ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SE
SELECT @@read_only;
@@read_only
1
-SET local.read_only = 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 'read_only = 1' at line 1
SELECT local.read_only;
ERROR 42S02: Unknown table 'local' in field list
-SET global.read_only = 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 'read_only = 1' at line 1
SELECT global.read_only;
ERROR 42S02: Unknown table 'global' in field list
SELECT read_only = @@session.read_only;
diff --git a/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result b/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
index 8de09fe6b39..e00be57692e 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
@@ -82,8 +82,6 @@ SELECT @@relay_log_purge = @@global.relay_log_purge;
'#---------------------FN_DYNVARS_141_08----------------------#'
SET relay_log_purge = 1;
ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.relay_log_purge = 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 'relay_log_purge = 1' at line 1
SELECT global.relay_log_purge;
ERROR 42S02: Unknown table 'global' in field list
SELECT relay_log_purge = @@session.relay_log_purge;
diff --git a/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result b/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result
index db97ce14c93..a1701635f0e 100644
--- a/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result
@@ -46,3 +46,13 @@ SELECT @@GLOBAL.replicate_ignore_table;
# Cleanup.
SET @@GLOBAL.replicate_ignore_table = @save_replicate_ignore_table;
+#
+# MDEV-20101 Assertion failure on select @@global.'m2'.replicate_ignore_table
+#
+SET NAMES latin1;
+SELECT @@global.'m2'.replicate_ignore_table;
+@@global.'m2'.replicate_ignore_table
+NULL
+Warnings:
+Warning 1617 There is no master connection 'm2'
+Warning 1617 There is no master connection 'm2'
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
index 7454f0b0089..0c90462df59 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
@@ -65,6 +65,12 @@ set global rpl_semi_sync_master_enabled=1e1;
ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_enabled'
set global rpl_semi_sync_master_enabled="some text";
ERROR 42000: Variable 'rpl_semi_sync_master_enabled' can't be set to the value of 'some text'
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+disconnect con1;
+disconnect con2;
+connection default;
+SET @@global.rpl_semi_sync_master_enabled = 1;
SET @@global.rpl_semi_sync_master_enabled = @start_global_value;
select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled
diff --git a/mysql-test/suite/sys_vars/r/secure_timestamp_no.result b/mysql-test/suite/sys_vars/r/secure_timestamp_no.result
new file mode 100644
index 00000000000..34eeb083c28
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/secure_timestamp_no.result
@@ -0,0 +1,40 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+select @@secure_timestamp;
+@@secure_timestamp
+NO
+set timestamp=1234567890.101112;
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'SUPER';
+SUPER
+EDITABLE
+create user foo@127.0.0.1;
+connect con2,127.0.0.1,foo,,test,$SLAVE_MYPORT;
+set timestamp=1234567890.101112;
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'non-privileged';
+non-privileged
+EDITABLE
+disconnect con2;
+connection slave;
+drop user foo@127.0.0.1;
+connection master;
+set time_zone='+00:00';
+set timestamp=1234567890.101112;
+select @@timestamp, now(6);
+@@timestamp now(6)
+1234567890.101112 2009-02-13 23:31:30.101112
+create table t1 (b varchar(20), a timestamp(6) default current_timestamp(6));
+insert t1 (b) values ('replicated');
+connection slave;
+create trigger t1rbr before insert on t1 for each row set new.a=now(6);
+set @@global.slave_run_triggers_for_rbr= yes;
+binlog 'LQfqWg8BAAAA/AAAAAABAAABAAQAMTAuMy42LU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtB+paEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEwQADQgICAoKCgFlBcaR';
+binlog '0gKWSRMBAAAAMQAAAHQDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIPEQMUAAYBQFUzwA==0gKWSRcBAAAAMAAAAKQDAAAAAB8AAAAAAAEAAv/8BmJpbmxvZ0mWAtIBivg3mwo+';
+set @@global.slave_run_triggers_for_rbr= default;
+select b, if(a > 20100101, 'READONLY', 'EDITABLE') as 'REPLICATION' from t1;
+b REPLICATION
+replicated EDITABLE
+binlog EDITABLE
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/secure_timestamp_rpl.result b/mysql-test/suite/sys_vars/r/secure_timestamp_rpl.result
new file mode 100644
index 00000000000..e2d79745a46
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/secure_timestamp_rpl.result
@@ -0,0 +1,42 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+select @@secure_timestamp;
+@@secure_timestamp
+REPLICATION
+set timestamp=1234567890.101112;
+ERROR HY000: The MariaDB server is running with the --secure-timestamp=REPLICATION option so it cannot execute this statement
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'SUPER';
+SUPER
+READONLY
+create user foo@127.0.0.1;
+connect con2,127.0.0.1,foo,,test,$SLAVE_MYPORT;
+set timestamp=1234567890.101112;
+ERROR HY000: The MariaDB server is running with the --secure-timestamp=REPLICATION option so it cannot execute this statement
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'non-privileged';
+non-privileged
+READONLY
+disconnect con2;
+connection slave;
+drop user foo@127.0.0.1;
+connection master;
+set time_zone='+00:00';
+set timestamp=1234567890.101112;
+select @@timestamp, now(6);
+@@timestamp now(6)
+1234567890.101112 2009-02-13 23:31:30.101112
+create table t1 (b varchar(20), a timestamp(6) default current_timestamp(6));
+insert t1 (b) values ('replicated');
+connection slave;
+create trigger t1rbr before insert on t1 for each row set new.a=now(6);
+set @@global.slave_run_triggers_for_rbr= yes;
+binlog 'LQfqWg8BAAAA/AAAAAABAAABAAQAMTAuMy42LU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtB+paEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEwQADQgICAoKCgFlBcaR';
+binlog '0gKWSRMBAAAAMQAAAHQDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIPEQMUAAYBQFUzwA==0gKWSRcBAAAAMAAAAKQDAAAAAB8AAAAAAAEAAv/8BmJpbmxvZ0mWAtIBivg3mwo+';
+set @@global.slave_run_triggers_for_rbr= default;
+select b, if(a > 20100101, 'READONLY', 'EDITABLE') as 'REPLICATION' from t1;
+b REPLICATION
+replicated EDITABLE
+binlog READONLY
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/secure_timestamp_super.result b/mysql-test/suite/sys_vars/r/secure_timestamp_super.result
new file mode 100644
index 00000000000..6fbb5e5fbf0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/secure_timestamp_super.result
@@ -0,0 +1,41 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+select @@secure_timestamp;
+@@secure_timestamp
+SUPER
+set timestamp=1234567890.101112;
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'SUPER';
+SUPER
+EDITABLE
+create user foo@127.0.0.1;
+connect con2,127.0.0.1,foo,,test,$SLAVE_MYPORT;
+set timestamp=1234567890.101112;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'non-privileged';
+non-privileged
+READONLY
+disconnect con2;
+connection slave;
+drop user foo@127.0.0.1;
+connection master;
+set time_zone='+00:00';
+set timestamp=1234567890.101112;
+select @@timestamp, now(6);
+@@timestamp now(6)
+1234567890.101112 2009-02-13 23:31:30.101112
+create table t1 (b varchar(20), a timestamp(6) default current_timestamp(6));
+insert t1 (b) values ('replicated');
+connection slave;
+create trigger t1rbr before insert on t1 for each row set new.a=now(6);
+set @@global.slave_run_triggers_for_rbr= yes;
+binlog 'LQfqWg8BAAAA/AAAAAABAAABAAQAMTAuMy42LU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtB+paEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEwQADQgICAoKCgFlBcaR';
+binlog '0gKWSRMBAAAAMQAAAHQDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIPEQMUAAYBQFUzwA==0gKWSRcBAAAAMAAAAKQDAAAAAB8AAAAAAAEAAv/8BmJpbmxvZ0mWAtIBivg3mwo+';
+set @@global.slave_run_triggers_for_rbr= default;
+select b, if(a > 20100101, 'READONLY', 'EDITABLE') as 'REPLICATION' from t1;
+b REPLICATION
+replicated EDITABLE
+binlog EDITABLE
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/secure_timestamp_yes.result b/mysql-test/suite/sys_vars/r/secure_timestamp_yes.result
new file mode 100644
index 00000000000..d317cfc30b2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/secure_timestamp_yes.result
@@ -0,0 +1,42 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+select @@secure_timestamp;
+@@secure_timestamp
+YES
+set timestamp=1234567890.101112;
+ERROR HY000: The MariaDB server is running with the --secure-timestamp=YES option so it cannot execute this statement
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'SUPER';
+SUPER
+READONLY
+create user foo@127.0.0.1;
+connect con2,127.0.0.1,foo,,test,$SLAVE_MYPORT;
+set timestamp=1234567890.101112;
+ERROR HY000: The MariaDB server is running with the --secure-timestamp=YES option so it cannot execute this statement
+select if(now(6) > 20100101, 'READONLY', 'EDITABLE') as 'non-privileged';
+non-privileged
+READONLY
+disconnect con2;
+connection slave;
+drop user foo@127.0.0.1;
+connection master;
+set time_zone='+00:00';
+set timestamp=1234567890.101112;
+select @@timestamp, now(6);
+@@timestamp now(6)
+1234567890.101112 2009-02-13 23:31:30.101112
+create table t1 (b varchar(20), a timestamp(6) default current_timestamp(6));
+insert t1 (b) values ('replicated');
+connection slave;
+create trigger t1rbr before insert on t1 for each row set new.a=now(6);
+set @@global.slave_run_triggers_for_rbr= yes;
+binlog 'LQfqWg8BAAAA/AAAAAABAAABAAQAMTAuMy42LU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtB+paEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEwQADQgICAoKCgFlBcaR';
+binlog '0gKWSRMBAAAAMQAAAHQDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIPEQMUAAYBQFUzwA==0gKWSRcBAAAAMAAAAKQDAAAAAB8AAAAAAAEAAv/8BmJpbmxvZ0mWAtIBivg3mwo+';
+set @@global.slave_run_triggers_for_rbr= default;
+select b, if(a > 20100101, 'READONLY', 'EDITABLE') as 'REPLICATION' from t1;
+b REPLICATION
+replicated READONLY
+binlog READONLY
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
index 7162e40ef6b..90d2fec3d0a 100644
--- a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
+++ b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
@@ -5,25 +5,25 @@
# Global - default
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
# Session - default
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
# via INFORMATION_SCHEMA.GLOBAL_VARIABLES
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'session_track%' ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE
SESSION_TRACK_SCHEMA ON
SESSION_TRACK_STATE_CHANGE OFF
-SESSION_TRACK_SYSTEM_VARIABLES
+SESSION_TRACK_SYSTEM_VARIABLES autocommit,character_set_client,character_set_connection,character_set_results,time_zone
SESSION_TRACK_TRANSACTION_INFO OFF
# via INFORMATION_SCHEMA.SESSION_VARIABLES
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'session_track%' ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE
SESSION_TRACK_SCHEMA ON
SESSION_TRACK_STATE_CHANGE OFF
-SESSION_TRACK_SYSTEM_VARIABLES
+SESSION_TRACK_SYSTEM_VARIABLES autocommit,character_set_client,character_set_connection,character_set_results,time_zone
SESSION_TRACK_TRANSACTION_INFO OFF
SET @global_saved_tmp = @@global.session_track_system_variables;
@@ -34,7 +34,7 @@ SELECT @@global.session_track_system_variables;
autocommit
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
# Altering session variable's value
SET @@session.session_track_system_variables='autocommit';
@@ -72,25 +72,25 @@ SET @@session.session_track_system_variables = DEFAULT;
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
# Variables' values in a new session (con2).
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
# Altering session should not affect global.
SET @@session.session_track_system_variables = 'sql_mode';
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
sql_mode
@@ -104,21 +104,15 @@ SELECT @@global.session_track_system_variables;
sql_mode
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-
+autocommit,character_set_client,character_set_connection,character_set_results,time_zone
# Switching to the default connection.
connection default;
# Testing NULL
SET @@global.session_track_system_variables = NULL;
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
SET @@session.session_track_system_variables = NULL;
-# Global - expect "" instead of NULL
-SELECT @@global.session_track_system_variables;
-@@global.session_track_system_variables
-NULL
-# Session - expect "" instead of NULL
-SELECT @@session.session_track_system_variables;
-@@session.session_track_system_variables
-
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
# testing with duplicate entries.
SET @@global.session_track_system_variables= "time_zone";
SET @@session.session_track_system_variables= "time_zone";
diff --git a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result
index a5fe9b35ed5..9cbfb9b2c11 100644
--- a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result
@@ -131,12 +131,8 @@ ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should
SELECT @@slave_max_allowed_packet;
@@slave_max_allowed_packet
4096
-SET local.slave_max_allowed_packet = 7000;
-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 'slave_max_allowed_packet = 7000' at line 1
SELECT local.slave_max_allowed_packet;
ERROR 42S02: Unknown table 'local' in field list
-SET global.slave_max_allowed_packet = 8000;
-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 'slave_max_allowed_packet = 8000' at line 1
SELECT global.slave_max_allowed_packet;
ERROR 42S02: Unknown table 'global' in field list
SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet;
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
deleted file mode 100644
index 02a3cdf27ce..00000000000
--- a/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_basic.result
+++ /dev/null
@@ -1,45 +0,0 @@
-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/slave_transaction_retry_errors.result b/mysql-test/suite/sys_vars/r/slave_transaction_retry_errors.result
new file mode 100644
index 00000000000..a7815bb3f78
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retry_errors.result
@@ -0,0 +1,21 @@
+select @@global.slave_transaction_retry_errors;
+@@global.slave_transaction_retry_errors
+1213,1205,10,20,400
+select @@session.slave_transaction_retry_errors;
+ERROR HY000: Variable 'slave_transaction_retry_errors' is a GLOBAL variable
+show global variables like 'slave_transaction_retry_errors';
+Variable_name Value
+slave_transaction_retry_errors 1213,1205,10,20,400
+show session variables like 'slave_transaction_retry_errors';
+Variable_name Value
+slave_transaction_retry_errors 1213,1205,10,20,400
+select * from information_schema.global_variables where variable_name='slave_transaction_retry_errors';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_TRANSACTION_RETRY_ERRORS 1213,1205,10,20,400
+select * from information_schema.session_variables where variable_name='slave_transaction_retry_errors';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_TRANSACTION_RETRY_ERRORS 1213,1205,10,20,400
+set global slave_transaction_retry_errors=1;
+ERROR HY000: Variable 'slave_transaction_retry_errors' is a read only variable
+set session slave_transaction_retry_errors=1;
+ERROR HY000: Variable 'slave_transaction_retry_errors' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_basic.result b/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_basic.result
new file mode 100644
index 00000000000..8be45f83341
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_basic.result
@@ -0,0 +1,126 @@
+SET @start_global_value = @@global.slave_transaction_retry_interval;
+SELECT @start_global_value;
+@start_global_value
+0
+'#--------------------FN_DYNVARS_149_01-------------------------#'
+SET @@global.slave_transaction_retry_interval = 50;
+SET @@global.slave_transaction_retry_interval = DEFAULT;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+0
+'#--------------------FN_DYNVARS_149_02-------------------------#'
+SET @@global.slave_transaction_retry_interval = DEFAULT;
+SELECT @@global.slave_transaction_retry_interval = 10;
+@@global.slave_transaction_retry_interval = 10
+0
+'#--------------------FN_DYNVARS_149_03-------------------------#'
+SET @@global.slave_transaction_retry_interval = 0;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+0
+SET @@global.slave_transaction_retry_interval = 1;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+1
+SET @@global.slave_transaction_retry_interval = 15;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+15
+SET @@global.slave_transaction_retry_interval = 1024;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+1024
+SET @@global.slave_transaction_retry_interval = 2147483648;
+Warnings:
+Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '2147483648'
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+3600
+SET @@global.slave_transaction_retry_interval = 2147483648*2-1;
+Warnings:
+Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4294967295'
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+3600
+SET @@global.slave_transaction_retry_interval = 2147483649*2;
+Warnings:
+Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4294967298'
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+3600
+SET @@global.slave_transaction_retry_interval = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4294967295'
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+3600
+'#--------------------FN_DYNVARS_149_04-------------------------#'
+SET @@slave_transaction_retry_interval = 2;
+ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.slave_transaction_retry_interval = 3;
+ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.slave_transaction_retry_interval = 4;
+ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_149_05-----------------------#'
+SET @@global.slave_transaction_retry_interval = -1;
+Warnings:
+Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '-1'
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+0
+SET @@global.slave_transaction_retry_interval = 2147483649*2147483649;
+Warnings:
+Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4611686022722355201'
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+3600
+SET @@global.slave_transaction_retry_interval = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval'
+SET @@global.slave_transaction_retry_interval = '100';
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval'
+SET @@global.slave_transaction_retry_interval = 7483649.56;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval'
+SET @@global.slave_transaction_retry_interval = ON;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval'
+SET @@global.slave_transaction_retry_interval = OFF;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval'
+'#------------------FN_DYNVARS_149_06-----------------------#'
+SET @@global.slave_transaction_retry_interval = 3000;
+SELECT @@global.slave_transaction_retry_interval = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='slave_transaction_retry_interval';
+@@global.slave_transaction_retry_interval = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_149_07-----------------------#'
+SELECT count(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='slave_transaction_retry_interval';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_149_08-----------------------#'
+SET @@global.slave_transaction_retry_interval = TRUE;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+1
+SET @@global.slave_transaction_retry_interval = FALSE;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+0
+'#---------------------FN_DYNVARS_149_09----------------------#'
+SET @@global.slave_transaction_retry_interval = 60*60;
+SELECT @@slave_transaction_retry_interval = @@global.slave_transaction_retry_interval;
+@@slave_transaction_retry_interval = @@global.slave_transaction_retry_interval
+1
+'#---------------------FN_DYNVARS_149_10----------------------#'
+SET slave_transaction_retry_interval = 2048;
+ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT slave_transaction_retry_interval;
+ERROR 42S22: Unknown column 'slave_transaction_retry_interval' in 'field list'
+SELECT @@slave_transaction_retry_interval;
+@@slave_transaction_retry_interval
+3600
+SET global slave_transaction_retry_interval = 99;
+SET @@global.slave_transaction_retry_interval = @start_global_value;
+SELECT @@global.slave_transaction_retry_interval;
+@@global.slave_transaction_retry_interval
+0
diff --git a/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result b/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
index e21b177eec4..3acd29b0c62 100644
--- a/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
@@ -117,12 +117,8 @@ ERROR HY000: Variable 'slow_launch_time' is a GLOBAL variable and should be set
SELECT @@slow_launch_time;
@@slow_launch_time
1
-SET local.slow_launch_time = 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 'slow_launch_time = 1' at line 1
SELECT local.slow_launch_time;
ERROR 42S02: Unknown table 'local' in field list
-SET global.slow_launch_time = 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 'slow_launch_time = 1' at line 1
SELECT global.slow_launch_time;
ERROR 42S02: Unknown table 'global' in field list
SELECT slow_launch_time = @@session.slow_launch_time;
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 049404f5648..17dfdeea3f3 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
@@ -84,12 +84,8 @@ SELECT @@slow_query_log = @@global.slow_query_log;
@@slow_query_log = @@global.slow_query_log
0
'#---------------------FN_DYNVARS_004_09----------------------#'
-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;
ERROR 42S02: Unknown table 'local' in field list
-SET global.slow_query_log = ON;
-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 = ON' at line 1
SELECT global.slow_query_log;
ERROR 42S02: Unknown table 'global' in field list
SELECT slow_query_log = @@session.slow_query_log;
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 2e3ca45d4f5..a200f620a7c 100644
--- a/mysql-test/suite/sys_vars/r/sql_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
@@ -158,7 +158,7 @@ MYSQL40,HIGH_NOT_PRECEDENCE
SET @@global.sql_mode = ORACLE;
SELECT @@global.sql_mode;
@@global.sql_mode
-PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
+PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
SET @@global.sql_mode = POSTGRESQL;
SELECT @@global.sql_mode;
@@global.sql_mode
@@ -288,7 +288,7 @@ MYSQL40,HIGH_NOT_PRECEDENCE
SET @@session.sql_mode = ORACLE;
SELECT @@session.sql_mode;
@@session.sql_mode
-PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
+PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
SET @@session.sql_mode = POSTGRESQL;
SELECT @@session.sql_mode;
@@session.sql_mode
@@ -357,17 +357,17 @@ REAL_AS_FLOAT,PIPES_AS_CONCAT
SET @@global.sql_mode = 50000;
SELECT @@global.sql_mode;
@@global.sql_mode
-PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,IGNORE_BAD_TABLE_OPTIONS,NO_UNSIGNED_SUBTRACTION,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
+PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,IGNORE_BAD_TABLE_OPTIONS,NO_UNSIGNED_SUBTRACTION,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
SET @@global.sql_mode = 500000;
SELECT @@global.sql_mode;
@@global.sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGRESQL,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,HIGH_NOT_PRECEDENCE
-SET @@global.sql_mode = 4294967295;
+SET @@global.sql_mode = 17179869183;
SELECT @@global.sql_mode;
@@global.sql_mode
-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
-SET @@global.sql_mode = 4294967296;
-ERROR 42000: Variable 'sql_mode' can't be set to the value of '4294967296'
+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,EMPTY_STRING_IS_NULL,SIMULTANEOUS_ASSIGNMENT
+SET @@global.sql_mode = 17179869184;
+ERROR 42000: Variable 'sql_mode' can't be set to the value of '17179869184'
SET @@global.sql_mode = 0.4;
ERROR 42000: Incorrect argument type to variable 'sql_mode'
'#---------------------FN_DYNVARS_152_08----------------------#'
@@ -381,10 +381,6 @@ SELECT @@global.sql_mode;
'#---------------------FN_DYNVARS_152_09----------------------#'
SET sql_mode = 'ANSI';
-SET session.sql_mode = 'ANSI';
-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 'sql_mode = 'ANSI'' at line 1
-SET global.sql_mode = 'ANSI';
-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 'sql_mode = 'ANSI'' at line 1
SET session sql_mode = 1;
SELECT @@sql_mode;
@@sql_mode
@@ -401,7 +397,7 @@ ANSI_QUOTES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,A
SET @@global.sql_mode = 'ONLY_FULL_GROUP_BY,PIPES_AS_CONCAT,REAL_AS_FLOAT,ORACLE,POSTGRESQL';
SELECT @@global.sql_mode;
@@global.sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,FOOBAR,IGNORE_SPACE';
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'FOOBAR'
SET @@sql_mode=',';
diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic.result
index d4153a0a0c8..e1c7e69d0f5 100644
--- a/mysql-test/suite/sys_vars/r/sync_binlog_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic.result
@@ -84,12 +84,8 @@ ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with
SELECT @@sync_binlog;
@@sync_binlog
4294967295
-SET local.sync_binlog = 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 'sync_binlog = 1' at line 1
SELECT local.sync_binlog;
ERROR 42S02: Unknown table 'local' in field list
-SET global.sync_binlog = 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 'sync_binlog = 1' at line 1
SELECT global.sync_binlog;
ERROR 42S02: Unknown table 'global' in field list
SELECT sync_binlog = @@session.sync_binlog;
diff --git a/mysql-test/suite/sys_vars/r/sync_frm_basic.result b/mysql-test/suite/sys_vars/r/sync_frm_basic.result
index 0c633d30820..ce9d0a1f358 100644
--- a/mysql-test/suite/sys_vars/r/sync_frm_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_frm_basic.result
@@ -85,8 +85,6 @@ ERROR HY000: Variable 'sync_frm' is a GLOBAL variable and should be set with SET
SELECT @@sync_frm;
@@sync_frm
1
-SET global.sync_frm = 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 'sync_frm = 1' at line 1
SELECT global.sync_frm;
ERROR 42S02: Unknown table 'global' in field list
SELECT sync_frm = @@session.sync_frm;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
index 3164d094528..8adb294db00 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
@@ -1,5 +1,5 @@
---- 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
+--- r\sysvars_debug.result 2017-08-08 10:52:39.036804900 +0300
++++ r\sysvars_debug,32bit.reject 2017-09-10 08:06:38.447122100 +0300
@@ -21,7 +21,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 0
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled
deleted file mode 100644
index c8a0250504e..00000000000
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled
+++ /dev/null
@@ -1,1236 +0,0 @@
---- suite/sys_vars/r/sysvars_innodb.result
-+++ suite/sys_vars/r/sysvars_innodb,32bit.reject
-@@ -47,13 +47,27 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 1
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 1
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE INT UNSIGNED
-+VARIABLE_COMMENT Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)
-+NUMERIC_MIN_VALUE 1
-+NUMERIC_MAX_VALUE 32
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_ADAPTIVE_MAX_SLEEP_DELAY
- SESSION_VALUE NULL
- GLOBAL_VALUE 150000
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 150000
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT The upper limit of the sleep delay in usec. Value of 0 disables it.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 1000000
-@@ -67,10 +81,10 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 8388608
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT
-+VARIABLE_TYPE INT
- VARIABLE_COMMENT DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.
- NUMERIC_MIN_VALUE 524288
--NUMERIC_MAX_VALUE 9223372036854775807
-+NUMERIC_MAX_VALUE 2147483647
- NUMERIC_BLOCK_SIZE 1024
- ENUM_VALUE_LIST NULL
- READ_ONLY YES
-@@ -81,7 +95,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 5
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Background commit interval in seconds
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 1073741824
-@@ -137,7 +151,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT InnoDB API transaction isolation level
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 3
-@@ -151,7 +165,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 64
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Data file autoextend increment in megabytes
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 1000
-@@ -165,7 +179,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 1
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT
-+VARIABLE_TYPE INT
- VARIABLE_COMMENT The AUTOINC lock modes supported by InnoDB: 0 => Old style AUTOINC locking (for backward compatibility) 1 => New style AUTOINC locking 2 => No AUTOINC locking (unsafe for SBR)
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 2
-@@ -263,7 +277,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 100
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Dump only the hottest N% of each buffer pool, defaults to 100
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 100
-@@ -305,7 +319,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT
-+VARIABLE_TYPE INT
- VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 64
-@@ -355,6 +369,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_BUFFER_POOL_POPULATE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Deprecated. This option has no effect and will be removed in MariaDB 10.2.3.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_BUFFER_POOL_SIZE
- SESSION_VALUE NULL
- GLOBAL_VALUE 8388608
-@@ -375,7 +403,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT A number between [0, 100] that tells how oftern buffer pool dump status in percentages should be printed. E.g. 10 means that buffer pool dump status is printed when every 10% of number of buffer pool pages are dumped. Default is 0 (only start and end status is printed).
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 100
-@@ -446,7 +474,7 @@
- DEFAULT_VALUE ON
- VARIABLE_SCOPE GLOBAL
- VARIABLE_TYPE BOOLEAN
--VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF. Enable InnoDB checksums validation (enabled by default). Disable with --skip-innodb-checksums.
-+VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF
- NUMERIC_MIN_VALUE NULL
- NUMERIC_MAX_VALUE NULL
- NUMERIC_BLOCK_SIZE NULL
-@@ -467,6 +495,104 @@
- ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_EVICTION_FACTOR
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make page cleaner LRU flushes use evicted instead of flushed page counts for its heuristics
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_CLEANER_FLUSH_CHUNK_SIZE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 100
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 100
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE INT UNSIGNED
-+VARIABLE_COMMENT Divide page cleaner flush list flush batches into chunks of this size
-+NUMERIC_MIN_VALUE 1
-+NUMERIC_MAX_VALUE 4294967295
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_FREE_LIST_LWM
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 10
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 10
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE INT UNSIGNED
-+VARIABLE_COMMENT Page cleaner will keep on flushing the same buffer pool instance if its free list length is below this percentage of innodb_lru_scan_depth
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 100
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_LRU_CHUNK_SIZE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 100
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 100
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE INT UNSIGNED
-+VARIABLE_COMMENT Divide page cleaner LRU list flush batches into chunks of this size
-+NUMERIC_MIN_VALUE 1
-+NUMERIC_MAX_VALUE 4294967295
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_LSN_AGE_FACTOR
-+SESSION_VALUE NULL
-+GLOBAL_VALUE HIGH_CHECKPOINT
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE HIGH_CHECKPOINT
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT The formula for LSN age factor for page cleaner adaptive flushing. LEGACY: Original Oracle MySQL 5.6 formula. HIGH_CHECKPOINT: (the default) Percona Server 5.6 formula.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST LEGACY,HIGH_CHECKPOINT
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_CLEANER_MAX_FLUSH_TIME
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 1000
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 1000
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE INT UNSIGNED
-+VARIABLE_COMMENT The maximum time limit for a single flush list flush iteration by the page cleaner thread in miliseconds
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 4294967295
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_MAX_LRU_TIME
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 1000
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 1000
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE INT UNSIGNED
-+VARIABLE_COMMENT The maximum time limit for a single LRU tail flush iteration by the page cleaner thread in miliseconds
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 4294967295
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -487,7 +613,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 1000
-@@ -515,7 +641,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 5
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT If the compression failure rate of a table is greater than this number more padding is added to the pages to reduce the failures. A value of zero implies no padding
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 100
-@@ -543,7 +669,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 50
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Percentage of empty space on a data page that can be reserved to make the page compressible.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 75
-@@ -557,14 +683,28 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 5000
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket
- NUMERIC_MIN_VALUE 1
--NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CORRUPT_TABLE_ACTION
-+SESSION_VALUE NULL
-+GLOBAL_VALUE assert
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE assert
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT Warn corruptions of user tables as 'corrupt table' instead of not crashing itself, when used with file_per_table. All file io for the datafile after detected as corrupt are disabled, except for the deletion.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST assert,warn,salvage
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_DATA_FILE_PATH
- SESSION_VALUE NULL
- GLOBAL_VALUE ibdata1:12M:autoextend
-@@ -781,7 +921,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
-@@ -789,6 +929,20 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY YES
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
-+SESSION_VALUE NULL
-+GLOBAL_VALUE LEGACY
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE BACKOFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT The algorithm to use for empty free list handling. Allowed values: LEGACY: Original Oracle MySQL 5.6 handling with single page flushes; BACKOFF: (default) Wait until cleaner produces a free page.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST LEGACY,BACKOFF
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
- SESSION_VALUE NULL
- GLOBAL_VALUE 1
-@@ -859,13 +1013,27 @@
- ENUM_VALUE_LIST OFF,ON,FORCE
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_FAKE_CHANGES
-+SESSION_VALUE OFF
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE SESSION
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. This is to cause replication prefetch IO. ATTENTION: the transaction started after enabled is affected.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_FAST_SHUTDOWN
- SESSION_VALUE NULL
- GLOBAL_VALUE 1
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 1
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 2
-@@ -879,7 +1047,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
-@@ -949,7 +1117,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
-@@ -963,7 +1131,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
-@@ -986,12 +1154,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
-@@ -1019,7 +1187,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
-@@ -1061,7 +1229,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
-@@ -1069,6 +1237,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
-@@ -1089,7 +1271,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
-@@ -1131,7 +1313,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
-@@ -1145,7 +1327,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
-@@ -1159,7 +1341,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
-@@ -1173,10 +1355,10 @@
- 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 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -1201,7 +1383,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
-@@ -1215,7 +1397,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
-@@ -1243,7 +1425,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
-@@ -1285,10 +1467,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
-@@ -1297,12 +1479,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
-@@ -1335,6 +1531,20 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_LOCKING_FAKE_CHANGES
-+SESSION_VALUE NULL
-+GLOBAL_VALUE ON
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE ON
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT ###EXPERIMENTAL### if enabled, transactions will get S row locks instead of X locks for fake changes. If disabled, fake change transactions will not take any locks at all.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -1369,7 +1579,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
-@@ -1377,16 +1587,72 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_LOG_ARCHIVE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Set to 1 if you want to have logs archived.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_LOG_ARCH_DIR
-+SESSION_VALUE NULL
-+GLOBAL_VALUE PATH
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE VARCHAR
-+VARIABLE_COMMENT Where full logs should be archived.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST NULL
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_LOG_ARCH_EXPIRE_SEC
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 0
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 0
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE 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 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
-@@ -1405,6 +1671,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_LOG_CHECKSUM_ALGORITHM
-+SESSION_VALUE NULL
-+GLOBAL_VALUE INNODB
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE INNODB
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT The algorithm InnoDB uses for log block checksums. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Logs created when this option is set to crc32/strict_crc32/none/strict_none will not be readable by any MySQL version or Percona Server versions that donot support this feature
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
- SESSION_VALUE NULL
- GLOBAL_VALUE ON
-@@ -1425,7 +1705,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
-@@ -1467,9 +1747,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
-@@ -1509,10 +1817,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
-@@ -1523,7 +1831,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
-@@ -1537,7 +1845,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
-@@ -1607,7 +1915,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
-@@ -1659,14 +1967,14 @@
- COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_OPEN_FILES
- SESSION_VALUE NULL
--GLOBAL_VALUE 2000
-+GLOBAL_VALUE 300
- 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
-@@ -1691,7 +1999,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
-@@ -1705,7 +2013,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
-@@ -1741,13 +2049,83 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Print lock wait timeout info to MySQL error log (off by default)
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_CLEANER
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make buffer pool cleaner and LRU manager threads acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_IO
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make I/O threads acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_MASTER
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make buffer pool cleaner thread acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_PURGE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make purge coordinator and worker threads acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_PURGE_BATCH_SIZE
- SESSION_VALUE NULL
- GLOBAL_VALUE 300
- 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
-@@ -1789,7 +2167,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
-@@ -1817,7 +2195,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
-@@ -1831,7 +2209,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
-@@ -1859,10 +2237,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
-@@ -1887,7 +2265,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
-@@ -1901,7 +2279,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
-@@ -1909,6 +2287,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
-@@ -1937,6 +2357,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
-@@ -1957,7 +2405,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
-@@ -1971,10 +2419,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
-@@ -2014,7 +2462,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
-@@ -2181,7 +2629,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
-@@ -2195,10 +2643,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
-@@ -2223,7 +2671,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
-@@ -2237,7 +2685,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
-@@ -2259,6 +2707,34 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Track the redo log for changed pages and output a changed page bitmap
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT NONE
-+VARIABLE_NAME INNODB_TRACK_REDO_LOG_NOW
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Force log tracker to catch up with checkpoint now
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -2307,7 +2783,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
-@@ -2321,7 +2797,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
-@@ -2336,7 +2812,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
-@@ -2357,6 +2833,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY YES
- COMMAND_LINE_ARGUMENT NONE
-+VARIABLE_NAME INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
-+SESSION_VALUE NULL
-+GLOBAL_VALUE ON
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE ON
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Use global innodb_flush_log_at_trx_commit value. (default: ON).
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_USE_MTFLUSH
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -2371,6 +2861,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY YES
- COMMAND_LINE_ARGUMENT NONE
-+VARIABLE_NAME INNODB_USE_STACKTRACE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Print stacktrace on long semaphore wait (off by default supported only on linux)
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_USE_SYS_MALLOC
- SESSION_VALUE NULL
- GLOBAL_VALUE ON
-@@ -2401,12 +2905,12 @@
- COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_VERSION
- SESSION_VALUE NULL
--GLOBAL_VALUE 5.6.49
-+GLOBAL_VALUE 5.6.49-89.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
-@@ -2419,7 +2923,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
index 0e4bb7cf7d6..16cda279c3e 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -1,725 +1,272 @@
---- sysvars_innodb.result 2019-08-31 10:30:56.408483011 +0300
-+++ sysvars_innodb,32bit.reject 2019-09-01 13:42:30.656578131 +0300
-@@ -46,7 +46,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 8
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT It is an alias for innodb_adaptive_hash_index_parts; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 512
-@@ -58,7 +58,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 8
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Number of InnoDB Adaptive Hash Index Partitions (default 8)
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 512
-@@ -70,7 +70,7 @@
- SESSION_VALUE NULL
- 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
-@@ -82,7 +82,7 @@
- SESSION_VALUE NULL
- 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
-@@ -94,7 +94,7 @@
- SESSION_VALUE NULL
- 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
-@@ -166,10 +166,10 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 134217728
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Size of a single memory chunk within each buffer pool instance for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
- NUMERIC_MIN_VALUE 1048576
--NUMERIC_MAX_VALUE 9223372036854775807
-+NUMERIC_MAX_VALUE 2147483647
- NUMERIC_BLOCK_SIZE 1048576
- ENUM_VALUE_LIST NULL
- READ_ONLY YES
-@@ -202,7 +202,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 25
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Dump only the hottest N% of each buffer pool, defaults to 25
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 100
-@@ -238,7 +238,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- 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
-@@ -310,7 +310,7 @@
- SESSION_VALUE NULL
- 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
-@@ -406,10 +406,10 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
--NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -418,7 +418,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 100
-@@ -430,10 +430,10 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
--NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -454,10 +454,10 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
--NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -466,10 +466,10 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
--NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -490,7 +490,7 @@
- SESSION_VALUE NULL
- 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
-@@ -526,7 +526,7 @@
- SESSION_VALUE NULL
- 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
-@@ -550,7 +550,7 @@
- SESSION_VALUE NULL
- 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
-@@ -562,10 +562,10 @@
- SESSION_VALUE NULL
- 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
-@@ -802,7 +802,7 @@
- SESSION_VALUE NULL
- 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
-@@ -922,7 +922,7 @@
- SESSION_VALUE NULL
- 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
-@@ -982,7 +982,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 100
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT
-+VARIABLE_TYPE INT
- VARIABLE_COMMENT Percentage of B-tree page filled during bulk insert
- NUMERIC_MIN_VALUE 10
- NUMERIC_MAX_VALUE 100
-@@ -994,7 +994,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1006,7 +1006,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1030,7 +1030,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1054,7 +1054,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1102,7 +1102,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1138,7 +1138,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1174,7 +1174,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1186,7 +1186,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1198,7 +1198,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1210,10 +1210,10 @@
- SESSION_VALUE NULL
- 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 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -1234,7 +1234,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1246,7 +1246,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1270,7 +1270,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1306,22 +1306,22 @@
- SESSION_VALUE NULL
- 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
- COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_IO_CAPACITY_MAX
- SESSION_VALUE NULL
--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
-@@ -1333,7 +1333,7 @@
- VARIABLE_TYPE BIGINT
- VARIABLE_COMMENT No effect for this build.
- NUMERIC_MIN_VALUE 0
--NUMERIC_MAX_VALUE 9223372036854775807
-+NUMERIC_MAX_VALUE 2147483647
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -1402,7 +1402,7 @@
- SESSION_VALUE 50
- 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
-@@ -1438,10 +1438,10 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
--NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_MAX_VALUE 4294967295
- NUMERIC_BLOCK_SIZE 0
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
-@@ -1450,7 +1450,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 65536
-@@ -1462,10 +1462,10 @@
- SESSION_VALUE NULL
- 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
-@@ -1522,7 +1522,7 @@
- SESSION_VALUE NULL
- 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 1
- NUMERIC_MAX_VALUE 100
-@@ -1570,7 +1570,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 8192
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Redo log write ahead unit size to avoid read-on-write, it should match the OS cache block IO size
- NUMERIC_MIN_VALUE 512
- NUMERIC_MAX_VALUE 16384
-@@ -1582,10 +1582,10 @@
- SESSION_VALUE NULL
- 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
-@@ -1654,10 +1654,10 @@
- SESSION_VALUE NULL
- 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
-@@ -1666,7 +1666,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1702,7 +1702,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 10
-@@ -1762,7 +1762,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 8
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT
-+VARIABLE_TYPE INT
- VARIABLE_COMMENT DEPRECATED. Number of multi-threaded flush threads
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 64
-@@ -1810,10 +1810,10 @@
- SESSION_VALUE NULL
- 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
-@@ -1834,7 +1834,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 4
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Page cleaner threads can be from 1 to 64. Default is 4.
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 64
-@@ -1858,7 +1858,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1870,7 +1870,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1954,7 +1954,7 @@
- SESSION_VALUE NULL
- 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
-@@ -1966,7 +1966,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 128
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Dictates rate at which UNDO records are purged. Value N means purge rollback segment(s) on every Nth iteration of purge invocation
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 128
-@@ -1978,7 +1978,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 4
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Purge threads can be from 1 to 32. Default is 4.
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 32
-@@ -2002,7 +2002,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2014,7 +2014,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2038,10 +2038,10 @@
- SESSION_VALUE NULL
- 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
-@@ -2062,7 +2062,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2086,7 +2086,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2098,7 +2098,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 39
-@@ -2110,7 +2110,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 39
-@@ -2122,7 +2122,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 39
-@@ -2158,7 +2158,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 1000
-@@ -2170,7 +2170,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 1
-@@ -2194,7 +2194,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2386,7 +2386,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2410,10 +2410,10 @@
- SESSION_VALUE NULL
- 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
-@@ -2446,7 +2446,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2458,7 +2458,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2542,7 +2542,7 @@
- SESSION_VALUE NULL
- 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
-@@ -2566,7 +2566,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Number of undo tablespaces to use.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 127
-@@ -2662,7 +2662,7 @@
- SESSION_VALUE NULL
- 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
+52c52
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+64c64
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+76c76
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+88c88
+< VARIABLE_TYPE BIGINT
+---
+> VARIABLE_TYPE INT
+160c160
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+163c163
+< NUMERIC_MAX_VALUE 9223372036854775807
+---
+> NUMERIC_MAX_VALUE 2147483647
+196c196
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+232c232
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+292c292
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+388c388
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+424c424
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+448c448
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+460c460
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+463c463
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+688c688
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+784c784
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+832c832
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+844c844
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+868c868
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+892c892
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+940c940
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+964c964
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1000c1000
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1012c1012
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1024c1024
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1036c1036
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1039c1039
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1060c1060
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1072c1072
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1096c1096
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1120c1120
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1123c1123
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1130c1130
+< DEFAULT_VALUE 18446744073709551615
+---
+> DEFAULT_VALUE 4294967295
+1132c1132
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1135c1135
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1192c1192
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1204c1204
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1207c1207
+< NUMERIC_MAX_VALUE 9223372036854775807
+---
+> NUMERIC_MAX_VALUE 2147483647
+1252c1252
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1300c1300
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1312c1312
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1315c1315
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1360c1360
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1363c1363
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1372c1372
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1492c1492
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1495c1495
+< NUMERIC_MAX_VALUE 9223372036854775807
+---
+> NUMERIC_MAX_VALUE 2147483647
+1516c1516
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1540c1540
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1552c1552
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1588c1588
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1600c1600
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1612c1612
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1636c1636
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1648c1648
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1672c1672
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1675c1675
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1696c1696
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1708c1708
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1756c1756
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1936c1936
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1960c1960
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+1963c1963
+< NUMERIC_MAX_VALUE 18446744073709551615
+---
+> NUMERIC_MAX_VALUE 4294967295
+1996c1996
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+2008c2008
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+2068c2068
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+2092c2092
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
+2116c2116
+< VARIABLE_TYPE BIGINT UNSIGNED
+---
+> VARIABLE_TYPE INT UNSIGNED
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled
deleted file mode 100644
index af9060d7334..00000000000
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled
+++ /dev/null
@@ -1,697 +0,0 @@
---- mysql-test/suite/sys_vars/r/sysvars_innodb.result 2018-07-30 23:41:05.030930072 +0200
-+++ mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.reject 2018-07-31 09:45:20.330811949 +0200
-@@ -47,6 +47,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 1
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 1
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)
-+NUMERIC_MIN_VALUE 1
-+NUMERIC_MAX_VALUE 64
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_ADAPTIVE_MAX_SLEEP_DELAY
- SESSION_VALUE NULL
- GLOBAL_VALUE 150000
-@@ -355,6 +369,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_BUFFER_POOL_POPULATE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Deprecated. This option has no effect and will be removed in MariaDB 10.2.3.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_BUFFER_POOL_SIZE
- SESSION_VALUE NULL
- GLOBAL_VALUE 8388608
-@@ -446,7 +474,7 @@
- DEFAULT_VALUE ON
- VARIABLE_SCOPE GLOBAL
- VARIABLE_TYPE BOOLEAN
--VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF. Enable InnoDB checksums validation (enabled by default). Disable with --skip-innodb-checksums.
-+VARIABLE_COMMENT DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting this to OFF
- NUMERIC_MIN_VALUE NULL
- NUMERIC_MAX_VALUE NULL
- NUMERIC_BLOCK_SIZE NULL
-@@ -467,6 +495,104 @@
- ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_EVICTION_FACTOR
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make page cleaner LRU flushes use evicted instead of flushed page counts for its heuristics
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_CLEANER_FLUSH_CHUNK_SIZE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 100
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 100
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT Divide page cleaner flush list flush batches into chunks of this size
-+NUMERIC_MIN_VALUE 1
-+NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_FREE_LIST_LWM
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 10
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 10
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT Page cleaner will keep on flushing the same buffer pool instance if its free list length is below this percentage of innodb_lru_scan_depth
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 100
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_LRU_CHUNK_SIZE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 100
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 100
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT Divide page cleaner LRU list flush batches into chunks of this size
-+NUMERIC_MIN_VALUE 1
-+NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_LSN_AGE_FACTOR
-+SESSION_VALUE NULL
-+GLOBAL_VALUE HIGH_CHECKPOINT
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE HIGH_CHECKPOINT
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT The formula for LSN age factor for page cleaner adaptive flushing. LEGACY: Original Oracle MySQL 5.6 formula. HIGH_CHECKPOINT: (the default) Percona Server 5.6 formula.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST LEGACY,HIGH_CHECKPOINT
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_CLEANER_MAX_FLUSH_TIME
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 1000
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 1000
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT The maximum time limit for a single flush list flush iteration by the page cleaner thread in miliseconds
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CLEANER_MAX_LRU_TIME
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 1000
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 1000
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT The maximum time limit for a single LRU tail flush iteration by the page cleaner thread in miliseconds
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -565,6 +691,20 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_CORRUPT_TABLE_ACTION
-+SESSION_VALUE NULL
-+GLOBAL_VALUE assert
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE assert
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT Warn corruptions of user tables as 'corrupt table' instead of not crashing itself, when used with file_per_table. All file io for the datafile after detected as corrupt are disabled, except for the deletion.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST assert,warn,salvage
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_DATA_FILE_PATH
- SESSION_VALUE NULL
- GLOBAL_VALUE ibdata1:12M:autoextend
-@@ -789,6 +929,20 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY YES
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
-+SESSION_VALUE NULL
-+GLOBAL_VALUE LEGACY
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE BACKOFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT The algorithm to use for empty free list handling. Allowed values: LEGACY: Original Oracle MySQL 5.6 handling with single page flushes; BACKOFF: (default) Wait until cleaner produces a free page.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST LEGACY,BACKOFF
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
- SESSION_VALUE NULL
- GLOBAL_VALUE 1
-@@ -859,6 +1013,20 @@
- ENUM_VALUE_LIST OFF,ON,FORCE
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_FAKE_CHANGES
-+SESSION_VALUE OFF
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE SESSION
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. This is to cause replication prefetch IO. ATTENTION: the transaction started after enabled is affected.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_FAST_SHUTDOWN
- SESSION_VALUE NULL
- GLOBAL_VALUE 1
-@@ -986,11 +1154,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
-@@ -1069,6 +1237,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
-@@ -1307,6 +1489,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
-@@ -1335,6 +1531,20 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_LOCKING_FAKE_CHANGES
-+SESSION_VALUE NULL
-+GLOBAL_VALUE ON
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE ON
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT ###EXPERIMENTAL### if enabled, transactions will get S row locks instead of X locks for fake changes. If disabled, fake change transactions will not take any locks at all.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -1377,6 +1587,62 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_LOG_ARCHIVE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Set to 1 if you want to have logs archived.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_LOG_ARCH_DIR
-+SESSION_VALUE NULL
-+GLOBAL_VALUE PATH
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE VARCHAR
-+VARIABLE_COMMENT Where full logs should be archived.
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST NULL
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT REQUIRED
-+VARIABLE_NAME INNODB_LOG_ARCH_EXPIRE_SEC
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 0
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 0
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT Expiration time for archived innodb transaction logs.
-+NUMERIC_MIN_VALUE 0
-+NUMERIC_MAX_VALUE 18446744073709551615
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_LOG_BLOCK_SIZE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE 512
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE 512
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_COMMENT ###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!
-+NUMERIC_MIN_VALUE 512
-+NUMERIC_MAX_VALUE 65536
-+NUMERIC_BLOCK_SIZE 0
-+ENUM_VALUE_LIST NULL
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_LOG_BUFFER_SIZE
- SESSION_VALUE NULL
- GLOBAL_VALUE 1048576
-@@ -1405,6 +1671,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_LOG_CHECKSUM_ALGORITHM
-+SESSION_VALUE NULL
-+GLOBAL_VALUE INNODB
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE INNODB
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE ENUM
-+VARIABLE_COMMENT The algorithm InnoDB uses for log block checksums. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Logs created when this option is set to crc32/strict_crc32/none/strict_none will not be readable by any MySQL version or Percona Server versions that donot support this feature
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
- SESSION_VALUE NULL
- GLOBAL_VALUE ON
-@@ -1475,6 +1755,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
-@@ -1659,7 +1967,7 @@
- COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME INNODB_OPEN_FILES
- SESSION_VALUE NULL
--GLOBAL_VALUE 2000
-+GLOBAL_VALUE 300
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
-@@ -1741,6 +2049,76 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRINT_LOCK_WAIT_TIMEOUT_INFO
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Print lock wait timeout info to MySQL error log (off by default)
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_CLEANER
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make buffer pool cleaner and LRU manager threads acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_IO
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make I/O threads acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_MASTER
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make buffer pool cleaner thread acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_PRIORITY_PURGE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Make purge coordinator and worker threads acquire shared resources with priority
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_PURGE_BATCH_SIZE
- SESSION_VALUE NULL
- GLOBAL_VALUE 300
-@@ -1909,6 +2287,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
-@@ -1937,6 +2357,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
-@@ -2014,7 +2462,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
-@@ -2259,6 +2707,34 @@
- ENUM_VALUE_LIST NULL
- READ_ONLY NO
- COMMAND_LINE_ARGUMENT OPTIONAL
-+VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Track the redo log for changed pages and output a changed page bitmap
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT NONE
-+VARIABLE_NAME INNODB_TRACK_REDO_LOG_NOW
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Force log tracker to catch up with checkpoint now
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -2336,7 +2812,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
-@@ -2357,6 +2833,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY YES
- COMMAND_LINE_ARGUMENT NONE
-+VARIABLE_NAME INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
-+SESSION_VALUE NULL
-+GLOBAL_VALUE ON
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE ON
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Use global innodb_flush_log_at_trx_commit value. (default: ON).
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_USE_MTFLUSH
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -2371,6 +2861,20 @@
- ENUM_VALUE_LIST OFF,ON
- READ_ONLY YES
- COMMAND_LINE_ARGUMENT NONE
-+VARIABLE_NAME INNODB_USE_STACKTRACE
-+SESSION_VALUE NULL
-+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
-+DEFAULT_VALUE OFF
-+VARIABLE_SCOPE GLOBAL
-+VARIABLE_TYPE BOOLEAN
-+VARIABLE_COMMENT Print stacktrace on long semaphore wait (off by default supported only on linux)
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST OFF,ON
-+READ_ONLY YES
-+COMMAND_LINE_ARGUMENT NONE
- VARIABLE_NAME INNODB_USE_SYS_MALLOC
- SESSION_VALUE NULL
- GLOBAL_VALUE ON
-@@ -2401,12 +2905,12 @@
- COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_VERSION
- SESSION_VALUE NULL
--GLOBAL_VALUE 5.6.49
-+GLOBAL_VALUE 5.6.49-89.0
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE NULL
- VARIABLE_SCOPE GLOBAL
- VARIABLE_TYPE VARCHAR
--VARIABLE_COMMENT InnoDB version
-+VARIABLE_COMMENT Percona-InnoDB-plugin version
- NUMERIC_MIN_VALUE NULL
- NUMERIC_MAX_VALUE NULL
- NUMERIC_BLOCK_SIZE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index bed23a777a8..2bd2920ff9d 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1,10 +1,13 @@
select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, 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 like 'innodb%' and
variable_name not in (
+'innodb_version', # always the same as the server version
'innodb_disallow_writes', # only available WITH_WSREP
'innodb_numa_interleave', # only available WITH_NUMA
'innodb_sched_priority_cleaner', # linux only
-'innodb_use_native_aio') # default value depends on OS
+'innodb_evict_tables_on_commit_debug', # one may want to override this
+'innodb_use_native_aio', # default value depends on OS
+'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing
order by variable_name;
VARIABLE_NAME INNODB_ADAPTIVE_FLUSHING
SESSION_VALUE NULL
@@ -42,18 +45,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
-SESSION_VALUE NULL
-DEFAULT_VALUE 8
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT It is an alias for innodb_adaptive_hash_index_parts; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE 1
-NUMERIC_MAX_VALUE 512
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTS
SESSION_VALUE NULL
DEFAULT_VALUE 8
@@ -282,23 +273,11 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_BUFFER_POOL_POPULATE
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_BUFFER_POOL_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 134217728
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT
+VARIABLE_TYPE BIGINT UNSIGNED
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
@@ -334,12 +313,12 @@ VARIABLE_NAME INNODB_CHANGE_BUFFERING
SESSION_VALUE NULL
DEFAULT_VALUE all
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT Buffer changes to reduce random access: OFF, ON, inserting, deleting, changing, or purging.
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Buffer changes to secondary indexes.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
+ENUM_VALUE_LIST none,inserts,deletes,changes,purges,all
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_CHANGE_BUFFERING_DEBUG
@@ -402,90 +381,6 @@ 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_CLEANER_EVICTION_FACTOR
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_CLEANER_FLUSH_CHUNK_SIZE
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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_FREE_LIST_LWM
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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_LSN_AGE_FACTOR
-SESSION_VALUE NULL
-DEFAULT_VALUE DEPRECATED
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST LEGACY,HIGH_CHECKPOINT,DEPRECATED
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_CLEANER_MAX_FLUSH_TIME
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
DEFAULT_VALUE OFF
@@ -582,21 +477,9 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_CORRUPT_TABLE_ACTION
-SESSION_VALUE NULL
-DEFAULT_VALUE deprecated
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST assert,warn,salvage,deprecated
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DATA_FILE_PATH
SESSION_VALUE NULL
-DEFAULT_VALUE
+DEFAULT_VALUE ibdata1:12M:autoextend
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Path to individual files and their sizes.
@@ -822,18 +705,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
-SESSION_VALUE NULL
-DEFAULT_VALUE DEPRECATED
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST LEGACY,BACKOFF,DEPRECATED
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
SESSION_VALUE NULL
DEFAULT_VALUE 1
@@ -906,26 +777,14 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_FAKE_CHANGES
-SESSION_VALUE OFF
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_FAST_SHUTDOWN
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
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).
+VARIABLE_COMMENT Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster), 2 (crash-like), 3 (fastest clean).
NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 2
+NUMERIC_MAX_VALUE 3
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -944,40 +803,16 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FILE_FORMAT
SESSION_VALUE NULL
-DEFAULT_VALUE Barracuda
+DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT File format to use for new tables in .ibd files.
+VARIABLE_COMMENT Deprecated parameter with no effect.
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
-DEFAULT_VALUE ON
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Whether to perform system file format check.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_FILE_FORMAT_MAX
-SESSION_VALUE NULL
-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
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FILE_PER_TABLE
SESSION_VALUE NULL
DEFAULT_VALUE ON
@@ -994,7 +829,7 @@ VARIABLE_NAME INNODB_FILL_FACTOR
SESSION_VALUE NULL
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Percentage of B-tree page filled during bulk insert
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100
@@ -1052,14 +887,14 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_FLUSH_METHOD
SESSION_VALUE NULL
-DEFAULT_VALUE
+DEFAULT_VALUE fsync
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
+VARIABLE_TYPE ENUM
VARIABLE_COMMENT With which method to flush data.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
+ENUM_VALUE_LIST fsync,O_DSYNC,littlesync,nosync,O_DIRECT,O_DIRECT_NO_FSYNC
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FLUSH_NEIGHBORS
@@ -1122,18 +957,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_FOREGROUND_PREFLUSH
-SESSION_VALUE NULL
-DEFAULT_VALUE DEPRECATED
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST SYNC_PREFLUSH,EXPONENTIAL_BACKOFF,DEPRECATED
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_FT_AUX_TABLE
SESSION_VALUE NULL
DEFAULT_VALUE
@@ -1302,18 +1125,18 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_INSTRUMENT_SEMAPHORES
+VARIABLE_NAME INNODB_INSTANT_ALTER_COLUMN_ALLOWED
SESSION_VALUE NULL
-DEFAULT_VALUE OFF
+DEFAULT_VALUE add_last
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT DEPRECATED. This setting has no effect.
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT File format constraint for ALTER TABLE
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
+ENUM_VALUE_LIST never,add_last
READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_IO_CAPACITY
SESSION_VALUE NULL
DEFAULT_VALUE 200
@@ -1338,30 +1161,18 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_KILL_IDLE_TRANSACTION
-SESSION_VALUE NULL
-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
-DEFAULT_VALUE ON
+DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Support large index prefix length of REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes.
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Deprecated parameter with 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 NONE
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE 0
@@ -1374,18 +1185,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_LOCKING_FAKE_CHANGES
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
@@ -1416,65 +1215,17 @@ 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_ARCHIVE
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_LOG_ARCH_DIR
-SESSION_VALUE NULL
-DEFAULT_VALUE
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_MAX_VALUE 1073741824
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_LOG_BLOCK_SIZE
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE 0
-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
DEFAULT_VALUE 16777216
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT
+VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer which InnoDB uses to write log to the log files on disk.
NUMERIC_MIN_VALUE 262144
NUMERIC_MAX_VALUE 9223372036854775807
@@ -1506,18 +1257,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_LOG_CHECKSUM_ALGORITHM
-SESSION_VALUE NULL
-DEFAULT_VALUE DEPRECATED
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Deprecated and translated to innodb_log_checksums (NONE to OFF, everything else to ON); only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE,DEPRECATED
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
SESSION_VALUE NULL
DEFAULT_VALUE ON
@@ -1614,30 +1353,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_MAX_BITMAP_FILE_SIZE
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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_CHANGED_PAGES
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
DEFAULT_VALUE 75.000000
@@ -1710,18 +1425,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_MIRRORED_LOG_GROUPS
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
DEFAULT_VALUE
@@ -1770,18 +1473,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_MTFLUSH_THREADS
-SESSION_VALUE NULL
-DEFAULT_VALUE 8
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT
-VARIABLE_COMMENT DEPRECATED. 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
DEFAULT_VALUE 37
@@ -1822,7 +1513,7 @@ VARIABLE_NAME INNODB_OPEN_FILES
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT
+VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT How many files at the maximum InnoDB keeps open at the same time.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 9223372036854775807
@@ -1852,8 +1543,8 @@ NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT OPTIONAL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_PAGE_CLEANER_DISABLED_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
@@ -1914,54 +1605,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_PRIORITY_CLEANER
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_PRIORITY_IO
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_PRIORITY_MASTER
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_PRIORITY_PURGE
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_PURGE_BATCH_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 300
@@ -2082,18 +1725,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_SAFE_TRUNCATE
-SESSION_VALUE NULL
-DEFAULT_VALUE ON
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Use backup-safe TRUNCATE TABLE and crash-safe RENAME (incompatible with older MariaDB 10.2; ON by default)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SAVED_PAGE_NUMBER_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE 0
@@ -2106,42 +1737,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_SCHED_PRIORITY_IO
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
DEFAULT_VALUE OFF
@@ -2166,30 +1761,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_SHOW_LOCKS_HELD
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-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
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 1
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES
SESSION_VALUE NULL
DEFAULT_VALUE 0
@@ -2382,18 +1953,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_SUPPORT_XA
-SESSION_VALUE ON
-DEFAULT_VALUE ON
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Enable InnoDB support for the XA two-phase commit
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SYNC_ARRAY_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 1
@@ -2444,7 +2003,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_TEMP_DATA_FILE_PATH
SESSION_VALUE NULL
-DEFAULT_VALUE
+DEFAULT_VALUE ibtmp1:12M:autoextend
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Path to files and their sizes making temp-tablespace.
@@ -2490,30 +2049,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_TRACK_REDO_LOG_NOW
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
@@ -2591,85 +2126,13 @@ SESSION_VALUE NULL
DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Enable atomic writes, instead of using the doublewrite buffer, for files on devices that supports atomic writes. To use this option one must use file_per_table=1, flush_method=O_DIRECT and use_fallocate=1. This option only works on Linux with either FusionIO cards using the directFS filesystem or with Shannon cards using any file system.
+VARIABLE_COMMENT Enable atomic writes, instead of using the doublewrite buffer, for files on devices that supports atomic writes. To use this option one must use innodb_file_per_table=1, innodb_flush_method=O_DIRECT. This option only works on Linux with either FusionIO cards using the directFS filesystem or with Shannon cards using any file system.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_USE_FALLOCATE
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Use posix_fallocate() to allocate files. DEPRECATED, has no effect.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_USE_MTFLUSH
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT DEPRECATED. Use multi-threaded flush. Default FALSE.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_USE_STACKTRACE
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deprecated and ignored; only exists to allow easier upgrade from earlier XtraDB versions.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_USE_TRIM
-SESSION_VALUE NULL
-DEFAULT_VALUE ON
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Deallocate (punch_hole|trim) unused portions of the page compressed page (on by default)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_VERSION
-SESSION_VALUE NULL
-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
DEFAULT_VALUE 4
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
index df7edb3d8b3..685c45162ac 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
@@ -1,7 +1,7 @@
---- sysvars_server_embedded.result 2019-09-01 15:14:00.790739643 +0300
-+++ sysvars_server_embedded,32bit.reject 2019-09-01 19:15:06.044626854 +0300
-@@ -14,7 +14,7 @@
- order by variable_name;
+--- sysvars_server_embedded.result 2019-09-02 17:28:33.630863762 +0300
++++ sysvars_server_embedded,32bit.reject 2019-09-02 17:50:30.619590080 +0300
+@@ -25,7 +25,7 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
@@ -9,7 +9,7 @@
VARIABLE_COMMENT Block size to be used for Aria index pages.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 32768
-@@ -24,7 +24,7 @@
+@@ -35,7 +35,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_CHECKPOINT_INTERVAL
VARIABLE_SCOPE GLOBAL
@@ -18,7 +18,7 @@
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
-@@ -34,7 +34,7 @@
+@@ -45,7 +45,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_CHECKPOINT_LOG_ACTIVITY
VARIABLE_SCOPE GLOBAL
@@ -27,7 +27,7 @@
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
-@@ -54,7 +54,7 @@
+@@ -65,7 +65,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_FORCE_START_AFTER_RECOVERY_FAILURES
VARIABLE_SCOPE GLOBAL
@@ -36,7 +36,7 @@
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
-@@ -74,7 +74,7 @@
+@@ -85,7 +85,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_GROUP_COMMIT_INTERVAL
VARIABLE_SCOPE GLOBAL
@@ -45,7 +45,7 @@
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
-@@ -84,7 +84,7 @@
+@@ -95,7 +95,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -54,7 +54,7 @@
VARIABLE_COMMENT Limit for transaction log size
NUMERIC_MIN_VALUE 8388608
NUMERIC_MAX_VALUE 4294967295
-@@ -114,10 +114,10 @@
+@@ -125,10 +125,10 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD
VARIABLE_SCOPE GLOBAL
@@ -67,7 +67,7 @@
NUMERIC_BLOCK_SIZE 100
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -134,7 +134,7 @@
+@@ -145,7 +145,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -76,7 +76,7 @@
VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
-@@ -144,7 +144,7 @@
+@@ -155,7 +155,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_FILE_HASH_SIZE
VARIABLE_SCOPE GLOBAL
@@ -85,7 +85,7 @@
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
-@@ -174,7 +174,7 @@
+@@ -185,7 +185,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_REPAIR_THREADS
VARIABLE_SCOPE SESSION
@@ -94,7 +94,7 @@
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
-@@ -187,7 +187,7 @@
+@@ -198,7 +198,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
@@ -103,7 +103,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -244,7 +244,7 @@
+@@ -255,7 +255,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME AUTO_INCREMENT_INCREMENT
VARIABLE_SCOPE SESSION
@@ -112,7 +112,7 @@
VARIABLE_COMMENT Auto-increment columns are incremented by this
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
-@@ -254,7 +254,7 @@
+@@ -265,7 +265,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME AUTO_INCREMENT_OFFSET
VARIABLE_SCOPE SESSION
@@ -121,7 +121,7 @@
VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
-@@ -264,7 +264,7 @@
+@@ -275,7 +275,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BACK_LOG
VARIABLE_SCOPE GLOBAL
@@ -130,7 +130,7 @@
VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -307,7 +307,7 @@
+@@ -328,7 +328,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
@@ -139,7 +139,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -324,20 +324,20 @@
+@@ -345,20 +345,20 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT
VARIABLE_SCOPE GLOBAL
@@ -164,7 +164,16 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -387,7 +387,7 @@
+@@ -378,7 +378,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of file cache for the binary log
+ NUMERIC_MIN_VALUE 8192
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -418,7 +418,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
@@ -173,7 +182,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -397,7 +397,7 @@
+@@ -428,7 +428,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
@@ -182,7 +191,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -544,7 +544,7 @@
+@@ -615,7 +615,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME CONNECT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -191,7 +200,7 @@
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
-@@ -594,7 +594,7 @@
+@@ -665,7 +665,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
@@ -200,7 +209,7 @@
VARIABLE_COMMENT Long search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 33
-@@ -604,7 +604,7 @@
+@@ -675,7 +675,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
VARIABLE_SCOPE SESSION
@@ -209,7 +218,7 @@
VARIABLE_COMMENT Short search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 32
-@@ -614,7 +614,7 @@
+@@ -685,7 +685,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
VARIABLE_SCOPE SESSION
@@ -218,7 +227,7 @@
VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -624,7 +624,7 @@
+@@ -695,7 +695,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
VARIABLE_SCOPE SESSION
@@ -227,7 +236,7 @@
VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -664,7 +664,7 @@
+@@ -735,7 +735,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DEFAULT_WEEK_FORMAT
VARIABLE_SCOPE SESSION
@@ -236,7 +245,7 @@
VARIABLE_COMMENT The default week format used by WEEK() functions
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 7
-@@ -674,7 +674,7 @@
+@@ -745,7 +745,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -245,7 +254,7 @@
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
-@@ -684,7 +684,7 @@
+@@ -755,7 +755,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -254,7 +263,7 @@
VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -694,7 +694,7 @@
+@@ -765,7 +765,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_QUEUE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -263,7 +272,7 @@
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
-@@ -714,7 +714,7 @@
+@@ -785,7 +785,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DIV_PRECISION_INCREMENT
VARIABLE_SCOPE SESSION
@@ -272,7 +281,7 @@
VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 38
-@@ -794,7 +794,7 @@
+@@ -865,7 +865,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME EXPIRE_LOGS_DAYS
VARIABLE_SCOPE GLOBAL
@@ -281,7 +290,7 @@
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
-@@ -824,7 +824,7 @@
+@@ -895,7 +895,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME EXTRA_MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
@@ -290,7 +299,7 @@
VARIABLE_COMMENT The number of connections on extra-port
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
-@@ -854,7 +854,7 @@
+@@ -925,7 +925,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME FLUSH_TIME
VARIABLE_SCOPE GLOBAL
@@ -299,7 +308,7 @@
VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -884,7 +884,7 @@
+@@ -955,7 +955,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MAX_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -308,7 +317,7 @@
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
-@@ -894,7 +894,7 @@
+@@ -965,7 +965,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MIN_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -317,7 +326,7 @@
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
-@@ -904,7 +904,7 @@
+@@ -975,7 +975,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -326,7 +335,7 @@
VARIABLE_COMMENT Number of best matches to use for query expansion
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -947,7 +947,7 @@
+@@ -1018,7 +1018,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT()
NUMERIC_MIN_VALUE 4
@@ -335,7 +344,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1074,7 +1074,7 @@
+@@ -1145,7 +1145,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HISTOGRAM_SIZE
VARIABLE_SCOPE SESSION
@@ -344,7 +353,7 @@
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
-@@ -1104,7 +1104,7 @@
+@@ -1175,7 +1175,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HOST_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -353,7 +362,7 @@
VARIABLE_COMMENT How many host names should be cached to avoid resolving.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65536
-@@ -1184,7 +1184,7 @@
+@@ -1285,7 +1285,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME INTERACTIVE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -362,7 +371,7 @@
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
-@@ -1207,7 +1207,7 @@
+@@ -1308,7 +1308,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer that is used for joins
NUMERIC_MIN_VALUE 128
@@ -371,7 +380,7 @@
NUMERIC_BLOCK_SIZE 128
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1224,7 +1224,7 @@
+@@ -1325,7 +1325,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME JOIN_CACHE_LEVEL
VARIABLE_SCOPE SESSION
@@ -380,7 +389,7 @@
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
-@@ -1247,7 +1247,7 @@
+@@ -1348,7 +1348,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
@@ -389,16 +398,16 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1404,7 +1404,7 @@
+@@ -1505,7 +1505,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME LOCK_WAIT_TIMEOUT
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_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -1504,7 +1504,7 @@
+@@ -1625,7 +1625,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
VARIABLE_SCOPE SESSION
@@ -407,7 +416,7 @@
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
-@@ -1534,7 +1534,7 @@
+@@ -1655,7 +1655,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_WARNINGS
VARIABLE_SCOPE SESSION
@@ -416,7 +425,7 @@
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
-@@ -1584,7 +1584,7 @@
+@@ -1705,7 +1705,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MAX_ALLOWED_PACKET
VARIABLE_SCOPE SESSION
@@ -425,7 +434,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -1597,14 +1597,14 @@
+@@ -1718,14 +1718,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the transactional cache
NUMERIC_MIN_VALUE 4096
@@ -442,7 +451,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
-@@ -1617,14 +1617,14 @@
+@@ -1738,14 +1738,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the statement cache
NUMERIC_MIN_VALUE 4096
@@ -459,7 +468,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
-@@ -1634,7 +1634,7 @@
+@@ -1755,7 +1755,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECT_ERRORS
VARIABLE_SCOPE GLOBAL
@@ -468,7 +477,7 @@
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
-@@ -1644,7 +1644,7 @@
+@@ -1765,7 +1765,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_DELAYED_THREADS
VARIABLE_SCOPE SESSION
@@ -477,7 +486,7 @@
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
-@@ -1664,7 +1664,7 @@
+@@ -1785,7 +1785,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_ERROR_COUNT
VARIABLE_SCOPE SESSION
@@ -486,7 +495,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -1677,14 +1677,14 @@
+@@ -1798,14 +1798,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
@@ -503,7 +512,7 @@
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
-@@ -1704,7 +1704,7 @@
+@@ -1825,7 +1825,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
VARIABLE_SCOPE SESSION
@@ -512,7 +521,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -1714,7 +1714,7 @@
+@@ -1835,7 +1835,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LONG_DATA_SIZE
VARIABLE_SCOPE GLOBAL
@@ -521,7 +530,7 @@
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
-@@ -1734,7 +1734,7 @@
+@@ -1855,7 +1855,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
VARIABLE_SCOPE SESSION
@@ -530,7 +539,7 @@
VARIABLE_COMMENT Maximum number of iterations when executing recursive queries
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1744,7 +1744,7 @@
+@@ -1865,7 +1865,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MAX_SEEKS_FOR_KEY
VARIABLE_SCOPE SESSION
@@ -539,7 +548,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1764,7 +1764,7 @@
+@@ -1885,7 +1885,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
VARIABLE_SCOPE SESSION
@@ -548,7 +557,7 @@
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
-@@ -1774,7 +1774,7 @@
+@@ -1895,7 +1895,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SP_RECURSION_DEPTH
VARIABLE_SCOPE SESSION
@@ -557,7 +566,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -1794,7 +1794,7 @@
+@@ -1915,7 +1915,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_TMP_TABLES
VARIABLE_SCOPE SESSION
@@ -566,7 +575,7 @@
VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1814,7 +1814,7 @@
+@@ -1935,7 +1935,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_WRITE_LOCK_COUNT
VARIABLE_SCOPE GLOBAL
@@ -575,7 +584,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1824,7 +1824,7 @@
+@@ -1945,7 +1945,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -584,7 +593,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
-@@ -1834,7 +1834,7 @@
+@@ -1955,7 +1955,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -593,7 +602,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -1844,7 +1844,7 @@
+@@ -1965,7 +1965,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
@@ -602,7 +611,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1854,7 +1854,7 @@
+@@ -1975,7 +1975,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MRR_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -611,7 +620,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -1864,17 +1864,17 @@
+@@ -1985,17 +1985,17 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MULTI_RANGE_COUNT
VARIABLE_SCOPE SESSION
@@ -632,7 +641,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
-@@ -1884,7 +1884,7 @@
+@@ -2005,7 +2005,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
VARIABLE_SCOPE GLOBAL
@@ -641,7 +650,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
-@@ -1907,7 +1907,7 @@
+@@ -2028,7 +2028,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
NUMERIC_MIN_VALUE 7
@@ -650,7 +659,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -1924,10 +1924,10 @@
+@@ -2045,10 +2045,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MYISAM_REPAIR_THREADS
VARIABLE_SCOPE SESSION
@@ -663,7 +672,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1937,7 +1937,7 @@
+@@ -2058,7 +2058,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
@@ -672,7 +681,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1974,7 +1974,7 @@
+@@ -2095,7 +2095,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME NET_BUFFER_LENGTH
VARIABLE_SCOPE SESSION
@@ -681,7 +690,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
-@@ -1984,7 +1984,7 @@
+@@ -2105,7 +2105,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_READ_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -690,7 +699,7 @@
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
-@@ -1994,7 +1994,7 @@
+@@ -2115,7 +2115,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_RETRY_COUNT
VARIABLE_SCOPE SESSION
@@ -699,7 +708,7 @@
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
-@@ -2004,7 +2004,7 @@
+@@ -2125,7 +2125,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_WRITE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -708,7 +717,7 @@
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
-@@ -2054,7 +2054,7 @@
+@@ -2175,7 +2175,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -717,7 +726,7 @@
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 or autoset 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
-@@ -2064,7 +2064,7 @@
+@@ -2185,7 +2185,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_PRUNE_LEVEL
VARIABLE_SCOPE SESSION
@@ -726,7 +735,7 @@
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
-@@ -2074,7 +2074,7 @@
+@@ -2195,7 +2195,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
@@ -735,7 +744,7 @@
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.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2084,7 +2084,7 @@
+@@ -2205,7 +2205,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
VARIABLE_SCOPE SESSION
@@ -744,7 +753,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
-@@ -2104,7 +2104,7 @@
+@@ -2225,7 +2225,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY
VARIABLE_SCOPE SESSION
@@ -753,7 +762,7 @@
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
-@@ -2124,7 +2124,7 @@
+@@ -2245,7 +2245,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -762,7 +771,7 @@
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
-@@ -2134,7 +2134,7 @@
+@@ -2255,7 +2255,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -771,7 +780,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 200
-@@ -2144,7 +2144,7 @@
+@@ -2265,7 +2265,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -780,7 +789,7 @@
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
-@@ -2154,7 +2154,7 @@
+@@ -2275,7 +2275,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -789,7 +798,7 @@
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
-@@ -2164,7 +2164,7 @@
+@@ -2285,7 +2285,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -798,7 +807,7 @@
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
-@@ -2174,7 +2174,7 @@
+@@ -2295,7 +2295,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -807,7 +816,7 @@
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
-@@ -2184,7 +2184,7 @@
+@@ -2305,7 +2305,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -816,7 +825,7 @@
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
-@@ -2194,7 +2194,7 @@
+@@ -2315,7 +2315,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -825,7 +834,7 @@
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
-@@ -2204,7 +2204,7 @@
+@@ -2325,7 +2325,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -834,7 +843,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2214,7 +2214,7 @@
+@@ -2335,7 +2335,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -843,7 +852,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2224,7 +2224,7 @@
+@@ -2345,7 +2345,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -852,7 +861,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2234,7 +2234,7 @@
+@@ -2355,7 +2355,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
VARIABLE_SCOPE GLOBAL
@@ -861,7 +870,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2244,7 +2244,7 @@
+@@ -2365,7 +2365,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -870,7 +879,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2254,7 +2254,7 @@
+@@ -2375,7 +2375,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -879,7 +888,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2264,7 +2264,7 @@
+@@ -2385,7 +2385,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -888,7 +897,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2274,7 +2274,7 @@
+@@ -2395,7 +2395,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -897,7 +906,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2284,7 +2284,7 @@
+@@ -2405,7 +2405,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -906,7 +915,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2294,7 +2294,7 @@
+@@ -2415,7 +2415,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -915,7 +924,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2304,7 +2304,7 @@
+@@ -2425,7 +2425,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -924,7 +933,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2314,7 +2314,7 @@
+@@ -2435,7 +2435,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -933,7 +942,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2324,7 +2324,7 @@
+@@ -2445,7 +2445,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -942,7 +951,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2334,7 +2334,7 @@
+@@ -2455,7 +2455,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -951,7 +960,7 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2344,7 +2344,7 @@
+@@ -2465,7 +2465,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -960,7 +969,7 @@
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2354,7 +2354,7 @@
+@@ -2475,7 +2475,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -969,7 +978,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2364,7 +2364,7 @@
+@@ -2485,7 +2485,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -978,7 +987,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2374,7 +2374,7 @@
+@@ -2495,7 +2495,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -987,7 +996,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2384,7 +2384,7 @@
+@@ -2505,7 +2505,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -996,7 +1005,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2394,7 +2394,7 @@
+@@ -2515,7 +2515,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1005,7 +1014,7 @@
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
-@@ -2404,7 +2404,7 @@
+@@ -2525,7 +2525,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1014,7 +1023,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
-@@ -2414,7 +2414,7 @@
+@@ -2535,7 +2535,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1023,7 +1032,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2424,7 +2424,7 @@
+@@ -2545,7 +2545,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1032,7 +1041,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2474,7 +2474,7 @@
+@@ -2595,7 +2595,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PRELOAD_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1041,7 +1050,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -2494,7 +2494,7 @@
+@@ -2615,7 +2615,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME PROFILING_HISTORY_SIZE
VARIABLE_SCOPE SESSION
@@ -1050,7 +1059,7 @@
VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -2504,7 +2504,7 @@
+@@ -2625,7 +2625,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PROGRESS_REPORT_TIME
VARIABLE_SCOPE SESSION
@@ -1059,7 +1068,7 @@
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
-@@ -2554,7 +2554,7 @@
+@@ -2685,7 +2685,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
VARIABLE_SCOPE SESSION
@@ -1068,7 +1077,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -2564,7 +2564,7 @@
+@@ -2695,7 +2695,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -1077,7 +1086,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2574,7 +2574,7 @@
+@@ -2705,7 +2705,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
VARIABLE_SCOPE GLOBAL
@@ -1086,7 +1095,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2587,7 +2587,7 @@
+@@ -2718,7 +2718,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
@@ -1095,7 +1104,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2624,7 +2624,7 @@
+@@ -2755,7 +2755,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME QUERY_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
@@ -1104,7 +1113,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -2637,7 +2637,7 @@
+@@ -2768,7 +2768,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1113,7 +1122,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2647,14 +2647,14 @@
+@@ -2778,14 +2778,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1130,7 +1139,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
-@@ -2664,7 +2664,7 @@
+@@ -2795,7 +2795,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME READ_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1139,7 +1148,7 @@
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
-@@ -2684,7 +2684,7 @@
+@@ -2815,7 +2815,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME READ_RND_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1148,7 +1157,7 @@
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
-@@ -2694,10 +2694,10 @@
+@@ -2825,10 +2825,10 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ROWID_MERGE_BUFF_SIZE
VARIABLE_SCOPE SESSION
@@ -1161,7 +1170,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2724,7 +2724,7 @@
+@@ -2865,7 +2865,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
@@ -1170,7 +1179,7 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2794,7 +2794,7 @@
+@@ -2935,7 +2935,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET
VARIABLE_SCOPE GLOBAL
@@ -1179,7 +1188,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -2804,7 +2804,7 @@
+@@ -2945,7 +2945,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLOW_LAUNCH_TIME
VARIABLE_SCOPE GLOBAL
@@ -1188,7 +1197,7 @@
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
-@@ -2847,7 +2847,7 @@
+@@ -2988,7 +2988,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
@@ -1197,7 +1206,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3054,7 +3054,7 @@
+@@ -3195,7 +3195,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME STORED_PROGRAM_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1206,7 +1215,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
-@@ -3114,7 +3114,7 @@
+@@ -3275,7 +3275,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1215,7 +1224,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 2097152
-@@ -3124,7 +3124,7 @@
+@@ -3285,7 +3285,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1224,7 +1233,7 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
-@@ -3144,7 +3144,7 @@
+@@ -3335,7 +3335,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1233,7 +1242,7 @@
VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -3154,7 +3154,7 @@
+@@ -3345,7 +3345,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_CONCURRENCY
VARIABLE_SCOPE GLOBAL
@@ -1242,7 +1251,7 @@
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
-@@ -3237,7 +3237,7 @@
+@@ -3428,7 +3428,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
@@ -1251,7 +1260,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3247,7 +3247,7 @@
+@@ -3438,7 +3438,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size.
NUMERIC_MIN_VALUE 1024
@@ -1260,7 +1269,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3257,14 +3257,14 @@
+@@ -3448,14 +3448,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
@@ -1277,7 +1286,7 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -3274,7 +3274,7 @@
+@@ -3465,7 +3465,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
@@ -1286,7 +1295,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -3404,7 +3404,7 @@
+@@ -3605,7 +3605,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -1295,7 +1304,7 @@
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
-@@ -3431,7 +3431,7 @@
+@@ -3632,7 +3632,7 @@
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 8221a64472b..0cbf4a9a2b2 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -12,6 +12,16 @@ variable_name not in (
'log_tc_size'
)
order by variable_name;
+VARIABLE_NAME ALTER_ALGORITHM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specify the alter table algorithm
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -292,6 +302,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BIND_ADDRESS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT IP address to bind to.
+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_ANNOTATE_ROW_EVENTS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
@@ -352,6 +372,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BINLOG_FILE_CACHE_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of file cache for the binary log
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_FORMAT
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
@@ -522,6 +552,46 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLUMN_COMPRESSION_THRESHOLD
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimum column data length eligible for compression
+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 COLUMN_COMPRESSION_ZLIB_LEVEL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT zlib compression level (1 gives best speed, 9 gives best compression)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME COLUMN_COMPRESSION_ZLIB_STRATEGY
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The strategy parameter is used to tune the compression algorithm. Use the value DEFAULT_STRATEGY for normal data, FILTERED for data produced by a filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no string match), or RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between DEFAULT_STRATEGY and HUFFMAN_ONLY. RLE is designed to be almost as fast as HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT_STRATEGY,FILTERED,HUFFMAN_ONLY,RLE,FIXED
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME COLUMN_COMPRESSION_ZLIB_WRAP
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Generate zlib header and trailer and compute adler32 check value. It can be used with storage engines that don't provide data integrity verification to detect data corruption.
+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 COMPLETION_TYPE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
@@ -805,7 +875,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME EXPLICIT_DEFAULTS_FOR_TIMESTAMP
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.
+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.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -1122,6 +1192,36 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME IDLE_READONLY_TRANSACTION_TIMEOUT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for read-only idle transaction
+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 IDLE_TRANSACTION_TIMEOUT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for idle transaction
+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 IDLE_WRITE_TRANSACTION_TIMEOUT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for write idle transaction
+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 IGNORE_BUILTIN_INNODB
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -1192,6 +1292,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME IN_PREDICATE_CONVERSION_THRESHOLD
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The minimum number of scalar elements in the value list of IN predicate that triggers its conversion to IN subquery. Set to 0 to disable the conversion.
+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 IN_TRANSACTION
VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE BIGINT UNSIGNED
@@ -1406,7 +1516,7 @@ VARIABLE_NAME LOCK_WAIT_TIMEOUT
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_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
@@ -1452,6 +1562,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_DISABLED_STATEMENTS
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Don't log certain types of statements to general log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST slave,sp
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_ERROR
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
@@ -1473,9 +1593,9 @@ ENUM_VALUE_LIST NONE,FILE,TABLE
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_QUERIES_NOT_USING_INDEXES
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log queries that are executed without benefit of any index to the slow log if it is open
+VARIABLE_COMMENT Log queries that are executed without benefit of any index to the slow log if it is open. Same as log_slow_filter='not_using_index'
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -1483,23 +1603,33 @@ ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_disabled_statements
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_DISABLED_STATEMENTS
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Don't log certain types of statements to slow log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST admin,call,slave,sp
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_FILTER
VARIABLE_SCOPE SESSION
VARIABLE_TYPE SET
-VARIABLE_COMMENT Log only certain types of queries
+VARIABLE_COMMENT Log only certain types of queries to the slow log. If variable empty alll kind of queries are logged. All types are bound by slow_query_time, except 'not_using_index' which is always logged if enabled
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
+ENUM_VALUE_LIST admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,not_using_index,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
@@ -1513,9 +1643,9 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_SLAVE_STATEMENTS
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open.
+VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open. Resets or sets the option 'slave' in log_slow_disabled_statements
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -2024,12 +2154,12 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_ALTER_TABLE
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Use old, non-optimized alter table
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Alias for alter_algorithm. Deprecated. Use --alter-algorithm instead.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
+ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_MODE
@@ -2099,7 +2229,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,default
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,default
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY
@@ -2522,6 +2652,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PROXY_PROTOCOL_NETWORKS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Enable proxy protocol for these source networks. The syntax is a comma separated list of IPv4 and IPv6 networks. If the network doesn't contain mask, it is considered to be a single host. "*" represents all networks and must the only directive on the line. String "localhost" represents non-TCP local connections (Unix domain socket, Windows named pipe or shared memory).
+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 PROXY_USER
VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE VARCHAR
@@ -2722,6 +2862,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SECURE_TIMESTAMP
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Restricts direct setting of a session timestamp. Possible levels are: YES - timestamp cannot deviate from the system clock, REPLICATION - replication thread can adjust timestamp to match the master's, SUPER - a user with this privilege and a replication thread can adjust timestamp, NO - historical behavior, anyone can modify session timestamp
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO,SUPER,REPLICATION,YES
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2909,7 +3059,7 @@ 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
+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,EMPTY_STRING_IS_NULL,SIMULTANEOUS_ASSIGNMENT
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SQL_NOTES
@@ -2941,7 +3091,7 @@ NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
-COMMAND_LINE_ARGUMENT NULL
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SQL_SELECT_LIMIT
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3112,6 +3262,26 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SYSTEM_VERSIONING_ALTER_HISTORY
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Versioning ALTER TABLE mode. ERROR: Fail ALTER with error; KEEP: Keep historical system rows and subject them to ALTER
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST ERROR,KEEP
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SYSTEM_VERSIONING_ASOF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Default value for the FOR SYSTEM_TIME AS OF clause
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3142,6 +3312,36 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TCP_KEEPALIVE_INTERVAL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT
+VARIABLE_COMMENT The interval, in seconds, between when successive keep-alive packets are sent if no acknowledgement is received.If set to 0, system dependent default is used.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TCP_KEEPALIVE_PROBES
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT
+VARIABLE_COMMENT The number of unacknowledged probes to send before considering the connection dead and notifying the application layer.If set to 0, system dependent default is used.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TCP_KEEPALIVE_TIME
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT
+VARIABLE_COMMENT Timeout, in seconds, with no activity until the first TCP keep-alive packet is sent.If set to 0, system dependent default is used.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3392,6 +3592,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_SOURCE_REVISION
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Source control revision id for MariaDB source code
+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
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
index 0d65cd9926e..3dc6c294435 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
@@ -1,7 +1,7 @@
---- sysvars_server_notembedded.result 2019-09-01 12:14:55.790521181 +0300
-+++ sysvars_server_notembedded,32bit.reject 2019-09-01 13:37:21.711271100 +0300
-@@ -13,7 +13,7 @@
- order by variable_name;
+--- sysvars_server_notembedded.result 2019-09-02 17:27:55.739188565 +0300
++++ sysvars_server_notembedded.reject 2019-09-02 17:55:08.525327501 +0300
+@@ -25,7 +25,7 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
@@ -9,7 +9,7 @@
VARIABLE_COMMENT Block size to be used for Aria index pages.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 32768
-@@ -23,7 +23,7 @@
+@@ -35,7 +35,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_CHECKPOINT_INTERVAL
VARIABLE_SCOPE GLOBAL
@@ -18,7 +18,7 @@
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
-@@ -33,7 +33,7 @@
+@@ -45,7 +45,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_CHECKPOINT_LOG_ACTIVITY
VARIABLE_SCOPE GLOBAL
@@ -27,7 +27,7 @@
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
-@@ -53,7 +53,7 @@
+@@ -65,7 +65,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_FORCE_START_AFTER_RECOVERY_FAILURES
VARIABLE_SCOPE GLOBAL
@@ -36,7 +36,7 @@
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
-@@ -73,7 +73,7 @@
+@@ -85,7 +85,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_GROUP_COMMIT_INTERVAL
VARIABLE_SCOPE GLOBAL
@@ -45,7 +45,7 @@
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
-@@ -83,7 +83,7 @@
+@@ -95,7 +95,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -54,7 +54,7 @@
VARIABLE_COMMENT Limit for transaction log size
NUMERIC_MIN_VALUE 8388608
NUMERIC_MAX_VALUE 4294967295
-@@ -113,10 +113,10 @@
+@@ -125,10 +125,10 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD
VARIABLE_SCOPE GLOBAL
@@ -67,7 +67,7 @@
NUMERIC_BLOCK_SIZE 100
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -133,7 +133,7 @@
+@@ -145,7 +145,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -76,7 +76,7 @@
VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
-@@ -143,7 +143,7 @@
+@@ -155,7 +155,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_FILE_HASH_SIZE
VARIABLE_SCOPE GLOBAL
@@ -85,7 +85,7 @@
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
-@@ -173,7 +173,7 @@
+@@ -185,7 +185,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_REPAIR_THREADS
VARIABLE_SCOPE SESSION
@@ -94,7 +94,7 @@
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
-@@ -186,7 +186,7 @@
+@@ -198,7 +198,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
@@ -103,7 +103,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -243,7 +243,7 @@
+@@ -255,7 +255,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME AUTO_INCREMENT_INCREMENT
VARIABLE_SCOPE SESSION
@@ -112,7 +112,7 @@
VARIABLE_COMMENT Auto-increment columns are incremented by this
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
-@@ -253,7 +253,7 @@
+@@ -265,7 +265,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME AUTO_INCREMENT_OFFSET
VARIABLE_SCOPE SESSION
@@ -121,7 +121,7 @@
VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
-@@ -263,7 +263,7 @@
+@@ -275,7 +275,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BACK_LOG
VARIABLE_SCOPE GLOBAL
@@ -130,7 +130,7 @@
VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -306,7 +306,7 @@
+@@ -328,7 +328,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
@@ -139,7 +139,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -323,20 +323,20 @@
+@@ -345,20 +345,20 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT
VARIABLE_SCOPE GLOBAL
@@ -164,7 +164,16 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -386,7 +386,7 @@
+@@ -378,7 +378,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT The size of file cache for the binary log
+ NUMERIC_MIN_VALUE 8192
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -418,7 +418,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
@@ -173,7 +182,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -396,7 +396,7 @@
+@@ -428,7 +428,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
@@ -182,7 +191,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -543,7 +543,7 @@
+@@ -615,7 +615,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME CONNECT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -191,7 +200,7 @@
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
-@@ -593,7 +593,7 @@
+@@ -665,7 +665,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
@@ -200,7 +209,7 @@
VARIABLE_COMMENT Long search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 33
-@@ -603,7 +603,7 @@
+@@ -675,7 +675,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
VARIABLE_SCOPE SESSION
@@ -209,7 +218,7 @@
VARIABLE_COMMENT Short search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 32
-@@ -613,7 +613,7 @@
+@@ -685,7 +685,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
VARIABLE_SCOPE SESSION
@@ -218,7 +227,7 @@
VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -623,7 +623,7 @@
+@@ -695,7 +695,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
VARIABLE_SCOPE SESSION
@@ -227,7 +236,7 @@
VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -673,7 +673,7 @@
+@@ -745,7 +745,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DEFAULT_WEEK_FORMAT
VARIABLE_SCOPE SESSION
@@ -236,7 +245,7 @@
VARIABLE_COMMENT The default week format used by WEEK() functions
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 7
-@@ -683,7 +683,7 @@
+@@ -755,7 +755,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -245,7 +254,7 @@
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
-@@ -693,7 +693,7 @@
+@@ -765,7 +765,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -254,7 +263,7 @@
VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -703,7 +703,7 @@
+@@ -775,7 +775,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_QUEUE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -263,7 +272,7 @@
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
-@@ -723,7 +723,7 @@
+@@ -795,7 +795,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DIV_PRECISION_INCREMENT
VARIABLE_SCOPE SESSION
@@ -272,7 +281,7 @@
VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 38
-@@ -813,7 +813,7 @@
+@@ -885,7 +885,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME EXPIRE_LOGS_DAYS
VARIABLE_SCOPE GLOBAL
@@ -281,7 +290,7 @@
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
-@@ -843,7 +843,7 @@
+@@ -915,7 +915,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME EXTRA_MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
@@ -290,7 +299,7 @@
VARIABLE_COMMENT The number of connections on extra-port
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
-@@ -873,7 +873,7 @@
+@@ -945,7 +945,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME FLUSH_TIME
VARIABLE_SCOPE GLOBAL
@@ -299,7 +308,7 @@
VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -903,7 +903,7 @@
+@@ -975,7 +975,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MAX_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -308,7 +317,7 @@
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
-@@ -913,7 +913,7 @@
+@@ -985,7 +985,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MIN_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -317,7 +326,7 @@
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
-@@ -923,7 +923,7 @@
+@@ -995,7 +995,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -326,7 +335,7 @@
VARIABLE_COMMENT Number of best matches to use for query expansion
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -966,7 +966,7 @@
+@@ -1038,7 +1038,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT()
NUMERIC_MIN_VALUE 4
@@ -335,7 +344,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1153,7 +1153,7 @@
+@@ -1235,7 +1235,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HISTOGRAM_SIZE
VARIABLE_SCOPE SESSION
@@ -344,7 +353,7 @@
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
-@@ -1183,7 +1183,7 @@
+@@ -1265,7 +1265,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HOST_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -353,7 +362,7 @@
VARIABLE_COMMENT How many host names should be cached to avoid resolving.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65536
-@@ -1263,7 +1263,7 @@
+@@ -1375,7 +1375,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME INTERACTIVE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -362,7 +371,7 @@
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
-@@ -1286,7 +1286,7 @@
+@@ -1398,7 +1398,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer that is used for joins
NUMERIC_MIN_VALUE 128
@@ -371,7 +380,7 @@
NUMERIC_BLOCK_SIZE 128
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1303,7 +1303,7 @@
+@@ -1415,7 +1415,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME JOIN_CACHE_LEVEL
VARIABLE_SCOPE SESSION
@@ -380,7 +389,7 @@
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
-@@ -1326,7 +1326,7 @@
+@@ -1438,7 +1438,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
@@ -389,16 +398,16 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1493,7 +1493,7 @@
+@@ -1605,7 +1605,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME LOCK_WAIT_TIMEOUT
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_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -1623,7 +1623,7 @@
+@@ -1755,7 +1755,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
VARIABLE_SCOPE SESSION
@@ -407,7 +416,7 @@
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
-@@ -1653,7 +1653,7 @@
+@@ -1785,7 +1785,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_WARNINGS
VARIABLE_SCOPE SESSION
@@ -416,7 +425,7 @@
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
-@@ -1713,7 +1713,7 @@
+@@ -1845,7 +1845,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MAX_ALLOWED_PACKET
VARIABLE_SCOPE SESSION
@@ -425,7 +434,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -1726,14 +1726,14 @@
+@@ -1858,14 +1858,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the transactional cache
NUMERIC_MIN_VALUE 4096
@@ -442,7 +451,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
-@@ -1746,14 +1746,14 @@
+@@ -1878,14 +1878,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the statement cache
NUMERIC_MIN_VALUE 4096
@@ -459,7 +468,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
-@@ -1763,7 +1763,7 @@
+@@ -1895,7 +1895,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECT_ERRORS
VARIABLE_SCOPE GLOBAL
@@ -468,7 +477,7 @@
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
-@@ -1773,7 +1773,7 @@
+@@ -1905,7 +1905,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_DELAYED_THREADS
VARIABLE_SCOPE SESSION
@@ -477,7 +486,7 @@
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
-@@ -1793,7 +1793,7 @@
+@@ -1925,7 +1925,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_ERROR_COUNT
VARIABLE_SCOPE SESSION
@@ -486,7 +495,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -1806,14 +1806,14 @@
+@@ -1938,14 +1938,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
@@ -503,7 +512,7 @@
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
-@@ -1833,7 +1833,7 @@
+@@ -1965,7 +1965,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
VARIABLE_SCOPE SESSION
@@ -512,7 +521,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -1843,7 +1843,7 @@
+@@ -1975,7 +1975,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LONG_DATA_SIZE
VARIABLE_SCOPE GLOBAL
@@ -521,7 +530,7 @@
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
-@@ -1863,7 +1863,7 @@
+@@ -1995,7 +1995,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
VARIABLE_SCOPE SESSION
@@ -530,7 +539,7 @@
VARIABLE_COMMENT Maximum number of iterations when executing recursive queries
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1883,7 +1883,7 @@
+@@ -2015,7 +2015,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SEEKS_FOR_KEY
VARIABLE_SCOPE SESSION
@@ -539,7 +548,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1903,7 +1903,7 @@
+@@ -2035,7 +2035,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
VARIABLE_SCOPE SESSION
@@ -548,7 +557,7 @@
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
-@@ -1913,7 +1913,7 @@
+@@ -2045,7 +2045,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SP_RECURSION_DEPTH
VARIABLE_SCOPE SESSION
@@ -557,7 +566,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -1933,7 +1933,7 @@
+@@ -2065,7 +2065,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_TMP_TABLES
VARIABLE_SCOPE SESSION
@@ -566,7 +575,7 @@
VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1953,7 +1953,7 @@
+@@ -2085,7 +2085,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_WRITE_LOCK_COUNT
VARIABLE_SCOPE GLOBAL
@@ -575,7 +584,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1963,7 +1963,7 @@
+@@ -2095,7 +2095,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -584,7 +593,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
-@@ -1973,7 +1973,7 @@
+@@ -2105,7 +2105,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -593,7 +602,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -1983,7 +1983,7 @@
+@@ -2115,7 +2115,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
@@ -602,7 +611,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1993,7 +1993,7 @@
+@@ -2125,7 +2125,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MRR_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -611,7 +620,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -2003,17 +2003,17 @@
+@@ -2135,17 +2135,17 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MULTI_RANGE_COUNT
VARIABLE_SCOPE SESSION
@@ -632,7 +641,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
-@@ -2023,7 +2023,7 @@
+@@ -2155,7 +2155,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
VARIABLE_SCOPE GLOBAL
@@ -641,7 +650,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
-@@ -2046,7 +2046,7 @@
+@@ -2178,7 +2178,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
NUMERIC_MIN_VALUE 7
@@ -650,7 +659,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -2063,10 +2063,10 @@
+@@ -2195,10 +2195,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MYISAM_REPAIR_THREADS
VARIABLE_SCOPE SESSION
@@ -663,7 +672,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2076,7 +2076,7 @@
+@@ -2208,7 +2208,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
@@ -672,7 +681,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2113,7 +2113,7 @@
+@@ -2245,7 +2245,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME NET_BUFFER_LENGTH
VARIABLE_SCOPE SESSION
@@ -681,7 +690,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
-@@ -2123,7 +2123,7 @@
+@@ -2255,7 +2255,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_READ_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -690,7 +699,7 @@
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
-@@ -2133,7 +2133,7 @@
+@@ -2265,7 +2265,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_RETRY_COUNT
VARIABLE_SCOPE SESSION
@@ -699,7 +708,7 @@
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
-@@ -2143,7 +2143,7 @@
+@@ -2275,7 +2275,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_WRITE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -708,7 +717,7 @@
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
-@@ -2193,7 +2193,7 @@
+@@ -2325,7 +2325,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -717,7 +726,7 @@
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 or autoset 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
-@@ -2203,7 +2203,7 @@
+@@ -2335,7 +2335,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_PRUNE_LEVEL
VARIABLE_SCOPE SESSION
@@ -726,7 +735,7 @@
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
-@@ -2213,7 +2213,7 @@
+@@ -2345,7 +2345,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
@@ -735,7 +744,7 @@
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.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2223,7 +2223,7 @@
+@@ -2355,7 +2355,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
VARIABLE_SCOPE SESSION
@@ -744,7 +753,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
-@@ -2243,7 +2243,7 @@
+@@ -2375,7 +2375,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY
VARIABLE_SCOPE SESSION
@@ -753,7 +762,7 @@
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
-@@ -2263,7 +2263,7 @@
+@@ -2395,7 +2395,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -762,7 +771,7 @@
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
-@@ -2273,7 +2273,7 @@
+@@ -2405,7 +2405,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -771,7 +780,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 200
-@@ -2283,7 +2283,7 @@
+@@ -2415,7 +2415,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -780,7 +789,7 @@
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
-@@ -2293,7 +2293,7 @@
+@@ -2425,7 +2425,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -789,7 +798,7 @@
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
-@@ -2303,7 +2303,7 @@
+@@ -2435,7 +2435,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -798,7 +807,7 @@
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
-@@ -2313,7 +2313,7 @@
+@@ -2445,7 +2445,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -807,7 +816,7 @@
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
-@@ -2323,7 +2323,7 @@
+@@ -2455,7 +2455,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -816,7 +825,7 @@
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
-@@ -2333,7 +2333,7 @@
+@@ -2465,7 +2465,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -825,7 +834,7 @@
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
-@@ -2343,7 +2343,7 @@
+@@ -2475,7 +2475,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -834,7 +843,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2353,7 +2353,7 @@
+@@ -2485,7 +2485,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -843,7 +852,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2363,7 +2363,7 @@
+@@ -2495,7 +2495,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -852,7 +861,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2373,7 +2373,7 @@
+@@ -2505,7 +2505,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
VARIABLE_SCOPE GLOBAL
@@ -861,7 +870,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2383,7 +2383,7 @@
+@@ -2515,7 +2515,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -870,7 +879,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2393,7 +2393,7 @@
+@@ -2525,7 +2525,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -879,7 +888,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2403,7 +2403,7 @@
+@@ -2535,7 +2535,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -888,7 +897,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2413,7 +2413,7 @@
+@@ -2545,7 +2545,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -897,7 +906,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2423,7 +2423,7 @@
+@@ -2555,7 +2555,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -906,7 +915,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2433,7 +2433,7 @@
+@@ -2565,7 +2565,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -915,7 +924,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2443,7 +2443,7 @@
+@@ -2575,7 +2575,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -924,7 +933,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2453,7 +2453,7 @@
+@@ -2585,7 +2585,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -933,7 +942,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2463,7 +2463,7 @@
+@@ -2595,7 +2595,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -942,7 +951,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2473,7 +2473,7 @@
+@@ -2605,7 +2605,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -951,7 +960,7 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2483,7 +2483,7 @@
+@@ -2615,7 +2615,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -960,7 +969,7 @@
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2493,7 +2493,7 @@
+@@ -2625,7 +2625,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -969,7 +978,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2503,7 +2503,7 @@
+@@ -2635,7 +2635,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -978,7 +987,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2513,7 +2513,7 @@
+@@ -2645,7 +2645,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -987,7 +996,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2523,7 +2523,7 @@
+@@ -2655,7 +2655,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -996,7 +1005,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2533,7 +2533,7 @@
+@@ -2665,7 +2665,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1005,7 +1014,7 @@
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
-@@ -2543,7 +2543,7 @@
+@@ -2675,7 +2675,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1014,7 +1023,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
-@@ -2553,7 +2553,7 @@
+@@ -2685,7 +2685,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1023,7 +1032,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2563,7 +2563,7 @@
+@@ -2695,7 +2695,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1032,7 +1041,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2613,7 +2613,7 @@
+@@ -2745,7 +2745,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PRELOAD_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1041,7 +1050,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -2633,7 +2633,7 @@
+@@ -2765,7 +2765,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME PROFILING_HISTORY_SIZE
VARIABLE_SCOPE SESSION
@@ -1050,7 +1059,7 @@
VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -2643,7 +2643,7 @@
+@@ -2775,7 +2775,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PROGRESS_REPORT_TIME
VARIABLE_SCOPE SESSION
@@ -1059,7 +1068,7 @@
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
-@@ -2693,7 +2693,7 @@
+@@ -2835,7 +2835,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
VARIABLE_SCOPE SESSION
@@ -1068,7 +1077,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -2703,7 +2703,7 @@
+@@ -2845,7 +2845,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -1077,7 +1086,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2713,7 +2713,7 @@
+@@ -2855,7 +2855,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
VARIABLE_SCOPE GLOBAL
@@ -1086,7 +1095,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2726,7 +2726,7 @@
+@@ -2868,7 +2868,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
@@ -1095,7 +1104,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2763,7 +2763,7 @@
+@@ -2905,7 +2905,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME QUERY_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
@@ -1104,7 +1113,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -2776,7 +2776,7 @@
+@@ -2918,7 +2918,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1113,7 +1122,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2786,14 +2786,14 @@
+@@ -2928,14 +2928,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1130,7 +1139,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
-@@ -2806,14 +2806,14 @@
+@@ -2948,14 +2948,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum speed(KB/s) to read binlog from master (0 = no limit)
NUMERIC_MIN_VALUE 0
@@ -1147,7 +1156,7 @@
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
-@@ -2833,7 +2833,7 @@
+@@ -2975,7 +2975,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME READ_RND_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1156,7 +1165,7 @@
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
-@@ -3033,10 +3033,10 @@
+@@ -3175,10 +3175,10 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ROWID_MERGE_BUFF_SIZE
VARIABLE_SCOPE SESSION
@@ -1169,7 +1178,45 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3063,7 +3063,7 @@
+@@ -3195,20 +3195,20 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME RPL_SEMI_SYNC_MASTER_TIMEOUT
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The timeout value (in ms) for semi-synchronous replication in the master
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME RPL_SEMI_SYNC_MASTER_TRACE_LEVEL
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The tracing level for semi-sync replication.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3265,10 +3265,10 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The tracing level for semi-sync replication.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3305,7 +3305,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
@@ -1178,7 +1225,7 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -3193,7 +3193,7 @@
+@@ -3435,7 +3435,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_DOMAIN_PARALLEL_THREADS
VARIABLE_SCOPE GLOBAL
@@ -1187,7 +1234,7 @@
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
-@@ -3223,7 +3223,7 @@
+@@ -3465,7 +3465,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET
VARIABLE_SCOPE GLOBAL
@@ -1196,7 +1243,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3243,7 +3243,7 @@
+@@ -3485,7 +3485,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_PARALLEL_MAX_QUEUED
VARIABLE_SCOPE GLOBAL
@@ -1205,7 +1252,7 @@
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
-@@ -3263,7 +3263,7 @@
+@@ -3505,7 +3505,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME SLAVE_PARALLEL_THREADS
VARIABLE_SCOPE GLOBAL
@@ -1214,7 +1261,7 @@
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
-@@ -3273,7 +3273,7 @@
+@@ -3515,7 +3515,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_PARALLEL_WORKERS
VARIABLE_SCOPE GLOBAL
@@ -1223,16 +1270,25 @@
VARIABLE_COMMENT Alias for slave_parallel_threads
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -3313,7 +3313,7 @@
+@@ -3555,7 +3555,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SLAVE_TRANSACTION_RETRIES
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
+ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock, elapsed lock wait timeout or listed in slave_transaction_retry_errors, before giving up and stopping
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3333,7 +3333,7 @@
+@@ -3575,7 +3575,7 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME SLAVE_TRANSACTION_RETRY_INTERVAL
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Interval of the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout or listed in slave_transaction_retry_errors
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 3600
+@@ -3595,7 +3595,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLOW_LAUNCH_TIME
VARIABLE_SCOPE GLOBAL
@@ -1241,7 +1297,7 @@
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
-@@ -3376,7 +3376,7 @@
+@@ -3638,7 +3638,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
@@ -1250,7 +1306,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3593,7 +3593,7 @@
+@@ -3855,7 +3855,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME STORED_PROGRAM_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1259,7 +1315,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
-@@ -3673,7 +3673,7 @@
+@@ -3955,7 +3955,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1268,7 +1324,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 2097152
-@@ -3683,7 +3683,7 @@
+@@ -3965,7 +3965,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1277,7 +1333,7 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
-@@ -3703,7 +3703,7 @@
+@@ -4015,7 +4015,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1286,7 +1342,7 @@
VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -3713,7 +3713,7 @@
+@@ -4025,7 +4025,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_CONCURRENCY
VARIABLE_SCOPE GLOBAL
@@ -1295,7 +1351,7 @@
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
-@@ -3866,7 +3866,7 @@
+@@ -4178,7 +4178,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
@@ -1304,7 +1360,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3876,7 +3876,7 @@
+@@ -4188,7 +4188,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size.
NUMERIC_MIN_VALUE 1024
@@ -1313,7 +1369,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3886,14 +3886,14 @@
+@@ -4198,14 +4198,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
@@ -1330,7 +1386,7 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -3903,7 +3903,7 @@
+@@ -4215,7 +4215,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
@@ -1339,7 +1395,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -4033,7 +4033,7 @@
+@@ -4355,7 +4355,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -1348,7 +1404,7 @@
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
-@@ -4060,7 +4060,7 @@
+@@ -4382,7 +4382,7 @@
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index f9c92b91d86..f65be0f3159 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -12,6 +12,16 @@ variable_name not in (
'log_tc_size'
)
order by variable_name;
+VARIABLE_NAME ALTER_ALGORITHM
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Specify the alter table algorithm
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -292,6 +302,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BIND_ADDRESS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT IP address to bind to.
+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_ANNOTATE_ROW_EVENTS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
@@ -352,6 +372,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BINLOG_FILE_CACHE_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The size of file cache for the binary log
+NUMERIC_MIN_VALUE 8192
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_FORMAT
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
@@ -522,6 +552,46 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME COLUMN_COMPRESSION_THRESHOLD
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimum column data length eligible for compression
+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 COLUMN_COMPRESSION_ZLIB_LEVEL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT zlib compression level (1 gives best speed, 9 gives best compression)
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 9
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME COLUMN_COMPRESSION_ZLIB_STRATEGY
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The strategy parameter is used to tune the compression algorithm. Use the value DEFAULT_STRATEGY for normal data, FILTERED for data produced by a filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no string match), or RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between DEFAULT_STRATEGY and HUFFMAN_ONLY. RLE is designed to be almost as fast as HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT_STRATEGY,FILTERED,HUFFMAN_ONLY,RLE,FIXED
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME COLUMN_COMPRESSION_ZLIB_WRAP
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Generate zlib header and trailer and compute adler32 check value. It can be used with storage engines that don't provide data integrity verification to detect data corruption.
+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 COMPLETION_TYPE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
@@ -825,7 +895,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME EXPLICIT_DEFAULTS_FOR_TIMESTAMP
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.
+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.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -1022,6 +1092,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME GTID_POS_AUTO_ENGINES
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT List of engines for which to automatically create a mysql.gtid_slave_pos_ENGINE table, if a transaction using that engine is replicated. This can be used to avoid introducing cross-engine transactions, if engines are used different from that used by table mysql.gtid_slave_pos
+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_SEQ_NO
VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE BIGINT UNSIGNED
@@ -1202,6 +1282,36 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME IDLE_READONLY_TRANSACTION_TIMEOUT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for read-only idle transaction
+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 IDLE_TRANSACTION_TIMEOUT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for idle transaction
+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 IDLE_WRITE_TRANSACTION_TIMEOUT
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The number of seconds the server waits for write idle transaction
+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 IGNORE_BUILTIN_INNODB
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -1272,6 +1382,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME IN_PREDICATE_CONVERSION_THRESHOLD
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT The minimum number of scalar elements in the value list of IN predicate that triggers its conversion to IN subquery. Set to 0 to disable the conversion.
+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 IN_TRANSACTION
VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE BIGINT UNSIGNED
@@ -1496,7 +1616,7 @@ VARIABLE_NAME LOCK_WAIT_TIMEOUT
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_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
@@ -1562,6 +1682,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_DISABLED_STATEMENTS
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Don't log certain types of statements to general log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST slave,sp
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_ERROR
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
@@ -1583,9 +1713,9 @@ ENUM_VALUE_LIST NONE,FILE,TABLE
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_QUERIES_NOT_USING_INDEXES
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log queries that are executed without benefit of any index to the slow log if it is open
+VARIABLE_COMMENT Log queries that are executed without benefit of any index to the slow log if it is open. Same as log_slow_filter='not_using_index'
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -1603,23 +1733,33 @@ ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_disabled_statements
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_DISABLED_STATEMENTS
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE SET
+VARIABLE_COMMENT Don't log certain types of statements to slow log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST admin,call,slave,sp
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_FILTER
VARIABLE_SCOPE SESSION
VARIABLE_TYPE SET
-VARIABLE_COMMENT Log only certain types of queries
+VARIABLE_COMMENT Log only certain types of queries to the slow log. If variable empty alll kind of queries are logged. All types are bound by slow_query_time, except 'not_using_index' which is always logged if enabled
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
+ENUM_VALUE_LIST admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,not_using_index,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
@@ -1633,9 +1773,9 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_SLAVE_STATEMENTS
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open.
+VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open. Resets or sets the option 'slave' in log_slow_disabled_statements
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -2164,12 +2304,12 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_ALTER_TABLE
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Use old, non-optimized alter table
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Alias for alter_algorithm. Deprecated. Use --alter-algorithm instead.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
+ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_MODE
@@ -2239,7 +2379,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,default
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,default
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY
@@ -2662,6 +2802,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME PROXY_PROTOCOL_NETWORKS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Enable proxy protocol for these source networks. The syntax is a comma separated list of IPv4 and IPv6 networks. If the network doesn't contain mask, it is considered to be a single host. "*" represents all networks and must the only directive on the line. String "localhost" represents non-TCP local connections (Unix domain socket, Windows named pipe or shared memory).
+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 PROXY_USER
VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE VARCHAR
@@ -3042,6 +3192,96 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RPL_SEMI_SYNC_MASTER_ENABLED
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable semi-synchronous replication master (disabled by default).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME RPL_SEMI_SYNC_MASTER_TIMEOUT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The timeout value (in ms) for semi-synchronous replication in the master
+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 RPL_SEMI_SYNC_MASTER_TRACE_LEVEL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The tracing level for semi-sync replication.
+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 RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wait until timeout when no semi-synchronous replication slave available (enabled by default).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME RPL_SEMI_SYNC_MASTER_WAIT_POINT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Should transaction wait for semi-sync ack after having synced binlog, or after having committed in storage engine.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST AFTER_SYNC,AFTER_COMMIT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RPL_SEMI_SYNC_SLAVE_DELAY_MASTER
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Only write master info file when ack is 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 RPL_SEMI_SYNC_SLAVE_ENABLED
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable semi-synchronous replication slave (disabled by default).
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME RPL_SEMI_SYNC_SLAVE_KILL_CONN_TIMEOUT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Timeout for the mysql connection used to kill the slave io_thread's connection on master. This timeout comes into play when stop slave is executed.
+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 RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The tracing level for semi-sync replication.
+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 SECURE_AUTH
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -3062,6 +3302,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SECURE_TIMESTAMP
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Restricts direct setting of a session timestamp. Possible levels are: YES - timestamp cannot deviate from the system clock, REPLICATION - replication thread can adjust timestamp to match the master's, SUPER - a user with this privilege and a replication thread can adjust timestamp, NO - historical behavior, anyone can modify session timestamp
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NO,SUPER,REPLICATION,YES
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3095,7 +3345,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SESSION_TRACK_SYSTEM_VARIABLES
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT Track changes in registered system variables. For compatibility with MySQL defaults this variable should be set to "autocommit, character_set_client, character_set_connection, character_set_results, time_zone"
+VARIABLE_COMMENT Track changes in registered system variables.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -3105,7 +3355,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SESSION_TRACK_TRANSACTION_INFO
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Track changes to the transaction attributes. OFF to disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all statements needed to start a transaction withthe same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction).
+VARIABLE_COMMENT Track changes to the transaction attributes. OFF to disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all statements needed to start a transaction with the same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction).
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -3315,13 +3565,33 @@ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SLAVE_TRANSACTION_RETRIES
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
+VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock, elapsed lock wait timeout or listed in slave_transaction_retry_errors, 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_TRANSACTION_RETRY_ERRORS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the slave thread to retry transaction for replication when a query event returns an error from the provided list. Deadlock and elapsed lock wait timeout errors are automatically added to this 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_TRANSACTION_RETRY_INTERVAL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Interval of the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout or listed in slave_transaction_retry_errors
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 3600
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_TYPE_CONVERSIONS
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE SET
@@ -3439,7 +3709,7 @@ 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
+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,EMPTY_STRING_IS_NULL,SIMULTANEOUS_ASSIGNMENT
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SQL_NOTES
@@ -3471,7 +3741,7 @@ NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
-COMMAND_LINE_ARGUMENT NULL
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SQL_SELECT_LIMIT
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3672,6 +3942,26 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME SYSTEM_VERSIONING_ALTER_HISTORY
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Versioning ALTER TABLE mode. ERROR: Fail ALTER with error; KEEP: Keep historical system rows and subject them to ALTER
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST ERROR,KEEP
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME SYSTEM_VERSIONING_ASOF
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Default value for the FOR SYSTEM_TIME AS OF clause
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST DEFAULT
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3702,6 +3992,36 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TCP_KEEPALIVE_INTERVAL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT
+VARIABLE_COMMENT The interval, in seconds, between when successive keep-alive packets are sent if no acknowledgement is received.If set to 0, system dependent default is used.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TCP_KEEPALIVE_PROBES
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT
+VARIABLE_COMMENT The number of unacknowledged probes to send before considering the connection dead and notifying the application layer.If set to 0, system dependent default is used.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TCP_KEEPALIVE_TIME
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT
+VARIABLE_COMMENT Timeout, in seconds, with no activity until the first TCP keep-alive packet is sent.If set to 0, system dependent default is used.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2147483
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -4022,6 +4342,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME VERSION_SOURCE_REVISION
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Source control revision id for MariaDB source code
+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
diff --git a/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result b/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
index 9c6825fa022..a3d86108862 100644
--- a/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
@@ -91,8 +91,6 @@ SELECT @@table_definition_cache = @@global.table_definition_cache;
'#---------------------FN_DYNVARS_019_09----------------------#'
SET table_definition_cache = 1;
ERROR HY000: Variable 'table_definition_cache' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.table_definition_cache = 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 'table_definition_cache = 1' at line 1
SELECT global.table_definition_cache;
ERROR 42S02: Unknown table 'global' in field list
SELECT table_definition_cache = @@session.table_definition_cache;
diff --git a/mysql-test/suite/sys_vars/r/tcp_keepalive_time.result b/mysql-test/suite/sys_vars/r/tcp_keepalive_time.result
new file mode 100644
index 00000000000..410fceb7294
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/tcp_keepalive_time.result
@@ -0,0 +1,9 @@
+set global tcp_keepalive_time = 1;
+set global tcp_keepalive_interval =1;
+set global tcp_keepalive_probes=1;
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
+disconnect con1;
+connection default;
+set global tcp_keepalive_time= default;
+set global tcp_keepalive_interval= default;
+set global tcp_keepalive_probes=default;
diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_basic.result b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
index 09ccebf12a2..f6ee2c92fa5 100644
--- a/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
+++ b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
@@ -123,10 +123,6 @@ SELECT @@global.tx_isolation;
READ-UNCOMMITTED
'#---------------------FN_DYNVARS_183_09----------------------#'
SET tx_isolation = 'REPEATABLE-READ';
-SET session.tx_isolation = 'REPEATABLE-READ';
-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 'tx_isolation = 'REPEATABLE-READ'' at line 1
-SET global.tx_isolation = 'REPEATABLE-READ';
-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 'tx_isolation = 'REPEATABLE-READ'' at line 1
SET session tx_isolation = 'REPEATABLE-READ';
SELECT @@tx_isolation;
@@tx_isolation
diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test
index 7b9f69bd7d1..c0127e1ef12 100644
--- a/mysql-test/suite/sys_vars/t/all_vars.test
+++ b/mysql-test/suite/sys_vars/t/all_vars.test
@@ -12,7 +12,7 @@ eval INSTALL PLUGIN blackhole SONAME "$HA_BLACKHOLE_SO";
eval INSTALL PLUGIN federated SONAME "$HA_FEDERATEDX_SO";
eval INSTALL PLUGIN oqgraph SONAME "$HA_OQGRAPH_SO";
eval INSTALL PLUGIN sphinx SONAME "$HA_SPHINX_SO";
-eval INSTALL PLUGIN innodb SONAME "$HA_XTRADB_SO";
+eval INSTALL PLUGIN innodb SONAME "$HA_INNODB_SO";
eval INSTALL PLUGIN rpl_semi_sync_master SONAME "$SEMISYNC_MASTER_SO";
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME "$SEMISYNC_SLAVE_SO";
--enable_abort_on_error
diff --git a/mysql-test/suite/sys_vars/t/alter_algorithm_basic.test b/mysql-test/suite/sys_vars/t/alter_algorithm_basic.test
new file mode 100644
index 00000000000..69a5320a98c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/alter_algorithm_basic.test
@@ -0,0 +1,58 @@
+SET @start_global_value = @@global.alter_algorithm;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL alter_algorithm=1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL alter_algorithm=-1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL alter_algorithm=weird;
+SET GLOBAL alter_algorithm=4;
+SELECT @@global.alter_algorithm;
+SET GLOBAL alter_algorithm=3;
+SELECT @@global.alter_algorithm;
+SET GLOBAL alter_algorithm=0;
+SELECT @@global.alter_algorithm;
+SET GLOBAL alter_algorithm=1;
+SELECT @@global.alter_algorithm;
+SET GLOBAL alter_algorithm=2;
+SELECT @@global.alter_algorithm;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL alter_algorithm=5;
+SELECT @@global.alter_algorithm;
+
+SET GLOBAL alter_algorithm=NOCOPY;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET alter_algorithm=1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET alter_algorithm=-1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET alter_algorithm=weird;
+SET alter_algorithm=4;
+SELECT @@alter_algorithm;
+SET alter_algorithm=3;
+SELECT @@alter_algorithm;
+SET alter_algorithm=0;
+SELECT @@alter_algorithm;
+SET alter_algorithm=1;
+SELECT @@alter_algorithm;
+SET alter_algorithm=2;
+SELECT @@alter_algorithm;
+--error ER_WRONG_VALUE_FOR_VAR
+SET alter_algorithm=5;
+SELECT @@alter_algorithm;
+
+SET SESSION alter_algorithm=INSTANT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+SET SESSION alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+SET SESSION alter_algorithm='DEFAULT';
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+SET SESSION alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+SET GLOBAL alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+SET SESSION alter_algorithm=DEFAULT;
+SHOW SESSION VARIABLES LIKE 'alter_algorithm';
+
+SET GLOBAL alter_algorithm = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
index dfa733a0b9b..6f7ceed0437 100644
--- a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
+++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
@@ -152,12 +152,8 @@ SELECT @@automatic_sp_privileges = @@global.automatic_sp_privileges;
###############################################################################
--Error ER_GLOBAL_VARIABLE
SET automatic_sp_privileges = 1;
---Error ER_PARSE_ERROR
-SET local.automatic_sp_privileges = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.automatic_sp_privileges;
---Error ER_PARSE_ERROR
-SET global.automatic_sp_privileges = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.automatic_sp_privileges;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/big_tables_basic.test b/mysql-test/suite/sys_vars/t/big_tables_basic.test
index 89a7ee83bc8..d004feac3db 100644
--- a/mysql-test/suite/sys_vars/t/big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/big_tables_basic.test
@@ -148,12 +148,8 @@ SELECT @@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_
SET big_tables = 1;
SELECT @@big_tables;
---Error ER_PARSE_ERROR
-SET local.big_tables = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.big_tables;
---Error ER_PARSE_ERROR
-SET session.big_tables = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.big_tables;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/bind_address_basic.test b/mysql-test/suite/sys_vars/t/bind_address_basic.test
new file mode 100644
index 00000000000..f7c567b36b8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/bind_address_basic.test
@@ -0,0 +1,95 @@
+
+
+################## mysql-test\t\bind_address_basic.test ############################
+# #
+# Variable Name: bind_address #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: filename #
+###############################################################################
+
+--source include/not_embedded.inc
+
+--echo '#---------------------BS_STVARS_001_01----------------------#'
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT COUNT(@@GLOBAL.bind_address);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_001_02----------------------#'
+####################################################################
+# Check if Value can set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.bind_address=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.bind_address);
+--echo 1 Expected
+
+
+
+
+--echo '#---------------------BS_STVARS_001_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+--disable_warnings
+SELECT VARIABLE_VALUE = ''
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='bind_address';
+--enable_warnings
+--echo 0 Expected
+
+SELECT COUNT(@@GLOBAL.bind_address);
+--echo 1 Expected
+
+--disable_warnings
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='bind_address';
+--enable_warnings
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_001_04----------------------#'
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@bind_address is NULL AND @@GLOBAL.bind_address is NULL;
+--echo 0 Expected
+
+SELECT @@bind_address is NOT NULL AND @@GLOBAL.bind_address is NOT NULL;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_001_05----------------------#'
+################################################################################
+# Check if bind_address can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@bind_address);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.bind_address);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.bind_address);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.bind_address);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT bind_address = @@SESSION.bind_address;
+--echo Expected error 'Readonly variable'
+
+
diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test
index 0191d2d4487..45018914ebc 100644
--- a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test
@@ -135,8 +135,6 @@ SELECT @@binlog_cache_size = @@global.binlog_cache_size;
--Error ER_GLOBAL_VARIABLE
SET binlog_cache_size = 1;
---Error ER_PARSE_ERROR
-SET global.binlog_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.binlog_cache_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test
index a7b5c508490..d6ae35ca9c0 100644
--- a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test
@@ -135,8 +135,6 @@ SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
--Error ER_GLOBAL_VARIABLE
SET binlog_stmt_cache_size = 1;
---Error ER_PARSE_ERROR
-SET global.binlog_stmt_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.binlog_stmt_cache_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test
index 5796db32565..125dc2fcf58 100644
--- a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test
@@ -181,12 +181,8 @@ SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
SET bulk_insert_buffer_size = 1;
SELECT @@bulk_insert_buffer_size;
---Error ER_PARSE_ERROR
-SET local.bulk_insert_buffer_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.bulk_insert_buffer_size;
---Error ER_PARSE_ERROR
-SET session.bulk_insert_buffer_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.bulk_insert_buffer_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
index 58c9361cef0..e3461e4ac77 100644
--- a/mysql-test/suite/sys_vars/t/character_set_client_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
@@ -63,8 +63,6 @@ SELECT character_set_client;
SET character_set_client=utf8;
SELECT @@session.character_set_client;
# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.character_set_client=utf8;
# using another syntax for accessing session variable
SET session character_set_client=utf8;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
index 1c2c3c33835..5d6412dd420 100644
--- a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
@@ -63,8 +63,6 @@ SELECT character_set_connection;
SET character_set_connection=utf8;
SELECT @@session.character_set_connection;
# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.character_set_connection=utf8;
# using another syntax for accessing session variable
SET session character_set_connection=utf8;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/character_set_database_basic.test b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
index deba5e5261f..54ccc5afddb 100644
--- a/mysql-test/suite/sys_vars/t/character_set_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
@@ -63,8 +63,6 @@ SELECT character_set_database;
SET character_set_database=utf8;
SELECT @@session.character_set_database;
# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.character_set_database=utf8;
# using another syntax for accessing session variable
SET session character_set_database=utf8;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
index 6bb2de35429..33b77eede06 100644
--- a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
@@ -62,9 +62,6 @@ SELECT character_set_filesystem;
# assign value without @@
SET character_set_filesystem=utf8;
SELECT @@session.character_set_filesystem;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.character_set_filesystem=utf8;
# using another syntax for accessing session variable
SET session character_set_filesystem=utf8;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/character_set_results_basic.test b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
index 92717b4b5dd..cca2277713e 100644
--- a/mysql-test/suite/sys_vars/t/character_set_results_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
@@ -62,9 +62,6 @@ SELECT character_set_results;
# assign value without @@
SET character_set_results=utf8;
SELECT @@session.character_set_results;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.character_set_results=utf8;
# using another syntax for accessing session variable
SET session character_set_results=utf8;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/character_set_server_basic.test b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
index 6dd4712c50a..de090348307 100644
--- a/mysql-test/suite/sys_vars/t/character_set_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
@@ -60,9 +60,6 @@ SELECT character_set_server;
# assign value without @@
SET character_set_server=utf8;
SELECT @@session.character_set_server;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.character_set_server=utf8;
# using another syntax for accessing session variable
SET session character_set_server=utf8;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/collation_connection_basic.test b/mysql-test/suite/sys_vars/t/collation_connection_basic.test
index 11a64f2e874..04eae1d8645 100644
--- a/mysql-test/suite/sys_vars/t/collation_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_connection_basic.test
@@ -60,9 +60,6 @@ SELECT collation_connection;
# assign value without @@
SET collation_connection=utf8_unicode_ci;
SELECT @@session.collation_connection;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.collation_connection=utf8_unicode_ci;
# using another syntax for accessing session variable
SET session collation_connection=utf8_unicode_ci;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/collation_database_basic.test b/mysql-test/suite/sys_vars/t/collation_database_basic.test
index 5a77a5dfc51..314331a7999 100644
--- a/mysql-test/suite/sys_vars/t/collation_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_database_basic.test
@@ -61,9 +61,6 @@ SELECT collation_database;
# assign value without @@
SET collation_database=utf8_unicode_ci;
SELECT @@session.collation_database;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.collation_database=utf8_unicode_ci;
# using another syntax for accessing session variable
SET session collation_database=utf8_unicode_ci;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/collation_server_basic.test b/mysql-test/suite/sys_vars/t/collation_server_basic.test
index a4686edf049..f27a9a185c4 100644
--- a/mysql-test/suite/sys_vars/t/collation_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_server_basic.test
@@ -59,9 +59,6 @@ SELECT collation_server;
# assign value without @@
SET collation_server=utf8_unicode_ci;
SELECT @@session.collation_server;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.collation_server=utf8_unicode_ci;
# using another syntax for accessing session variable
SET session collation_server=utf8_unicode_ci;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/completion_type_basic.test b/mysql-test/suite/sys_vars/t/completion_type_basic.test
index 927654cd32a..7a962fbdf99 100644
--- a/mysql-test/suite/sys_vars/t/completion_type_basic.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_basic.test
@@ -157,12 +157,8 @@ SELECT @@local.completion_type = @@session.completion_type;
SET completion_type = 1;
SELECT @@completion_type;
---Error ER_PARSE_ERROR
-SET local.completion_type = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.completion_type;
---Error ER_PARSE_ERROR
-SET session.completion_type = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.completion_type;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
index 5be569e52d3..6f08915079a 100644
--- a/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
+++ b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
@@ -164,8 +164,6 @@ SELECT @@concurrent_insert = @@global.concurrent_insert;
--Error ER_GLOBAL_VARIABLE
SET concurrent_insert = 1;
SELECT @@concurrent_insert;
---Error ER_PARSE_ERROR
-SET global.concurrent_insert = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.concurrent_insert;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/connect_timeout_basic.test b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
index d89734a00c2..b20006e5c96 100644
--- a/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
@@ -131,8 +131,6 @@ SELECT @@connect_timeout = @@global.connect_timeout;
--Error ER_GLOBAL_VARIABLE
SET connect_timeout = 1;
---Error ER_PARSE_ERROR
-SET global.connect_timeout = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.connect_timeout;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/default_master_connection_basic.test b/mysql-test/suite/sys_vars/t/default_master_connection_basic.test
index 627a236aaa7..ae91bc46e1a 100644
--- a/mysql-test/suite/sys_vars/t/default_master_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/default_master_connection_basic.test
@@ -102,12 +102,8 @@ SELECT @@local.default_master_connection = @@session.default_master_connection;
SET default_master_connection = 'foo';
SELECT @@default_master_connection;
---Error ER_PARSE_ERROR
-SET local.default_master_connection = 'foo';
--Error ER_UNKNOWN_TABLE
SELECT local.default_master_connection;
---Error ER_PARSE_ERROR
-SET session.default_master_connection = 'foo';
--Error ER_UNKNOWN_TABLE
SELECT session.default_master_connection;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/default_week_format_basic.test b/mysql-test/suite/sys_vars/t/default_week_format_basic.test
index e609cdc53f5..592379bae8c 100644
--- a/mysql-test/suite/sys_vars/t/default_week_format_basic.test
+++ b/mysql-test/suite/sys_vars/t/default_week_format_basic.test
@@ -170,12 +170,8 @@ SELECT @@local.default_week_format = @@session.default_week_format;
SET default_week_format = 1;
SELECT @@default_week_format;
---Error ER_PARSE_ERROR
-SET local.default_week_format = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.default_week_format;
---Error ER_PARSE_ERROR
-SET session.default_week_format = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.default_week_format;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic.test
index 0c9a7d1ddb8..3eb345dc5c3 100644
--- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic.test
@@ -141,12 +141,8 @@ SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
--Error ER_GLOBAL_VARIABLE
SET delayed_insert_limit = 1;
SELECT @@delayed_insert_limit;
---Error ER_PARSE_ERROR
-SET local.delayed_insert_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.delayed_insert_limit;
---Error ER_PARSE_ERROR
-SET global.delayed_insert_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.delayed_insert_limit;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
index 2486ff5800f..79521924290 100644
--- a/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
@@ -140,12 +140,8 @@ SELECT @@delayed_insert_timeout = @@global.delayed_insert_timeout;
--Error 1229
SET delayed_insert_timeout = 1;
SELECT @@delayed_insert_timeout;
---Error 1064
-SET local.delayed_insert_timeout = 1;
--Error 1109
SELECT local.delayed_insert_timeout;
---Error 1064
-SET global.delayed_insert_timeout = 1;
--Error 1109
SELECT global.delayed_insert_timeout;
--Error 1054
diff --git a/mysql-test/suite/sys_vars/t/delayed_queue_size_basic.test b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic.test
index e8b5ab31224..a0aae63c8b8 100644
--- a/mysql-test/suite/sys_vars/t/delayed_queue_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic.test
@@ -136,12 +136,8 @@ SELECT @@delayed_queue_size = @@global.delayed_queue_size;
--Error 1229
SET delayed_queue_size = 1;
SELECT @@delayed_queue_size;
---Error ER_PARSE_ERROR
-SET local.delayed_queue_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.delayed_queue_size;
---Error ER_PARSE_ERROR
-SET global.delayed_queue_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.delayed_queue_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
index 97f0e0eab81..6399288cafc 100644
--- a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
@@ -179,12 +179,8 @@ SELECT @@local.div_precision_increment = @@session.div_precision_increment;
SET div_precision_increment = 1;
SELECT @@div_precision_increment;
---Error ER_PARSE_ERROR
-SET local.div_precision_increment = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.div_precision_increment;
---Error ER_PARSE_ERROR
-SET session.div_precision_increment = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.div_precision_increment;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/event_scheduler_basic.test b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
index 2e6aa3cba5c..acd7d4bd8a8 100644
--- a/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
+++ b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
@@ -147,12 +147,8 @@ SELECT @@event_scheduler = @@global.event_scheduler;
#######################################################################
--Error ER_GLOBAL_VARIABLE
SET event_scheduler = ON;
---Error ER_PARSE_ERROR
-SET local.event_scheduler = OFF;
--Error ER_UNKNOWN_TABLE
SELECT local.event_scheduler;
---Error ER_PARSE_ERROR
-SET global.event_scheduler = ON;
--Error ER_UNKNOWN_TABLE
SELECT global.event_scheduler;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
index 3f4504907b5..f95c7c55f6e 100644
--- a/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
+++ b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
@@ -152,12 +152,8 @@ SELECT @@expire_logs_days = @@global.expire_logs_days;
--Error ER_GLOBAL_VARIABLE
SET expire_logs_days = 1;
SELECT @@expire_logs_days;
---Error ER_PARSE_ERROR
-SET local.expire_logs_days = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.expire_logs_days;
---Error ER_PARSE_ERROR
-SET global.expire_logs_days = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.expire_logs_days;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/flush_basic.test b/mysql-test/suite/sys_vars/t/flush_basic.test
index 4eb821e9af1..842d0caa581 100644
--- a/mysql-test/suite/sys_vars/t/flush_basic.test
+++ b/mysql-test/suite/sys_vars/t/flush_basic.test
@@ -149,8 +149,6 @@ SELECT @@flush = @@global.flush;
--Error ER_GLOBAL_VARIABLE
SET flush = 1;
---Error ER_PARSE_ERROR
-SET global.flush = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.flush;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
index 454b5d7477e..1d925a5e8c1 100644
--- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
@@ -64,7 +64,7 @@ SELECT @@global.ft_boolean_syntax;
--echo '#--------------------FN_DYNVARS_033_03-------------------------#'
######################################################################
-# see if it is accessable using session scope #
+# see if it is accessible using session scope #
######################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.ft_boolean_syntax = '# -><()!*:""&|';
diff --git a/mysql-test/suite/sys_vars/t/general_log_basic.test b/mysql-test/suite/sys_vars/t/general_log_basic.test
index 6a1d00f1b6f..b41185e2049 100644
--- a/mysql-test/suite/sys_vars/t/general_log_basic.test
+++ b/mysql-test/suite/sys_vars/t/general_log_basic.test
@@ -143,12 +143,8 @@ SELECT @@general_log = @@global.general_log;
#######################################################################
--Error ER_GLOBAL_VARIABLE
SET general_log = ON;
---Error ER_PARSE_ERROR
-SET local.general_log = OFF;
--Error ER_UNKNOWN_TABLE
SELECT local.general_log;
---Error ER_PARSE_ERROR
-SET global.general_log = ON;
--Error ER_UNKNOWN_TABLE
SELECT global.general_log;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/identity_basic.test b/mysql-test/suite/sys_vars/t/identity_basic.test
index 2ddec32a621..f88d2651046 100644
--- a/mysql-test/suite/sys_vars/t/identity_basic.test
+++ b/mysql-test/suite/sys_vars/t/identity_basic.test
@@ -163,12 +163,8 @@ SELECT @@session.identity = @@local.identity;
SET identity = 1;
SELECT @@identity;
---Error ER_PARSE_ERROR
-SET local.identity = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.identity;
---Error ER_PARSE_ERROR
-SET session.identity = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.identity;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/init_connect_basic.test b/mysql-test/suite/sys_vars/t/init_connect_basic.test
index b2f2cb92e40..6aba83d3675 100644
--- a/mysql-test/suite/sys_vars/t/init_connect_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_connect_basic.test
@@ -66,7 +66,7 @@ SELECT @@global.init_connect;
--echo '#--------------------FN_DYNVARS_036_03-------------------------#'
######################################################################
-# see if it is accessable using session scope #
+# see if it is accessible using session scope #
######################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.init_connect = '';
diff --git a/mysql-test/suite/sys_vars/t/init_slave_basic.test b/mysql-test/suite/sys_vars/t/init_slave_basic.test
index b137a525090..4dd7fd80d82 100644
--- a/mysql-test/suite/sys_vars/t/init_slave_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_slave_basic.test
@@ -66,7 +66,7 @@ SELECT @@global.init_slave;
--echo '#--------------------FN_DYNVARS_037_03-------------------------#'
######################################################################
-# see if it is accessable using session scope #
+# see if it is accessible using session scope #
######################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.init_slave = '';
diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_method_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_method_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_partitions_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_blocking_buffer_pool_restore_basic.test b/mysql-test/suite/sys_vars/t/innodb_blocking_buffer_pool_restore_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_blocking_buffer_pool_restore_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.opt b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.opt
new file mode 100644
index 00000000000..787f6ce532d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.opt
@@ -0,0 +1,5 @@
+--loose-default-storage-engine=innodb
+--loose-innodb_buffer_pool_load_at_startup=0
+--loose-innodb_buffer_pool_dump_at_shutdown=0
+--loose-innodb-buffer-pool-size=8M
+--loose-innodb-page-size=16k
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.test
new file mode 100644
index 00000000000..4a4411101e2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_abort_loads.test
@@ -0,0 +1,149 @@
+#
+# MDEV-11455 - add status variable innodb_buffer_pool_load_abort
+#
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+--echo
+--echo # innodb_buffer_pool_load_incomplete defaults 0
+SELECT variable_name, variable_value
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_incomplete';
+
+--echo
+--echo # populate with data
+
+CREATE TABLE t1 (
+c01 blob, c02 blob, c03 blob, c04 blob, c05 blob,
+c06 blob, c07 blob, c08 blob, c09 blob, c10 blob,
+c11 blob, c12 blob, c13 blob, c14 blob, c15 blob,
+c16 blob, c17 blob, c18 blob, c19 blob, c20 blob,
+c21 blob, c22 blob, c23 blob, c24 blob, c25 blob,
+c26 blob, c27 blob, c28 blob, c29 blob, c30 blob,
+c31 blob, c32 blob, c33 blob, c34 blob, c35 blob,
+c36 blob, c37 blob, c38 blob, c39 blob, c40 blob,
+c41 blob, c42 blob, c43 blob, c44 blob, c45 blob,
+c46 blob, c47 blob, c48 blob, c49 blob, c50 blob,
+c51 blob, c52 blob, c53 blob, c54 blob, c55 blob,
+c56 blob, c57 blob, c58 blob, c59 blob, c60 blob,
+c61 blob, c62 blob, c63 blob, c64 blob
+) ROW_FORMAT=dynamic;
+
+SET @a = repeat('a', 16 * 1024);
+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
+);
+
+SET GLOBAL innodb_buffer_pool_dump_now=1;
+# Wait for for the dump to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
+-- source include/wait_condition.inc
+
+--echo
+--echo # Restart server
+--source include/restart_mysqld.inc
+
+--echo
+--echo # Abort after 16 pages
+SET GLOBAL innodb_buffer_pool_load_pages_abort=16,
+ GLOBAL innodb_buffer_pool_load_now=1,
+ GLOBAL innodb_buffer_pool_dump_at_shutdown=1;
+
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 19) = 'Buffer pool(s) load'
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
+-- source include/wait_condition.inc
+
+SELECT variable_name, SUBSTR(variable_value, 1, 38) as VALUE
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) IN ('innodb_buffer_pool_load_incomplete','innodb_buffer_pool_load_status')
+ ORDER BY variable_name;
+
+--let $incomplete=`select count(*) as BLOB_PAGES from information_schema.INNODB_BUFFER_PAGE WHERE PAGE_TYPE='BLOB' group by PAGE_TYPE`
+
+# Shouldn't dump at shutdown due to innodb_buffer_pool_load_incomplete
+
+--echo
+--echo # Restart server
+--source include/restart_mysqld.inc
+
+--echo
+--echo # Load buffer pool
+SET GLOBAL innodb_buffer_pool_load_now=1;
+
+# Wait for for the load to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
+-- source include/wait_condition.inc
+
+--echo
+--echo # Should be more than previous as we didn't overwrite our save file
+--replace_result $incomplete Previous_loaded
+--eval select count(*) > $incomplete as Loaded_more from information_schema.INNODB_BUFFER_PAGE WHERE PAGE_TYPE='BLOB' group by PAGE_TYPE;
+
+--echo
+--echo # Successful, so innodb_buffer_pool_load_incomplete should be FALSE
+SELECT variable_name, SUBSTR(variable_value, 1, 33) as VALUE
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) IN ('innodb_buffer_pool_load_incomplete','innodb_buffer_pool_load_status')
+ ORDER BY variable_name;
+
+--echo
+--echo # innodb_buffer_pool_dump_now=1 should reset the innodb_buffer_pool_load_incomplete status
+
+SET GLOBAL innodb_buffer_pool_dump_now=1;
+# Wait for for the dump to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
+-- source include/wait_condition.inc
+
+SELECT variable_name, SUBSTR(variable_value, 1, 33) as VALUE
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) IN ('innodb_buffer_pool_load_incomplete', 'innodb_buffer_pool_dump_status');
+
+--let $fulldump=`select count(*) as BLOB_PAGES from information_schema.INNODB_BUFFER_PAGE WHERE PAGE_TYPE='BLOB' group by PAGE_TYPE`
+
+--echo
+--echo # Restart server
+--source include/restart_mysqld.inc
+
+--echo
+--echo # Load buffer pool
+SET GLOBAL innodb_buffer_pool_load_now=1;
+
+# Wait for for the load to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
+-- source include/wait_condition.inc
+
+--echo
+--echo # Should be same amount
+--replace_result $fulldump Previously_dumped
+--eval select abs($fulldump - count(*)) <= 2 as Loaded_about_same_size from information_schema.INNODB_BUFFER_PAGE WHERE PAGE_TYPE='BLOB' group by PAGE_TYPE;
+
+--echo
+--echo # Clean up
+
+--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/ib_buffer_pool
+DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_restore_at_startup_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_restore_at_startup_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_restore_at_startup_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_checksum_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_checksum_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_checksum_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_key_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_key_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_shm_key_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
index aba3b1e3479..19f0890feff 100644
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
@@ -48,9 +48,9 @@ set @@session.innodb_change_buffering='some';
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffering=1.1;
---error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffering=1;
---error ER_WRONG_TYPE_FOR_VAR
+SELECT @@global.innodb_change_buffering;
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_change_buffering=-2;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffering=1e1;
diff --git a/mysql-test/suite/sys_vars/t/innodb_checkpoint_age_target_basic.test b/mysql-test/suite/sys_vars/t/innodb_checkpoint_age_target_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_checkpoint_age_target_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_corrupt_table_action_basic.test b/mysql-test/suite/sys_vars/t/innodb_corrupt_table_action_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_corrupt_table_action_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_dict_size_limit_basic.test b/mysql-test/suite/sys_vars/t/innodb_dict_size_limit_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_dict_size_limit_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_doublewrite_file_basic.test b/mysql-test/suite/sys_vars/t/innodb_doublewrite_file_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_doublewrite_file_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_fake_changes_basic.test b/mysql-test/suite/sys_vars/t/innodb_fake_changes_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_fake_changes_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_fast_checksum_basic.test b/mysql-test/suite/sys_vars/t/innodb_fast_checksum_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_fast_checksum_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
index 9fe9f490aa4..21d47588796 100644
--- a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
@@ -5,7 +5,7 @@
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 1 #
-# Valid Values: 0,1,2 #
+# Valid Values: 0,1,2,3 #
# #
# #
# Creation Date: 2008-02-20 #
@@ -81,6 +81,8 @@ SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = 2;
SELECT @@global.innodb_fast_shutdown;
+SET @@global.innodb_fast_shutdown = 3;
+SELECT @@global.innodb_fast_shutdown;
--echo '#--------------------FN_DYNVARS_042_04-------------------------#'
###########################################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test
deleted file mode 100644
index 739260c07e5..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-# 2010-01-25 - Added
-#
-
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_file_format;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are 'Antelope' and 'Barracuda'
-select @@global.innodb_file_format in ('Antelope', 'Barracuda');
-select @@global.innodb_file_format;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_file_format;
-show global variables like 'innodb_file_format';
-show session variables like 'innodb_file_format';
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_file_format';
-select * from information_schema.session_variables where variable_name='innodb_file_format';
---enable_warnings
-
-#
-# show that it's writable
-#
-set global innodb_file_format='Antelope';
-select @@global.innodb_file_format;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_file_format';
-select * from information_schema.session_variables where variable_name='innodb_file_format';
---enable_warnings
-set @@global.innodb_file_format='Barracuda';
-select @@global.innodb_file_format;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_file_format';
-select * from information_schema.session_variables where variable_name='innodb_file_format';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-set session innodb_file_format='Salmon';
---error ER_GLOBAL_VARIABLE
-set @@session.innodb_file_format='Salmon';
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_file_format=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_file_format=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format='Salmon';
-
-#
-# Cleanup
-#
-
-SET @@global.innodb_file_format = @start_global_value;
-SELECT @@global.innodb_file_format;
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
deleted file mode 100644
index 56afba48e29..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
+++ /dev/null
@@ -1,101 +0,0 @@
-#
-# 2011-08-02 - Added
-#
-
---source include/not_embedded.inc
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_file_format_check;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are 'ON' and 'OFF'
-SELECT @@global.innodb_file_format_check in (0, 1);
-SELECT @@global.innodb_file_format_check;
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.innodb_file_format_check;
-SHOW global variables LIKE 'innodb_file_format_check';
-SHOW session variables LIKE 'innodb_file_format_check';
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_check';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_check';
---enable_warnings
-
-#
-# show that it's read only
-#
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@global.innodb_file_format_check='Off';
---echo Expected error 'Read only variable'
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@global.innodb_file_format_check=1;
---echo Expected error 'Read only variable'
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@global.innodb_file_format_check=0;
---echo Expected error 'Read only variable'
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@global.innodb_file_format_check='On';
---echo Expected error 'Read only variable'
-
---error ER_GLOBAL_VARIABLE
-SET session innodb_large_prefix='OFF';
---error ER_GLOBAL_VARIABLE
-SET @@session.innodb_stats_on_metadata='ON';
-
-#
-# Check if the value in GLOBAL Table matches value in variable
-#
-
---disable_warnings
-SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_file_format_check';
---enable_warnings
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.innodb_file_format_check);
---echo 1 Expected
-
---disable_warnings
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_file_format_check';
---enable_warnings
---echo 1 Expected
-
-#
-# Check if accessing variable with and without GLOBAL point to same variable
-#
-SELECT @@innodb_file_format_check = @@GLOBAL.innodb_file_format_check;
---echo 1 Expected
-
-#
-# Check if innodb_doublewrite can be accessed with and without @@ sign
-#
-
-SELECT COUNT(@@innodb_file_format_check);
---echo 1 Expected
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.innodb_file_format_check);
---echo Expected error 'Variable is a GLOBAL variable'
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.innodb_file_format_check);
---echo Expected error 'Variable is a GLOBAL variable'
-
-SELECT COUNT(@@GLOBAL.innodb_file_format_check);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_file_format_check = @@SESSION.innodb_file_format_check;
---echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
deleted file mode 100644
index 494f3817cb8..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# 2011-08-02 - Added
-#
---source include/not_embedded.inc
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_file_format_max;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are 'Antelope' and 'Barracuda'
-SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
-SELECT @@global.innodb_file_format_max;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.innodb_file_format_max;
-SHOW global variables LIKE 'innodb_file_format_max';
-SHOW session variables LIKE 'innodb_file_format_max';
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_max';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_max';
---enable_warnings
-
-#
-# show that it's writable
-#
-SET global innodb_file_format_max='Antelope';
-SELECT @@global.innodb_file_format_max;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_max';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_max';
---enable_warnings
-SET @@global.innodb_file_format_max='Barracuda';
-SELECT @@global.innodb_file_format_max;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_file_format_max';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_file_format_max';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-SET session innodb_file_format_max='Salmon';
---error ER_GLOBAL_VARIABLE
-SET @@session.innodb_file_format_max='Salmon';
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_file_format_max=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_file_format_max=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-SET global innodb_file_format_max='Salmon';
-
-#
-# Cleanup
-#
-
-SET @@global.innodb_file_format_max = @start_global_value;
-SELECT @@global.innodb_file_format_max;
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_checkpoint_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_checkpoint_debug_basic.test
deleted file mode 100644
index 093a765e0e5..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_flush_checkpoint_debug_basic.test
+++ /dev/null
@@ -1,12 +0,0 @@
---source include/have_debug.inc
---source include/have_xtradb.inc
-
-SELECT @@global.innodb_flush_checkpoint_debug;
-SET @@global.innodb_flush_checkpoint_debug=1;
-SELECT @@global.innodb_flush_checkpoint_debug;
-SET @@global.innodb_flush_checkpoint_debug=0;
-SELECT @@global.innodb_flush_checkpoint_debug;
---error ER_GLOBAL_VARIABLE
-SET @@session.innodb_flush_checkpoint_debug=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.innodb_flush_checkpoint_debug;
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
index 9f99c1305fd..76a9ed9cefd 100644
--- a/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
@@ -29,7 +29,7 @@
# Displaying default value #
####################################################################
SELECT COUNT(@@GLOBAL.innodb_flush_method);
---echo 0 Expected
+--echo 1 Expected
--echo '#---------------------BS_STVARS_029_02----------------------#'
@@ -42,7 +42,7 @@ SET @@GLOBAL.innodb_flush_method=1;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
---echo 0 Expected
+--echo 1 Expected
@@ -60,7 +60,7 @@ WHERE VARIABLE_NAME='innodb_flush_method';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.innodb_flush_method);
---echo 0 Expected
+--echo 1 Expected
--disable_warnings
SELECT COUNT(VARIABLE_VALUE)
@@ -86,7 +86,7 @@ SELECT @@innodb_flush_method = @@GLOBAL.innodb_flush_method;
################################################################################
SELECT COUNT(@@innodb_flush_method);
---echo 0 Expected
+--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_flush_method);
@@ -97,7 +97,7 @@ SELECT COUNT(@@SESSION.innodb_flush_method);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
---echo 0 Expected
+--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_flush_method = @@SESSION.innodb_flush_method;
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test b/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test
new file mode 100644
index 00000000000..aad91d0f4a3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test
@@ -0,0 +1,26 @@
+--source include/have_innodb.inc
+# Embedded server tests do not support restarting.
+--source include/not_embedded.inc
+
+call mtr.add_suppression("InnoDB: Failed to set .*DIRECT");
+--replace_result unbuffered fsync
+select @@innodb_flush_method;
+
+create table t(a serial) engine=innodb;
+
+# kill and restart
+FLUSH TABLES;
+let $shutdown_timeout= 0;
+let $restart_parameters=--innodb-flush-method=5;
+--source include/restart_mysqld.inc
+select @@innodb_flush_method;
+
+insert into t values(0);
+# kill and restart
+FLUSH TABLES;
+let $shutdown_timeout= 0;
+let $restart_parameters=--innodb-flush-method=0;
+--source include/restart_mysqld.inc
+select @@innodb_flush_method;
+
+drop table t;
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_neighbor_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_neighbor_pages_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_flush_neighbor_pages_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_ibuf_accel_rate_basic.test b/mysql-test/suite/sys_vars/t/innodb_ibuf_accel_rate_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_ibuf_accel_rate_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_ibuf_active_contract_basic.test b/mysql-test/suite/sys_vars/t/innodb_ibuf_active_contract_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_ibuf_active_contract_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_ibuf_max_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_ibuf_max_size_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_ibuf_max_size_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_import_table_from_xtrabackup_basic.test b/mysql-test/suite/sys_vars/t/innodb_import_table_from_xtrabackup_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_import_table_from_xtrabackup_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_instant_alter_column_allowed_basic.test b/mysql-test/suite/sys_vars/t/innodb_instant_alter_column_allowed_basic.test
new file mode 100644
index 00000000000..4ff84b42a3a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_instant_alter_column_allowed_basic.test
@@ -0,0 +1,32 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_instant_alter_column_allowed;
+SET GLOBAL innodb_instant_alter_column_allowed=never;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_instant_alter_column_allowed;
+show global variables like 'innodb_instant_alter_column_allowed';
+show session variables like 'innodb_instant_alter_column_allowed';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_instant_alter_column_allowed';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_instant_alter_column_allowed';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_instant_alter_column_allowed=no;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_instant_alter_column_allowed=1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_instant_alter_column_allowed=-1;
+select @@global.innodb_instant_alter_column_allowed;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_instant_alter_column_allowed=2;
+select @@global.innodb_instant_alter_column_allowed;
+set global innodb_instant_alter_column_allowed=1;
+select @@global.innodb_instant_alter_column_allowed;
+set global innodb_instant_alter_column_allowed=0;
+select @@global.innodb_instant_alter_column_allowed;
+set global innodb_instant_alter_column_allowed=default;
+select @@global.innodb_instant_alter_column_allowed;
+
+SET GLOBAL innodb_instant_alter_column_allowed = @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
deleted file mode 100644
index 9b302be79b5..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test
+++ /dev/null
@@ -1,42 +0,0 @@
---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_kill_idle_transaction_basic.test b/mysql-test/suite/sys_vars/t/innodb_kill_idle_transaction_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_kill_idle_transaction_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
deleted file mode 100644
index 877fe17b003..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-# 2010-01-25 - Added
-#
-
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_large_prefix;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are 'ON' and 'OFF'
-select @@global.innodb_large_prefix in (0, 1);
-select @@global.innodb_large_prefix;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_large_prefix;
-show global variables like 'innodb_large_prefix';
-show session variables like 'innodb_large_prefix';
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
---enable_warnings
-
-#
-# show that it's writable
-#
-set global innodb_large_prefix='OFF';
-select @@global.innodb_large_prefix;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
---enable_warnings
-set @@global.innodb_large_prefix=1;
-select @@global.innodb_large_prefix;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
---enable_warnings
-set global innodb_large_prefix=0;
-select @@global.innodb_large_prefix;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
---enable_warnings
-set @@global.innodb_large_prefix='ON';
-select @@global.innodb_large_prefix;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-set session innodb_large_prefix='OFF';
---error ER_GLOBAL_VARIABLE
-set @@session.innodb_large_prefix='ON';
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_large_prefix=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_large_prefix=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_large_prefix=2;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_large_prefix=-3;
-select @@global.innodb_large_prefix;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_large_prefix';
-select * from information_schema.session_variables where variable_name='innodb_large_prefix';
---enable_warnings
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_large_prefix='AUTO';
-
-#
-# Cleanup
-#
-
-SET @@global.innodb_large_prefix = @start_global_value;
-SELECT @@global.innodb_large_prefix;
diff --git a/mysql-test/suite/sys_vars/t/innodb_lazy_drop_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_lazy_drop_table_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_lazy_drop_table_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test b/mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_block_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_block_size_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_log_block_size_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_changed_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_changed_pages_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_max_changed_pages_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
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
deleted file mode 100644
index c8412f969eb..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_mtflush_threads_basic.test
+++ /dev/null
@@ -1,21 +0,0 @@
---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_page_cleaners_basic.test b/mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test
index 716492ba1b3..367116a7e36 100644
--- a/mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test
@@ -1,6 +1,6 @@
# Variable name: innodb_page_cleaners
# Scope: Global
-# Access type: Static
+# Access type: Dynamic
# Data type: numeric
--source include/have_innodb.inc
@@ -8,12 +8,38 @@
SELECT COUNT(@@GLOBAL.innodb_page_cleaners);
--echo 1 Expected
-SELECT COUNT(@@innodb_page_cleaners);
+SELECT @@innodb_page_cleaners;
--echo 1 Expected
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_page_cleaners=2;
+--echo Expected to pass
+
+SELECT @@innodb_page_cleaners;
+--echo 2 Expected
+
SET @@GLOBAL.innodb_page_cleaners=1;
---echo Expected error 'Read-only variable'
+--echo Expected to pass
+
+SELECT @@innodb_page_cleaners;
+--echo 1 Expected
+
+SET @@GLOBAL.innodb_page_cleaners=6;
+--echo Expected to pass
+
+SELECT @@innodb_page_cleaners;
+--echo 6 Expected
+
+SET @@GLOBAL.innodb_page_cleaners=4;
+--echo Expected to pass
+
+SELECT @@innodb_page_cleaners;
+--echo 4 Expected
+
+SET @@GLOBAL.innodb_page_cleaners=0;
+--echo Warning expected
+
+SELECT @@innodb_page_cleaners;
+--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_page_cleaners = @@SESSION.innodb_page_cleaners;
diff --git a/mysql-test/suite/sys_vars/t/innodb_print_lock_wait_timeout_info_basic.test b/mysql-test/suite/sys_vars/t/innodb_print_lock_wait_timeout_info_basic.test
deleted file mode 100644
index 23d8ba667ce..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_print_lock_wait_timeout_info_basic.test
+++ /dev/null
@@ -1,89 +0,0 @@
---source include/have_xtradb.inc
-
-SET @start_global_value = @@global.innodb_print_lock_wait_timeout_info;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are 'ON' and 'OFF'
-SELECT @@global.innodb_print_lock_wait_timeout_info in (0, 1);
-SELECT @@global.innodb_print_lock_wait_timeout_info;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.innodb_print_lock_wait_timeout_info;
-SHOW global variables LIKE 'innodb_print_lock_wait_timeout_info';
-SHOW session variables LIKE 'innodb_print_lock_wait_timeout_info';
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
---enable_warnings
-
-#
-# SHOW that it's writable
-#
-SET global innodb_print_lock_wait_timeout_info='OFF';
-SELECT @@global.innodb_print_lock_wait_timeout_info;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
---enable_warnings
-SET @@global.innodb_print_lock_wait_timeout_info=1;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
---enable_warnings
-SET global innodb_print_lock_wait_timeout_info=0;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
---enable_warnings
-SET @@global.innodb_print_lock_wait_timeout_info='ON';
-SELECT @@global.innodb_print_lock_wait_timeout_info;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-SET session innodb_print_lock_wait_timeout_info='OFF';
---error ER_GLOBAL_VARIABLE
-SET @@session.innodb_print_lock_wait_timeout_info='ON';
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_print_lock_wait_timeout_info=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_print_lock_wait_timeout_info=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-SET global innodb_print_lock_wait_timeout_info=2;
---error ER_WRONG_VALUE_FOR_VAR
-SET global innodb_print_lock_wait_timeout_info=-3;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_print_lock_wait_timeout_info';
---enable_warnings
---error ER_WRONG_VALUE_FOR_VAR
-SET global innodb_print_lock_wait_timeout_info='AUTO';
-
-#
-# Cleanup
-#
-
-SET @@global.innodb_print_lock_wait_timeout_info = @start_global_value;
-SELECT @@global.innodb_print_lock_wait_timeout_info;
diff --git a/mysql-test/suite/sys_vars/t/innodb_read_ahead_basic.test b/mysql-test/suite/sys_vars/t/innodb_read_ahead_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_read_ahead_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_recovery_stats_basic.test b/mysql-test/suite/sys_vars/t/innodb_recovery_stats_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_recovery_stats_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_recovery_update_relay_log_basic.test b/mysql-test/suite/sys_vars/t/innodb_recovery_update_relay_log_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_recovery_update_relay_log_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test
deleted file mode 100644
index 2c2037f167f..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test
+++ /dev/null
@@ -1,51 +0,0 @@
---source include/have_xtradb.inc
---source include/linux.inc
---source include/not_embedded.inc
-
-# A dynamic, global variable
-
-# Test in read-only mode
---let $restart_parameters= --innodb-read-only
---source include/restart_mysqld.inc
---let $restart_parameters=
-
-# This has no actual effect in innodb_read_only mode
-SET GLOBAL innodb_sched_priority_cleaner=39;
-
---source include/restart_mysqld.inc
-
-# Default value
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-
-# Global only
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@SESSION.innodb_sched_priority_cleaner;
-
-# Correct values
-# The high priority values may need permissions, thus do not test them
-# SET GLOBAL innodb_sched_priority_cleaner=39;
-# SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-#SET GLOBAL innodb_sched_priority_cleaner=34;
-# SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-SET GLOBAL innodb_sched_priority_cleaner=19;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-SET GLOBAL innodb_sched_priority_cleaner=5;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-SET GLOBAL innodb_sched_priority_cleaner=0;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-
-# Incorrect values
-SET GLOBAL innodb_sched_priority_cleaner=-1;
-SELECT @@GLOBAL.innodb_sched_priority_cleaner;
-#SET GLOBAL innodb_sched_priority_cleaner=40;
-#SELECT @@GLOBAL.innodb_sched_priority_cleaner;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_cleaner=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_cleaner=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_cleaner='foo';
-
-# If we are lacking permissions, then we cannot restore the startup value
-# at the end.
---source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test
deleted file mode 100644
index f77816e84c2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test
+++ /dev/null
@@ -1,44 +0,0 @@
---source include/have_debug.inc
---source include/have_xtradb.inc
---source include/linux.inc
---source include/not_embedded.inc
-
-# A dynamic, global variable
-
-SET @start_value = @@GLOBAL.innodb_sched_priority_io;
-
-# Default value
-SELECT @@GLOBAL.innodb_sched_priority_io;
-
-# Global only
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@SESSION.innodb_sched_priority_io;
-
-# Correct values
-# The high priority values may need permissions, thus do not test them
-# SET GLOBAL innodb_sched_priority_io=39;
-# SELECT @@GLOBAL.innodb_sched_priority_io;
-#SET GLOBAL innodb_sched_priority_io=34;
-# SELECT @@GLOBAL.innodb_sched_priorit_io;
-SET GLOBAL innodb_sched_priority_io=19;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-SET GLOBAL innodb_sched_priority_io=5;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-SET GLOBAL innodb_sched_priority_io=0;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-
-# Incorrect values
-SET GLOBAL innodb_sched_priority_io=-1;
-SELECT @@GLOBAL.innodb_sched_priority_io;
-#SET GLOBAL innodb_sched_priority_io=40;
-#SELECT @@GLOBAL.innodb_sched_priority_io;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_io=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_io=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_io='foo';
-
-# If we are lacking permissions, then we cannot restore the startup value
-# at the end.
---source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test
deleted file mode 100644
index 150e7e5793d..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test
+++ /dev/null
@@ -1,44 +0,0 @@
---source include/have_debug.inc
---source include/have_xtradb.inc
---source include/linux.inc
---source include/not_embedded.inc
-
-# A dynamic, global variable
-
-SET @start_value = @@GLOBAL.innodb_sched_priority_master;
-
-# Default value
-SELECT @@GLOBAL.innodb_sched_priority_master;
-
-# Global only
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@SESSION.innodb_sched_priority_master;
-
-# Correct values
-# The high priority values may need permissions, thus do not test them
-# SET GLOBAL innodb_sched_priority_master=39;
-# SELECT @@GLOBAL.innodb_sched_priority_master;
-#SET GLOBAL innodb_sched_priority_master=34;
-# SELECT @@GLOBAL.innodb_sched_priority_master;
-SET GLOBAL innodb_sched_priority_master=19;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-SET GLOBAL innodb_sched_priority_master=5;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-SET GLOBAL innodb_sched_priority_master=0;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-
-# Incorrect values
-SET GLOBAL innodb_sched_priority_master=-1;
-SELECT @@GLOBAL.innodb_sched_priority_master;
-#SET GLOBAL innodb_sched_priority_master=40;
-#SELECT @@GLOBAL.innodb_sched_priority_master;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_master=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_master=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_master='foo';
-
-# If we are lacking permissions, then we cannot restore the startup value
-# at the end.
---source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test
deleted file mode 100644
index bc37e4ee568..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test
+++ /dev/null
@@ -1,44 +0,0 @@
---source include/have_debug.inc
---source include/have_xtradb.inc
---source include/linux.inc
---source include/not_embedded.inc
-
-# A dynamic, global variable
-
-SET @start_value = @@GLOBAL.innodb_sched_priority_purge;
-
-# Default value
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-
-# Global only
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@SESSION.innodb_sched_priority_purge;
-
-# Correct values
-# The high priority values may need permissions, thus do not test them
-# SET GLOBAL innodb_sched_priority_purge=39;
-# SELECT @@GLOBAL.innodb_sched_priority_purge;
-#SET GLOBAL innodb_sched_priority_purge=34;
-# SELECT @@GLOBAL.innodb_sched_priority_purge;
-SET GLOBAL innodb_sched_priority_purge=19;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-SET GLOBAL innodb_sched_priority_purge=5;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-SET GLOBAL innodb_sched_priority_purge=0;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-
-# Incorrect values
-SET GLOBAL innodb_sched_priority_purge=-1;
-SELECT @@GLOBAL.innodb_sched_priority_purge;
-#SET GLOBAL innodb_sched_priority_purge=40;
-#SELECT @@GLOBAL.innodb_sched_priority_purge;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_purge=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_purge=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-SET GLOBAL innodb_sched_priority_purge='foo';
-
-# If we are lacking permissions, then we cannot restore the startup value
-# at the end.
---source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_show_locks_held_basic.test b/mysql-test/suite/sys_vars/t/innodb_show_locks_held_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_show_locks_held_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_show_verbose_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_show_verbose_locks_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_show_verbose_locks_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_auto_update_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_auto_update_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_stats_auto_update_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test
index a3a9b99a133..2a3a0f9b44e 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test
@@ -18,11 +18,6 @@
--source include/have_innodb.inc
-if (`select plugin_auth_version <= "5.7.17" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not present before MySQL 5.7.17 or 5.6.35
-}
-
####################################################################
# Display default value #
####################################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_update_need_lock_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_update_need_lock_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_stats_update_need_lock_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
deleted file mode 100644
index 30f3b0ef46b..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
+++ /dev/null
@@ -1,240 +0,0 @@
-################# mysql-test\t\innodb_support_xa_basic.test ###################
-# #
-# Variable Name: innodb_support_xa #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: 1 #
-# Range: 0,1 #
-# #
-# #
-# Creation Date: 2008-02-20 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable innodb_support_xa #
-# 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/have_innodb.inc
---source include/load_sysvars.inc
-
-########################################################################
-# START OF innodb_support_xa TESTS #
-########################################################################
-
-
-################################################################################
-# Saving initial value of innodb_support_xa in a temporary variable #
-################################################################################
-
-
-SET @session_start_value = @@session.innodb_support_xa;
-SELECT @session_start_value;
-
-
-SET @global_start_value = @@global.innodb_support_xa;
-SELECT @global_start_value;
-
-
-
---echo '#--------------------FN_DYNVARS_046_01------------------------#'
-########################################################################
-# Display the DEFAULT value of innodb_support_xa #
-########################################################################
-
-SET @@session.innodb_support_xa = 0;
-SET @@session.innodb_support_xa = DEFAULT;
-SELECT @@session.innodb_support_xa;
-
-SET @@global.innodb_support_xa = 0;
-SET @@global.innodb_support_xa = DEFAULT;
-SELECT @@global.innodb_support_xa;
-
---echo '#---------------------FN_DYNVARS_046_02-------------------------#'
-##########################################################################
-# Check if innodb_support_xa can be accessed with and without @@ sign #
-##########################################################################
-
-SET innodb_support_xa = 1;
-SELECT @@innodb_support_xa;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.innodb_support_xa;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.innodb_support_xa;
-
---Error ER_UNKNOWN_TABLE
-SELECT global.innodb_support_xa;
-#using another syntax for accessing system variables
-SET session innodb_support_xa = 0;
-SELECT @@session.innodb_support_xa;
-
-SET global innodb_support_xa = 0;
-SELECT @@global.innodb_support_xa;
-
-
---echo '#--------------------FN_DYNVARS_046_03------------------------#'
-##########################################################################
-# change the value of innodb_support_xa to a valid value #
-##########################################################################
-# for session
-SET @@session.innodb_support_xa = 0;
-SELECT @@session.innodb_support_xa;
-SET @@session.innodb_support_xa = 1;
-SELECT @@session.innodb_support_xa;
-
-# for global
-SET @@global.innodb_support_xa = 0;
-SELECT @@global.innodb_support_xa;
-SET @@global.innodb_support_xa = 1;
-SELECT @@global.innodb_support_xa;
-
-
---echo '#--------------------FN_DYNVARS_046_04-------------------------#'
-###########################################################################
-# Change the value of innodb_support_xa to invalid value #
-###########################################################################
-
-# for session
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.innodb_support_xa = -0.6;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.innodb_support_xa = 1.6;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.innodb_support_xa = "T";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.innodb_support_xa = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.innodb_support_xa = TRÜE;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.innodb_support_xa = ÕN;
-
-SET @@session.innodb_support_xa = OF;
-SELECT @@session.innodb_support_xa;
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.innodb_support_xa = ÓFF;
-
-# for global
-
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = -1;
-SELECT @@global.innodb_support_xa;
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = 2;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = "T";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = TRÜE;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = ÕN;
-
-SET @@global.innodb_support_xa = OF;
-SELECT @@global.innodb_support_xa;
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_support_xa = ÓFF;
-
-
---echo '#-------------------FN_DYNVARS_046_05----------------------------#'
-###########################################################################
-# Test if changing global variable effects session and vice versa #
-###########################################################################
-
-SET @@global.innodb_support_xa = 0;
-SET @@session.innodb_support_xa = 1;
-SELECT @@global.innodb_support_xa AS res_is_0;
-
-SET @@global.innodb_support_xa = 0;
-SELECT @@session.innodb_support_xa AS res_is_1;
-
---echo '#----------------------FN_DYNVARS_046_06------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#########################################################################
-
---disable_warnings
-SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_support_xa';
---enable_warnings
-SELECT @@global.innodb_support_xa;
---disable_warnings
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_support_xa';
---enable_warnings
-
-
---echo '#----------------------FN_DYNVARS_046_07------------------------#'
-#########################################################################
-# Check if the value in SESSION Table matches value in variable #
-#########################################################################
-
---disable_warnings
-SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
- WHERE VARIABLE_NAME='innodb_support_xa';
---enable_warnings
-SELECT @@session.innodb_support_xa;
---disable_warnings
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
- WHERE VARIABLE_NAME='innodb_support_xa';
---enable_warnings
-
-
---echo '#---------------------FN_DYNVARS_046_08-------------------------#'
-###################################################################
-# Check if ON and OFF values can be used on variable #
-###################################################################
-
-SET @@session.innodb_support_xa = OFF;
-SELECT @@session.innodb_support_xa;
-SET @@session.innodb_support_xa = ON;
-SELECT @@session.innodb_support_xa;
-
-SET @@global.innodb_support_xa = OFF;
-SELECT @@global.innodb_support_xa;
-SET @@global.innodb_support_xa = ON;
-SELECT @@global.innodb_support_xa;
-
---echo '#---------------------FN_DYNVARS_046_09----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-SET @@session.innodb_support_xa = TRUE;
-SELECT @@session.innodb_support_xa;
-SET @@session.innodb_support_xa = FALSE;
-SELECT @@session.innodb_support_xa;
-
-SET @@global.innodb_support_xa = TRUE;
-SELECT @@global.innodb_support_xa;
-SET @@global.innodb_support_xa = FALSE;
-SELECT @@global.innodb_support_xa;
-
-##############################
-# Restore initial value #
-##############################
-
-SET @@session.innodb_support_xa = @session_start_value;
-SELECT @@session.innodb_support_xa;
-
-SET @@global.innodb_support_xa = @global_start_value;
-SELECT @@global.innodb_support_xa;
-
-###############################################################
-# END OF innodb_support_xa TESTS #
-###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
deleted file mode 100644
index a6875ec780d..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
+++ /dev/null
@@ -1,135 +0,0 @@
-################# mysql-test\t\innodb_support_xa_func.test ###################
-# #
-# Variable Name: innodb_support_xa #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: 1 #
-# Range: 0,1 #
-# #
-# #
-# Creation Date: 2008-03-08 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable innodb_support_xa #
-# that checks the behavior of this variable in the following ways#
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
-
---source include/have_innodb.inc
---source include/count_sessions.inc
---echo '#--------------------FN_DYNVARS_046_01-------------------------#'
-####################################################################
-# Check if setting innodb_support_xa is changed in new connection #
-####################################################################
-
-SET @@global.innodb_support_xa = OFF;
-connect (con1,localhost,root,,,,);
-connection con1;
-SELECT @@global.innodb_support_xa;
-SELECT @@session.innodb_support_xa;
-disconnect con1;
-
-
---echo '#--------------------FN_DYNVARS_046_01-------------------------#'
-###########################################################
-# Begin the functionality Testing of innodb_support_xa #
-###########################################################
-
-connection default;
-SET @@global.innodb_support_xa = 1;
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-create table t1 (a int) engine=innodb;
-
-#====================================================
---echo '---check when innodb_support_xa is 1---'
-#====================================================
-
-
-SET @@innodb_support_xa = 1;
-
-xa start 'test1';
-INSERT t1 values (10);
-xa end 'test1';
-xa prepare 'test1';
-xa rollback 'test1';
-SELECT * from t1;
-
-#====================================================
---echo '---check when innodb_support_xa is 0---'
-#====================================================
-
-SET @@innodb_support_xa = 0;
-#
-xa start 'test1';
-INSERT t1 values (10);
-xa end 'test1';
-xa prepare 'test1';
-xa rollback 'test1';
-SELECT * from t1;
-
-#====================================================
---echo '------general xa testing--------'
-#====================================================
-
-SET @@global.innodb_support_xa = 1;
-SET @@innodb_support_xa = 1;
-
-xa start 'testa','testb';
-INSERT t1 values (30);
---Error ER_XAER_RMFAIL
-COMMIT;
-xa end 'testa','testb';
---Error ER_XAER_RMFAIL
-BEGIN;
---Error ER_XAER_RMFAIL
-CREATE table t2 (a int);
-CONNECT (con1,localhost,root,,,,);
-connection con1;
-
---Error ER_XAER_DUPID
-xa start 'testa','testb';
---Error ER_XAER_DUPID
-xa start 'testa','testb', 123;
-
-# gtrid [ , bqual [ , formatID ] ]
-xa start 0x7465737462, 0x2030405060, 0xb;
-INSERT t1 values (40);
-xa end 'testb',' 0@P`',11;
-xa prepare 'testb',0x2030405060,11;
-
---Error ER_XAER_RMFAIL
-START TRANSACTION;
-xa recover;
-
-# uncomment the line below when binlog will be able to prepare
-#disconnect con1;
-
-CONNECTION default;
-xa prepare 'testa','testb';
-xa recover;
---Error ER_XAER_NOTA
-xa commit 'testb',0x2030405060,11;
-xa commit 'testa','testb';
-
-CONNECTION con1;
-xa rollback 'testb',0x2030405060,11;
-
-SELECT * from t1;
-
-disconnect con1;
-connection default;
-DROP table t1;
---source include/wait_until_count_sessions.inc
-
-########################################################
-# End of functionality Testing for innodb_support_xa #
-########################################################
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_timer_based_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_timer_based_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_timer_based_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test b/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
index 3c547152e27..2f9da412a06 100644
--- a/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
@@ -1,10 +1,5 @@
--source include/have_innodb.inc
-if (`select plugin_auth_version <= "5.6.28-MariaDB-76.1" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.6.28-MariaDB-76.1 or earlier
-}
-
SET @start_global_value = @@global.innodb_tmpdir;
SELECT @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_track_changed_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_track_changed_pages_basic.test
deleted file mode 100644
index daf15922498..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_track_changed_pages_basic.test
+++ /dev/null
@@ -1,18 +0,0 @@
-# Tests for innodb_track_changed_pages variable
-
---source include/have_xtradb.inc
-
-SELECT COUNT(@@GLOBAL.innodb_track_changed_pages);
-
-SELECT @@GLOBAL.innodb_track_changed_pages = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_track_changed_pages';
-
-SELECT @@innodb_track_changed_pages = @@GLOBAL.innodb_track_changed_pages;
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.innodb_track_changed_pages);
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@LOCAL.innodb_track_changed_pages);
---error ER_BAD_FIELD_ERROR
-SELECT innodb_track_changed_pages = @@SESSION.innodb_track_changed_pages;
diff --git a/mysql-test/suite/sys_vars/t/innodb_track_redo_log_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_track_redo_log_now_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_track_redo_log_now_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_global_flush_log_at_trx_commit_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_global_flush_log_at_trx_commit_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_global_flush_log_at_trx_commit_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
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
deleted file mode 100644
index a9c40b9e522..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_mtflush_basic.test
+++ /dev/null
@@ -1,22 +0,0 @@
---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_stacktrace_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_stacktrace_basic.test
deleted file mode 100644
index b7da1dae3d4..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_stacktrace_basic.test
+++ /dev/null
@@ -1,56 +0,0 @@
---source include/have_xtradb.inc
-
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
---echo 1 Expected
-
-####################################################################
-# Check if Value can set #
-####################################################################
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_use_stacktrace=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
---echo 1 Expected
-
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#################################################################
-
-SELECT IF(@@GLOBAL.innodb_use_stacktrace, 'ON', 'OFF') = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_use_stacktrace';
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
---echo 1 Expected
-
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_use_stacktrace';
---echo 1 Expected
-
-################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-################################################################################
-SELECT @@innodb_use_stacktrace = @@GLOBAL.innodb_use_stacktrace;
---echo 1 Expected
-
-SELECT COUNT(@@innodb_use_stacktrace);
---echo 1 Expected
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.innodb_use_stacktrace);
---echo Expected error 'Variable is a GLOBAL variable'
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.innodb_use_stacktrace);
---echo Expected error 'Variable is a GLOBAL variable'
-
-SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_use_stacktrace = @@SESSION.innodb_use_stacktrace;
---echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_sys_stats_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_sys_stats_table_basic.test
deleted file mode 100644
index 00aa476e8d2..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_sys_stats_table_basic.test
+++ /dev/null
@@ -1 +0,0 @@
---echo XtraDB extension
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
deleted file mode 100644
index c1b0f142179..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test
+++ /dev/null
@@ -1,36 +0,0 @@
---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/insert_id_basic.test b/mysql-test/suite/sys_vars/t/insert_id_basic.test
index c9d3e1f4e52..36272e99617 100644
--- a/mysql-test/suite/sys_vars/t/insert_id_basic.test
+++ b/mysql-test/suite/sys_vars/t/insert_id_basic.test
@@ -164,12 +164,8 @@ SELECT @@session.insert_id = @@local.insert_id;
SET insert_id = 1;
SELECT @@insert_id;
---Error ER_PARSE_ERROR
-SET local.insert_id = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.insert_id;
---Error ER_PARSE_ERROR
-SET session.insert_id = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.insert_id;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test
index 354c65490a4..a737b30ac97 100644
--- a/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test
@@ -128,12 +128,8 @@ SELECT @@key_buffer_size = @@global.key_buffer_size;
--Error ER_GLOBAL_VARIABLE
SET key_buffer_size = 8 ;
---Error ER_PARSE_ERROR
-SET local.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_buffer_size;
---Error ER_PARSE_ERROR
-SET global.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_buffer_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic.test b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic.test
index e0970016577..0d47dc3f613 100644
--- a/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic.test
+++ b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic.test
@@ -148,12 +148,8 @@ SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
--Error ER_GLOBAL_VARIABLE
SET key_cache_age_threshold = 8000;
SELECT @@key_cache_age_threshold;
---Error ER_PARSE_ERROR
-SET local.key_cache_age_threshold = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_age_threshold;
---Error ER_PARSE_ERROR
-SET global.key_cache_age_threshold = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_age_threshold;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test
index 99a3c5dc327..6e84b121dbd 100644
--- a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test
@@ -152,12 +152,8 @@ SELECT @@key_cache_block_size = @@global.key_cache_block_size;
--Error ER_GLOBAL_VARIABLE
SET key_cache_block_size = 8000;
SELECT @@key_cache_block_size;
---Error ER_PARSE_ERROR
-SET local.key_cache_block_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_block_size;
---Error ER_PARSE_ERROR
-SET global.key_cache_block_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_block_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test
index dd41e4d37a0..a1770d62e57 100644
--- a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test
@@ -153,12 +153,8 @@ SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
--Error ER_GLOBAL_VARIABLE
SET key_cache_division_limit = 80;
SELECT @@key_cache_division_limit;
---Error ER_PARSE_ERROR
-SET local.key_cache_division_limit = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_division_limit;
---Error ER_PARSE_ERROR
-SET global.key_cache_division_limit = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_division_limit;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test b/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test
index deebe708d3d..b8caa5bbf70 100644
--- a/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test
@@ -143,12 +143,8 @@ SELECT @@key_cache_file_hash_size = @@global.key_cache_file_hash_size;
--Error ER_GLOBAL_VARIABLE
SET key_cache_file_hash_size = 8000;
SELECT @@key_cache_file_hash_size;
---Error ER_PARSE_ERROR
-SET local.key_cache_file_hash_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_file_hash_size;
---Error ER_PARSE_ERROR
-SET global.key_cache_file_hash_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_file_hash_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
index c66bdc40a02..7f748bec2c0 100644
--- a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
+++ b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
@@ -56,9 +56,6 @@ SELECT lc_time_names;
# assign value without @@
SET lc_time_names=ar_AE;
SELECT @@session.lc_time_names;
-# assign global variable without @@
---Error ER_PARSE_ERROR
-SET global.lc_time_names=ar_AE;
# using another syntax for accessing session variable
SET session lc_time_names=ar_AE;
# accessing variable with scope the wrong way
diff --git a/mysql-test/suite/sys_vars/t/local_infile_basic.test b/mysql-test/suite/sys_vars/t/local_infile_basic.test
index 731eac42541..4430fa32f0a 100644
--- a/mysql-test/suite/sys_vars/t/local_infile_basic.test
+++ b/mysql-test/suite/sys_vars/t/local_infile_basic.test
@@ -154,8 +154,6 @@ SELECT @@local_infile = @@global.local_infile;
--Error ER_GLOBAL_VARIABLE
SET local_infile = 1;
SELECT @@local_infile;
---Error ER_PARSE_ERROR
-SET global.local_infile = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.local_infile;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/log_disabled_statements_basic.test b/mysql-test/suite/sys_vars/t/log_disabled_statements_basic.test
new file mode 100644
index 00000000000..f6191629f91
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_disabled_statements_basic.test
@@ -0,0 +1,51 @@
+# set session
+
+SET @start_global_value = @@global.log_disabled_statements;
+
+#
+# exists as global only
+#
+select @@global.log_disabled_statements;
+select @@session.log_disabled_statements;
+show global variables like 'log_disabled_statements';
+show session variables like 'log_disabled_statements';
+select * from information_schema.global_variables where variable_name='log_disabled_statements';
+select * from information_schema.session_variables where variable_name='log_disabled_statements';
+
+#
+# show that it's writable
+#
+set global log_disabled_statements=1;
+select @@global.log_disabled_statements;
+set session log_disabled_statements=1;
+select @@session.log_disabled_statements;
+
+#
+# all valid values
+#
+set session log_disabled_statements=1;
+select @@session.log_disabled_statements;
+set session log_disabled_statements=2;
+select @@session.log_disabled_statements;
+set session log_disabled_statements='slave';
+select @@session.log_disabled_statements;
+set session log_disabled_statements='sp';
+select @@session.log_disabled_statements;
+set session log_disabled_statements='slave,sp';
+select @@session.log_disabled_statements;
+set session log_disabled_statements='';
+select @@session.log_disabled_statements;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_disabled_statements=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_disabled_statements=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_disabled_statements="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_disabled_statements=1024;
+
+SET @@global.log_disabled_statements = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/log_disabled_statements_func-master.opt b/mysql-test/suite/sys_vars/t/log_disabled_statements_func-master.opt
new file mode 100644
index 00000000000..c9f62c1ab8a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_disabled_statements_func-master.opt
@@ -0,0 +1,2 @@
+--general-log
+--general-log-file=test.log
diff --git a/mysql-test/suite/sys_vars/t/log_disabled_statements_func.test b/mysql-test/suite/sys_vars/t/log_disabled_statements_func.test
new file mode 100644
index 00000000000..a7a088cdcd9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_disabled_statements_func.test
@@ -0,0 +1,61 @@
+SET @old_log_output= @@global.log_output;
+SET @old_log_disable_statements= @@global.log_disabled_statements;
+
+
+CREATE TABLE t1 (i INT PRIMARY KEY AUTO_INCREMENT, j VARCHAR(255) ) ENGINE=MyISAM;
+insert into t1 (j) values ('a'),('b'),('c'),('d');
+
+# enable slow logging to table
+SET GLOBAL log_output = 'file,table';
+
+DELIMITER $;
+CREATE PROCEDURE slow()
+BEGIN
+ SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b';
+ SELECT count(*) from t1 where j>'a';
+END
+$
+
+DELIMITER ;$
+
+select @@log_disabled_statements;
+TRUNCATE TABLE mysql.general_log;
+check table t1;
+CALL slow();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2';
+
+--echo -->
+SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%";
+--echo <--
+
+TRUNCATE TABLE mysql.general_log;
+SET SESSION log_disabled_statements="";
+check table t1;
+CALL slow();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3';
+
+--echo -->
+SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%";
+--echo <--
+
+TRUNCATE TABLE mysql.general_log;
+SET SESSION log_disabled_statements="sp,slave";
+check table t1;
+CALL slow();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4';
+
+--echo -->
+SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%";
+--echo <--
+
+DROP TABLE t1;
+DROP PROCEDURE slow;
+
+#
+# Restore setup
+#
+TRUNCATE TABLE mysql.general_log;
+SET @@global.log_output= @old_log_output;
+SET @@global.log_disabled_statements= @old_log_disable_statements;
+
+
diff --git a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
index a726bff08d7..5710920464f 100644
--- a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
@@ -21,6 +21,16 @@
###############################################################################
SET @start_value= @@global.log_queries_not_using_indexes;
+SET @filter_start_value= @@global.log_slow_filter;
+
+####################################################################
+# Check that variable is both session and global #
+####################################################################
+
+SET @@global.log_queries_not_using_indexes= TRUE;
+SET @@session.log_queries_not_using_indexes= TRUE;
+SET @@global.log_queries_not_using_indexes= FALSE;
+SET @@session.log_queries_not_using_indexes= FALSE;
####################################################################
# Valid values for boolean #
@@ -63,7 +73,7 @@ SET GLOBAL log_queries_not_using_indexes= +0;
SELECT @@global.log_queries_not_using_indexes;
#################################################################
-# Check if the value in GLOBAL Table matches value in variable #
+# Not valid values for the variable #
#################################################################
--error ER_WRONG_VALUE_FOR_VAR
@@ -88,23 +98,38 @@ SET @@global.log_queries_not_using_indexes= @badvar;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL log_queries_not_using_indexes= 'DEFAULT';
---error ER_GLOBAL_VARIABLE
-SET log_queries_not_using_indexes= TRUE;
-
---error ER_GLOBAL_VARIABLE
-SET SESSION log_queries_not_using_indexes= TRUE;
-
---error ER_GLOBAL_VARIABLE
-SET @@session.log_queries_not_using_indexes= TRUE;
-
---error ER_GLOBAL_VARIABLE
-SET LOCAL log_queries_not_using_indexes= TRUE;
-
--error ER_PARSE_ERROR
SET @@global log_queries_not_using_indexes= TRUE;
--error ER_PARSE_ERROR
SET @@SESSION log_queries_not_using_indexes= TRUE;
-SET @@global.log_queries_not_using_indexes= @start_value;
+####################################################################
+# Ensure that the value matches log_slow_filter #
+####################################################################
+
+SET @@SESSION.log_queries_not_using_indexes= TRUE;
+select @@SESSION.log_slow_filter;
+SET @@SESSION.log_queries_not_using_indexes= FALSE;
+select @@SESSION.log_slow_filter;
+SET @@GLOBAL.log_queries_not_using_indexes= TRUE;
+select @@GLOBAL.log_slow_filter;
+SET @@GLOBAL.log_queries_not_using_indexes= FALSE;
+select @@GLOBAL.log_slow_filter;
+
+SET @@SESSION.log_slow_filter="";
+select @@SESSION.log_queries_not_using_indexes;
+SET @@SESSION.log_slow_filter="not_using_index";
+select @@SESSION.log_queries_not_using_indexes;
+
+SET @@GLOBAL.log_slow_filter="";
+select @@GLOBAL.log_queries_not_using_indexes;
+SET @@GLOBAL.log_slow_filter="not_using_index";
+select @@GLOBAL.log_queries_not_using_indexes;
+####################################################################
+# Restore original value #
+####################################################################
+
+SET @@global.log_queries_not_using_indexes= @start_value;
+SET @@global.log_slow_filter= @filter_start_value;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
index 78e4d35f69a..97822a0f23a 100644
--- a/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
+++ b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
@@ -16,7 +16,7 @@ CREATE TABLE log_slow_admin_statements (
SET GLOBAL log_output = 'file,table';
SET GLOBAL slow_query_log = on;
SET SESSION long_query_time = 0;
-SET GLOBAL log_slow_admin_statements = on;
+SET SESSION log_slow_admin_statements = on;
# test ALTER, OPTIMIZE and CHECK against the table shown up
ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
@@ -59,3 +59,30 @@ SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
DROP PROCEDURE add_rows;
TRUNCATE TABLE mysql.slow_log;
+
+#
+# Ensure that log_slow_admin_statements maps to log_slow_disable_statements
+#
+
+SET @save_log_slow_disabled_statements= @@global.log_slow_disabled_statements;
+SET @@SESSION.log_slow_admin_statements= TRUE;
+select @@SESSION.log_slow_disabled_statements;
+SET @@SESSION.log_slow_admin_statements= FALSE;
+select @@SESSION.log_slow_disabled_statements;
+SET @@GLOBAL.log_slow_admin_statements= TRUE;
+select @@GLOBAL.log_slow_disabled_statements;
+SET @@GLOBAL.log_slow_admin_statements= FALSE;
+select @@GLOBAL.log_slow_disabled_statements;
+
+SET @@SESSION.log_slow_disabled_statements="";
+select @@SESSION.log_slow_admin_statements;
+SET @@SESSION.log_slow_disabled_statements="admin";
+select @@SESSION.log_slow_admin_statements;
+
+SET @@GLOBAL.log_slow_disabled_statements="";
+select @@GLOBAL.log_slow_admin_statements;
+SET @@GLOBAL.log_slow_disabled_statements="admin";
+select @@GLOBAL.log_slow_admin_statements;
+
+SET @@global.log_slow_disabled_statements= @save_log_slow_disabled_statements;
+
diff --git a/mysql-test/suite/sys_vars/t/log_slow_disabled_statements_basic.test b/mysql-test/suite/sys_vars/t/log_slow_disabled_statements_basic.test
new file mode 100644
index 00000000000..77391df6b3c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_disabled_statements_basic.test
@@ -0,0 +1,57 @@
+# set session
+
+SET @start_global_value = @@global.log_slow_disabled_statements;
+
+#
+# exists as global only
+#
+select @@global.log_slow_disabled_statements;
+select @@session.log_slow_disabled_statements;
+show global variables like 'log_slow_disabled_statements';
+show session variables like 'log_slow_disabled_statements';
+select * from information_schema.global_variables where variable_name='log_slow_disabled_statements';
+select * from information_schema.session_variables where variable_name='log_slow_disabled_statements';
+
+#
+# show that it's writable
+#
+set global log_slow_disabled_statements=1;
+select @@global.log_slow_disabled_statements;
+set session log_slow_disabled_statements=1;
+select @@session.log_slow_disabled_statements;
+
+#
+# all valid values
+#
+set session log_slow_disabled_statements=1;
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements=2;
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements=5;
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements='admin';
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements='slave';
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements='call';
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements='sp';
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements='admin,sp,call,slave';
+select @@session.log_slow_disabled_statements;
+set session log_slow_disabled_statements='';
+select @@session.log_slow_disabled_statements;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_disabled_statements=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_disabled_statements=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_slow_disabled_statements="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_slow_disabled_statements=1024;
+
+SET @@global.log_slow_disabled_statements = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_disabled_statements_func.test b/mysql-test/suite/sys_vars/t/log_slow_disabled_statements_func.test
new file mode 100644
index 00000000000..483948c840e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_disabled_statements_func.test
@@ -0,0 +1,92 @@
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_long_query_time= @@session.long_query_time;
+SET @old_log_slow_disable_statements= @@global.log_slow_disabled_statements;
+
+# Log everything to slow log
+SET @@session.log_slow_verbosity="explain,innodb,query_plan";
+
+CREATE TABLE t1 (i INT PRIMARY KEY AUTO_INCREMENT, j blob) ENGINE=MyISAM;
+insert into t1 (j) values ('a'),('b'),('c'),('d');
+create table t2 (a int auto_increment primary key) engine=myisam;
+
+# enable slow logging to table
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+
+DELIMITER $;
+CREATE PROCEDURE slow()
+BEGIN
+ SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b';
+ SELECT count(*) from t1 where j>'a';
+ insert into t2 () values();
+END
+$
+
+CREATE PROCEDURE slow2()
+BEGIN
+ SELECT j,count(*) from t1 group by j;
+ create temporary table t3 (a int);
+ alter table t3 add column (b int);
+ call slow();
+ drop temporary table t3;
+ SELECT j,count(*)+1 from t1 group by j,i;
+END
+$
+
+DELIMITER ;$
+
+SET SESSION long_query_time = 0;
+
+SELECT @@log_slow_disabled_statements;
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra int;
+CALL slow2();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2';
+
+--echo -->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+--echo <--
+
+SET SESSION log_slow_disabled_statements="call,admin";
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra2 int;
+CALL slow2();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3';
+
+--echo -->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+--echo <--
+
+SET SESSION log_slow_disabled_statements="";
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra3 int;
+CALL slow2();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4';
+
+--echo -->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+--echo <--
+
+SET SESSION log_slow_disabled_statements="call,admin,slave,sp";
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE t1 add column extra4 int;
+CALL slow2();
+SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part5';
+
+--echo -->
+SELECT sql_text FROM mysql.slow_log where sql_text <> "Close stmt" and sql_text <> "Prepare";
+--echo <--
+
+DROP TABLE t1,t2;
+DROP PROCEDURE slow;
+DROP PROCEDURE slow2;
+
+#
+# Restore setup
+#
+SET @@session.long_query_time= @old_long_query_time;
+TRUNCATE TABLE mysql.slow_log;
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@global.log_slow_disabled_statements= @old_log_slow_disable_statements;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test b/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test
index 2891b7ded8b..5309456b3ef 100644
--- a/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test
@@ -39,6 +39,8 @@ set session log_slow_filter='full_join';
select @@session.log_slow_filter;
set session log_slow_filter='full_scan';
select @@session.log_slow_filter;
+set session log_slow_filter='not_using_index';
+select @@session.log_slow_filter;
set session log_slow_filter='query_cache';
select @@session.log_slow_filter;
set session log_slow_filter='query_cache_miss';
@@ -49,7 +51,7 @@ set session log_slow_filter='tmp_table_on_disk';
select @@session.log_slow_filter;
set session log_slow_filter='filesort,query_cache';
select @@session.log_slow_filter;
-set session log_slow_filter='admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk';
+set session log_slow_filter='admin,not_using_index,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk';
select @@session.log_slow_filter;
set session log_slow_filter='';
select @@session.log_slow_filter;
@@ -64,6 +66,6 @@ set session log_slow_filter=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set session log_slow_filter="foo";
--error ER_WRONG_VALUE_FOR_VAR
-set session log_slow_filter=1024;
+set session log_slow_filter=16384;
SET @@global.log_slow_filter = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
index 710299f053c..974ec95ca5c 100644
--- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
@@ -165,12 +165,8 @@ SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
--Error ER_GLOBAL_VARIABLE
SET max_binlog_cache_size = 6000;
SELECT @@max_binlog_cache_size;
---Error ER_PARSE_ERROR
-SET local.max_binlog_cache_size = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_binlog_cache_size;
---Error ER_PARSE_ERROR
-SET global.max_binlog_cache_size = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_binlog_cache_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
index 4d2574a7890..22e8808ed8c 100644
--- a/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
@@ -153,12 +153,8 @@ SELECT @@max_binlog_size = @@global.max_binlog_size;
--Error ER_GLOBAL_VARIABLE
SET max_binlog_size = 6000;
SELECT @@max_binlog_size;
---Error ER_PARSE_ERROR
-SET local.max_binlog_size = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_binlog_size;
---Error ER_PARSE_ERROR
-SET global.max_binlog_size = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_binlog_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
index 3c2f6f6d391..ba528e268ec 100644
--- a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
@@ -166,12 +166,8 @@ SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size;
--Error ER_GLOBAL_VARIABLE
SET max_binlog_stmt_cache_size = 6000;
SELECT @@max_binlog_stmt_cache_size;
---Error ER_PARSE_ERROR
-SET local.max_binlog_stmt_cache_size = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_binlog_stmt_cache_size;
---Error ER_PARSE_ERROR
-SET global.max_binlog_stmt_cache_size = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_binlog_stmt_cache_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/max_connect_errors_basic.test b/mysql-test/suite/sys_vars/t/max_connect_errors_basic.test
index f9599579449..654ccfd45b8 100644
--- a/mysql-test/suite/sys_vars/t/max_connect_errors_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_connect_errors_basic.test
@@ -151,12 +151,8 @@ SELECT @@max_connect_errors = @@global.max_connect_errors;
--Error ER_GLOBAL_VARIABLE
SET max_connect_errors = 6000;
SELECT @@max_connect_errors;
---Error ER_PARSE_ERROR
-SET local.max_connect_errors = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_connect_errors;
---Error ER_PARSE_ERROR
-SET global.max_connect_errors = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_connect_errors;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/max_connections_basic.test b/mysql-test/suite/sys_vars/t/max_connections_basic.test
index 44f0d81a4b7..b4f3afbf3b6 100644
--- a/mysql-test/suite/sys_vars/t/max_connections_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_connections_basic.test
@@ -153,12 +153,8 @@ SELECT @@max_connections = @@global.max_connections;
--Error ER_GLOBAL_VARIABLE
SET max_connections = 6000;
SELECT @@max_connections;
---Error ER_PARSE_ERROR
-SET local.max_connections = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_connections;
---Error ER_PARSE_ERROR
-SET global.max_connections = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_connections;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
index a97256d84a4..799dd0c8555 100644
--- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
@@ -158,12 +158,8 @@ SELECT @@max_prepared_stmt_count = @@global.max_prepared_stmt_count;
--Error ER_GLOBAL_VARIABLE
SET max_prepared_stmt_count = 6000;
SELECT @@max_prepared_stmt_count;
---Error ER_PARSE_ERROR
-SET local.max_prepared_stmt_count = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_prepared_stmt_count;
---Error ER_PARSE_ERROR
-SET global.max_prepared_stmt_count = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_prepared_stmt_count;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
index 05d0fd1be82..de7cc395daf 100644
--- a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
@@ -150,12 +150,8 @@ SELECT @@max_relay_log_size = @@global.max_relay_log_size;
SET max_relay_log_size = 6000;
SELECT @@max_relay_log_size;
---Error ER_PARSE_ERROR
-SET local.max_relay_log_size = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_relay_log_size;
---Error ER_PARSE_ERROR
-SET global.max_relay_log_size = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_relay_log_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
index f70431b5580..6fecee3f32d 100644
--- a/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
@@ -178,11 +178,6 @@ SELECT @@global.myisam_stats_method;
SET myisam_stats_method = 'nulls_equal';
---Error ER_PARSE_ERROR
-SET session.myisam_stats_method = 'nulls_equal';
---Error ER_PARSE_ERROR
-SET global.myisam_stats_method = 'nulls_equal';
-
SET session myisam_stats_method = 'nulls_equal';
SELECT @@myisam_stats_method;
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
index d0de9202d3f..f6def41fa56 100644
--- a/mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test
+++ b/mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test
@@ -144,8 +144,6 @@ SELECT @@mysql56_temporal_format = @@global.mysql56_temporal_format;
--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
diff --git a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
index cce180fea67..9a6cb4779e5 100644
--- a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
@@ -20,7 +20,7 @@ select * from information_schema.session_variables where variable_name='old_alte
# show that it's writable
#
set global old_alter_table=1;
-set session old_alter_table=ON;
+set session old_alter_table=1;
select @@global.old_alter_table;
select @@session.old_alter_table;
show global variables like 'old_alter_table';
@@ -28,6 +28,32 @@ show session variables like 'old_alter_table';
select * from information_schema.global_variables where variable_name='old_alter_table';
select * from information_schema.session_variables where variable_name='old_alter_table';
+set global old_alter_table=2;
+set session old_alter_table=2;
+select @@global.old_alter_table;
+select @@session.old_alter_table;
+show global variables like 'old_alter_table';
+show session variables like 'old_alter_table';
+select * from information_schema.global_variables where variable_name='old_alter_table';
+select * from information_schema.session_variables where variable_name='old_alter_table';
+
+set global old_alter_table=3;
+set session old_alter_table=3;
+select @@global.old_alter_table;
+select @@session.old_alter_table;
+show global variables like 'old_alter_table';
+show session variables like 'old_alter_table';
+select * from information_schema.global_variables where variable_name='old_alter_table';
+select * from information_schema.session_variables where variable_name='old_alter_table';
+
+set global old_alter_table=4;
+set session old_alter_table=4;
+select @@global.old_alter_table;
+select @@session.old_alter_table;
+show global variables like 'old_alter_table';
+show session variables like 'old_alter_table';
+select * from information_schema.global_variables where variable_name='old_alter_table';
+select * from information_schema.session_variables where variable_name='old_alter_table';
#
# incorrect types
#
diff --git a/mysql-test/suite/sys_vars/t/old_mode_basic.test b/mysql-test/suite/sys_vars/t/old_mode_basic.test
index 93a93960836..088f85c48bd 100644
--- a/mysql-test/suite/sys_vars/t/old_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_mode_basic.test
@@ -197,11 +197,6 @@ SELECT @@global.old_mode;
SET old_mode = 'NO_PROGRESS_INFO';
---Error ER_PARSE_ERROR
-SET session.old_mode = 'ANSI';
---Error ER_PARSE_ERROR
-SET global.old_mode = 'ANSI';
-
SET session old_mode = 1;
SELECT @@old_mode;
diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_basic.test b/mysql-test/suite/sys_vars/t/query_cache_limit_basic.test
index c94ba3a52dd..98baa17d421 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_limit_basic.test
@@ -152,12 +152,8 @@ SELECT @@query_cache_limit = @@global.query_cache_limit;
--Error ER_GLOBAL_VARIABLE
SET query_cache_limit = 1;
SELECT @@query_cache_limit;
---Error ER_PARSE_ERROR
-SET local.query_cache_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_limit;
---Error ER_PARSE_ERROR
-SET global.query_cache_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_limit;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic.test b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic.test
index 9276a987dfb..b7916e73fa2 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic.test
@@ -159,12 +159,8 @@ SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
--Error ER_GLOBAL_VARIABLE
SET query_cache_min_res_unit = 1;
SELECT @@query_cache_min_res_unit;
---Error ER_PARSE_ERROR
-SET local.query_cache_min_res_unit = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_min_res_unit;
---Error ER_PARSE_ERROR
-SET global.query_cache_min_res_unit = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_min_res_unit;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/query_cache_size_basic.test b/mysql-test/suite/sys_vars/t/query_cache_size_basic.test
index 2a589ae3771..352cc29a445 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_size_basic.test
@@ -142,12 +142,8 @@ SELECT @@query_cache_size = @@global.query_cache_size;
--Error ER_GLOBAL_VARIABLE
SET query_cache_size = 1;
SELECT @@query_cache_size;
---Error ER_PARSE_ERROR
-SET local.query_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_size;
---Error ER_PARSE_ERROR
-SET global.query_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_size;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/read_only_basic.test b/mysql-test/suite/sys_vars/t/read_only_basic.test
index 0f77e983f92..3ef35020f01 100644
--- a/mysql-test/suite/sys_vars/t/read_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_only_basic.test
@@ -146,12 +146,8 @@ SELECT @@read_only = @@global.read_only;
--Error ER_GLOBAL_VARIABLE
SET read_only = 1;
SELECT @@read_only;
---Error ER_PARSE_ERROR
-SET local.read_only = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.read_only;
---Error ER_PARSE_ERROR
-SET global.read_only = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.read_only;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test b/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
index 081b79ebb73..dd211bb10ea 100644
--- a/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
+++ b/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
@@ -143,8 +143,6 @@ SELECT @@relay_log_purge = @@global.relay_log_purge;
--Error ER_GLOBAL_VARIABLE
SET relay_log_purge = 1;
---Error ER_PARSE_ERROR
-SET global.relay_log_purge = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.relay_log_purge;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test b/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test
index 56cf7f17c7f..1cf6f010eca 100644
--- a/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test
@@ -49,3 +49,10 @@ SELECT @@GLOBAL.replicate_ignore_table;
--echo # Cleanup.
SET @@GLOBAL.replicate_ignore_table = @save_replicate_ignore_table;
+
+--echo #
+--echo # MDEV-20101 Assertion failure on select @@global.'m2'.replicate_ignore_table
+--echo #
+
+SET NAMES latin1;
+SELECT @@global.'m2'.replicate_ignore_table;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
index 2ff03a53c42..68653d3a9a7 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
@@ -6,7 +6,6 @@
#
#
source include/not_embedded.inc;
-source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_enabled;
SET @start_global_value = @@global.rpl_semi_sync_master_enabled;
@@ -52,6 +51,35 @@ set global rpl_semi_sync_master_enabled=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global rpl_semi_sync_master_enabled="some text";
+#
+# Test conflicting concurrent setting
+#
+--let $val_saved= `SELECT @@global.rpl_semi_sync_master_enabled`
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+--let $iter=100
+--disable_query_log
+while ($iter)
+{
+ --connection con1
+ --send_eval SET @@global.rpl_semi_sync_master_enabled = $iter % 2
+
+ --connection con2
+ --send_eval SET @@global.rpl_semi_sync_master_enabled = ($iter + 1) % 2
+
+ --connection con1
+ reap;
+ --connection con2
+ reap;
+
+ --dec $iter
+}
+--enable_query_log
+disconnect con1;
+disconnect con2;
+
+--connection default
+--eval SET @@global.rpl_semi_sync_master_enabled = $val_saved
#
# Cleanup
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
index 74d3c41150b..d312fa1c367 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
@@ -5,7 +5,6 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
-source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_timeout;
SET @start_global_value = @@global.rpl_semi_sync_master_timeout;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
index c41b53fe5e6..3419254bafd 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
@@ -5,7 +5,6 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
-source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_master_trace_level;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
index d4a46a08140..60ca4425e5b 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
@@ -6,7 +6,6 @@
#
#
source include/not_embedded.inc;
-source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_wait_no_slave;
SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave;
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
index 8125cf8d653..2f8cd8ec160 100644
--- 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
@@ -1,5 +1,4 @@
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;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
index c7ce371970d..71be941cbdc 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
@@ -6,7 +6,6 @@
#
#
source include/not_embedded.inc;
-source include/have_semisync.inc;
select @@global.rpl_semi_sync_slave_enabled;
SET @start_global_value = @@global.rpl_semi_sync_slave_enabled;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
index d7e001b7322..74b6ac0a6ae 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
@@ -5,7 +5,6 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
-source include/have_semisync.inc;
select @@global.rpl_semi_sync_slave_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level;
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_no-slave.opt b/mysql-test/suite/sys_vars/t/secure_timestamp_no-slave.opt
new file mode 100644
index 00000000000..4c9000c0ebe
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_no-slave.opt
@@ -0,0 +1 @@
+--secure-timestamp=no
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_no.test b/mysql-test/suite/sys_vars/t/secure_timestamp_no.test
new file mode 100644
index 00000000000..8871666abd0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_no.test
@@ -0,0 +1,4 @@
+#
+# MDEV-15923 option to control who can set session @@timestamp
+#
+source inc/secure_timestamp_func.inc;
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_rpl-slave.opt b/mysql-test/suite/sys_vars/t/secure_timestamp_rpl-slave.opt
new file mode 100644
index 00000000000..13754861d0f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_rpl-slave.opt
@@ -0,0 +1 @@
+--secure-timestamp=replication
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_rpl.test b/mysql-test/suite/sys_vars/t/secure_timestamp_rpl.test
new file mode 100644
index 00000000000..8871666abd0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_rpl.test
@@ -0,0 +1,4 @@
+#
+# MDEV-15923 option to control who can set session @@timestamp
+#
+source inc/secure_timestamp_func.inc;
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_super-slave.opt b/mysql-test/suite/sys_vars/t/secure_timestamp_super-slave.opt
new file mode 100644
index 00000000000..f747ec6c0c9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_super-slave.opt
@@ -0,0 +1 @@
+--secure-timestamp=super
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_super.test b/mysql-test/suite/sys_vars/t/secure_timestamp_super.test
new file mode 100644
index 00000000000..8871666abd0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_super.test
@@ -0,0 +1,4 @@
+#
+# MDEV-15923 option to control who can set session @@timestamp
+#
+source inc/secure_timestamp_func.inc;
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_yes-slave.opt b/mysql-test/suite/sys_vars/t/secure_timestamp_yes-slave.opt
new file mode 100644
index 00000000000..a74d68957ef
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_yes-slave.opt
@@ -0,0 +1 @@
+--secure-timestamp=yes
diff --git a/mysql-test/suite/sys_vars/t/secure_timestamp_yes.test b/mysql-test/suite/sys_vars/t/secure_timestamp_yes.test
new file mode 100644
index 00000000000..8871666abd0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_timestamp_yes.test
@@ -0,0 +1,4 @@
+#
+# MDEV-15923 option to control who can set session @@timestamp
+#
+source inc/secure_timestamp_func.inc;
diff --git a/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test b/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test
index 90e6052947c..2cb51e3e968 100644
--- a/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test
+++ b/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test
@@ -85,14 +85,11 @@ SELECT @@session.session_track_system_variables;
connection default;
--echo # Testing NULL
+--error ER_WRONG_VALUE_FOR_VAR
SET @@global.session_track_system_variables = NULL;
+--error ER_WRONG_VALUE_FOR_VAR
SET @@session.session_track_system_variables = NULL;
---echo # Global - expect "" instead of NULL
-SELECT @@global.session_track_system_variables;
---echo # Session - expect "" instead of NULL
-SELECT @@session.session_track_system_variables;
-
--echo # testing with duplicate entries.
# Lets first set it to some valid value.
SET @@global.session_track_system_variables= "time_zone";
diff --git a/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test
index 4caaae84906..821c1855b03 100644
--- a/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test
@@ -152,12 +152,8 @@ SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet;
--Error ER_GLOBAL_VARIABLE
SET slave_max_allowed_packet = 6000;
SELECT @@slave_max_allowed_packet;
---Error ER_PARSE_ERROR
-SET local.slave_max_allowed_packet = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.slave_max_allowed_packet;
---Error ER_PARSE_ERROR
-SET global.slave_max_allowed_packet = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.slave_max_allowed_packet;
--Error ER_BAD_FIELD_ERROR
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
deleted file mode 100644
index ac5296677b9..00000000000
--- a/mysql-test/suite/sys_vars/t/slave_run_triggers_for_rbr_basic.test
+++ /dev/null
@@ -1,30 +0,0 @@
-
--- 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/slave_transaction_retry_errors-master.opt b/mysql-test/suite/sys_vars/t/slave_transaction_retry_errors-master.opt
new file mode 100644
index 00000000000..a93f9f02f70
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_transaction_retry_errors-master.opt
@@ -0,0 +1 @@
+--slave_transaction_retry_errors="10,20, 5000, 400"
diff --git a/mysql-test/suite/sys_vars/t/slave_transaction_retry_errors.test b/mysql-test/suite/sys_vars/t/slave_transaction_retry_errors.test
new file mode 100644
index 00000000000..aa2299cf815
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_transaction_retry_errors.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.slave_transaction_retry_errors;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.slave_transaction_retry_errors;
+show global variables like 'slave_transaction_retry_errors';
+show session variables like 'slave_transaction_retry_errors';
+select * from information_schema.global_variables where variable_name='slave_transaction_retry_errors';
+select * from information_schema.session_variables where variable_name='slave_transaction_retry_errors';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global slave_transaction_retry_errors=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session slave_transaction_retry_errors=1;
diff --git a/mysql-test/suite/sys_vars/t/slave_transaction_retry_interval_basic.test b/mysql-test/suite/sys_vars/t/slave_transaction_retry_interval_basic.test
new file mode 100644
index 00000000000..4d8d55901d1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_transaction_retry_interval_basic.test
@@ -0,0 +1,190 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+####### mysql-test\t\slave_transaction_retry_interval_basic.test ##############
+# #
+# Variable Name: slave_transaction_retry_interval #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value: 10 #
+# Range: #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+# Description: Test Cases of Dynamic System Variable #
+# slave_transaction_retry_interval #
+# 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/not_embedded.inc
+--source include/load_sysvars.inc
+
+###################################################################
+# START OF slave_transaction_retry_interval TESTS #
+###################################################################
+
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.slave_transaction_retry_interval;
+SELECT @start_global_value;
+
+--echo '#--------------------FN_DYNVARS_149_01-------------------------#'
+###################################################################
+# Display the DEFAULT value of slave_transaction_retry_interval #
+###################################################################
+
+SET @@global.slave_transaction_retry_interval = 50;
+SET @@global.slave_transaction_retry_interval = DEFAULT;
+SELECT @@global.slave_transaction_retry_interval;
+
+--echo '#--------------------FN_DYNVARS_149_02-------------------------#'
+###################################################################
+# Check the DEFAULT value of slave_transaction_retry_interval #
+###################################################################
+
+SET @@global.slave_transaction_retry_interval = DEFAULT;
+SELECT @@global.slave_transaction_retry_interval = 10;
+
+--echo '#--------------------FN_DYNVARS_149_03-------------------------#'
+###############################################################################
+# Change the value of slave_transaction_retry_interval to a valid value for
+# GLOBAL Scope
+###############################################################################
+
+SET @@global.slave_transaction_retry_interval = 0;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 1;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 15;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 1024;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 2147483648;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 2147483648*2-1;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 2147483649*2;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = 4294967295;
+SELECT @@global.slave_transaction_retry_interval;
+
+--echo '#--------------------FN_DYNVARS_149_04-------------------------#'
+##############################################################################
+# Check if variable can be access with session scope #
+##############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@slave_transaction_retry_interval = 2;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.slave_transaction_retry_interval = 3;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@local.slave_transaction_retry_interval = 4;
+
+
+--echo '#------------------FN_DYNVARS_149_05-----------------------#'
+############################################################################
+# Change the value of slave_transaction_retry_interval to an invalid value #
+############################################################################
+
+SET @@global.slave_transaction_retry_interval = -1;
+SELECT @@global.slave_transaction_retry_interval;
+
+SET @@global.slave_transaction_retry_interval = 2147483649*2147483649;
+SELECT @@global.slave_transaction_retry_interval;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retry_interval = 65530.34;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retry_interval = '100';
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retry_interval = 7483649.56;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retry_interval = ON;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retry_interval = OFF;
+
+--echo '#------------------FN_DYNVARS_149_06-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+SET @@global.slave_transaction_retry_interval = 3000;
+SELECT @@global.slave_transaction_retry_interval = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='slave_transaction_retry_interval';
+
+
+--echo '#------------------FN_DYNVARS_149_07-----------------------#'
+###########################################################################
+# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
+###########################################################################
+
+SELECT count(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='slave_transaction_retry_interval';
+
+
+--echo '#------------------FN_DYNVARS_149_08-----------------------#'
+####################################################################
+# Check if TRUE and FALSE values can be used on variable #
+####################################################################
+
+SET @@global.slave_transaction_retry_interval = TRUE;
+SELECT @@global.slave_transaction_retry_interval;
+SET @@global.slave_transaction_retry_interval = FALSE;
+SELECT @@global.slave_transaction_retry_interval;
+
+
+--echo '#---------------------FN_DYNVARS_149_09----------------------#'
+###############################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+###############################################################################
+
+
+SET @@global.slave_transaction_retry_interval = 60*60;
+SELECT @@slave_transaction_retry_interval = @@global.slave_transaction_retry_interval;
+
+
+--echo '#---------------------FN_DYNVARS_149_10----------------------#'
+###############################################################################
+# Check if slave_transaction_retry_interval can be accessed without @@ sign
+# and scope
+###############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET slave_transaction_retry_interval = 2048;
+--Error ER_BAD_FIELD_ERROR
+SELECT slave_transaction_retry_interval;
+
+SELECT @@slave_transaction_retry_interval;
+
+#verifying another another syntax for setting value
+SET global slave_transaction_retry_interval = 99;
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.slave_transaction_retry_interval = @start_global_value;
+SELECT @@global.slave_transaction_retry_interval;
+
+########################################################
+# END OF slave_transaction_retry_interval TESTS #
+########################################################
diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
index bedcb6201b1..71b25185549 100644
--- a/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
@@ -151,12 +151,8 @@ SELECT @@slow_launch_time = @@global.slow_launch_time;
--Error ER_GLOBAL_VARIABLE
SET slow_launch_time = 1;
SELECT @@slow_launch_time;
---Error ER_PARSE_ERROR
-SET local.slow_launch_time = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.slow_launch_time;
---Error ER_PARSE_ERROR
-SET global.slow_launch_time = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.slow_launch_time;
--Error ER_BAD_FIELD_ERROR
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 b429f9f5cea..3d58902ab8d 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
@@ -145,12 +145,8 @@ SELECT @@slow_query_log = @@global.slow_query_log;
######################################################################
# Check if slow_query_log can be accessed with and without @@ sign #
######################################################################
---Error ER_PARSE_ERROR
-SET local.slow_query_log = OFF;
--Error ER_UNKNOWN_TABLE
SELECT local.slow_query_log;
---Error ER_PARSE_ERROR
-SET global.slow_query_log = ON;
--Error ER_UNKNOWN_TABLE
SELECT global.slow_query_log;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/sql_mode_basic.test b/mysql-test/suite/sys_vars/t/sql_mode_basic.test
index 83f938925d5..b4841ecd3ff 100644
--- a/mysql-test/suite/sys_vars/t/sql_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_mode_basic.test
@@ -307,11 +307,11 @@ SELECT @@global.sql_mode;
SET @@global.sql_mode = 500000;
SELECT @@global.sql_mode;
-SET @@global.sql_mode = 4294967295;
+SET @@global.sql_mode = 17179869183;
SELECT @@global.sql_mode;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.sql_mode = 4294967296;
+SET @@global.sql_mode = 17179869184;
# use of decimal values
@@ -336,11 +336,6 @@ SELECT @@global.sql_mode;
SET sql_mode = 'ANSI';
---Error ER_PARSE_ERROR
-SET session.sql_mode = 'ANSI';
---Error ER_PARSE_ERROR
-SET global.sql_mode = 'ANSI';
-
SET session sql_mode = 1;
SELECT @@sql_mode;
diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic.test
index 8ac04480c65..4b5cc379fbf 100644
--- a/mysql-test/suite/sys_vars/t/sync_binlog_basic.test
+++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic.test
@@ -108,12 +108,8 @@ WHERE VARIABLE_NAME='sync_binlog';
--Error ER_GLOBAL_VARIABLE
SET sync_binlog = 1;
SELECT @@sync_binlog;
---Error ER_PARSE_ERROR
-SET local.sync_binlog = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.sync_binlog;
---Error ER_PARSE_ERROR
-SET global.sync_binlog = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.sync_binlog;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/sync_frm_basic.test b/mysql-test/suite/sys_vars/t/sync_frm_basic.test
index d9dcffb6318..6fb9e03d572 100644
--- a/mysql-test/suite/sys_vars/t/sync_frm_basic.test
+++ b/mysql-test/suite/sys_vars/t/sync_frm_basic.test
@@ -144,8 +144,6 @@ SELECT @@sync_frm = @@global.sync_frm;
--Error ER_GLOBAL_VARIABLE
SET sync_frm = 1;
SELECT @@sync_frm;
---Error ER_PARSE_ERROR
-SET global.sync_frm = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.sync_frm;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.test b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
index f67ed6ef072..ef52ee3264a 100644
--- a/mysql-test/suite/sys_vars/t/sysvars_innodb.test
+++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
@@ -8,8 +8,11 @@
select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, 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 like 'innodb%' and
variable_name not in (
+ 'innodb_version', # always the same as the server version
'innodb_disallow_writes', # only available WITH_WSREP
'innodb_numa_interleave', # only available WITH_NUMA
'innodb_sched_priority_cleaner', # linux only
- 'innodb_use_native_aio') # default value depends on OS
+ 'innodb_evict_tables_on_commit_debug', # one may want to override this
+ 'innodb_use_native_aio', # default value depends on OS
+ 'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing
order by variable_name;
diff --git a/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
index 4d0f7f9d69e..c887608b00f 100644
--- a/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
@@ -127,8 +127,6 @@ SELECT @@table_definition_cache = @@global.table_definition_cache;
--Error ER_GLOBAL_VARIABLE
SET table_definition_cache = 1;
---Error ER_PARSE_ERROR
-SET global.table_definition_cache = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.table_definition_cache;
--Error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/suite/sys_vars/t/tcp_keepalive_time.test b/mysql-test/suite/sys_vars/t/tcp_keepalive_time.test
new file mode 100644
index 00000000000..6b40c3d6eab
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/tcp_keepalive_time.test
@@ -0,0 +1,11 @@
+--source include/not_embedded.inc
+# A smoke test for TCP keepalive options
+set global tcp_keepalive_time = 1;
+set global tcp_keepalive_interval =1;
+set global tcp_keepalive_probes=1;
+connect(con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+disconnect con1;
+connection default;
+set global tcp_keepalive_time= default;
+set global tcp_keepalive_interval= default;
+set global tcp_keepalive_probes=default;
diff --git a/mysql-test/suite/sys_vars/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test
index bfd3fb40db3..41015033fe9 100644
--- a/mysql-test/suite/sys_vars/t/thread_stack_basic.test
+++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test
@@ -1,17 +1,17 @@
#
# only global
#
---replace_result 372736 299008
+--replace_result 392192 299008
select @@global.thread_stack;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.thread_stack;
---replace_result 372736 299008
+--replace_result 392192 299008
show global variables like 'thread_stack';
---replace_result 372736 299008
+--replace_result 392192 299008
show session variables like 'thread_stack';
---replace_result 372736 299008
+--replace_result 392192 299008
select * from information_schema.global_variables where variable_name='thread_stack';
---replace_result 372736 299008
+--replace_result 392192 299008
select * from information_schema.session_variables where variable_name='thread_stack';
#
diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic.test b/mysql-test/suite/sys_vars/t/timestamp_basic.test
index 8b26622443d..5f780e7ab40 100644
--- a/mysql-test/suite/sys_vars/t/timestamp_basic.test
+++ b/mysql-test/suite/sys_vars/t/timestamp_basic.test
@@ -47,7 +47,7 @@ SELECT floor(@@timestamp) = UNIX_TIMESTAMP(), @@timestamp = UNIX_TIMESTAMP(NOW(6
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
##############################################################
-# see if accessable using global scope #
+# see if accessible using global scope #
##############################################################
--Error ER_LOCAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
index 0a15aa08b6b..5b484cb9b1b 100644
--- a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
+++ b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
@@ -189,10 +189,6 @@ SELECT @@global.tx_isolation;
SET tx_isolation = 'REPEATABLE-READ';
---Error ER_PARSE_ERROR
-SET session.tx_isolation = 'REPEATABLE-READ';
---Error ER_PARSE_ERROR
-SET global.tx_isolation = 'REPEATABLE-READ';
#using SET SESSION|GLOBAL syntax
SET session tx_isolation = 'REPEATABLE-READ';
SELECT @@tx_isolation;
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
index 4eda96a7723..be038eb4baf 100644
--- a/mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/wsrep_sst_method_basic.test
@@ -25,7 +25,7 @@ SET @@global.wsrep_sst_method=mysqldump;
SELECT @@global.wsrep_sst_method;
# The xtrabackup and xtrabackup-v2 methods are obsolete,
# but we can still select them (they will be automatically
-# replaced to mariabackup in next versions of server):
+# replaced to mariabackup):
SET @@global.wsrep_sst_method=xtrabackup;
SELECT @@global.wsrep_sst_method;
SET @@global.wsrep_sst_method="xtrabackup-v2";
diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
index 6605f7c99b4..19e8efb06ad 100644
--- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
+++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
@@ -127,8 +127,8 @@ ERROR HY000: Function or expression 'uuid_short()' cannot be used in the GENERAT
create or replace table t1 (a varchar(1024) as (uuid()) PERSISTENT);
ERROR HY000: Function or expression 'uuid()' cannot be used in the GENERATED ALWAYS AS clause of `a`
# VALUES()
-create or replace table t1 (a varchar(1024), b varchar(1024) as (values(a)));
-ERROR HY000: Function or expression 'values()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+create or replace table t1 (a varchar(1024), b varchar(1024) as (value(a)));
+ERROR HY000: Function or expression 'value()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# VERSION()
create or replace table t1 (a varchar(1024), b varchar(1024) as (version()) PERSISTENT);
ERROR HY000: Function or expression 'version()' cannot be used in the GENERATED ALWAYS AS clause of `b`
@@ -247,3 +247,5 @@ ERROR HY000: Expression in the GENERATED ALWAYS AS clause is too big
# Constant expression
create or replace table t1 (a int as (PI()) PERSISTENT);
drop table if exists t1;
+create table t1 (a timestamp, b varchar(255) as (date_format(a, '%w %a %m %b')) stored);
+ERROR HY000: Function or expression 'date_format()' cannot be used in the GENERATED ALWAYS AS clause of `b`
diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result
index 8bfb8f0429c..0f80365f6a7 100644
--- a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result
@@ -54,7 +54,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -67,7 +67,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -87,7 +87,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@@ -109,7 +109,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -131,7 +131,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int as (a % 2));
@@ -141,6 +141,6 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result
index 96eb2bdc02f..e53a7594663 100644
--- a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result
@@ -54,7 +54,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -67,7 +67,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -87,7 +87,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment'
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@@ -109,7 +109,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@@ -131,7 +131,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int as (a % 2));
@@ -141,6 +141,6 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index a9b5bc29018..90dee4a43dc 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -284,7 +284,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(32) DEFAULT NULL,
- `c` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL,
+ `c` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL,
`d` varchar(5) GENERATED ALWAYS AS (left(`b`,5)) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
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 f4cbb5bd662..84817469fa2 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
@@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@@ -92,7 +92,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
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 87bd1bcf530..b4b41635110 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
@@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@@ -92,7 +92,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
diff --git a/mysql-test/suite/vcol/r/vcol_sql_mode.result b/mysql-test/suite/vcol/r/vcol_sql_mode.result
index d78a290a7c2..385939fd037 100644
--- a/mysql-test/suite/vcol/r/vcol_sql_mode.result
+++ b/mysql-test/suite/vcol/r/vcol_sql_mode.result
@@ -340,11 +340,11 @@ DROP TABLE t1;
# PAD_CHAR_TO_FULL_LENGTH + LENGTH(char_column) = hard dependency
CREATE TABLE t1 (a CHAR(5), v INT AS (LENGTH(a)) VIRTUAL, KEY(v));
Warnings:
-Warning 1901 Function or expression 'length(`a`)' cannot be used in the GENERATED ALWAYS AS clause of `v`
+Warning 1901 Function or expression 'octet_length(`a`)' cannot be used in the GENERATED ALWAYS AS clause of `v`
Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
SHOW WARNINGS;
Level Code Message
-Warning 1901 Function or expression 'length(`a`)' cannot be used in the GENERATED ALWAYS AS clause of `v`
+Warning 1901 Function or expression 'octet_length(`a`)' cannot be used in the GENERATED ALWAYS AS clause of `v`
Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
DROP TABLE t1;
#
diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result
index d4104c2c57e..10ab32f9486 100644
--- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result
+++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result
@@ -393,7 +393,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert ignore into t1 values (11,default);
@@ -410,7 +410,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (`a` MOD 10) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert ignore into t1 values (11,default);
@@ -915,7 +915,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) DEFAULT NULL,
- `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL
+ `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,octet_length(`a`),octet_length(`b`),`b`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('start,','end',default);
select * from t1;
@@ -978,7 +978,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (octet_length(`a`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('text',default);
select * from t1;
@@ -1142,7 +1142,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
- `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL
+ `b` int(11) GENERATED ALWAYS AS (octet_length(`a`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('text',default);
select * from t1;
@@ -2894,6 +2894,21 @@ a b
2012-12-12 Wednesday Wed December Dec
drop table t1;
set sql_warnings = 0;
+# DATE_FORMAT() STORED
+set sql_warnings = 1;
+create table t1 (a date, b varchar(100) as (date_format(a, '%W %a %M %b', 'de_DE')) STORED);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` date DEFAULT NULL,
+ `b` varchar(100) GENERATED ALWAYS AS (date_format(`a`,'%W %a %M %b','de_DE')) STORED
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('2012-12-12',default);
+select * from t1;
+a b
+2012-12-12 Mittwoch Mi Dezember Dez
+drop table t1;
+set sql_warnings = 0;
# CURRENT_USER()
set sql_warnings = 1;
create table t1 (a char, b varchar(32) as (current_user()));
diff --git a/mysql-test/suite/vcol/r/vcol_view_innodb.result b/mysql-test/suite/vcol/r/vcol_view_innodb.result
index 091cdc02fb3..b5d722f4d58 100644
--- a/mysql-test/suite/vcol/r/vcol_view_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_view_innodb.result
@@ -35,7 +35,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 5 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00
Warnings:
-Note 1003 select `v2`.`d` AS `d`,`v2`.`e` AS `e` from `test`.`v2`
+Note 1003 /* select#1 */ select `v2`.`d` AS `d`,`v2`.`e` AS `e` from `test`.`v2`
create view v3 (d,e) as select d*2, e*2 from v1;
select * from v3;
d e
diff --git a/mysql-test/suite/vcol/r/vcol_view_myisam.result b/mysql-test/suite/vcol/r/vcol_view_myisam.result
index 8ad1853faa4..8f86774c418 100644
--- a/mysql-test/suite/vcol/r/vcol_view_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_view_myisam.result
@@ -35,7 +35,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 5 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00
Warnings:
-Note 1003 select `v2`.`d` AS `d`,`v2`.`e` AS `e` from `test`.`v2`
+Note 1003 /* select#1 */ select `v2`.`d` AS `d`,`v2`.`e` AS `e` from `test`.`v2`
create view v3 (d,e) as select d*2, e*2 from v1;
select * from v3;
d e
diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc
index 766d0c7410c..52324176694 100644
--- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc
@@ -187,7 +187,7 @@ create or replace table t1 (a varchar(1024) as (uuid()) PERSISTENT);
--echo # VALUES()
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
-create or replace table t1 (a varchar(1024), b varchar(1024) as (values(a)));
+create or replace table t1 (a varchar(1024), b varchar(1024) as (value(a)));
--echo # VERSION()
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
@@ -354,3 +354,6 @@ eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long
create or replace table t1 (a int as (PI()) PERSISTENT);
drop table if exists t1;
+
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a timestamp, b varchar(255) as (date_format(a, '%w %a %m %b')) stored);
diff --git a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc
index dafc42098dd..fa2162e5981 100644
--- a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc
@@ -1197,6 +1197,12 @@ let $values1 = '2012-12-12',default;
let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
+--echo # DATE_FORMAT() STORED
+let $cols = a date, b varchar(100) as (date_format(a, '%W %a %M %b', 'de_DE')) STORED;
+let $values1 = '2012-12-12',default;
+let $rows = 1;
+--source suite/vcol/inc/vcol_supported_sql_funcs.inc
+
--echo # CURRENT_USER()
let $cols = a char, b varchar(32) as (current_user());
let $values1 = 'a', default;
diff --git a/mysql-test/suite/versioning/common.inc b/mysql-test/suite/versioning/common.inc
new file mode 100644
index 00000000000..efb081a02e4
--- /dev/null
+++ b/mysql-test/suite/versioning/common.inc
@@ -0,0 +1,89 @@
+--disable_query_log
+if (!$TEST_VERSIONING_SO)
+{
+ --skip needs test_versioning plugin
+}
+source include/have_innodb.inc;
+
+set @@session.time_zone='+00:00';
+select ifnull(max(transaction_id), 0) into @start_trx_id from mysql.transaction_registry;
+set @test_start=now(6);
+
+delimiter ~~;
+create procedure if not exists verify_trt()
+begin
+ set @i= 0;
+ select
+ @i:= @i + 1 as No,
+ transaction_id > 0 as A,
+ commit_id > transaction_id as B,
+ begin_timestamp > @test_start as C,
+ commit_timestamp >= begin_timestamp as D
+ from mysql.transaction_registry
+ where transaction_id > @start_trx_id;
+ select ifnull(max(transaction_id), 0)
+ into @start_trx_id
+ from mysql.transaction_registry;
+end~~
+
+create procedure if not exists verify_trt_dummy(recs int)
+begin
+ declare i int default 1;
+ create temporary table tmp (No int, A bool, B bool, C bool, D bool);
+ while i <= recs do
+ insert into tmp values (i, 1, 1, 1, 1);
+ set i= i + 1;
+ end while;
+ select * from tmp;
+ drop table tmp;
+end~~
+
+delimiter ;~~
+
+let $default_engine= `select @@default_storage_engine`;
+let $non_default_engine= `select if(@@default_storage_engine = 'InnoDB', 'MyISAM', 'InnoDB')`;
+let $sys_datatype_expl= timestamp(6);
+let $sys_datatype_expl_uc= TIMESTAMP(6);
+let $sys_datatype_max= TIMESTAMP'2038-01-19 03:14:07.999999';
+
+if ($MTR_COMBINATION_MYISAM)
+{
+ --let $MTR_COMBINATION_TIMESTAMP= 1
+}
+if ($MTR_COMBINATION_TRADITIONAL)
+{
+ --let $MTR_COMBINATION_TIMESTAMP= 1
+}
+if ($MTR_COMBINATION_HEAP)
+{
+ --let $MTR_COMBINATION_TIMESTAMP= 1
+}
+if ($MTR_COMBINATION_TRX_ID)
+{
+ let $sys_datatype_expl= bigint(20) unsigned;
+ let $sys_datatype_expl_uc= BIGINT(20) UNSIGNED;
+ let $sys_datatype_max= 18446744073709551615;
+}
+
+eval create or replace function current_row(sys_trx_end $sys_datatype_expl)
+returns int
+deterministic
+ return sys_trx_end = $sys_datatype_max;
+
+delimiter ~~;
+eval create or replace function check_row(row_start $sys_datatype_expl, row_end $sys_datatype_expl)
+returns varchar(255)
+deterministic
+begin
+ if row_end < row_start then
+ return "ERROR: row_end < row_start";
+ elseif row_end = row_start then
+ return "ERROR: row_end == row_start";
+ elseif current_row(row_end) then
+ return "CURRENT ROW";
+ end if;
+ return "HISTORICAL ROW";
+end~~
+delimiter ;~~
+
+--enable_query_log
diff --git a/mysql-test/suite/versioning/common.opt b/mysql-test/suite/versioning/common.opt
new file mode 100644
index 00000000000..b55a187cb13
--- /dev/null
+++ b/mysql-test/suite/versioning/common.opt
@@ -0,0 +1 @@
+--plugin-load-add=$TEST_VERSIONING_SO
diff --git a/mysql-test/suite/versioning/common_finish.inc b/mysql-test/suite/versioning/common_finish.inc
new file mode 100644
index 00000000000..61641c6c5ce
--- /dev/null
+++ b/mysql-test/suite/versioning/common_finish.inc
@@ -0,0 +1,8 @@
+--disable_query_log
+--disable_warnings
+drop procedure if exists verify_trt;
+drop procedure if exists verify_trt_dummy;
+drop function if exists current_row;
+drop function if exists check_row;
+--enable_warnings
+--enable_query_log
diff --git a/mysql-test/suite/handler/disabled.def b/mysql-test/suite/versioning/disabled.def
index 888298bbb09..888298bbb09 100644
--- a/mysql-test/suite/handler/disabled.def
+++ b/mysql-test/suite/versioning/disabled.def
diff --git a/mysql-test/suite/versioning/engines.combinations b/mysql-test/suite/versioning/engines.combinations
new file mode 100644
index 00000000000..57e2af6cd06
--- /dev/null
+++ b/mysql-test/suite/versioning/engines.combinations
@@ -0,0 +1,16 @@
+[timestamp]
+default-storage-engine=innodb
+
+[trx_id]
+default-storage-engine=innodb
+
+[myisam]
+default-storage-engine=myisam
+
+[traditional]
+default-storage-engine=myisam
+sql-mode=traditional
+
+[heap]
+default-storage-engine=memory
+
diff --git a/mysql-test/suite/versioning/engines.inc b/mysql-test/suite/versioning/engines.inc
new file mode 100644
index 00000000000..c841fece702
--- /dev/null
+++ b/mysql-test/suite/versioning/engines.inc
@@ -0,0 +1 @@
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/versioning/innodb.combinations b/mysql-test/suite/versioning/innodb.combinations
new file mode 100644
index 00000000000..1a0812cfafe
--- /dev/null
+++ b/mysql-test/suite/versioning/innodb.combinations
@@ -0,0 +1,5 @@
+[timestamp]
+default-storage-engine=innodb
+
+[trx_id]
+default-storage-engine=innodb
diff --git a/mysql-test/suite/versioning/innodb.inc b/mysql-test/suite/versioning/innodb.inc
new file mode 100644
index 00000000000..c841fece702
--- /dev/null
+++ b/mysql-test/suite/versioning/innodb.inc
@@ -0,0 +1 @@
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/versioning/key_type.combinations b/mysql-test/suite/versioning/key_type.combinations
new file mode 100644
index 00000000000..93c0ea8bc06
--- /dev/null
+++ b/mysql-test/suite/versioning/key_type.combinations
@@ -0,0 +1,3 @@
+[unique]
+[pk]
+[sec]
diff --git a/mysql-test/suite/versioning/key_type.inc b/mysql-test/suite/versioning/key_type.inc
new file mode 100644
index 00000000000..888a1d97098
--- /dev/null
+++ b/mysql-test/suite/versioning/key_type.inc
@@ -0,0 +1,14 @@
+--disable_query_log
+if ($MTR_COMBINATION_UNIQUE)
+{
+ let $KEY_TYPE= unique;
+}
+if ($MTR_COMBINATION_PK)
+{
+ let $KEY_TYPE= primary key;
+}
+if ($MTR_COMBINATION_SEC)
+{
+ let $KEY_TYPE= key;
+}
+--enable_query_log
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
new file mode 100644
index 00000000000..2ecd5152a45
--- /dev/null
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -0,0 +1,695 @@
+select @@system_versioning_alter_history;
+@@system_versioning_alter_history
+ERROR
+create table t(
+a int
+);
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t drop system versioning;
+ERROR HY000: Table `t` is not system-versioned
+alter table t add system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t add column y int;
+ERROR HY000: Not allowed for system-versioned `test`.`t`. Change @@system_versioning_alter_history to proceed with ALTER.
+alter table t add primary key (a);
+ERROR HY000: Not allowed for system-versioned `test`.`t`. Change @@system_versioning_alter_history to proceed with ALTER.
+alter table t add unique key (a);
+ERROR HY000: Not allowed for system-versioned `test`.`t`. Change @@system_versioning_alter_history to proceed with ALTER.
+alter table t engine innodb;
+ERROR HY000: Not allowed for system-versioned `test`.`t`. Change to/from native system versioning engine is not supported.
+alter table t drop system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set system_versioning_alter_history= keep;
+alter table t add system versioning;
+alter table t drop system versioning, drop column row_start;
+ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
+alter table t drop system versioning;
+alter table t
+add column trx_start bigint(20) unsigned as row start invisible,
+add column trx_end bigint(20) unsigned as row end invisible,
+add period for system_time(trx_start, trx_end),
+add system versioning;
+ERROR HY000: `trx_start` must be of type TIMESTAMP(6) for system-versioned table `t`
+alter table t
+add column trx_start timestamp as row start invisible,
+add column trx_end timestamp as row end invisible,
+add period for system_time(trx_start, trx_end),
+add system versioning;
+ERROR HY000: `trx_start` must be of type TIMESTAMP(6) for system-versioned table `t`
+alter table t
+add column trx_start timestamp(6) not null as row start invisible,
+add column trx_end timestamp(6) not null as row end invisible,
+add period for system_time(trx_start, trx_end),
+add system versioning;
+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 'as row start invisible,
+add column trx_end timestamp(6) not null as row end i...' at line 2
+alter table t
+add column trx_start timestamp(6) as row start invisible,
+add column trx_end timestamp(6) as row end invisible,
+add period for system_time(trx_start, trx_end),
+add system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `trx_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `trx_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`trx_start`, `trx_end`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t drop system versioning;
+ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `trx_start`'
+alter table t drop column trx_start, drop column trx_end;
+select row_start from t;
+row_start
+alter table t drop system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t add column trx_start timestamp(6) as row start;
+ERROR HY000: Duplicate ROW START column `trx_start`
+alter table t add system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t add column trx_start timestamp(6) as row start;
+ERROR HY000: Duplicate ROW START column `trx_start`
+alter table t modify a int as row start;
+ERROR HY000: Duplicate ROW START column `a`
+alter table t add column b int;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t add column c int;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t add column d int first;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `d` int(11) DEFAULT NULL,
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t add column e int after d;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `d` int(11) DEFAULT NULL,
+ `e` int(11) DEFAULT NULL,
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t drop column a;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `d` int(11) DEFAULT NULL,
+ `e` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t (
+a int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end))
+with system versioning;
+select * from t for system_time all;
+a
+alter table t drop column row_start;
+ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `row_end`'
+alter table t drop column row_end;
+ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `row_start`'
+alter table t drop column row_start, drop column row_end;
+select * from t for system_time all;
+a
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t drop column row_start;
+ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
+alter table t drop column row_end;
+ERROR 42000: Can't DROP COLUMN `row_end`; check that it exists
+create or replace table t (
+a int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end))
+with system versioning;
+select * from t for system_time all;
+a
+alter table t drop column row_start, drop column row_end;
+select * from t for system_time all;
+a
+create or replace table t(
+a int
+);
+insert into t values(1);
+alter table t add system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+insert into t values(2);
+select * from t for system_time all;
+a
+1
+2
+select * from t;
+a
+1
+2
+update t set a=3 where a=1;
+select * from t;
+a
+3
+2
+select * from t for system_time all;
+a
+3
+2
+1
+select row_start from t where a=3 into @tm;
+alter table t add column b int;
+select @tm=row_start from t where a=3;
+@tm=row_start
+1
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t;
+a b
+3 NULL
+2 NULL
+select * from t for system_time all;
+a b
+3 NULL
+2 NULL
+1 NULL
+alter table t drop system versioning;
+select * from t;
+a b
+3 NULL
+2 NULL
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t modify a int with system versioning;
+ERROR HY000: Table `t` is not system-versioned
+alter table t modify a int without system versioning;
+ERROR HY000: Table `t` is not system-versioned
+alter table t add system versioning;
+alter table t modify a int without system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t modify a int with system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t(
+a int
+) engine=innodb;
+alter table t
+add column trx_start timestamp(6) as row start invisible,
+add column trx_end timestamp(6) as row end invisible,
+add period for system_time(trx_start, trx_end),
+add system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `trx_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `trx_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`trx_start`, `trx_end`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+# Issue #211: drop of system columns required before drop system versioning
+alter table t drop column trx_start, drop column trx_end;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t drop system versioning;
+insert into t values(1);
+call verify_trt;
+No A B C D
+alter table t
+add column trx_start bigint(20) unsigned as row start invisible,
+add column trx_end bigint(20) unsigned as row end invisible,
+add period for system_time(trx_start, trx_end),
+add system versioning;
+call verify_trt;
+No A B C D
+1 1 1 1 1
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `trx_start` bigint(20) unsigned GENERATED ALWAYS AS ROW START INVISIBLE,
+ `trx_end` bigint(20) unsigned GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`trx_start`, `trx_end`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t drop column trx_start, drop column trx_end;
+call verify_trt;
+No A B C D
+alter table t drop system versioning, algorithm=copy;
+call verify_trt;
+No A B C D
+alter table t add system versioning, algorithm=copy;
+call verify_trt;
+No A B C D
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+update t set a= 2;
+select * from t for system_time all;
+a
+2
+1
+alter table t add column b int, algorithm=copy;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t;
+a b
+2 NULL
+call verify_trt;
+No A B C D
+alter table t drop column b, algorithm=copy;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t for system_time all;
+a
+2
+1
+call verify_trt;
+No A B C D
+alter table t drop system versioning, algorithm=copy;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+call verify_trt;
+No A B C D
+create or replace table t (a int);
+insert t values (1),(2),(3),(4);
+alter table t add b int auto_increment null unique;
+select * from t;
+a b
+1 1
+2 2
+3 3
+4 4
+drop table t;
+create or replace table t (a int) with system versioning engine=innodb;
+insert into t values (1), (2), (3);
+delete from t where a<3;
+alter table t add b int not null unique;
+Got one of the listed errors
+alter table t add b int auto_increment unique;
+Got one of the listed errors
+alter table t add b int auto_increment null unique;
+select * from t;
+a b
+3 1
+select * from t for system_time all;
+a b
+1 NULL
+2 NULL
+3 1
+insert into t values (4, 0);
+select * from t for system_time all;
+a b
+1 NULL
+2 NULL
+3 1
+4 2
+create or replace table t (a int) with system versioning;
+insert into t values (1), (2), (3);
+delete from t where a<3;
+alter table t add b int not null unique;
+Got one of the listed errors
+alter table t add b int auto_increment unique;
+Got one of the listed errors
+alter table t add b int auto_increment null unique;
+select * from t;
+a b
+3 1
+select * from t for system_time all;
+a b
+1 NULL
+2 NULL
+3 1
+insert into t values (4, 0);
+select * from t for system_time all;
+a b
+1 NULL
+2 NULL
+3 1
+4 2
+create or replace table t (a int, b int primary key, c int unique) with system versioning;
+insert t values (1,2,3),(1,3,4),(1,4,5);
+alter table t drop system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) NOT NULL,
+ `c` int(11) DEFAULT NULL,
+ PRIMARY KEY (`b`),
+ UNIQUE KEY `c` (`c`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t;
+a b c
+1 2 3
+1 3 4
+1 4 5
+create or replace table t (
+a int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+alter table t change column row_start asdf timestamp(6);
+ERROR HY000: Can not change system versioning field `row_start`
+insert into t values (1);
+alter table t modify column row_start bigint unsigned;
+ERROR HY000: Can not change system versioning field `row_start`
+set system_versioning_alter_history= SURVIVE;
+ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'SURVIVE'
+set system_versioning_alter_history= 'DROP';
+ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'DROP'
+create or replace table t (a int) with system versioning;
+alter table t add system versioning;
+ERROR HY000: Table `t` is already system-versioned
+alter table t add system versioning, drop system versioning;
+ERROR HY000: Table `t` is already system-versioned
+set @@system_versioning_alter_history=keep;
+create or replace table t(x int, y int) with system versioning engine=innodb;
+alter table t modify y int without system versioning;
+insert into t values(1, 1);
+update t set y=2;
+# MDEV-14681 Bogus ER_UNSUPPORTED_EXTENSION
+create or replace table t1 (pk int auto_increment unique) with system versioning;
+insert into t1 values (1);
+delete from t1;
+alter table t1 engine=myisam;
+# MDEV-14692 crash in MDL_context::upgrade_shared_lock()
+create or replace temporary table t (a int);
+alter table t change column if exists b c bigint unsigned generated always as row start;
+ERROR HY000: TEMPORARY tables do not support system versioning
+alter table t change column if exists b c bigint unsigned generated always as row end;
+ERROR HY000: TEMPORARY tables do not support system versioning
+alter table t add system versioning;
+ERROR HY000: TEMPORARY tables do not support system versioning
+drop table t;
+# MDEV-14744 trx_id-based and transaction-based mixup in assertion
+create or replace table t (c text) engine=innodb with system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `c` text DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t add fulltext key (c);
+create or replace table t (a int) with system versioning;
+alter table t drop column a;
+ERROR HY000: Table `t` must have at least one versioned column
+alter table t drop column a, drop column a;
+ERROR 42000: Can't DROP COLUMN `a`; check that it exists
+create or replace table t1 (row_start int);
+alter table t1 with system versioning;
+ERROR 42S21: Duplicate column name 'row_start'
+create or replace table t1 (row_end int);
+alter table t1 with system versioning;
+ERROR 42S21: Duplicate column name 'row_end'
+create or replace table t1 (a int, row_start int) with system versioning;
+ERROR 42S21: Duplicate column name 'row_start'
+create or replace table t1 (a int) with system versioning;
+set statement system_versioning_alter_history=keep for
+alter table t1 add column row_start int;
+ERROR 42S21: Duplicate column name 'row_start'
+set statement system_versioning_alter_history=keep for
+alter table t1 add column row_start timestamp(6);
+ERROR 42S21: Duplicate column name 'row_start'
+# MDEV-14798 Add, drop system versioning semantic and syntax
+create or replace table t (
+a int,
+row_start timestamp(6) generated always as row start,
+row_end timestamp(6) generated always as row end,
+period for system_time(row_start, row_end)
+) with system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t
+drop column row_start,
+drop column row_end,
+drop period for system_time,
+drop system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t drop period for system_time;
+ERROR HY000: Table `t` is not system-versioned
+create or replace table t (
+a int,
+row_start timestamp(6) generated always as row start,
+row_end timestamp(6) generated always as row end,
+period for system_time(row_start, row_end)
+) with system versioning;
+alter table t drop period for system_time;
+ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `row_start`, DROP COLUMN `row_end`'
+alter table t drop column sys_trx_start, drop period for system_time;
+ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `row_start`, DROP COLUMN `row_end`'
+alter table t drop column sys_trx_end, drop period for system_time;
+ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `row_start`, DROP COLUMN `row_end`'
+alter table t add period for system_time(sys_trx_start, sys_trx_end);
+ERROR HY000: Table `t` is already system-versioned
+#
+# MDEV-14790 System versioning for system tables does not work as expected
+#
+use mysql;
+create or replace table t (x int) with system versioning;
+ERROR HY000: System versioning tables in the `mysql` database are not supported
+alter table user add system versioning;
+ERROR HY000: System versioning tables in the `mysql` database are not supported
+use test;
+# MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column
+create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning;
+alter table t1 modify s timestamp(6) as row start;
+ERROR HY000: Duplicate ROW START column `s`
+# ignore CHECK for historical rows
+create or replace table t (a int) with system versioning;
+insert into t values (0), (1);
+delete from t where a = 0;
+alter table t add check (a > 1);
+ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t`
+alter table t add check (a > 0);
+insert into t values (0);
+ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t`
+insert into t values (2);
+#
+# MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning
+#
+set system_versioning_alter_history= keep;
+create or replace table t1 (a int, b int generated always as (0) stored) engine=innodb with system versioning;
+insert into t1 (a) values (1);
+alter table t1 modify a int without system versioning, algorithm=copy;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+alter table t1 modify a int with system versioning, algorithm=copy;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+alter table t1 modify a int without system versioning;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+alter table t1 modify a int with system versioning;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) GENERATED ALWAYS AS (0) STORED
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t1;
+a b
+1 0
+alter table t1 modify b int generated always as (0) stored without system versioning;
+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 'without system versioning' at line 1
+alter table t1 modify b int generated always as (0) stored with system versioning;
+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 'system versioning' at line 1
+alter table t1 modify b int without system versioning;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t1;
+a b
+1 0
+create or replace table t1 (a int, b int generated always as (0) virtual) engine=innodb with system versioning;
+insert into t1 (a) values (1);
+alter table t1 modify a int without system versioning, algorithm=copy;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+alter table t1 modify a int with system versioning, algorithm=copy;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+alter table t1 modify a int without system versioning;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+alter table t1 modify a int with system versioning;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+select * from t1;
+a b
+1 0
+affected rows: 1
+#
+# MDEV-19304 Segfault in ALTER TABLE after UPDATE for SIMULTANEOUS_ASSIGNMENT
+#
+create or replace table t1 (a int, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) engine=myisam with system versioning;
+insert into t1 values (null, null, null);
+insert into t1 values (null, null, null);
+set sql_mode= 'simultaneous_assignment';
+update t1 set e= 1;
+Warnings:
+Warning 1906 The value specified for generated column 'e' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'e' in table 't1' has been ignored
+alter table t1 force;
+set sql_mode= default;
+#
+# MDEV-18862 Unfortunate error message upon attempt to drop system versioning
+#
+set system_versioning_alter_history= keep;
+create or replace table t1 (x int) with system versioning;
+alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
+ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
+alter table t1 drop period for system_time;
+ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
+alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
+ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
+alter table t1 drop column `row_end`;
+ERROR 42000: Can't DROP COLUMN `row_end`; check that it exists
+#
+# MDEV-19127 Assertion `row_start_field' failed in vers_prepare_keys upon ALTER TABLE
+#
+set system_versioning_alter_history=keep;
+create or replace table t1 (f1 int) with system versioning;
+alter table t1 add f2 int with system versioning, drop system versioning;
+create or replace table t1 (f1 int) with system versioning;
+alter table t1 drop system versioning, add f2 int with system versioning;
+ERROR HY000: Table `t1` is not system-versioned
+drop table t1;
+# MDEV-16490 It's possible to make a system versioned table without any versioning field
+set @@system_versioning_alter_history=keep;
+create or replace table t (a int) with system versioning engine=innodb;
+alter table t change column a a int without system versioning;
+ERROR HY000: Table `t` must have at least one versioned column
+alter table t
+change column a a int without system versioning,
+add column b int with system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t
+change column a new_a int,
+drop system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `new_a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t add system versioning;
+alter table t change column new_a a int without system versioning;
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+alter table t
+add column c int,
+change column c c int without system versioning,
+change column b b int without system versioning;
+ERROR HY000: Table `t` must have at least one versioned column
+alter table t
+add column c int without system versioning,
+change column c c int,
+change column b b int without system versioning;
+drop table t;
+#
+# MDEV-21688 Assertion or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table
+#
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (128);
+delete from t1;
+set statement system_versioning_alter_history=keep for
+alter table t1 drop system versioning, modify column a tinyint;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/auto_increment.result b/mysql-test/suite/versioning/r/auto_increment.result
new file mode 100644
index 00000000000..8ff1bed8fe3
--- /dev/null
+++ b/mysql-test/suite/versioning/r/auto_increment.result
@@ -0,0 +1,65 @@
+create table t1(
+id int unsigned auto_increment primary key,
+x int unsigned,
+y int unsigned,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+create table t2(
+id int unsigned auto_increment primary key,
+x int unsigned,
+y int unsigned);
+insert into t1(x, y) values(1, 11);
+insert into t2(x, y) values(1, 11);
+insert into t1(x, y) values(2, 12);
+insert into t2(x, y) values(2, 12);
+insert into t1(x, y) values(3, 13);
+insert into t2(x, y) values(3, 13);
+insert into t1(x, y) values(4, 14);
+insert into t2(x, y) values(4, 14);
+insert into t1(x, y) values(5, 15);
+insert into t2(x, y) values(5, 15);
+insert into t1(x, y) values(6, 16);
+insert into t2(x, y) values(6, 16);
+insert into t1(x, y) values(7, 17);
+insert into t2(x, y) values(7, 17);
+insert into t1(x, y) values(8, 18);
+insert into t2(x, y) values(8, 18);
+insert into t1(x, y) values(9, 19);
+insert into t2(x, y) values(9, 19);
+select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner join t2 on t1.id = t2.id;
+A x y x y
+1 1 11 1 11
+1 2 12 2 12
+1 3 13 3 13
+1 4 14 4 14
+1 5 15 5 15
+1 6 16 6 16
+1 7 17 7 17
+1 8 18 8 18
+1 9 19 9 19
+delete from t1 where x = 2;
+delete from t2 where x = 2;
+select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner join t2 on t1.id = t2.id;
+A x y x y
+1 1 11 1 11
+1 3 13 3 13
+1 4 14 4 14
+1 5 15 5 15
+1 6 16 6 16
+1 7 17 7 17
+1 8 18 8 18
+1 9 19 9 19
+delete from t1 where x > 7;
+delete from t2 where x > 7;
+select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner join t2 on t1.id = t2.id;
+A x y x y
+1 1 11 1 11
+1 3 13 3 13
+1 4 14 4 14
+1 5 15 5 15
+1 6 16 6 16
+1 7 17 7 17
+drop table t1;
+drop table t2;
diff --git a/mysql-test/suite/versioning/r/commit_id.result b/mysql-test/suite/versioning/r/commit_id.result
new file mode 100644
index 00000000000..abf2eaf91ba
--- /dev/null
+++ b/mysql-test/suite/versioning/r/commit_id.result
@@ -0,0 +1,100 @@
+create table t1(
+id int auto_increment primary key,
+sys_trx_start bigint unsigned as row start invisible,
+sys_trx_end bigint unsigned as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end)
+)
+with system versioning
+engine innodb;
+insert into t1 values ();
+set @ts0= now(6);
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx0;
+select transaction_id = @tx0 from mysql.transaction_registry
+order by transaction_id desc limit 1;
+transaction_id = @tx0
+1
+set @ts1= now(6);
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx1;
+select transaction_id = @tx1 from mysql.transaction_registry
+order by transaction_id desc limit 1;
+transaction_id = @tx1
+1
+set @ts2= now(6);
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx2;
+select transaction_id = @tx2 from mysql.transaction_registry
+order by transaction_id desc limit 1;
+transaction_id = @tx2
+1
+set @ts3= now(6);
+select
+trt_trx_id(@ts0) < @tx0 as A,
+trt_trx_id(@ts0, true) = @tx0 as B,
+trt_trx_id(@ts1) = @tx0 as C,
+trt_trx_id(@ts1, true) = @tx1 as D,
+trt_trx_id(@ts2) = @tx1 as E,
+trt_trx_id(@ts2, true) = @tx2 as F,
+trt_trx_id(@ts3) = @tx2 as G,
+trt_trx_id(@ts3, true) is null as H;
+A B C D E F G H
+1 1 1 1 1 1 1 1
+select
+trt_commit_id(@ts0) < @tx0 as A,
+trt_commit_id(@ts0, true) = trt_commit_id(null, @tx0) as B,
+trt_commit_id(@ts1) = trt_commit_id(null, @tx0) as C,
+trt_commit_id(@ts1, true) = trt_commit_id(null, @tx1) as D,
+trt_commit_id(@ts2) = trt_commit_id(null, @tx1) as E,
+trt_commit_id(@ts2, true) = trt_commit_id(null, @tx2) as F,
+trt_commit_id(@ts3) = trt_commit_id(null, @tx2) as G,
+trt_commit_id(@ts3, true) is null as H;
+A B C D E F G H
+1 1 1 1 1 1 1 1
+select
+trt_trx_sees(@tx1, @tx0) as A,
+not trt_trx_sees(@tx0, @tx1) as B,
+trt_trx_sees_eq(@tx1, @tx1) as C,
+not trt_trx_sees(@tx1, @tx1) as D,
+trt_trx_sees(@tx2, 0) as E,
+trt_trx_sees(-1, @tx2) as F;
+A B C D E F
+1 1 1 1 1 1
+select trt_trx_sees(0, @tx2);
+trt_trx_sees(0, @tx2)
+0
+set transaction isolation level read uncommitted;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx3;
+select isolation_level = 'READ-UNCOMMITTED' from mysql.transaction_registry where transaction_id = @tx3;
+isolation_level = 'READ-UNCOMMITTED'
+1
+set transaction isolation level read committed;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx4;
+select isolation_level = 'READ-COMMITTED' from mysql.transaction_registry where transaction_id = @tx4;
+isolation_level = 'READ-COMMITTED'
+1
+set transaction isolation level serializable;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx5;
+select isolation_level = 'SERIALIZABLE' from mysql.transaction_registry where transaction_id = @tx5;
+isolation_level = 'SERIALIZABLE'
+1
+set transaction isolation level repeatable read;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx6;
+select isolation_level = 'REPEATABLE-READ' from mysql.transaction_registry where transaction_id = @tx6;
+isolation_level = 'REPEATABLE-READ'
+1
+drop table t1;
+call verify_trt;
+No A B C D
+1 1 1 1 1
+2 1 1 1 1
+3 1 1 1 1
+4 1 1 1 1
+5 1 1 1 1
+6 1 1 1 1
+7 1 1 1 1
+8 1 1 1 1
diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result
new file mode 100644
index 00000000000..5189e55bc30
--- /dev/null
+++ b/mysql-test/suite/versioning/r/create.result
@@ -0,0 +1,526 @@
+drop table if exists t1;
+create table t1 (
+x1 int unsigned,
+Sys_start SYS_DATATYPE as row start invisible comment 'start',
+Sys_end SYS_DATATYPE as row end invisible comment 'end',
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x1` int(10) unsigned DEFAULT NULL,
+ `Sys_start` SYS_DATATYPE GENERATED ALWAYS AS ROW START INVISIBLE COMMENT 'start',
+ `Sys_end` SYS_DATATYPE GENERATED ALWAYS AS ROW END INVISIBLE COMMENT 'end',
+ PERIOD FOR SYSTEM_TIME (`Sys_start`, `Sys_end`)
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1';
+table_catalog def
+table_schema test
+table_name t1
+table_type SYSTEM VERSIONED
+version 10
+table_rows 0
+data_free 0
+auto_increment NULL
+check_time NULL
+table_collation latin1_swedish_ci
+checksum NULL
+create_options
+table_comment
+select table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,character_maximum_length,character_octet_length,character_set_name,collation_name,column_key,extra,column_comment,is_generated,generation_expression from information_schema.columns where table_name='t1';
+table_catalog def
+table_schema test
+table_name t1
+column_name x1
+ordinal_position 1
+column_default NULL
+character_maximum_length NULL
+character_octet_length NULL
+character_set_name NULL
+collation_name NULL
+column_key
+extra
+column_comment
+is_generated NEVER
+generation_expression NULL
+table_catalog def
+table_schema test
+table_name t1
+column_name Sys_start
+ordinal_position 2
+column_default NULL
+character_maximum_length NULL
+character_octet_length NULL
+character_set_name NULL
+collation_name NULL
+column_key
+extra STORED GENERATED, INVISIBLE
+column_comment start
+is_generated ALWAYS
+generation_expression ROW START
+table_catalog def
+table_schema test
+table_name t1
+column_name Sys_end
+ordinal_position 3
+column_default NULL
+character_maximum_length NULL
+character_octet_length NULL
+character_set_name NULL
+collation_name NULL
+column_key
+extra STORED GENERATED, INVISIBLE
+column_comment end
+is_generated ALWAYS
+generation_expression ROW END
+# Implicit fields test
+create or replace table t1 (
+x2 int unsigned
+) with system versioning;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x2` int(10) unsigned DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x3 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (x, Sys_end)
+) with system versioning;
+ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
+create or replace table t1 (
+x4 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end2 timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end2`
+create or replace table t1 (
+x5 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, x)
+) with system versioning;
+ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
+create or replace table t1 (
+x6 int unsigned,
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+ERROR HY000: Wrong parameters for `t1`: missing 'AS ROW START'
+create or replace table t1 (
+x7 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_end)
+);
+ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
+create or replace table t1 (
+x8 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (sys_insert, sys_remove)
+) with system versioning;
+ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
+create or replace table t1 (
+x9 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_end)
+);
+ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
+create or replace table t1 (
+x10 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_start)
+);
+ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
+create or replace table t1 (
+x11 int unsigned,
+Sys_start bigint unsigned as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+Got one of the listed errors
+create or replace table t1 (
+x12 int unsigned,
+Sys_start timestamp(6) as row start invisible,
+Sys_end bigint unsigned as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+Got one of the listed errors
+create or replace table t1 (
+x13 int unsigned,
+Sys_start bigint as row start invisible,
+Sys_end bigint unsigned as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning engine innodb;
+ERROR HY000: `Sys_start` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`
+create or replace table t1 (
+x14 int unsigned,
+Sys_start bigint unsigned as row start invisible,
+Sys_end bigint as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning engine innodb;
+ERROR HY000: `Sys_end` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`
+create or replace table t1 (
+x15 int with system versioning,
+B int
+);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x15` int(11) DEFAULT NULL,
+ `B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x16 int with system versioning,
+B int
+) with system versioning;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x16` int(11) DEFAULT NULL,
+ `B` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x17 int,
+B int without system versioning
+);
+create or replace table t1 (
+x18 int,
+B int without system versioning
+) with system versioning;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x18` int(11) DEFAULT NULL,
+ `B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x19 int with system versioning,
+B int without system versioning
+);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x19` int(11) DEFAULT NULL,
+ `B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x20 int with system versioning,
+B int without system versioning
+) with system versioning;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x20` int(11) DEFAULT NULL,
+ `B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x21 int without system versioning
+);
+create or replace table t1 (
+x22 int without system versioning
+) with system versioning;
+ERROR HY000: Table `t1` must have at least one versioned column
+create or replace table t1 (a int) with system versioning;
+create table tt1 like t1;
+show create table tt1;
+Table Create Table
+tt1 CREATE TABLE `tt1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+drop table tt1;
+create temporary table tt1 like t1;
+Warnings:
+Warning 1105 System versioning is stripped from temporary `test.tt1`
+# Temporary is stripped from versioning
+show create table tt1;
+Table Create Table
+tt1 CREATE TEMPORARY TABLE `tt1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
+# CREATE TABLE ... SELECT
+create or replace table t1 (x23 int) with system versioning;
+create or replace table t0(
+y int,
+st timestamp(6) as row start,
+en timestamp(6) as row end,
+period for system_time (st, en)
+) with system versioning;
+## For non-versioned table:
+### 1. invisible fields are not included
+create or replace table t2 as select * from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x23` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
+### 2. all visible fields are included
+create or replace table t3 as select * from t0;
+select * from t0;
+y st en
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `y` int(11) DEFAULT NULL,
+ `st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
+## For versioned table
+insert into t1 values (1);
+select row_start from t1 into @row_start;
+insert into t0 (y) values (2);
+select st from t0 into @st;
+create or replace table t2 with system versioning as select * from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x23` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+#### invisible fields are not copied
+select * from t2;
+x23
+1
+select * from t2 where row_start <= @row_start;
+x23
+### 2. source table with visible system fields, target with invisible
+create or replace table t3 with system versioning as select * from t0;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `y` int(11) DEFAULT NULL,
+ `st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t3 where y > 2;
+y st en
+select y from t3 where st = @st and row_start > @st;
+y
+2
+### 3. source and target table with visible system fields
+create or replace table t3 (
+st timestamp(6) as row start invisible,
+en timestamp(6) as row end invisible,
+period for system_time (st, en)
+) with system versioning as select * from t0;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `y` int(11) DEFAULT NULL,
+ `st` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `en` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`st`, `en`)
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select y from t3;
+y
+2
+select y from t3 where st = @st;
+y
+### 4. system fields not or wrongly selected
+create or replace table t3 with system versioning select x23 from t1;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `x23` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t3;
+x23
+1
+create or replace table t3 with system versioning select x23, row_start from t1;
+ERROR 42S21: Duplicate column name 'row_start'
+create or replace table t3 with system versioning select x23, row_end from t1;
+ERROR 42S21: Duplicate column name 'row_end'
+# Prepare checking for historical row
+delete from t1;
+select row_end from t1 for system_time all into @row_end;
+delete from t0;
+select en from t0 for system_time all into @en;
+## Combinations of versioned + non-versioned
+create or replace table t2 (y int);
+insert into t2 values (3);
+create or replace table t3 with system versioning select * from t1 for system_time all, t2;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `x23` int(11) DEFAULT NULL,
+ `y` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from t3 for system_time all;
+x23 y
+1 3
+select * from t3 for system_time all where row_start = @row_start and row_end = @row_end;
+x23 y
+create or replace table t2 like t0;
+insert into t2 (y) values (1), (2);
+delete from t2 where y = 2;
+create or replace table t3 select * from t2 for system_time all;
+select st, en from t3 where y = 1 into @st, @en;
+select y from t2 for system_time all where st = @st and en = @en;
+y
+1
+select st, en from t3 where y = 2 into @st, @en;
+select y from t2 for system_time all where st = @st and en = @en;
+y
+2
+## Default engine detection
+create or replace table t1 (x25 int) with system versioning engine NON_DEFAULT_ENGINE;
+create or replace table t2
+as select x25, row_start, row_end from t1 for system_time all;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x25` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
+create or replace table t2 with system versioning
+as select x25, row_start rs, row_end re from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x25` int(11) DEFAULT NULL,
+ `rs` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `re` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+x26 int,
+st bigint unsigned as row start,
+en bigint unsigned as row end,
+period for system_time (st, en)
+) with system versioning engine innodb;
+create or replace table t2 with system versioning engine myisam
+as select * from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x26` int(11) DEFAULT NULL,
+ `st` bigint(20) unsigned NOT NULL DEFAULT 0,
+ `en` bigint(20) unsigned NOT NULL DEFAULT 0
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (x27 int, id int) with system versioning engine NON_DEFAULT_ENGINE;
+create or replace table t2 (b int, id int);
+create or replace table t3 with system versioning
+as select t2.b, t1.x27, t1.row_start rs, t1.row_end re from t2 inner join t1 on t2.id=t1.id;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `b` int(11) DEFAULT NULL,
+ `x27` int(11) DEFAULT NULL,
+ `rs` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `re` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+## Errors
+create or replace temporary table t (x28 int) with system versioning;
+ERROR HY000: TEMPORARY tables do not support system versioning
+create or replace table t1 (
+x29 int unsigned,
+Sys_start0 timestamp(6) as row start invisible,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+ERROR HY000: Duplicate ROW START column `Sys_start`
+create or replace table t1 (
+x29 int unsigned,
+Sys_end0 timestamp(6) as row end invisible,
+Sys_start timestamp(6) as row start invisible,
+Sys_end timestamp(6) as row end invisible,
+period for system_time (Sys_start, Sys_end)
+) with system versioning;
+ERROR HY000: Duplicate ROW END column `Sys_end`
+## System fields detection
+create or replace table t1 (x30 int) with system versioning;
+create or replace table t2 (
+y int,
+st timestamp(6) as row start invisible,
+en timestamp(6) as row end invisible,
+period for system_time (st, en)
+) with system versioning;
+create or replace table t3
+as select x30, y, row_start, row_end, st, en from t1, t2;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `x30` int(11) DEFAULT NULL,
+ `y` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
+create or replace table t3 (
+y int,
+st timestamp(6) as row start invisible,
+en timestamp(6) as row end invisible,
+period for system_time (st, en)
+) with system versioning
+as select x30, y, row_start, row_end, st, en from t1, t2;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `x30` int(11) DEFAULT NULL,
+ `y` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
+ `st` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `en` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`st`, `en`)
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+# MDEV-14828 Server crashes in JOIN::prepare / setup_fields on 2nd execution of PS [#437]
+create or replace table t1 (x int) with system versioning;
+prepare bad from 'create or replace table t2 with system versioning as select * from t1';
+execute bad;
+execute bad;
+execute bad;
+execute bad;
+execute bad;
+execute bad;
+execute bad;
+execute bad;
+# bad is good.
+# MDEV-15413 Unexpected errors upon CREATE TABLE .. WITH SYSTEM VERSIONING AS SELECT ...
+create or replace table t1 with system versioning as select 1 as i;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (i int) with system versioning as select 1 as i;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create or replace table t1 (
+a int,
+row_start bigint as row start,
+row_end bigint as row end,
+period for system_time (row_start, row_end)
+) engine=innodb with system versioning;
+ERROR HY000: `row_start` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`
+create or replace table t1 (
+a int,
+row_start bigint as row start,
+row_end bigint as row end,
+period for system_time (row_start, row_end)
+) engine=myisam with system versioning;
+ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1`
+create table t (
+a int,
+row_start datetime(6) generated always as row start,
+row_end datetime(6) generated always as row end,
+period for system_time(row_start, row_end)
+) with system versioning;
+ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t`
+# MDEV-16490 It's possible to make a system versioned table without any versioning field
+create or replace table t1 (x int without system versioning)
+with system versioning
+select 1 as y;
+create or replace table t1 (x int without system versioning)
+with system versioning
+select 1 as x;
+ERROR HY000: Table `t1` must have at least one versioned column
+drop tables t0, t1, t2, t3;
diff --git a/mysql-test/suite/versioning/r/cte.result b/mysql-test/suite/versioning/r/cte.result
new file mode 100644
index 00000000000..e35ab3e84d6
--- /dev/null
+++ b/mysql-test/suite/versioning/r/cte.result
@@ -0,0 +1,314 @@
+set time_zone="+00:00";
+set default_storage_engine=innodb;
+create or replace table dept (
+dept_id int(10) primary key,
+name varchar(100)
+) with system versioning;
+create or replace table emp (
+emp_id int(10) primary key,
+dept_id int(10) not null,
+name varchar(100) not null,
+mgr int(10),
+salary int(10) not null,
+constraint `dept-emp-fk`
+ foreign key (dept_id) references dept (dept_id)
+on delete cascade
+on update restrict,
+constraint `mgr-fk`
+ foreign key (mgr) references emp (emp_id)
+on delete restrict
+on update restrict
+) with system versioning;
+insert into dept (dept_id, name) values (10, "accounting");
+insert into emp (emp_id, name, salary, dept_id, mgr) values
+(1, "bill", 1000, 10, null),
+(20, "john", 500, 10, 1),
+(30, "jane", 750, 10,1 );
+select row_start into @ts_1 from emp where name="jane";
+update emp set mgr=30 where name ="john";
+explain extended
+with ancestors as (
+select e.emp_id, e.name, e.mgr, e.salary from emp as e where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary from emp as e
+) select * from ancestors for system_time as of @ts_1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 8 100.00
+2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
+3 UNION e ALL NULL NULL NULL NULL 4 100.00 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` where `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
+select row_start into @ts_2 from emp where name="john";
+explain extended /* All report to 'Bill' */
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp for system_time as of timestamp @ts_1 as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp for system_time as of timestamp @ts_1 as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 100.00
+2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
+3 RECURSIVE UNION e ALL mgr-fk NULL NULL NULL 4 100.00 Using where
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 2 100.00
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
+/* All report to 'Bill' */
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp for system_time as of timestamp @ts_1 as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp for system_time as of timestamp @ts_1 as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors;
+emp_id name mgr salary
+1 bill NULL 1000
+20 john 1 500
+30 jane 1 750
+explain extended with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of timestamp @ts_1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 100.00
+2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
+3 RECURSIVE UNION e ALL mgr-fk NULL NULL NULL 4 100.00 Using where
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 2 100.00
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of timestamp @ts_1;
+emp_id name mgr salary
+1 bill NULL 1000
+20 john 1 500
+30 jane 1 750
+explain extended with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select name from emp where emp_id in (select emp_id from ancestors for system_time as of timestamp @ts_1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY emp ALL PRIMARY NULL NULL NULL 4 75.00 Using where
+1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
+4 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 4 100.00
+2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
+3 RECURSIVE UNION e ALL mgr-fk NULL NULL NULL 4 100.00 Using where
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 2 100.00
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME ALL `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `test`.`emp`.`name` AS `name` from `test`.`emp` FOR SYSTEM_TIME ALL semi join (`ancestors`) where `test`.`emp`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999'
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select name from emp where emp_id in (select emp_id from ancestors for system_time as of timestamp @ts_1);
+name
+bill
+john
+jane
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2,
+ancestors for system_time as of @ts_2 a2;
+emp_id name mgr salary emp_id name mgr salary
+1 bill NULL 1000 1 bill NULL 1000
+30 jane 1 750 1 bill NULL 1000
+20 john 30 500 1 bill NULL 1000
+1 bill NULL 1000 30 jane 1 750
+30 jane 1 750 30 jane 1 750
+20 john 30 500 30 jane 1 750
+1 bill NULL 1000 20 john 30 500
+30 jane 1 750 20 john 30 500
+20 john 30 500 20 john 30 500
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2,
+ancestors for system_time as of now() a2;
+ERROR HY000: Conflicting FOR SYSTEM_TIME clauses in WITH RECURSIVE
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors,
+ancestors for system_time as of @ts_2 a2;
+ERROR HY000: Conflicting FOR SYSTEM_TIME clauses in WITH RECURSIVE
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2,
+ancestors a2;
+ERROR HY000: Conflicting FOR SYSTEM_TIME clauses in WITH RECURSIVE
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e
+where name = 'bill'
+ union
+select e.emp_id, e.name, e.mgr, e.salary
+from emp as e,
+ancestors as a
+where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2
+where emp_id in (select * from ancestors);
+ERROR HY000: Conflicting FOR SYSTEM_TIME clauses in WITH RECURSIVE
+# SYSTEM_TIME to internal recursive instance is prohibited
+with recursive cte as
+(
+select * from emp
+union all
+select * from cte for system_time as of @ts_1
+)
+select * from cte;
+ERROR HY000: Table `cte` is not system-versioned
+create or replace table emp ( emp_id int, name varchar(127), mgr int) with system versioning;
+create or replace table addr ( emp_id int, address varchar(100)) with system versioning;
+insert emp values (1, 'bill', 0), (2, 'bill', 1), (3, 'kate', 1);
+insert addr values (1, 'Moscow'), (2, 'New York'), (3, 'London');
+set @ts=now(6);
+delete from emp;
+delete from addr;
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr
+from emp for system_time as of timestamp @ts as e
+where name = 'bill'
+ union
+select ee.emp_id, ee.name, ee.mgr
+from emp for system_time as of timestamp @ts as ee, ancestors as a
+where ee.mgr = a.emp_id
+)
+select * from ancestors;
+emp_id name mgr
+1 bill 0
+2 bill 1
+3 kate 1
+insert emp values (4, 'john', 1);
+insert addr values (4, 'Paris');
+with ancestors as (select * from emp natural join addr) select * from ancestors;
+emp_id name mgr address
+4 john 1 Paris
+with ancestors as (select * from emp natural join addr) select * from ancestors for system_time all;
+emp_id name mgr address
+1 bill 0 Moscow
+2 bill 1 New York
+3 kate 1 London
+4 john 1 Paris
+with ancestors as (select * from (select * from emp natural join addr) for system_time all as t) select * from ancestors;
+emp_id name mgr address
+1 bill 0 Moscow
+2 bill 1 New York
+3 kate 1 London
+4 john 1 Paris
+select * from (select * from emp natural join addr) for system_time all as t;
+emp_id name mgr address
+1 bill 0 Moscow
+2 bill 1 New York
+3 kate 1 London
+4 john 1 Paris
+drop table emp;
+drop table dept;
+drop table addr;
diff --git a/mysql-test/suite/versioning/r/debug.result b/mysql-test/suite/versioning/r/debug.result
new file mode 100644
index 00000000000..72bd1f18a68
--- /dev/null
+++ b/mysql-test/suite/versioning/r/debug.result
@@ -0,0 +1,54 @@
+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
+create temporary table tt1 (a int) with system versioning;
+ERROR HY000: TEMPORARY tables do not support system versioning
+set @old_dbug=@@global.debug_dbug;
+set global debug_dbug='+d,sysvers_force';
+create table t2 (a int);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create temporary table tt2 (a int) with system versioning;
+show create table tt2;
+Table Create Table
+tt2 CREATE TEMPORARY TABLE `tt2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connect con1, localhost, root;
+create table t3 (a int);
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create temporary table tt3 (a int) with system versioning;
+show create table tt3;
+Table Create Table
+tt3 CREATE TEMPORARY TABLE `tt3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+disconnect con1;
+connection default;
+set debug_dbug='+d,sysvers_show';
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+create table t4 (a int);
+show create table t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `a` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+set global debug_dbug=@old_dbug;
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/suite/versioning/r/delete.result b/mysql-test/suite/versioning/r/delete.result
new file mode 100644
index 00000000000..5aa239b9cb8
--- /dev/null
+++ b/mysql-test/suite/versioning/r/delete.result
@@ -0,0 +1,132 @@
+# Basic + delete from view
+create or replace table t1(
+XNo int unsigned,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+insert into t1(XNo) values(0);
+insert into t1(XNo) values(1);
+insert into t1(XNo) values(2);
+insert into t1(XNo) values(3);
+insert into t1(XNo) values(4);
+insert into t1(XNo) values(5);
+insert into t1(XNo) values(6);
+insert into t1(XNo) values(7);
+insert into t1(XNo) values(8);
+insert into t1(XNo) values(9);
+select XNo, sys_end < MAXVAL from t1 for system_time all;
+XNo sys_end < MAXVAL
+0 0
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+delete from t1 where XNo = 0;
+delete from t1 where XNo = 1;
+delete from t1 where XNo > 5;
+create view vt1 as select XNo from t1;
+select XNo as XNo_vt1 from vt1;
+XNo_vt1
+2
+3
+4
+5
+delete from vt1 where XNo = 3;
+select XNo as XNo_vt1 from vt1;
+XNo_vt1
+2
+4
+5
+drop view vt1;
+drop table t1;
+# Check sys_start, sys_end
+create or replace table t1(
+x int,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+insert into t1(x) values (1);
+select sys_start into @sys_start from t1;
+delete from t1;
+select * from t1;
+x
+select x = 1 as A, sys_start = @sys_start as B, sys_end > sys_start as C from t1 for system_time all;
+A B C
+1 1 1
+drop table t1;
+# Multi-delete
+create or replace table t1(
+x int,
+y int,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+create or replace table t2 like t1;
+insert into t1(x, y) values (1, 1), (2, 2), (3, 3), (14, 4);
+insert into t2(x, y) values (11, 1), (12, 2), (13, 32), (14, 4);
+delete t1, t2 from t1 join t2 where t1.y = 3 and t2.y = 32;
+select x as t1_x from t1;
+t1_x
+1
+2
+14
+select x as t2_x from t2;
+t2_x
+11
+12
+14
+delete t1, t2 from t1 join t2 where t1.x = t2.x;
+select x as t1_x from t1;
+t1_x
+1
+2
+select x as t2_x from t2;
+t2_x
+11
+12
+select x as t1_x_all from t1 for system_time all;
+t1_x_all
+1
+2
+3
+14
+select x as t2_x_all from t2 for system_time all;
+t2_x_all
+11
+12
+13
+14
+drop table t1;
+drop table t2;
+# Update + delete
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+update t1 set x= 2;
+delete from t1;
+select x from t1 for system_time all;
+x
+2
+1
+drop table t1;
+#
+# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+#
+create or replace table t1 (a int) with system versioning;
+replace into t1 values (1), (2);
+create or replace trigger tr before delete on t1 for each row delete from xx;
+create or replace procedure pr() delete from t1;
+call pr;
+ERROR 42S02: Table 'test.xx' doesn't exist
+call pr;
+ERROR 42S02: Table 'test.xx' doesn't exist
+drop procedure pr;
+drop trigger tr;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/delete_history.result b/mysql-test/suite/versioning/r/delete_history.result
new file mode 100644
index 00000000000..93f240272c1
--- /dev/null
+++ b/mysql-test/suite/versioning/r/delete_history.result
@@ -0,0 +1,131 @@
+create table t (a int);
+delete history from t before system_time now();
+ERROR HY000: Table `t` is not system-versioned
+create or replace table t (
+a int,
+row_start SYS_TYPE as row start invisible,
+row_end SYS_TYPE as row end invisible,
+period for system_time (row_start, row_end))
+with system versioning;
+insert into t values (1);
+update t set a=2;
+set @test = 'correct';
+create trigger trg_before before delete on t for each row set @test = 'incorrect';
+create trigger trg_after after delete on t for each row set @test = 'incorrect';
+delete history from t;
+select @test from t;
+@test
+correct
+drop table t;
+create or replace table t (
+a int,
+row_start SYS_TYPE as row start invisible,
+row_end SYS_TYPE as row end invisible,
+period for system_time (row_start, row_end))
+with system versioning;
+insert into t values (1), (2);
+update t set a=11 where a=1;
+set @ts1=now(6);
+update t set a=22 where a=2;
+select * from t for system_time all;
+a
+11
+22
+1
+2
+delete history from t before system_time timestamp @ts1;
+select * from t for system_time all;
+a
+11
+22
+2
+prepare stmt from 'delete history from t';
+execute stmt;
+drop prepare stmt;
+select * from t for system_time all;
+a
+11
+22
+delete from t;
+create or replace procedure truncate_sp()
+begin
+delete history from t before system_time timestamp now(6);
+end~~
+call truncate_sp;
+select * from t for system_time all;
+a
+drop procedure truncate_sp;
+# Truncate partitioned
+create or replace table t (a int)
+with system versioning
+partition by system_time limit 1 (
+partition p0 history,
+partition p1 history,
+partition pn current);
+insert into t values (1);
+update t set a= 2;
+update t set a= 3;
+delete history from t;
+select * from t for system_time all;
+a
+3
+# VIEW
+create or replace table t (
+i int,
+row_start SYS_TYPE as row start invisible,
+row_end SYS_TYPE as row end invisible,
+period for system_time (row_start, row_end))
+with system versioning;
+delete history from t;
+create or replace view v as select * from t;
+delete history from v;
+ERROR 42S02: 'v' is a view
+create or replace table t (i int);
+delete history from t;
+ERROR HY000: Table `t` is not system-versioned
+create or replace view v as select * from t;
+delete history from v;
+ERROR 42S02: 'v' is a view
+prepare stmt from 'delete history from t';
+ERROR HY000: Table `t` is not system-versioned
+drop table t;
+drop view v;
+create or replace table t (i int);
+create or replace view v as select * from t;
+drop table v;
+ERROR 42S02: 'test.v' is a view
+lock table v write;
+delete history from v before system_time now(6);
+ERROR 42S02: 'v' is a view
+unlock tables;
+drop view v;
+drop table t;
+create table t1 (i int) with system versioning;
+create procedure pr() delete history from t1 before system_time now();
+call pr;
+call pr;
+drop procedure pr;
+drop table t1;
+#
+# MDEV-19814 Assertion `update->n_fields < ulint(table->n_cols + table->n_v_cols)' on DELETE HISTORY
+#
+create or replace table t1 (
+f varchar(1),
+row_start SYS_TYPE as row start,
+row_end SYS_TYPE as row end,
+period for system_time (row_start, row_end))
+with system versioning;
+insert into t1 (f) values ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h');
+delete from t1;
+delete history from t1;
+drop table t1;
+#
+# MDEV-20186 Wrong result or Assertion on INSERT after DELETE HISTORY
+#
+create or replace table t1 (a int check (a > 0)) with system versioning;
+delete history from t1;
+insert into t1 values (1);
+select * from t1;
+a
+1
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/derived.result b/mysql-test/suite/versioning/r/derived.result
new file mode 100644
index 00000000000..5b8eee4ab4a
--- /dev/null
+++ b/mysql-test/suite/versioning/r/derived.result
@@ -0,0 +1,295 @@
+create table emp
+(
+emp_id int,
+name varchar(127),
+mgr int
+) with system versioning;
+insert into emp values (1, 'bill', 0),
+(2, 'bill', 1),
+(3, 'kate', 1);
+set @ts=now(6);
+delete from emp;
+insert into emp values (4, 'john', 1);
+with ancestors as (select * from emp) select * from ancestors;
+emp_id name mgr
+4 john 1
+set @tmp= "with ancestors as (select * from emp) select * from ancestors";
+prepare stmt from @tmp;
+execute stmt;
+emp_id name mgr
+4 john 1
+drop prepare stmt;
+with ancestors as (select * from emp for system_time all) select * from ancestors;
+emp_id name mgr
+1 bill 0
+2 bill 1
+3 kate 1
+4 john 1
+set @tmp= "with ancestors as (select * from emp for system_time all) select * from ancestors";
+prepare stmt from @tmp;
+execute stmt;
+emp_id name mgr
+1 bill 0
+2 bill 1
+3 kate 1
+4 john 1
+drop prepare stmt;
+with recursive ancestors as (select * from emp) select * from ancestors;
+emp_id name mgr
+4 john 1
+set @tmp= "with recursive ancestors as (select * from emp) select * from ancestors";
+prepare stmt from @tmp;
+execute stmt;
+emp_id name mgr
+4 john 1
+drop prepare stmt;
+select emp_id from (select emp_id from emp where row_end>'2031-1-1') as tmp;
+emp_id
+4
+set @tmp= "select emp_id from (select emp_id from emp where row_end>'2031-1-1') as tmp";
+prepare stmt from @tmp;
+execute stmt;
+emp_id
+4
+drop prepare stmt;
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr
+from emp as e
+where name = 'john'
+ union
+select ee.emp_id, ee.name, ee.mgr
+from emp as ee, ancestors as a
+where ee.mgr = a.emp_id
+)
+select * from ancestors;
+emp_id name mgr
+4 john 1
+set @tmp= "
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp as e
+ where name = 'john'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp as ee, ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors";
+prepare stmt from @tmp;
+execute stmt;
+emp_id name mgr
+4 john 1
+drop prepare stmt;
+with recursive
+ancestors
+as
+(
+select e.emp_id, e.name, e.mgr
+from emp for system_time as of timestamp @ts as e
+where name = 'bill'
+ union
+select ee.emp_id, ee.name, ee.mgr
+from emp for system_time as of timestamp @ts as ee,
+ancestors as a
+where ee.mgr = a.emp_id
+)
+select * from ancestors;
+emp_id name mgr
+1 bill 0
+2 bill 1
+3 kate 1
+set @tmp= "
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp for system_time as of timestamp @ts as e
+ where name = 'bill'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp for system_time as of timestamp @ts as ee,
+ ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors";
+prepare stmt from @tmp;
+execute stmt;
+emp_id name mgr
+1 bill 0
+2 bill 1
+3 kate 1
+drop prepare stmt;
+drop table emp;
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int) with system versioning;
+insert into t1 values (1);
+set @t0= now(6);
+delete from t1;
+insert into t1 values (2);
+insert into t2 values (10);
+select * from (select *, t1.row_end, t1.row_end as endo from t1) as s0;
+x row_end endo
+2 # #
+select * from (select *, t1.row_end, t2.row_start from t1, t2) as s0;
+x y row_end row_start
+2 10 # #
+# SYSTEM_TIME propagation from inner to outer
+select * from (select * from t1 for system_time as of timestamp @t0, t2) as s0;
+x y
+1 10
+with s1 as (select * from t1 for system_time as of timestamp @t0, t2) select * from s1;
+x y
+1 10
+# leading table selection
+select * from (select *, t1.row_end from t2, t1 for system_time as of timestamp @t0) as s2;
+y x row_end
+10 1 #
+with s3 as (select *, t1.row_end from t2, t1 for system_time as of timestamp @t0) select * from s3;
+y x row_end
+10 1 #
+### VIEW instead of t1
+set @q= concat("create view vt1 as select * from t1 for system_time as of timestamp '", @t0, "'");
+prepare q from @q;
+execute q;
+drop prepare q;
+create view vt2 as select * from t1;
+# SYSTEM_TIME propagation from view
+select * from vt1;
+x
+1
+# SYSTEM_TIME propagation from inner to outer
+select * from (select * from vt1, t2) as s0;
+x y
+1 10
+### SYSTEM_TIME clash
+select * from (select * from t1 for system_time all) for system_time all as dt0;
+ERROR HY000: Table `dt0` is not system-versioned
+select * from vt1 for system_time all;
+ERROR HY000: Table `vt1` is not system-versioned
+with dt1 as (select * from t1 for system_time all)
+select * from dt1 for system_time all;
+ERROR HY000: Table `dt1` is not system-versioned
+### UNION
+set @t1= now(6);
+delete from t2;
+insert into t2 values (3);
+# SYSTEM_TIME is not propagated
+select x from t1 union
+select y from t2;
+x
+2
+3
+select x from t1 for system_time as of @t0 union
+select y from t2;
+x
+1
+3
+select x from t1 union
+select y from t2 for system_time as of @t1;
+x
+2
+10
+select x from t1 for system_time as of @t0 union
+select y from t2 for system_time as of @t1;
+x
+1
+10
+# LEFT/RIGHT JOIN
+create or replace table t1 (x int, y int) with system versioning;
+create or replace table t2 (x int, y int) with system versioning;
+insert into t1 values (1, 1), (1, 2), (1, 3), (4, 4), (5, 5);
+insert into t2 values (1, 2), (2, 1), (3, 1);
+## Outer or inner SYSTEM_TIME produces same expression
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+Query A:
+Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t2`.`row_start` <= <cache>(current_timestamp(6)) and `test`.`t1`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t1`.`row_start` <= <cache>(current_timestamp(6))
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+Query B:
+Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t2`.`row_start` <= <cache>(current_timestamp(6)) and `test`.`t1`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t1`.`row_start` <= <cache>(current_timestamp(6))
+Fine result: queries A and B are equal.
+## LEFT JOIN: t1, t2 versioned
+select * from (
+select t1.x as LJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2
+from t1 left join t2 on t1.x = t2.x)
+as derived;
+LJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+alter table t2 drop system versioning;
+## LEFT JOIN: t1 versioned
+select * from (
+select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2
+from t1 left join t2 on t1.x = t2.x)
+as derived;
+LJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+alter table t1 drop system versioning;
+alter table t2 add system versioning;
+## LEFT JOIN: t2 versioned
+select * from (
+select t1.x as LJ3_x1, t1.y as y1, t2.x as x2, t2.y as y2
+from t1 left join t2 on t1.x = t2.x)
+as derived;
+LJ3_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+alter table t1 add system versioning;
+## RIGHT JOIN: t1, t2 versioned
+select * from (
+select t1.x as RJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2
+from t1 right join t2 on t1.x = t2.x)
+as derived;
+RJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+alter table t2 drop system versioning;
+## RIGHT JOIN: t1 versioned
+select * from (
+select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2
+from t1 right join t2 on t1.x = t2.x)
+as derived;
+RJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+alter table t1 drop system versioning;
+alter table t2 add system versioning;
+## RIGHT JOIN: t2 versioned
+select * from (
+select t1.x as RJ3_x1, t1.y as y1, t2.x as x2, t2.y as y2
+from t1 right join t2 on t1.x = t2.x)
+as derived;
+RJ3_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+drop table t1, t2;
+drop view vt1, vt2;
diff --git a/mysql-test/suite/versioning/r/foreign.result b/mysql-test/suite/versioning/r/foreign.result
new file mode 100644
index 00000000000..32b5e5cf3d8
--- /dev/null
+++ b/mysql-test/suite/versioning/r/foreign.result
@@ -0,0 +1,429 @@
+#################
+# Test RESTRICT #
+#################
+create table parent(
+id int,
+KEY_TYPE (id)
+) engine innodb;
+create table child(
+parent_id int,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end),
+foreign key(parent_id) references parent(id)
+on delete restrict
+on update restrict
+) engine innodb with system versioning;
+insert into parent values(1);
+insert into child values(1);
+delete from parent where id = 1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+delete from child where parent_id = 1;
+delete from parent where id = 1;
+insert into parent values(1);
+insert into child values(1);
+update parent set id=id+1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+delete from child;
+update parent set id=id+1;
+select * from child for system_time all;
+parent_id
+1
+1
+drop table child;
+drop table parent;
+##############################################
+# Test when clustered index is a foreign key #
+##############################################
+create table parent(
+id int(10) unsigned,
+KEY_TYPE (id)
+) engine innodb;
+create table child(
+parent_id int(10) unsigned primary key,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end),
+foreign key(parent_id) references parent(id)
+) engine innodb with system versioning;
+insert into parent values(1);
+insert into child values(1);
+delete from parent where id = 1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+drop table child;
+drop table parent;
+################
+# Test CASCADE #
+################
+create table parent(
+id int,
+KEY_TYPE (id)
+) engine innodb;
+create table child(
+parent_id int,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end),
+foreign key(parent_id) references parent(id)
+on delete cascade
+on update cascade
+) engine innodb with system versioning;
+insert into parent values(1);
+insert into child values(1);
+delete from parent where id = 1;
+select * from child;
+parent_id
+select * from child for system_time all;
+parent_id
+1
+insert into parent values(1);
+insert into child values(1);
+update parent set id = id + 1;
+select * from child;
+parent_id
+2
+select * from child for system_time all;
+parent_id
+1
+1
+2
+drop table child;
+drop table parent;
+create or replace table parent (
+id int,
+KEY_TYPE(id),
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end)
+) with system versioning
+engine innodb;
+create or replace table child (
+x int,
+parent_id int not null,
+constraint `parent-fk`
+ foreign key (parent_id) references parent (id)
+on delete cascade
+on update restrict
+)
+engine innodb;
+insert into parent (id) values (2);
+insert into child (x, parent_id) values (2, 2);
+delete from parent;
+select * from child;
+x parent_id
+drop table child;
+drop table parent;
+create or replace table parent (
+id int,
+KEY_TYPE(id)
+)
+engine innodb;
+create or replace table child (
+id int primary key,
+parent_id int not null,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end),
+constraint `parent-fk`
+ foreign key (parent_id) references parent (id)
+on delete cascade
+on update restrict
+) with system versioning
+engine innodb;
+insert into parent (id) values (3);
+insert into child (id, parent_id) values (3, 3);
+delete from parent;
+select * from child;
+id parent_id
+select *, check_row(row_start, row_end) from child for system_time all;
+id parent_id check_row(row_start, row_end)
+3 3 HISTORICAL ROW
+drop table child;
+drop table parent;
+#################
+# Test SET NULL #
+#################
+create table parent(
+id int,
+KEY_TYPE (id)
+) engine innodb;
+create or replace table child(
+parent_id int,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end),
+foreign key(parent_id) references parent(id)
+on delete set null
+on update set null
+) engine innodb with system versioning;
+insert into parent values(1);
+insert into child values(1);
+delete from child;
+insert into child values(1);
+delete from parent where id = 1;
+select * from child;
+parent_id
+NULL
+select *, current_row(sys_end) as current_row from child for system_time all order by sys_end;
+parent_id current_row
+1 0
+1 0
+NULL 1
+delete from child;
+insert into parent values(1);
+insert into child values(1);
+update parent set id= id + 1;
+select * from child;
+parent_id
+NULL
+select *, current_row(sys_end) as current_row from child for system_time all order by sys_end;
+parent_id current_row
+1 0
+1 0
+NULL 0
+1 0
+NULL 1
+drop table child;
+drop table parent;
+###########################
+# Parent table is foreign #
+###########################
+create or replace table parent(
+id int,
+KEY_TYPE (id),
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end)
+) engine innodb with system versioning;
+create or replace table child(
+parent_id int,
+foreign key(parent_id) references parent(id)
+) engine innodb;
+insert into parent values(1);
+insert into child values(1);
+delete from parent;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+update parent set id=2;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+delete from child;
+delete from parent;
+insert into child values(1);
+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`))
+insert into parent values(1);
+insert into child values(1);
+delete from parent;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+update parent set id=2;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
+drop table child;
+drop table parent;
+###################
+# crash on DELETE #
+###################
+create or replace table a (
+cola int(10),
+KEY_TYPE (cola),
+v_cola int(10) as (cola mod 10) virtual,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end)
+) engine=innodb with system versioning;
+create index v_cola on a (v_cola);
+create or replace table b(
+cola int(10),
+v_cola int(10),
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end)
+) engine=innodb with system versioning;
+alter table b add constraint `v_cola_fk`
+foreign key (v_cola) references a (v_cola);
+insert into a(cola) values (12);
+insert into b(cola, v_cola) values (10,2);
+delete from a;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`b`, CONSTRAINT `v_cola_fk` FOREIGN KEY (`v_cola`) REFERENCES `a` (`v_cola`))
+drop table b, a;
+###############################################
+# CASCADE UPDATE foreign not system versioned #
+###############################################
+create or replace table parent (
+id smallint unsigned not null auto_increment,
+value int unsigned not null,
+primary key (id, value)
+) engine = innodb;
+create or replace table child (
+id mediumint unsigned not null auto_increment primary key,
+parent_id smallint unsigned not null,
+parent_value int unsigned not null,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time(sys_start, sys_end),
+constraint `fk_child_parent`
+ foreign key (parent_id, parent_value) references parent (id, value)
+on delete cascade
+on update cascade
+) engine = innodb with system versioning;
+create or replace table subchild (
+id int not null auto_increment primary key,
+parent_id smallint unsigned not null,
+parent_value int unsigned not null,
+constraint `fk_subchild_child_parent`
+ foreign key (parent_id, parent_value) references child (parent_id, parent_value)
+on delete cascade
+on update cascade
+) engine=innodb;
+insert into parent (value) values (23);
+select id, value from parent into @id, @value;
+insert into child values (default, @id, @value);
+insert into subchild values (default, @id, @value);
+select parent_id from subchild;
+parent_id
+1
+update parent set id = 11, value = value + 1;
+select parent_id from subchild;
+parent_id
+11
+select * from child;
+id parent_id parent_value
+1 11 24
+delete from parent;
+select count(*) from child;
+count(*)
+0
+select * from child for system_time all;
+id parent_id parent_value
+1 1 23
+1 11 24
+select count(*) from subchild;
+count(*)
+0
+drop table subchild, child, parent;
+#
+# MDEV-18057 Assertion `(node->state == 5) || (node->state == 6)' failed in row_upd_sec_step upon DELETE after UPDATE failed due to FK violation
+#
+create or replace table t1 (f1 int, key(f1)) engine=innodb;
+create or replace table t2 (f2 int, foreign key (f2) references t1 (f1)) engine=innodb with system versioning;
+set foreign_key_checks= off;
+insert ignore into t2 values (1);
+set foreign_key_checks= on;
+update t2 set f2= 2;
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`))
+delete from t2;
+drop table t2, t1;
+#
+# MDEV-18879 Corrupted record inserted by FOREIGN KEY operation
+#
+SET timestamp = 1;
+SET time_zone='+02:00';
+SELECT now();
+now()
+1970-01-01 02:00:01
+CREATE TABLE t1 (
+pk INT UNSIGNED PRIMARY KEY,
+f1 varchar(255) CHARACTER SET ucs2,
+f2 longtext CHARACTER SET ucs2,
+f3 varchar(255),
+f4 char(255),
+f5 longtext CHARACTER SET ucs2,
+f6 INT UNSIGNED,
+f7 INT UNSIGNED,
+f8 INT UNSIGNED,
+f9 INT UNSIGNED,
+f10 INT UNSIGNED,
+f11 INT UNSIGNED,
+f12 varchar(255) CHARACTER SET ucs2,
+f13 char(255) CHARACTER SET ucs2,
+f14 char(255) CHARACTER SET ucs2,
+f15 varchar(255),
+f16 longtext,
+f17 char(255)
+) ENGINE=InnoDB WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES
+(1, 'a', 'e', 'f', 'a', 'generate', 1, 2, 3, 4, 5, 6, 'main', 'against', 'b', 'u', 'explode', 'tomorrow'),
+(2, REPEAT('a',127), 'f', 'k', 'game', 'g', 2, 3, 4, 5, 6, 7, REPEAT('o',222), 'oven', 'flower', REPEAT('r',120), 'l', 'g'),
+(3, 'weekly', 'x', 'v', 'r', 'c', 3, 4, 5, 6, 7, 8, 'validity', 'y', 'h', 'oxygen', 'venture', 'uncertainty'),
+(4, 'r', 't', REPEAT('b',153), 'modern', 'h', 4, 5, 6, 7, 8, 9, REPEAT('g',128), 'a', 'w', 'f', 'b', 'b'),
+(5, 'h', 'y', REPEAT('v',107), 'knife', 'profession', 5, 6, 7, 8, 9, 0, 'infection', 'u', 'likelihood', REPEAT('n',149), 'folk', 'd'),
+(6, 'g', 'violent', REPEAT('o',28), 'capital', 'p', 6, 7, 8, 9, 0, 1, 'w', 'patron', 'd', 'y', 'originally', 'k'),
+(7, 'k', 'uncomfortable', REPEAT('v',248), 'y', 'link', 7, 8, 9, 0, 1, 2, REPEAT('j',204), 'j', 'statute', 'emphasis', 'u', 'water'),
+(8, 'preparation', 'water', 'suck', 'silver', 'a', 8, 9, 0, 1, 2, 3, 'h', 'q', 'o', 't', 'k', 'y'),
+(9, 'y', 'f', 'e', 'a', 'dawn', 9, 0, 1, 2, 3, 4, 'peak', 'parking', 'b', 't', 'timber', 'c'),
+(10, REPEAT('h',78), 'apologize', 'direct', 'u', 'frankly', 0, 1, 2, 3, 4, 5, 'h', 'exhibit', 'f', 'd', 'effective', 'c'),
+(11, 'i', 'h', 'a', 'y', 'u', 1, 2, 3, 4, 5, 6, 'l', 'b', 'm', 'respond', 'ideological', 'credibility');
+CREATE TABLE t2 (
+pk int primary key,
+f char(255) CHARACTER SET ucs2,
+key(f)
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,'against'),(2,'q');
+SET SQL_MODE= '';
+SET timestamp = 2;
+SELECT * FROM t1 INTO OUTFILE 't1.data';
+SET timestamp = 3;
+UPDATE t1 SET f13 = 'q';
+SET timestamp = 4;
+LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
+Warnings:
+Warning 1265 Data truncated for column 'f12' at row 2
+Warning 1265 Data truncated for column 'f12' at row 4
+Warning 1265 Data truncated for column 'f12' at row 7
+SELECT * FROM t1 INTO OUTFILE 't1.data.2' ;
+SET timestamp = 5;
+LOAD DATA INFILE 't1.data.2' REPLACE INTO TABLE t1;
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 2
+Warning 1265 Data truncated for column 'f12' at row 2
+Warning 1265 Data truncated for column 'f12' at row 4
+Warning 1265 Data truncated for column 'f12' at row 7
+Warning 1265 Data truncated for column 'f1' at row 10
+SELECT * FROM t2 INTO OUTFILE 't2.data';
+SET timestamp = 6;
+LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2;
+SET FOREIGN_KEY_CHECKS = OFF;
+ALTER TABLE t1 ADD FOREIGN KEY (f13) REFERENCES t2 (f) ON DELETE SET NULL;
+SET timestamp = 7;
+LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
+Warnings:
+Warning 1265 Data truncated for column 'f12' at row 2
+Warning 1265 Data truncated for column 'f12' at row 4
+Warning 1265 Data truncated for column 'f12' at row 7
+SET FOREIGN_KEY_CHECKS = ON;
+SET SESSION SQL_MODE= 'NO_BACKSLASH_ESCAPES';
+SET timestamp = 8;
+LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
+Warnings:
+Warning 1265 Data truncated for column 'f12' at row 2
+Warning 1265 Data truncated for column 'f12' at row 4
+Warning 1265 Data truncated for column 'f12' at row 7
+SET timestamp = 9;
+REPLACE INTO t2 SELECT * FROM t2;
+DROP TABLE t1, t2;
+#
+# MDEV-16210 FK constraints on versioned tables use historical rows, which may cause constraint violation
+#
+create or replace table t1 (a int, key(a)) engine innodb with system versioning;
+create or replace table t2 (b int, foreign key (b) references t1(a)) engine innodb;
+insert into t1 values (1),(2);
+insert into t2 values (1);
+# DELETE from referenced table is not allowed
+delete from t1 where a = 1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`))
+drop tables t2, t1;
+#
+# MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 or server crash in row_ins_foreign_report_err upon DELETE from versioned table with FK
+#
+create or replace table t1 (x int primary key) engine innodb;
+create or replace table t2 (x int, foreign key (x) references t1(x)) engine innodb with system versioning;
+set foreign_key_checks= off;
+insert into t2 values (1), (1);
+set foreign_key_checks= on;
+# DELETE from foreign table is allowed
+delete from t2;
+drop tables t2, t1;
+create or replace table t1 (a int, key(a)) engine innodb;
+insert into t1 values (1);
+create or replace table t2 (b int, foreign key (b) references t1(a)) engine innodb with system versioning;
+insert into t2 values (1), (1);
+# DELETE from foreign table is allowed
+delete from t2;
+drop tables t2, t1;
diff --git a/mysql-test/suite/versioning/r/insert.result b/mysql-test/suite/versioning/r/insert.result
new file mode 100644
index 00000000000..01d829d3430
--- /dev/null
+++ b/mysql-test/suite/versioning/r/insert.result
@@ -0,0 +1,112 @@
+create or replace table t1(
+x int unsigned,
+y int unsigned,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+insert into t1(x, y) values(3, 4);
+insert into t1(x, y) values(2, 3);
+insert into t1 values(40, 33);
+select x, y, sys_end < MAXVAL from t1;
+x y sys_end < MAXVAL
+3 4 0
+2 3 0
+40 33 0
+create or replace table t1(
+id int unsigned auto_increment primary key,
+x int unsigned,
+y int unsigned,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+insert into t1(x, y) values(33, 44);
+insert into t1(id, x, y) values(20, 33, 44);
+insert into t1 values(40, 33, 44);
+select id, x, y, sys_end < MAXVAL from t1;
+id x y sys_end < MAXVAL
+1 33 44 0
+20 33 44 0
+40 33 44 0
+create or replace table t1(
+x int unsigned,
+y int unsigned,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+create view vt1_1 as select x, y from t1;
+insert into t1(x, y) values(8001, 9001);
+insert into vt1_1(x, y) values(1001, 2001);
+insert into vt1_1 values(1002, 2002);
+select x, y, sys_end < MAXVAL from t1;
+x y sys_end < MAXVAL
+8001 9001 0
+1001 2001 0
+1002 2002 0
+select x, y from vt1_1;
+x y
+8001 9001
+1001 2001
+1002 2002
+drop view vt1_1;
+create or replace table t1( id bigint primary key, a int, b int) with system versioning;
+insert into t1 values(1, 1, 1);
+select row_start, row_end from t1 into @sys_start, @sys_end;
+select id, a, b from t1;
+id a b
+1 1 1
+insert into t1 values(2, 2, 2);
+select id, a, b, row_start > @sys_start as C, row_end = @sys_end as D from t1 where id = 2;
+id a b C D
+2 2 2 1 1
+drop table t1;
+create or replace table t1(
+x int unsigned,
+y int unsigned,
+sys_start SYS_DATATYPE as row start invisible,
+sys_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning;
+create or replace table t2 like t1;
+insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
+delete from t1 where x >= 1;
+insert into t1(x, y) values (1, 1001), (2, 2001), (3, 3001), (4, 4001), (5, 5001), (6, 6001);
+insert into t1(x, y, sys_start) values (7, 7001, DEFAULT);
+insert into t1(x, y, sys_end) values (8, 8001, DEFAULT);
+insert into t1(x, y, sys_start, sys_end) values (9, 9001, DEFAULT, DEFAULT);
+insert into t2 select x, y from t1 for system_time all;
+select x, y from t1;
+x y
+1 1001
+2 2001
+3 3001
+4 4001
+5 5001
+6 6001
+7 7001
+8 8001
+9 9001
+select x, y from t2;
+x y
+1 1000
+2 2000
+3 3000
+4 4000
+5 5000
+6 6000
+7 7000
+8 8000
+9 9000
+1 1001
+2 2001
+3 3001
+4 4001
+5 5001
+6 6001
+7 7001
+8 8001
+9 9001
+drop table t1;
+drop table t2;
diff --git a/mysql-test/suite/versioning/r/insert2.result b/mysql-test/suite/versioning/r/insert2.result
new file mode 100644
index 00000000000..f5c7b411cdf
--- /dev/null
+++ b/mysql-test/suite/versioning/r/insert2.result
@@ -0,0 +1,86 @@
+create table t1(
+x int unsigned,
+sys_start bigint unsigned as row start invisible,
+sys_end bigint unsigned as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning engine=innodb;
+create table t2(x int unsigned) engine=innodb;
+start transaction;
+insert into t1(x) values(1);
+commit;
+start transaction;
+insert into t2(x) values(1);
+savepoint a;
+insert into t1(x) values(1);
+rollback to a;
+commit;
+insert into t2(x) values (1);
+create or replace table t1 (
+x int,
+y int as (x) virtual,
+sys_trx_start bigint unsigned as row start invisible,
+sys_trx_end bigint unsigned as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end)
+) engine=innodb with system versioning;
+insert into t1 values (1, null);
+update t1 set x= x + 1;
+select x, y, sys_trx_end = 18446744073709551615 as current from t1 for system_time all;
+x y current
+2 2 1
+1 1 0
+create or replace table t1 (
+x int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1), (2);
+insert into t1 (row_start) select row_end from t1;
+ERROR HY000: The value specified for generated column 'row_start' in table 't1' has been ignored
+set sql_mode='';
+insert into t1 (row_start, row_end) values (DEFAULT, 1);
+Warnings:
+Warning 1906 The value specified for generated column 'row_end' in table 't1' has been ignored
+set sql_mode=default;
+select @@sql_mode into @saved_mode;
+set sql_mode= '';
+insert into t1 (x, row_start, row_end) values (3, 4, 5);
+Warnings:
+Warning 1906 The value specified for generated column 'row_start' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'row_end' in table 't1' has been ignored
+set sql_mode= @saved_mode;
+insert into t1 (row_start, row_end) values (DEFAULT, DEFAULT);
+select * from t1;
+x
+1
+2
+NULL
+3
+NULL
+# MDEV-14792 INSERT without column list into table with explicit versioning columns produces bad data
+create or replace table t1 (
+i int,
+s timestamp(6) as row start,
+e timestamp(6) as row end,
+c varchar(8),
+period for system_time(s, e))
+with system versioning;
+insert into t1 values (1, null, null, 'foo');
+select i, c, e>TIMESTAMP'2038-01-01 00:00:00' AS current_row from t1;
+i c current_row
+1 foo 1
+drop table t1;
+drop table t2;
+#
+# MDEV-14871 Server crashes in fill_record / fill_record_n_invoke_before_triggers upon inserting into versioned table with trigger
+#
+create or replace table t1 (pk int primary key) with system versioning;
+create trigger tr before insert on t1 for each row select 1 into @a;
+insert into t1 values (1),(2);
+drop table t1;
+create table t1 (pk int primary key, i int) with system versioning;
+replace into t1 values (1,10),(1,100),(1,1000);
+select pk,i,row_end > '2038-01-01' from t1 for system_time all;
+pk i row_end > '2038-01-01'
+1 1000 1
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/load_data.result b/mysql-test/suite/versioning/r/load_data.result
new file mode 100644
index 00000000000..5e7b36c9a6a
--- /dev/null
+++ b/mysql-test/suite/versioning/r/load_data.result
@@ -0,0 +1,8 @@
+CREATE TABLE t1 (a INT, b INT, c INT, vc INT AS (c), UNIQUE(a), UNIQUE(b)) WITH SYSTEM VERSIONING;
+INSERT IGNORE INTO t1 (a,b,c) VALUES (1,2,3);
+SELECT a, b, c FROM t1 INTO OUTFILE '15330.data';
+LOAD DATA INFILE '15330.data' IGNORE INTO TABLE t1 (a,b,c);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'a'
+LOAD DATA INFILE '15330.data' REPLACE INTO TABLE t1 (a,b,c);
+DROP TABLE t1;
diff --git a/mysql-test/suite/versioning/r/online.result b/mysql-test/suite/versioning/r/online.result
new file mode 100644
index 00000000000..aabf2b98cbf
--- /dev/null
+++ b/mysql-test/suite/versioning/r/online.result
@@ -0,0 +1,117 @@
+set system_versioning_alter_history=keep;
+create or replace table t (a int);
+alter table t add system versioning, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned timestamp tables. Try LOCK=SHARED
+alter table t add system versioning, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Not implemented for system-versioned timestamp tables. Try ALGORITHM=COPY
+alter table t add system versioning, lock=shared;
+alter table t add column b int, change column a a int without system versioning, lock=none;
+alter table t drop system versioning, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
+alter table t drop system versioning, algorithm=inplace;
+create or replace table t (
+a int, b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t values (1, 0);
+insert into t values (2, 0);
+delete from t where a = 2;
+alter table t drop column b, lock=none;
+alter table t add index idx(a), lock=none;
+select a, check_row(row_start, row_end) from t for system_time all order by a;
+a check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+# MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL -
+# generates error if table uses SYSTEM VERSIONING [tempesta-tech/mariadb#540]
+create or replace table t1 (a int, key(a)) with system versioning;
+create or replace table t2 like t;
+alter table t2 add foreign key(a) references t1(a);
+alter table t2 modify column a int not null, lock=none;
+drop table t2;
+drop table t1;
+# MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
+create or replace table t1 (
+a int,
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+create or replace table t2 (
+a int without system versioning,
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+insert into t1 values (1,1);
+insert into t2 values (1,1);
+set @@system_versioning_alter_history=keep;
+# without rebuild
+alter table t1
+change a a int without system versioning,
+algorithm=instant;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+alter table t2
+change a a int with system versioning,
+add primary key pk (a),
+algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
+# with rebuild
+alter table t2
+change a a int with system versioning,
+add primary key pk (a);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
+update t1 set a=2;
+select count(*) from t1 for system_time all;
+count(*)
+1
+update t2 set a=2;
+select count(*) from t2 for system_time all;
+count(*)
+2
+drop table t1, t2;
+# rollback ALTER TABLE: nothing should change
+create or replace table t (
+a int,
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+insert into t values (1, 1);
+select c.prtype from information_schema.innodb_sys_columns as c
+join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+where t.name='test/t' and c.name='b';
+prtype
+50179
+set @@system_versioning_alter_history=keep;
+select c.prtype from information_schema.innodb_sys_columns as c
+join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+where t.name='test/t' and c.name='b';
+prtype
+50179
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `row_start` SYS_DATATYPE GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` SYS_DATATYPE GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select count(*) from t for system_time all;
+count(*)
+1
+update t set b=11;
+select count(*) from t for system_time all;
+count(*)
+2
+drop table t;
diff --git a/mysql-test/suite/versioning/r/optimized.result b/mysql-test/suite/versioning/r/optimized.result
new file mode 100644
index 00000000000..2385a43d0a4
--- /dev/null
+++ b/mysql-test/suite/versioning/r/optimized.result
@@ -0,0 +1,75 @@
+create table t (
+a int,
+b int without system versioning
+) with system versioning;
+insert into t values(1, 2);
+insert into t values(3, 4);
+select * from t;
+a b
+1 2
+3 4
+select a from t for system_time as of timestamp now(6);
+a
+1
+3
+select a, b, b+0 from t for system_time as of timestamp now(6);
+a b b+0
+1 2 2
+3 4 4
+select * from t for system_time as of timestamp now(6);
+a b
+1 2
+3 4
+select count(*) from t for system_time as of timestamp now(6) group by b;
+count(*)
+1
+1
+select * from t for system_time as of timestamp now(6) order by b asc;
+a b
+1 2
+3 4
+select * from t for system_time as of timestamp now(6) order by b desc;
+a b
+3 4
+1 2
+select * from t for system_time as of timestamp now(6) group by a having a=2;
+a b
+select * from t for system_time as of timestamp now(6) group by b having b=2;
+a b
+1 2
+select a from t for system_time as of timestamp now(6) where b=2;
+a
+1
+select a from t for system_time as of timestamp now(6) where b=NULL;
+a
+select a from t for system_time as of timestamp now(6) where b is NULL;
+a
+select count(*), b from t for system_time as of timestamp now(6) group by b having b=NULL;
+count(*) b
+select a, b from t;
+a b
+1 2
+3 4
+create or replace table t (
+a int,
+b int not null without system versioning
+) with system versioning;
+insert into t values (1, 2), (3, 4);
+select * from t for system_time as of timestamp now(6);
+a b
+1 2
+3 4
+select * from t for system_time as of timestamp now(6) where b is NULL;
+a b
+create or replace table t (x int with system versioning, y int);
+select column_name, extra from information_schema.columns where table_name='t';
+column_name extra
+x
+y WITHOUT SYSTEM VERSIONING
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `x` int(11) DEFAULT NULL,
+ `y` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+drop table t;
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
new file mode 100644
index 00000000000..a89053369a7
--- /dev/null
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -0,0 +1,686 @@
+set system_versioning_alter_history=keep;
+# Check conventional partitioning on temporal tables
+create or replace table t1 (
+x int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end))
+with system versioning
+partition by range columns (x) (
+partition p0 values less than (100),
+partition p1 values less than (1000));
+insert into t1 values (3), (300);
+select * from t1;
+x
+3
+300
+select * from t1 partition (p0);
+x
+3
+select * from t1 partition (p1);
+x
+300
+delete from t1;
+select * from t1;
+x
+select * from t1 partition (p0);
+x
+select * from t1 partition (p1);
+x
+select * from t1 for system_time all;
+x
+3
+300
+select * from t1 partition (p0) for system_time all;
+x
+3
+select * from t1 partition (p1) for system_time all;
+x
+300
+# Engine change native <-> non-native versioning prohibited
+create or replace table t1 (
+i int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end))
+engine=DEFAULT_ENGINE
+with system versioning partition by hash(i);
+alter table t1 engine=NON_DEFAULT_ENGINE;
+ERROR HY000: Not allowed for system-versioned `test`.`t1`. Change to/from native system versioning engine is not supported.
+## CREATE TABLE
+create or replace table t1 (x int)
+partition by system_time (
+partition p0 history,
+partition pn current);
+ERROR HY000: Table `t1` is not system-versioned
+create or replace table t1 (x int);
+alter table t1
+partition by system_time (
+partition p0 history,
+partition pn current);
+ERROR HY000: Table `t1` is not system-versioned
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition p0 current);
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition p0 current,
+partition p1 current);
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition p0 history,
+partition p1 history);
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition pn current,
+partition p0 history);
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition p0,
+partition pn current);
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition p0 history,
+partition pn current);
+## ALTER TABLE
+alter table t1 add partition (
+partition p1 current);
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+alter table t1 add partition (
+partition p1 history);
+Warnings:
+Warning 4115 Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME
+(PARTITION `p0` HISTORY ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` HISTORY ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` CURRENT ENGINE = DEFAULT_ENGINE)
+insert into t1 values (1), (2);
+alter table t1 drop partition pn;
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+alter table t1 drop partition p1;
+alter table t1 drop partition p0;
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+select x from t1;
+x
+1
+2
+# Bug #260: incorrect IB partitioning warning
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 1 (
+partition p0 history,
+partition pn current);
+alter table t1 change x big int;
+create or replace table t1 (i int) engine myisam partition by hash(i) partitions 2;
+alter table t1 add partition (partition px history);
+ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
+## INSERT, UPDATE, DELETE
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+partition p0 history,
+partition pn current);
+set @now= now(6);
+insert into t1 values (1);
+set @str= concat('select x, row_start < @now as A, row_end > @now as B from t1 partition (p0)');
+prepare select_p0 from @str;
+set @str= concat('select x, row_start > @now as C, row_end = timestamp\'2038-01-19 03:14:07.999999\' as D from t1 partition (pn)');
+prepare select_pn from @str;
+execute select_p0;
+x A B
+execute select_pn;
+x C D
+1 1 1
+set @str= concat('select row_start from t1 partition (pn) into @ts0');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+set @now= now(6);
+delete from t1;
+execute select_p0;
+x A B
+1 1 1
+execute select_pn;
+x C D
+set @str= concat('select row_start from t1 partition (p0) into @ts1');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+select @ts0 = @ts1;
+@ts0 = @ts1
+1
+set @now= now(6);
+insert into t1 values (2);
+execute select_p0;
+x A B
+1 1 0
+execute select_pn;
+x C D
+2 1 1
+set @str= concat('select row_start from t1 partition (pn) into @ts0');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+set @now= now(6);
+update t1 set x = x + 1;
+execute select_p0;
+x A B
+1 1 0
+2 1 1
+execute select_pn;
+x C D
+3 1 1
+drop prepare select_p0;
+drop prepare select_pn;
+set @str= concat('select row_start from t1 partition (p0) where x = 2 into @ts1');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+set @str= concat('select row_end from t1 partition (p0) where x = 2 into @ts2');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+set @str= concat('select row_start from t1 partition (pn) into @ts3');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+select @ts0 = @ts1;
+@ts0 = @ts1
+1
+select @ts2 = @ts3;
+@ts2 = @ts3
+1
+## rotation by LIMIT
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 0 (
+partition p0 history,
+partition p1 history,
+partition pn current);
+ERROR HY000: Wrong parameters for partitioned `t1`: wrong value for 'LIMIT'
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 2 (
+partition p0 history,
+partition p1 history,
+partition pn current);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME LIMIT 2
+(PARTITION `p0` HISTORY ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` HISTORY ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` CURRENT ENGINE = DEFAULT_ENGINE)
+alter table t1 drop partition non_existent;
+ERROR HY000: Error in list of partitions to DROP
+insert into t1 values (1), (2), (3), (4), (5), (6);
+select * from t1 partition (pn);
+x
+1
+2
+3
+4
+5
+6
+delete from t1 where x < 4;
+delete from t1;
+select * from t1 partition (p0);
+x
+1
+2
+3
+select * from t1 partition (p1);
+x
+4
+5
+6
+insert into t1 values (7), (8);
+Warnings:
+Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
+### warn about full partition
+delete from t1;
+Warnings:
+Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
+select * from t1 partition (p1) order by x;
+x
+4
+5
+6
+7
+8
+### Assertion in ALTER on warning from partitioning LIMIT [#446]
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1), (2);
+delete from t1;
+alter table t1 partition by system_time limit 1 (
+partition p1 history,
+partition pn current);
+## rotation by INTERVAL
+create or replace table t1 (x int)
+with system versioning
+partition by system_time interval 0 second (
+partition p0 history,
+partition p1 history,
+partition pn current);
+ERROR HY000: Wrong parameters for partitioned `t1`: wrong value for 'INTERVAL'
+create or replace table t1 (x int)
+with system versioning
+partition by system_time interval 1 second starts 12345 (
+partition p0 history,
+partition p1 history,
+partition pn current);
+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 'starts 12345 (
+partition p0 history,
+partition p1 history,
+partition pn current)' at line 3
+create table t1 (i int) with system versioning
+partition by system_time interval 6 day limit 98
+(partition p0 history, partition ver_pn current);
+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 98
+(partition p0 history, partition ver_pn current)' at line 2
+## Subpartitions
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 2
+subpartition by key (x)
+subpartitions 2 (
+partition p0 history,
+partition p1 history,
+partition pn current);
+insert into t1 (x) values (1), (2), (3), (4), (5);
+select * from t1 partition (pnsp0);
+x
+1
+3
+5
+select * from t1 partition (pnsp1);
+x
+2
+4
+### warn about full partition
+delete from t1 where x < 3;
+delete from t1;
+delete from t1;
+select * from t1 partition (p0sp0);
+x
+1
+3
+5
+select * from t1 partition (p0sp1);
+x
+2
+4
+select * from t1 partition (p1sp0);
+x
+select * from t1 partition (p1sp1);
+x
+create or replace table t1 (
+a bigint,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end))
+with system versioning
+partition by range (a)
+(partition p0 values less than (20) engine innodb,
+partition p1 values less than maxvalue engine innodb);
+insert into t1 values (1);
+create or replace table t1 (
+f_int1 integer default 0,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning
+partition by range(f_int1)
+subpartition by hash(f_int1)
+( partition part1 values less than (1000)
+(subpartition subpart11 storage engine = 'innodb',
+subpartition subpart12 storage engine = 'innodb'));
+insert into t1 values (1);
+create or replace table t1 (i int) engine=innodb partition by key(i);
+alter table t1
+add column row_start SYS_DATATYPE as row start invisible,
+add column row_end SYS_DATATYPE as row end invisible,
+add period for system_time(row_start, row_end),
+add system versioning;
+insert into t1 values();
+# MDEV-14722 Assertion in ha_commit_trans for sub-statement
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 day (
+partition p1 history,
+partition pc current);
+create or replace table t2 (f int);
+create or replace trigger tr before insert on t2
+for each row select table_rows from information_schema.tables
+where table_name = 't1' into @a;
+insert into t2 values (1);
+# MDEV-14740 Locking assertion for system_time partitioning
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 week (
+partition p1 history,
+partition pn current);
+create or replace table t2 (f int);
+create or replace trigger tr before insert on t2
+for each row select count(*) from t1 into @a;
+insert into t2 values (1);
+# MDEV-14741 Assertion `(trx)->start_file == 0' failed in row_truncate_table_for_mysql()
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 hour (
+partition p1 history,
+partition pn current);
+set autocommit= off;
+truncate table t1;
+set autocommit= on;
+# MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLES
+create or replace table t1 (x int) with system versioning;
+lock table t1 write;
+alter table t1 partition by system_time interval 1 week (
+partition p1 history,
+partition pn current);
+unlock tables;
+# MDEV-14748 Assertion in ha_myisammrg::attach_children()
+create or replace table t1 (x int) engine=myisam with system versioning
+partition by system_time interval 1 month (partition p1 history, partition pn current);
+create or replace table t2 (x int) engine=myisam;
+create or replace table t3 (x int) engine=merge union=(t2);
+create or replace table t4 (x int) engine=myisam;
+create or replace trigger tr after insert on t4 for each row insert into t2
+( select x from t3 ) union ( select x from t1 );
+insert into t4 values (1);
+# MDEV-14821 Assertion failure
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (0), (1);
+update t1 set x= x + 1;
+alter table t1 partition by system_time limit 1 (
+partition p1 history,
+partition p2 history,
+partition pn current);
+delete from t1 where x = 1;
+delete from t1 where x = 2;
+# MDEV-14923 Assertion upon INSERT into locked versioned partitioned table
+create or replace table t1 (x int) with system versioning
+partition by system_time (partition p1 history, partition pn current);
+lock table t1 write;
+alter table t1 add partition (partition p1 history);
+ERROR HY000: Duplicate partition name p1
+insert into t1 values (1);
+unlock tables;
+create or replace table t1 (pk int) with system versioning
+partition by system_time interval 10 year (
+partition p1 history,
+partition p2 history,
+partition pn current
+);
+ERROR 22003: TIMESTAMP value is out of range in 'INTERVAL'
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 hour (
+partition p0 history, partition pn current);
+set @ts=(select partition_description from information_schema.partitions
+where table_schema='test' and table_name='t1' and partition_name='p0');
+alter table t1 add column b int;
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+partition_name partition_ordinal_position partition_method timediff(partition_description, @ts)
+p0 1 SYSTEM_TIME 00:00:00.000000
+pn 2 SYSTEM_TIME NULL
+Warnings:
+Warning 1292 Truncated incorrect time value: 'CURRENT'
+alter table t1 add partition (partition p1 history, partition p2 history);
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+partition_name partition_ordinal_position partition_method timediff(partition_description, @ts)
+p0 1 SYSTEM_TIME 00:00:00.000000
+p1 2 SYSTEM_TIME 01:00:00.000000
+p2 3 SYSTEM_TIME 02:00:00.000000
+pn 4 SYSTEM_TIME NULL
+Warnings:
+Warning 1292 Truncated incorrect time value: 'CURRENT'
+alter table t1 drop partition p0;
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+partition_name partition_ordinal_position partition_method timediff(partition_description, @ts)
+p1 1 SYSTEM_TIME 01:00:00.000000
+p2 2 SYSTEM_TIME 02:00:00.000000
+pn 3 SYSTEM_TIME NULL
+Warnings:
+Warning 1292 Truncated incorrect time value: 'CURRENT'
+alter table t1 drop partition p2;
+ERROR HY000: Can only drop oldest partitions when rotating by INTERVAL
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+partition_name partition_ordinal_position partition_method timediff(partition_description, @ts)
+p1 1 SYSTEM_TIME 01:00:00.000000
+p2 2 SYSTEM_TIME 02:00:00.000000
+pn 3 SYSTEM_TIME NULL
+Warnings:
+Warning 1292 Truncated incorrect time value: 'CURRENT'
+#
+# MDEV-15103 Assertion in ha_partition::part_records() for updating VIEW
+#
+create or replace table t1 (pk int primary key, f int) with system versioning
+partition by system_time limit 100 (partition p1 history, partition pn current);
+insert into t1 values (1,10), (2,20);
+create or replace view v1 as select * from t1;
+update v1 set f= 30;
+#
+# MDEV-15168 Unexpected ER_VERS_ENGINE_UNSUPPORTED upon dropping versioning on a partitioned table
+#
+create or replace table t (a int) with system versioning
+partition by system_time (partition p1 history, partition pn current);
+alter table t drop system versioning;
+ERROR HY000: Can not DROP SYSTEM VERSIONING for table `t` partitioned BY SYSTEM_TIME
+# MDEV-15191 Assertion `bit < (map)->n_bits' failed in bitmap_is_set upon INSERT
+create or replace table t1 (i int) with system versioning;
+insert into t1 values (1), (2);
+update t1 set i= 3;
+alter table t1 partition by system_time interval 1 month (partition p1 history, partition pn current);
+lock table t1 write;
+alter table t1 add partition (partition p2 history);
+insert into t1 values (4);
+unlock tables;
+# MDEV-15036 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' in Diagnostics_area::set_ok_status or unexpected ER_RANGE_NOT_INCREASING_ERROR
+create or replace table t1 (a int) with system versioning
+partition by system_time limit 2 (
+partition p1 history, partition p2 history,
+partition p3 history, partition pn current);
+insert into t1 values (1),(2),(3);
+update t1 set a = 4;
+delete from t1;
+delete from t1 where a is not null;
+# MDEV-14823 Wrong error message upon selecting from a system_time partition
+create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current);
+select * from t1 partition (p0) for system_time all;
+ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 partition (p0) for system_time all;
+call sp;
+ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+call sp;
+ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+drop procedure sp;
+# MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
+create or replace table t1 (pk int primary key)
+engine=myisam
+with system versioning
+partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+Same test but for Aria storage engine
+create or replace table t1 (pk int primary key)
+engine=aria
+with system versioning
+partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+#
+# MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments
+#
+create or replace table t1 (pk int) with system versioning
+partition by system_time interval 7 second (
+partition ver_p1 history,
+partition ver_pn current);
+alter table t1
+partition by system_time interval column_get(column_create(7,7), 7 as int) second (
+partition ver_p1 history,
+partition ver_pn current);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME INTERVAL 7 SECOND
+(PARTITION `ver_p1` HISTORY ENGINE = DEFAULT_ENGINE,
+ PARTITION `ver_pn` CURRENT ENGINE = DEFAULT_ENGINE)
+#
+# MDEV-19175 Server crashes in ha_partition::vers_can_native upon INSERT DELAYED into versioned partitioned table
+#
+create or replace table t1 (f int) with system versioning partition by hash(f);
+insert delayed into t1 values (1);
+#
+# MDEV-20068 History partition rotation is not done under LOCK TABLES
+#
+create or replace table t1 (x int) with system versioning partition by system_time limit 1
+(partition p1 history, partition pn current);
+lock tables t1 write;
+insert into t1 values (0), (1), (2), (3);
+delete from t1 where x < 3;
+delete from t1;
+Warnings:
+Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
+unlock tables;
+#
+# MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
+#
+create or replace table t1 (pk int primary key) with system versioning partition by system_time limit 100 (partition p1 history, partition pn current);
+execute immediate 'select * from t1 for update';
+pk
+drop view v1;
+drop tables t, t1, t2, t3, t4;
+#
+# MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables
+#
+create or replace table t1 (
+x int,
+a varchar(255)
+) with system versioning partition by system_time (partition p1 history, partition pn current);
+insert into t1 (x) values (1), (2), (3), (4);
+update t1 set a= 'foo' limit 3;
+update t1 set a= 'bar' limit 4;
+select * from t1;
+x a
+1 bar
+2 bar
+3 bar
+4 bar
+drop table t1;
+#
+# MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
+#
+create table t1 (a int) with system versioning
+partition by system_time limit 3
+(partition p1 history, partition p2 history, partition pn current);
+insert into t1 values (1),(2),(3),(4);
+delete from t1;
+delete from t1;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check note Not supported for non-INTERVAL history partitions
+test.t1 check note The storage engine for the table doesn't support check
+drop table t1;
+#
+# MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
+#
+create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2;
+insert into t1 values (1,'foo'),(2,'bar');
+create table t2 (b int);
+insert into t2 values (1),(2);
+update t1, t2 set a = 1;
+drop table t1, t2;
+#
+# MDEV-20515 multi-update tries to position updated table by null reference
+#
+create or replace table t1 (a int);
+insert into t1 values (0), (1);
+create or replace table t2 (b int) with system versioning
+partition by system_time
+(partition p1 history, partition pn current);
+insert into t2 values (0), (2);
+update t1 left join t2 on a > b set b= 2 order by b;
+drop table t1, t2;
+#
+# MDEV-17091 Assertion `old_part_id == m_last_part' failed in
+# ha_partition::update_row or `part_id == m_last_part' in
+# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
+#
+create or replace table t1 (pk int primary key, f int) engine=innodb
+with system versioning
+partition by key() partitions 2;
+insert into t1 values (1,10),(2,20);
+# expected to hit same partition
+select * from t1 partition (p0);
+pk f
+1 10
+2 20
+alter table t1 drop system versioning;
+# 1 and 2 are expected to be in different partitions
+select * from t1 partition(p0);
+pk f
+1 10
+select * from t1 partition(p1);
+pk f
+2 20
+update t1 set f=pk;
+delete from t1;
+drop table t1;
+#
+# MDEV-22413 Server hangs upon UPDATE/DELETE on a view reading from versioned partitioned table
+#
+create or replace table t1 (f char(6)) engine innodb with system versioning;
+insert into t1 values (null);
+update t1 set f= 'foo';
+update t1 set f= 'bar';
+create or replace view v1 as select * from t1 for system_time all;
+update v1 set f = '';
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+create or replace table t1 (f char(6)) engine innodb with system versioning
+partition by system_time limit 1
+(partition p1 history, partition p2 history, partition pn current);
+insert into t1 values (null);
+update t1 set f= 'foo';
+update t1 set f= 'bar';
+create or replace view v1 as select * from t1 for system_time all;
+update v1 set f= '';
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+delete from v1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+drop view v1;
+drop table t1;
+#
+# MDEV-22112 Assertion `tab_part_info->part_type == RANGE_PARTITION || tab_part_info->part_type == LIST_PARTITION' failed in prep_alter_part_table
+#
+create table t1 (a int) with system versioning partition by system_time;
+ERROR HY000: For SYSTEM_TIME partitions each partition must be defined
+create table t1 (a int) with system versioning partition by system_time
+(partition p1 history, partition pn current);
+alter table t1 add partition (partition p2);
+ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
+drop table t1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/versioning/r/partition_innodb.result b/mysql-test/suite/versioning/r/partition_innodb.result
new file mode 100644
index 00000000000..b9870797cd2
--- /dev/null
+++ b/mysql-test/suite/versioning/r/partition_innodb.result
@@ -0,0 +1,80 @@
+# MDEV-15951 system versioning by trx id doesn't work with partitioning
+# currently trx_id does not support partitioning by system_time
+create or replace table t1(
+i int,
+row_start bigint unsigned generated always as row start,
+row_end bigint unsigned generated always as row end,
+period for system_time(row_start, row_end)
+) engine=InnoDB with system versioning partition by system_time (
+partition p0 history,
+partition pn current
+);
+ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1`
+create or replace table t1(
+i int,
+row_start bigint unsigned generated always as row start,
+row_end bigint unsigned generated always as row end,
+period for system_time(row_start, row_end)
+) engine=InnoDB with system versioning;
+alter table t1 partition by system_time (
+partition p0 history,
+partition pn current
+);
+ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `#sql-temporary`
+drop table t1;
+create or replace table t (
+a int primary key,
+row_start bigint unsigned as row start invisible,
+row_end bigint unsigned as row end invisible,
+period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by key() (
+partition p1,
+partition p2
+);
+ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END
+create or replace table t (
+a int primary key,
+row_start bigint unsigned as row start invisible,
+row_end bigint unsigned as row end invisible,
+period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by key(a, row_start) (
+partition p1,
+partition p2
+);
+ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END
+create or replace table t (
+a int primary key,
+row_start bigint unsigned as row start invisible,
+row_end bigint unsigned as row end invisible,
+period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by hash(a + row_end * 2) (
+partition p1,
+partition p2
+);
+ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END
+create or replace table t (
+a int primary key,
+row_start bigint unsigned as row start invisible,
+row_end bigint unsigned as row end invisible,
+period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by range columns (a, row_start) (
+partition p1 values less than (100, 100)
+);
+ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END
+#
+# MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table
+#
+create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i))
+engine=innodb with system versioning partition by key() partitions 2;
+insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b');
+alter table t1 drop system versioning;
+replace into t1 select * from t1;
+select * from t1 where i > 0 or pk = 1000 limit 1;
+pk i c
+1 1 a
+drop table t1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/versioning/r/partition_rotation.result b/mysql-test/suite/versioning/r/partition_rotation.result
new file mode 100644
index 00000000000..ff312c937cc
--- /dev/null
+++ b/mysql-test/suite/versioning/r/partition_rotation.result
@@ -0,0 +1,70 @@
+set timestamp=unix_timestamp('2001-02-03 10:20:30');
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 day
+subpartition by key (i) subpartitions 2
+(partition p1 history, partition pn current);
+set timestamp=unix_timestamp('2001-02-03 10:20:40');
+insert t1 values (1);
+delete from t1;
+set timestamp=unix_timestamp('2001-02-04 10:20:50');
+insert t1 values (2);
+delete from t1;
+select subpartition_name,partition_description,table_rows from information_schema.partitions where table_schema='test' and table_name='t1';
+subpartition_name partition_description table_rows
+p1sp0 2001-02-04 10:20:30 1
+p1sp1 2001-02-04 10:20:30 1
+pnsp0 CURRENT 0
+pnsp1 CURRENT 0
+set timestamp=unix_timestamp('2001-02-04 10:20:55');
+alter table t1 add partition (partition p0 history, partition p2 history);
+set timestamp=unix_timestamp('2001-02-04 10:30:00');
+insert t1 values (4),(5);
+set timestamp=unix_timestamp('2001-02-04 10:30:10');
+update t1 set i=6 where i=5;
+select subpartition_name,partition_description,table_rows from information_schema.partitions where table_schema='test' and table_name='t1';
+subpartition_name partition_description table_rows
+p1sp0 2001-02-04 10:20:30 1
+p1sp1 2001-02-04 10:20:30 0
+p0sp0 2001-02-05 10:20:30 1
+p0sp1 2001-02-05 10:20:30 1
+p2sp0 2001-02-06 10:20:30 0
+p2sp1 2001-02-06 10:20:30 0
+pnsp0 CURRENT 0
+pnsp1 CURRENT 2
+## pruning check
+set @ts=(select partition_description from information_schema.partitions
+where table_schema='test' and table_name='t1' and partition_name='p0' limit 1);
+select * from t1;
+i
+4
+6
+explain partitions select * from t1;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 for system_time as of '2001-02-04 10:20:30';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p2_p2sp0,p2_p2sp1,pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL # Using where
+set @ts=(select row_end from t1 for system_time all where i=1);
+select * from t1 for system_time all where row_end = @ts;
+i
+1
+explain partitions select * from t1 for system_time all where row_end = @ts;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1_p1sp0,p1_p1sp1 # NULL NULL NULL NULL # #
+#
+# MDEV-16023 Unfortunate error message WARN_VERS_PART_FULL
+#
+set timestamp= unix_timestamp('2020-07-29 10:30:10');
+create or replace table t1 (a int) with system versioning
+partition by system_time interval 1 second (
+partition p0 history,
+partition p1 history,
+partition pc current
+);
+set timestamp= unix_timestamp('2020-07-29 10:30:14');
+insert into t1 values (1),(2),(3);
+show warnings;
+Level Code Message
+# Cleanup
+set timestamp= default;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/replace.result b/mysql-test/suite/versioning/r/replace.result
new file mode 100644
index 00000000000..bda61f118b0
--- /dev/null
+++ b/mysql-test/suite/versioning/r/replace.result
@@ -0,0 +1,50 @@
+create or replace table t(
+id int,
+KEY_TYPE(id),
+x int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+insert t values (1, 2);
+replace t values (1, 3);
+select *, current_row(row_end) as current from t for system_time all order by x;
+id x current
+1 2 0
+1 3 1
+drop table t;
+create table t (
+id int unique,
+x int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert t values (1, 2);
+replace t values (1, 3);
+select *, current_row(row_end) as current from t for system_time all order by x;
+id x current
+1 2 0
+1 3 1
+drop table t;
+# MDEV-15645 Assertion `table->insert_values' failed in write_record upon REPLACE into a view with underlying versioned table
+create or replace table t1 (a int, b int, primary key (a), unique(b)) with system versioning;
+insert into t1 values (1,1);
+create or replace table t2 (c int);
+create or replace view v as select t1.* from t1 join t2;
+replace into v (a, b) select a, b from t1;
+drop view v;
+drop tables t1, t2;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT,
+f INT,
+row_start SYS_DATATYPE AS ROW START INVISIBLE,
+row_end SYS_DATATYPE AS ROW END INVISIBLE,
+PRIMARY KEY(pk),
+UNIQUE(f),
+PERIOD FOR SYSTEM_TIME(row_start, row_end)
+) WITH SYSTEM VERSIONING;
+INSERT INTO t1 () VALUES (),(),(),(),(),();
+UPDATE IGNORE t1 SET f = 1;
+REPLACE t1 SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result
new file mode 100644
index 00000000000..627f3991499
--- /dev/null
+++ b/mysql-test/suite/versioning/r/rpl.result
@@ -0,0 +1,167 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+connection master;
+CREATE TABLE t1 (x int) with system versioning;
+insert into t1 values (1);
+select * from t1 order by x;
+x
+1
+delete from t1;
+select * from t1 order by x;
+x
+select * from t1 for system_time all order by row_end, x;
+x
+1
+connection slave;
+select * from t1 order by x;
+x
+select * from t1 for system_time all order by row_end, x;
+x
+1
+connection master;
+insert into t1 values (2);
+connection slave;
+select * from t1 order by x;
+x
+2
+connection master;
+update t1 set x = 3;
+connection slave;
+select * from t1 order by x;
+x
+3
+select * from t1 for system_time all order by row_end, x;
+x
+1
+2
+3
+# check unversioned -> versioned replication
+connection master;
+create or replace table t1 (x int primary key);
+connection slave;
+alter table t1 with system versioning;
+connection master;
+insert into t1 values (1);
+connection slave;
+select * from t1 order by x;
+x
+1
+select * from t1 for system_time all order by row_end, x;
+x
+1
+connection master;
+update t1 set x= 2 where x = 1;
+connection slave;
+select * from t1 order by x;
+x
+2
+select * from t1 for system_time all order by row_end, x;
+x
+1
+2
+connection master;
+delete from t1;
+connection slave;
+select * from t1 order by x;
+x
+select * from t1 for system_time all order by row_end, x;
+x
+1
+2
+# same thing (UPDATE, DELETE), but without PK
+connection master;
+create or replace table t1 (x int);
+connection slave;
+alter table t1 with system versioning;
+connection master;
+insert into t1 values (1);
+update t1 set x= 2 where x = 1;
+connection slave;
+select * from t1 order by x;
+x
+2
+select * from t1 for system_time all order by row_end, x;
+x
+1
+2
+connection master;
+delete from t1;
+connection slave;
+select * from t1 order by x;
+x
+select * from t1 for system_time all order by row_end, x;
+x
+1
+2
+# multi-update
+connection master;
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (x int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+update t1, t2 set t1.x=11, t2.x=22;
+connection slave;
+select * from t1 order by x;
+x
+11
+select * from t2 order by x;
+x
+22
+select * from t1 for system_time all order by row_end, x;
+x
+1
+11
+select * from t2 for system_time all order by row_end, x;
+x
+2
+22
+# MDEV-14767 system_versioning_alter_history breaks ALTER replication
+## Case 1: KEEP on the master, ALTER will work on the slave
+connection master;
+create or replace table t1 (a int) with system versioning;
+set system_versioning_alter_history= KEEP;
+alter table t1 add column b int;
+connection slave;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+## Case 2: ERROR on the master, it'll fail on the master, the slave won't see it
+connection master;
+set system_versioning_alter_history= ERROR;
+alter table t1 drop column b;
+ERROR HY000: Not allowed for system-versioned `test`.`t1`. Change @@system_versioning_alter_history to proceed with ALTER.
+connection slave;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+## Case 3: table is not versioned on the master, ALTER will work on the slave
+connection master;
+create or replace table t1 (a int);
+connection slave;
+create or replace table t1 (a int) with system versioning;
+connection master;
+alter table t1 add column b int;
+connection slave;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+connection master;
+drop table t1, t2;
+create table t1 (i int) with system versioning partition by system_time limit 8 ( partition p1 history, partition p2 history, partition pn current );
+insert into t1 values (1);
+update t1 set i = 1;
+update t1 set i = 0;
+connection slave;
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/r/rpl_mix.result b/mysql-test/suite/versioning/r/rpl_mix.result
new file mode 100644
index 00000000000..68eded0faf7
--- /dev/null
+++ b/mysql-test/suite/versioning/r/rpl_mix.result
@@ -0,0 +1,11 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES (1,10),(2,20);
+UPDATE t1 SET i = 100;
+SET BINLOG_FORMAT= ROW;
+DELETE HISTORY FROM t1;
+connection slave;
+connection master;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/r/rpl_row.result b/mysql-test/suite/versioning/r/rpl_row.result
new file mode 100644
index 00000000000..03ac8dc9eb8
--- /dev/null
+++ b/mysql-test/suite/versioning/r/rpl_row.result
@@ -0,0 +1,14 @@
+include/master-slave.inc
+[connection master]
+# MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables
+set @old_row_image= @@binlog_row_image;
+set binlog_row_image= minimal;
+create or replace table t1 (pk int, i int, primary key(pk))
+with system versioning;
+insert into t1 values (1,10),(2,20);
+update t1 set i = 0;
+connection slave;
+connection master;
+drop table t1;
+set binlog_row_image= @old_row_image;
+include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
new file mode 100644
index 00000000000..23c6e2d74af
--- /dev/null
+++ b/mysql-test/suite/versioning/r/select.result
@@ -0,0 +1,647 @@
+create or replace table t1 (
+x int unsigned,
+y int unsigned,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning;
+insert into t1 (x, y) values
+(0, 100),
+(1, 101),
+(2, 102),
+(3, 103),
+(4, 104),
+(5, 105),
+(6, 106),
+(7, 107),
+(8, 108),
+(9, 109);
+set @t0= now(6);
+delete from t1 where x = 3;
+delete from t1 where x > 7;
+insert into t1(x, y) values(3, 33);
+select sys_trx_start from t1 where x = 3 and y = 33 into @t1;
+select x, y from t1;
+x y
+0 100
+1 101
+2 102
+4 104
+5 105
+6 106
+7 107
+3 33
+select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
+ASOF_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+select x as FROMTO_x, y from t1 for system_time from timestamp '1970-01-01 00:00:00' to timestamp @t1;
+FROMTO_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+select x as BETWAND_x, y from t1 for system_time between timestamp '1970-01-01 00:00:00' and timestamp @t1;
+BETWAND_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+3 33
+select x as ALL_x, y from t1 for system_time all;
+ALL_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+3 33
+ASOF2_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+FROMTO2_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+BETWAND2_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+3 33
+create or replace table t1 (
+x int unsigned,
+y int unsigned
+) with system versioning;
+create or replace table t2 (
+x int unsigned,
+y int unsigned
+) with system versioning;
+insert into t1 values (1, 1), (1, 2), (1, 3), (4, 4), (5, 5);
+insert into t2 values (1, 2), (2, 1), (3, 1);
+set @t0= now(6);
+select t1.x as IJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x;
+IJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+select t1.x as LJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x;
+LJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+select t1.x as RJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x;
+RJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+delete from t1;
+delete from t2;
+explain extended select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`x` AS `IJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > @`t0` and `test`.`t2`.`row_start` <= @`t0` and `test`.`t1`.`row_end` > @`t0` and `test`.`t1`.`row_start` <= @`t0`
+explain extended select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+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 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`x` AS `LJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL left join `test`.`t2` FOR SYSTEM_TIME ALL on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t2`.`row_end` > @`t0` and `test`.`t2`.`row_start` <= @`t0`) where `test`.`t1`.`row_end` > @`t0` and `test`.`t1`.`row_start` <= @`t0`
+explain extended select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`x` AS `RJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t2` FOR SYSTEM_TIME ALL left join `test`.`t1` FOR SYSTEM_TIME ALL on(`test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > @`t0` and `test`.`t1`.`row_start` <= @`t0`) where `test`.`t2`.`row_end` > @`t0` and `test`.`t2`.`row_start` <= @`t0`
+select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+IJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+LJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+RJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+drop table t1;
+drop table t2;
+create table t1(
+A int
+) with system versioning;
+insert into t1 values(1);
+select * from t1;
+A
+1
+create or replace table t1 (x int);
+insert into t1 values (1);
+select * from t1 for system_time all;
+ERROR HY000: Table `t1` is not system-versioned
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+select * from t1 for system_time all for update;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+create or replace table t1 (a int not null auto_increment primary key) with system versioning;
+select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
+a
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (a int) with system versioning;
+insert into t1 values(1);
+insert into t2 values(1);
+create view v1 as select * from t2 inner join t1 using (a);
+select * from v1;
+a
+1
+drop view v1;
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create view vt1 as select a from t1;
+select * from t1 natural join vt1;
+a
+1
+drop view vt1;
+create or replace table t1(x int) with system versioning;
+select * from (t1 as r left join t1 as u using (x)), t1;
+x x
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create trigger read_end after update on t1
+for each row set @end = old.row_end;
+update t1 set a=2;
+select @end;
+@end
+MAX_RESULT
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+select * from (select * from t1 cross join t2) as tmp;
+a b
+1 2
+select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
+a b
+1 2
+select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00:00')) as tmp;
+a b
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+select * from t1 for system_time all natural left join t2 for system_time all;
+a1 a2
+1 1
+2 1
+1 2
+2 2
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+create or replace view v1 as select a1 from t1;
+select * from v1 natural join t2;
+a1 a2
+1 1
+2 1
+1 2
+2 2
+select * from v1 natural left join t2;
+a1 a2
+1 1
+2 1
+1 2
+2 2
+select * from v1 natural right join t2;
+a2 a1
+1 1
+2 1
+1 2
+2 2
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+explain extended
+select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>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
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` FOR SYSTEM_TIME ALL left join (`test`.`t1` FOR SYSTEM_TIME ALL `t2` left join `test`.`t1` FOR SYSTEM_TIME ALL `t3` on(`test`.`t3`.`a` = `test`.`t2`.`a` and `test`.`t3`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999')) on(`test`.`t2`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999' and `test`.`t1`.`a` > 1) where `test`.`t1`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999'
+select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
+a a
+2 1
+3 1
+2 2
+3 2
+2 3
+3 3
+1 NULL
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int) with system versioning;
+insert into t1 values (1), (2), (3);
+delete from t1 where x = 3;
+insert into t2 values (1);
+select * from t1, t2 for system_time all;
+x y
+1 1
+2 1
+select * from (select * from t1 for system_time all, t2 for system_time all)
+for system_time all as t;
+ERROR HY000: Table `t` is not system-versioned
+# TRANSACTION/TIMESTAMP specifier in SYSTEM_TIME [MDEV-14645, Issue #396]
+create or replace table t1 (x int) with system versioning engine myisam;
+select * from t1 for system_time as of transaction 1;
+ERROR HY000: Transaction-precise system versioning for `t1` is not supported
+# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 for system_time as of transaction 1;
+call sp;
+ERROR HY000: Transaction-precise system versioning for `t1` is not supported
+call sp;
+ERROR HY000: Transaction-precise system versioning for `t1` is not supported
+create or replace table t1 (a int);
+create or replace procedure sp()
+select * from t1 for system_time all;
+call sp;
+ERROR HY000: Table `t1` is not system-versioned
+call sp;
+ERROR HY000: Table `t1` is not system-versioned
+drop procedure sp;
+create or replace table t1 (
+x int,
+sys_trx_start bigint unsigned as row start invisible,
+sys_trx_end bigint unsigned as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning engine innodb;
+insert into t1 values (1);
+set @ts= now(6);
+delete from t1;
+select sys_trx_start from t1 for system_time all into @trx_start;
+## ensure @trx_start is much lower than unix timestamp
+select @trx_start < unix_timestamp(@ts) - 100 as trx_start_good;
+trx_start_good
+1
+## TIMESTAMP specifier
+select x from t1 for system_time as of timestamp @ts;
+x
+1
+set @ts= timestamp'1-1-1 0:0:0';
+select x from t1 for system_time as of timestamp @ts;
+x
+## TRANSACTION specifier
+select x from t1 for system_time as of transaction @trx_start;
+x
+1
+## no specifier (auto-detection)
+select x from t1 for system_time as of @ts;
+x
+select x from t1 for system_time as of @trx_start;
+x
+1
+### Issue #365, bug 4 (related to #226, optimized fields)
+create or replace table t1 (i int, b int) with system versioning;
+insert into t1 values (0, 0), (0, 0);
+select min(i) over (partition by b) as f
+from (select i + 0 as i, b from t1) as tt
+order by i;
+f
+0
+0
+### Issue #365, bug 5 (dangling AND)
+create or replace table t1 (a int);
+create or replace table t2 (b int) with system versioning;
+select * from t1
+where exists (select 1 from t2 where t2.b = t1.a and t2.b = t1.a);
+a
+### Issue #365, bug 9 (not a derived subquery)
+create or replace table t1 (x int) with system versioning;
+select t1.x in (select x from t1) a from t1, (select x from t1) b;
+a
+### Issue #365, bug 10 (WHERE cond freed prematurely for PS)
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+create or replace view v1 as select x from t1 where x = 1;
+prepare stmt from "
+select x from t1 where x in (select x from v1);";
+execute stmt;
+x
+1
+execute stmt;
+x
+1
+### Issue #365, bug 11 (WHERE cond not top level item)
+create or replace table t1 (a int, b int, key idx(a)) with system versioning;
+insert into t1 values (1, 1), (2, 2);
+select * from t1 where (a, 2) in ((1, 1), (2, 2)) and b = 1;
+a b
+### Issue #398, NOW is now non-magic
+create or replace table t1 (x int) with system versioning;
+select * from t1 for system_time as of current_timestamp;
+x
+select * from t1 for system_time as of now;
+ERROR 42S22: Unknown column 'now' in 'FOR SYSTEM_TIME'
+### Issue #405, NATURAL JOIN failure
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int);
+create or replace view v1 as select a, row_start, row_end from t1 where a > round(rand()*1000);
+select * from v1 natural join t2;
+a row_start row_end b
+#
+# Issue #406, MDEV-14633 Assertion on TRT read
+#
+create or replace table t1 (pk int primary key, i int, t time, key (i)) with system versioning;
+insert into t1 values (1, 10, '15:01:53'), (2, 20, '00:00:00');
+delete from t1;
+select * from t1 where t = '00:00:00' and i > 0 and row_end <> '2012-12-12 00:00:00';
+pk i t
+#
+# MDEV-14816 Assertion `join->best_read < double(1.797...e+308L)' failed in bool greedy_search
+#
+create or replace table t1 (f1 int) with system versioning;
+create or replace table t2 (f2 int) with system versioning;
+create or replace table t3 (f3 int);
+create or replace table t4 (f4 int);
+insert into t1 values (1), (2), (3), (4);
+insert into t2 values (1), (2), (3);
+insert into t3 values (1), (2);
+insert into t4 values (1);
+select * from
+t1 as t1a
+left join t2 as t2a left join (t3 as t3a inner join t1) on t2a.f2 = t3a.f3 on t1a.f1 = t2a.f2
+left join (t2 join t3 inner join t4) on t2a.f2 = t1a.f1;
+f1 f2 f3 f1 f2 f3 f4
+1 1 1 1 1 1 1
+2 2 2 1 1 1 1
+1 1 1 2 1 1 1
+2 2 2 2 1 1 1
+1 1 1 3 1 1 1
+2 2 2 3 1 1 1
+1 1 1 4 1 1 1
+2 2 2 4 1 1 1
+1 1 1 1 1 2 1
+2 2 2 1 1 2 1
+1 1 1 2 1 2 1
+2 2 2 2 1 2 1
+1 1 1 3 1 2 1
+2 2 2 3 1 2 1
+1 1 1 4 1 2 1
+2 2 2 4 1 2 1
+1 1 1 1 2 1 1
+2 2 2 1 2 1 1
+1 1 1 2 2 1 1
+2 2 2 2 2 1 1
+1 1 1 3 2 1 1
+2 2 2 3 2 1 1
+1 1 1 4 2 1 1
+2 2 2 4 2 1 1
+1 1 1 1 2 2 1
+2 2 2 1 2 2 1
+1 1 1 2 2 2 1
+2 2 2 2 2 2 1
+1 1 1 3 2 2 1
+2 2 2 3 2 2 1
+1 1 1 4 2 2 1
+2 2 2 4 2 2 1
+1 1 1 1 3 1 1
+2 2 2 1 3 1 1
+1 1 1 2 3 1 1
+2 2 2 2 3 1 1
+1 1 1 3 3 1 1
+2 2 2 3 3 1 1
+1 1 1 4 3 1 1
+2 2 2 4 3 1 1
+1 1 1 1 3 2 1
+2 2 2 1 3 2 1
+1 1 1 2 3 2 1
+2 2 2 2 3 2 1
+1 1 1 3 3 2 1
+2 2 2 3 3 2 1
+1 1 1 4 3 2 1
+2 2 2 4 3 2 1
+3 3 NULL NULL 1 1 1
+3 3 NULL NULL 1 2 1
+3 3 NULL NULL 2 1 1
+3 3 NULL NULL 2 2 1
+3 3 NULL NULL 3 1 1
+3 3 NULL NULL 3 2 1
+4 NULL NULL NULL NULL NULL NULL
+#
+# MDEV-15004 parser greedily parses AS OF TIMESTAMP
+#
+select timestamp'2016-02-30 08:07:06';
+ERROR HY000: Incorrect DATETIME value: '2016-02-30 08:07:06'
+select * from t1 for system_time as of timestamp'2016-02-30 08:07:06';
+ERROR HY000: Incorrect DATETIME value: '2016-02-30 08:07:06'
+select timestamp('2003-12-31 12:00:00','12:00:00');
+timestamp('2003-12-31 12:00:00','12:00:00')
+2004-01-01 00:00:00
+select * from t1 for system_time as of timestamp('2003-12-31 12:00:00','12:00:00');
+f1
+#
+# MDEV-15391 Server crashes in JOIN::fix_all_splittings_in_plan or Assertion `join->best_read < double(1.79...e+308L)' failed [tempesta-tech#475]
+#
+create or replace table t1 (f1 int) with system versioning;
+insert t1 values (1),(2);
+create or replace table t2 (f2 int);
+create or replace table t3 (f3 int);
+create or replace table t4 (f4 int) with system versioning;
+select f1 from t1 join t2 left join t3 left join t4 on f3 = f4 on f3 = f2;
+f1
+insert t2 values (1),(2);
+insert t3 values (1),(2);
+insert t4 values (1),(2);
+explain extended
+select f1 from t1 join t2 left join t3 left join t4 on f3 = f4 on f3 = f2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`f1` AS `f1` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` left join (`test`.`t3` left join `test`.`t4` FOR SYSTEM_TIME ALL on(`test`.`t4`.`f4` = `test`.`t2`.`f2` and `test`.`t4`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999')) on(`test`.`t3`.`f3` = `test`.`t2`.`f2`) where `test`.`t1`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999'
+drop view v1;
+drop table t1, t2, t3, t4;
+#
+# MDEV-15980 FOR SYSTEM_TIME BETWEEN and FROM .. TO work with negative intervals
+#
+create or replace table t1 (
+a int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1);
+delete from t1;
+select row_start from t1 for system_time all into @t1;
+select row_end from t1 for system_time all into @t2;
+select * from t1 for system_time between @t1 and @t2;
+a
+1
+select * from t1 for system_time between @t2 and @t1;
+a
+select * from t1 for system_time from @t1 to @t2;
+a
+1
+select * from t1 for system_time from @t2 to @t1;
+a
+drop table t1;
+#
+# MDEV-15991 Server crashes in setup_on_expr upon calling SP or function executing DML on versioned tables
+#
+create or replace table t1 (i int);
+insert into t1 values (1);
+create or replace procedure p(n int)
+begin
+select * from t1;
+end $
+call p(1);
+i
+1
+alter table t1 add system versioning;
+call p(2);
+i
+1
+call p(3);
+i
+1
+#
+# MDEV-15947 ASAN heap-use-after-free in Item_ident::print or in my_strcasecmp_utf8 or unexpected ER_BAD_FIELD_ERROR upon call of stored procedure reading from versioned table
+#
+create or replace table t1 (i int) with system versioning;
+create or replace procedure p() select * from t1;
+call p;
+i
+flush tables;
+call p;
+i
+call p;
+i
+drop procedure p;
+drop table t1;
+#
+# MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
+#
+create table t1 (a varchar(8));
+insert into t1 values ('foo'),('bar');
+create table t2 (b date);
+create procedure pr() insert into t2 select * from t1;
+call pr;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+prepare stmt from 'insert into t2 select * from t1';
+execute stmt;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+alter table t1 add system versioning;
+call pr;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+call pr;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+execute stmt;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+execute stmt;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+drop prepare stmt;
+drop procedure pr;
+drop table t1, t2;
+call verify_trt_dummy(34);
+No A B C D
+1 1 1 1 1
+2 1 1 1 1
+3 1 1 1 1
+4 1 1 1 1
+5 1 1 1 1
+6 1 1 1 1
+7 1 1 1 1
+8 1 1 1 1
+9 1 1 1 1
+10 1 1 1 1
+11 1 1 1 1
+12 1 1 1 1
+13 1 1 1 1
+14 1 1 1 1
+15 1 1 1 1
+16 1 1 1 1
+17 1 1 1 1
+18 1 1 1 1
+19 1 1 1 1
+20 1 1 1 1
+21 1 1 1 1
+22 1 1 1 1
+23 1 1 1 1
+24 1 1 1 1
+25 1 1 1 1
+26 1 1 1 1
+27 1 1 1 1
+28 1 1 1 1
+29 1 1 1 1
+30 1 1 1 1
+31 1 1 1 1
+32 1 1 1 1
+33 1 1 1 1
+34 1 1 1 1
diff --git a/mysql-test/suite/versioning/r/select2,trx_id.rdiff b/mysql-test/suite/versioning/r/select2,trx_id.rdiff
new file mode 100644
index 00000000000..d4b35c45568
--- /dev/null
+++ b/mysql-test/suite/versioning/r/select2,trx_id.rdiff
@@ -0,0 +1,38 @@
+--- select2.result
++++ select2,trx_id.result~
+@@ -22,6 +22,8 @@
+ delete from t1 where x > 7;
+ insert into t1(x, y) values(3, 33);
+ select sys_start from t1 where x = 3 and y = 33 into @t1;
++set @x1= @t1;
++select trt_commit_ts(@x1) into @t1;
+ select x, y from t1;
+ x y
+ 0 100
+@@ -82,7 +84,7 @@
+ 8 108
+ 9 109
+ 3 33
+-select x as ASOF2_x, y from t1 for system_time as of @t0;
++select x as ASOF2_x, y from t1 for system_time as of @x0;
+ ASOF2_x y
+ 0 100
+ 1 101
+@@ -94,7 +96,7 @@
+ 7 107
+ 8 108
+ 9 109
+-select x as FROMTO2_x, y from t1 for system_time from '1970-01-01 00:00' to @t1;
++select x as FROMTO2_x, y from t1 for system_time from @x0 to @x1;
+ FROMTO2_x y
+ 0 100
+ 1 101
+@@ -106,7 +108,7 @@
+ 7 107
+ 8 108
+ 9 109
+-select x as BETWAND2_x, y from t1 for system_time between timestamp '1970-01-01 00:00' and timestamp @t1;
++select x as BETWAND2_x, y from t1 for system_time between transaction @x0 and transaction @x1;
+ BETWAND2_x y
+ 0 100
+ 1 101
diff --git a/mysql-test/suite/versioning/r/select2.result b/mysql-test/suite/versioning/r/select2.result
new file mode 100644
index 00000000000..90607335fc1
--- /dev/null
+++ b/mysql-test/suite/versioning/r/select2.result
@@ -0,0 +1,343 @@
+create table t1(
+x int unsigned,
+y int unsigned,
+sys_start SYS_TYPE as row start invisible,
+sys_end SYS_TYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning engine=ENGINE;
+insert into t1 (x, y) values
+(0, 100),
+(1, 101),
+(2, 102),
+(3, 103),
+(4, 104),
+(5, 105),
+(6, 106),
+(7, 107),
+(8, 108),
+(9, 109);
+set @t0= now(6);
+select sys_start from t1 limit 1 into @x0;
+delete from t1 where x = 3;
+delete from t1 where x > 7;
+insert into t1(x, y) values(3, 33);
+select sys_start from t1 where x = 3 and y = 33 into @t1;
+select x, y from t1;
+x y
+0 100
+1 101
+2 102
+4 104
+5 105
+6 106
+7 107
+3 33
+select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
+ASOF_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+select x as FROMTO_x, y from t1 for system_time from '1970-01-01 00:00' to timestamp @t1;
+FROMTO_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+select x as BETWAND_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
+BETWAND_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+3 33
+select x as ALL_x, y from t1 for system_time all;
+ALL_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+3 33
+select x as ASOF2_x, y from t1 for system_time as of @t0;
+ASOF2_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+select x as FROMTO2_x, y from t1 for system_time from '1970-01-01 00:00' to @t1;
+FROMTO2_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+select x as BETWAND2_x, y from t1 for system_time between timestamp '1970-01-01 00:00' and timestamp @t1;
+BETWAND2_x y
+0 100
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+3 33
+drop table t1;
+create table t1(
+x int,
+y int,
+sys_start SYS_TYPE as row start invisible,
+sys_end SYS_TYPE as row end invisible,
+period for system_time (sys_start, sys_end))
+with system versioning engine=ENGINE;
+create table t2 like t1;
+insert into t1 values (1, 1), (1, 2), (1, 3), (4, 4), (5, 5);
+insert into t2 values (1, 2), (2, 1), (3, 1);
+set @t0= now(6);
+select t1.x as IJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x;
+IJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+select t1.x as LJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x;
+LJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+select t1.x as RJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x;
+RJ1_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+delete from t1;
+delete from t2;
+select IJ2_x1,y1,x2,y2 from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+IJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+select LJ2_x1,y1,x2,y2 from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+LJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+4 4 NULL NULL
+5 5 NULL NULL
+select RJ2_x1,y1,x2,y2 from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+RJ2_x1 y1 x2 y2
+1 1 1 2
+1 2 1 2
+1 3 1 2
+NULL NULL 2 1
+NULL NULL 3 1
+drop table t1;
+drop table t2;
+# MDEV-14686 Server crashes in Item_field::used_tables on 2nd call of SP [#422]
+create or replace table t1 (called int, bad int) with system versioning;
+create or replace procedure bad() select * from t1 where bad in (select called from t1);
+called bad
+called bad
+called bad
+called bad
+called bad
+called bad
+called bad
+called bad
+# bad() is good.
+# MDEV-14751 Server crashes in TABLE::versioned on 2nd execution of SP [#431]
+create or replace table t1 (called_bad int);
+create or replace table t2 (b int);
+create or replace procedure bad() select * from t1 where ( 5, 6 ) in ( select b, b from t2 ) and called_bad in ( select max(b) from t2 );
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+# bad() is good.
+# MDEV-14786 Server crashes in Item_cond::transform on 2nd execution of SP querying from a view [#436]
+create or replace table t1 (called_bad int) with system versioning;
+create or replace view v1 as select called_bad from t1 where called_bad < 5;
+create or replace procedure bad() select called_bad from v1;
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+called_bad
+# bad() is good.
+# wildcard expansion on hidden fields.
+create or replace table t1(
+A int
+) with system versioning;
+insert into t1 values(1);
+select * from t1;
+A
+1
+create or replace table t1 (x int);
+insert into t1 values (1);
+select * from t1 for system_time all;
+ERROR HY000: Table `t1` is not system-versioned
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+select * from t1 for system_time as of now() for update;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+create or replace table t1 (a int not null auto_increment primary key) with system versioning;
+select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
+a
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (a int) with system versioning;
+insert into t1 values(1);
+insert into t2 values(1);
+create or replace view v1 as select * from t2 inner join t1 using (a);
+select * from v1;
+a
+1
+drop view v1;
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create view vt1 as select a from t1;
+select * from t1 natural join vt1;
+a
+1
+drop view vt1;
+create or replace table t1(x int) with system versioning;
+select * from (t1 as r left join t1 as u using (x)), t1;
+x x
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create trigger read_end after update on t1
+for each row set @end = old.row_end;
+update t1 set a=2;
+select @end;
+@end
+MAX_RESULT
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+select * from (select * from t1 cross join t2) as tmp;
+a b
+1 2
+select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
+a b
+1 2
+select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00')) as tmp;
+a b
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+select * from t1 for system_time all natural left join t2 for system_time all;
+a1 a2
+1 1
+2 1
+1 2
+2 2
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+create or replace view v1 as select a1 from t1;
+select * from v1 natural join t2;
+a1 a2
+1 1
+2 1
+1 2
+2 2
+select * from v1 natural left join t2;
+a1 a2
+1 1
+2 1
+1 2
+2 2
+select * from v1 natural right join t2;
+a2 a1
+1 1
+2 1
+1 2
+2 2
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
+a a
+2 1
+3 1
+2 2
+3 2
+2 3
+3 3
+1 NULL
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int) with system versioning;
+insert into t1 values (1), (2), (3);
+delete from t1 where x = 3;
+insert into t2 values (1);
+select * from t1, t2 for system_time all;
+x y
+1 1
+2 1
+select * from (select * from t1 for system_time all, t2 for system_time all) for system_time all as t;
+ERROR HY000: Table `t` is not system-versioned
+select * from (t1 for system_time all join t2 for system_time all) for system_time all;
+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
+# MDEV-16043 Assertion thd->Item_change_list::is_empty() failed in mysql_parse upon SELECT from a view reading from a versioned table
+create or replace table t1 (a int) with system versioning;
+create or replace view v1 as select * from t1;
+prepare stmt from "select * from t1 where exp( '20010609211642053929' )";
+execute stmt;
+ERROR 22003: DOUBLE value is out of range in 'exp('20010609211642053929')'
+select a from v1;
+a
+drop view v1;
+drop table t1, t2;
diff --git a/mysql-test/suite/versioning/r/simple.result b/mysql-test/suite/versioning/r/simple.result
new file mode 100644
index 00000000000..df47f80c9e9
--- /dev/null
+++ b/mysql-test/suite/versioning/r/simple.result
@@ -0,0 +1,200 @@
+set default_storage_engine=innodb;
+create or replace table dept (
+dept_id int(10) primary key,
+name varchar(100)
+)
+with system versioning;
+create or replace table emp (
+emp_id int(10) primary key,
+dept_id int(10),
+name varchar(100),
+salary int(10),
+constraint `dept-emp-fk`
+ foreign key (dept_id) references dept (dept_id)
+on delete restrict
+on update restrict
+)
+with system versioning;
+select now() into @ts_0;
+insert into dept (dept_id, name) values (10, "accounting");
+commit;
+select row_start into @ts_1 from dept where dept_id=10;
+insert into emp (emp_id, name, salary, dept_id) values (1, "bill", 1000, 10);
+commit;
+select row_start into @ts_2 from emp where name="bill";
+select * from emp;
+emp_id dept_id name salary
+1 10 bill 1000
+update emp set salary=2000 where name="bill";
+commit;
+select row_start into @ts_3 from emp where name="bill";
+select * from emp;
+emp_id dept_id name salary
+1 10 bill 2000
+select * from emp for system_time as of timestamp @ts_2;
+emp_id dept_id name salary
+1 10 bill 1000
+select * from emp for system_time as of timestamp @ts_3;
+emp_id dept_id name salary
+1 10 bill 2000
+select * from emp e, dept d
+where d.dept_id = 10
+and d.dept_id = e.dept_id;
+emp_id dept_id name salary dept_id name
+1 10 bill 2000 10 accounting
+select * from
+emp for system_time from timestamp @ts_1 to timestamp @ts_2 e,
+dept for system_time from timestamp @ts_1 to timestamp @ts_2 d
+where d.dept_id = 10
+and d.dept_id = e.dept_id;
+emp_id dept_id name salary dept_id name
+set statement system_versioning_asof=@ts_0 for
+select * from emp e, dept d
+where d.dept_id = 10
+and d.dept_id = e.dept_id;
+emp_id dept_id name salary dept_id name
+set statement system_versioning_asof=@ts_1 for
+select * from emp e, dept d
+where d.dept_id = 10
+and d.dept_id = e.dept_id;
+emp_id dept_id name salary dept_id name
+set statement system_versioning_asof=@ts_2 for
+select * from emp e, dept d
+where d.dept_id = 10
+and d.dept_id = e.dept_id;
+emp_id dept_id name salary dept_id name
+1 10 bill 1000 10 accounting
+set statement system_versioning_asof=@ts_3 for
+select * from emp e, dept d
+where d.dept_id = 10
+and d.dept_id = e.dept_id;
+emp_id dept_id name salary dept_id name
+1 10 bill 2000 10 accounting
+drop table emp, dept;
+create table t1 (
+a timestamp(6),
+b timestamp(6) generated always as (a + interval 1 day),
+c timestamp(6) generated always as (a + interval 1 month) stored,
+d timestamp(6) generated always as row start,
+e timestamp(6) generated always as row end,
+period for system_time(d,e)
+) with system versioning;
+show columns from t1;
+Field Type Null Key Default Extra
+a timestamp(6) NO current_timestamp(6) on update current_timestamp(6)
+b timestamp(6) YES NULL VIRTUAL GENERATED
+c timestamp(6) YES NULL STORED GENERATED
+d timestamp(6) NO NULL STORED GENERATED
+e timestamp(6) NO NULL STORED GENERATED
+select 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,column_comment,is_generated,generation_expression,'---' from information_schema.columns where table_name='t1';
+table_catalog def
+table_schema test
+table_name t1
+column_name a
+ordinal_position 1
+column_default current_timestamp(6)
+is_nullable NO
+data_type timestamp
+character_maximum_length NULL
+character_octet_length NULL
+numeric_precision NULL
+numeric_scale NULL
+datetime_precision 6
+character_set_name NULL
+collation_name NULL
+column_type timestamp(6)
+column_key
+extra on update current_timestamp(6)
+column_comment
+is_generated NEVER
+generation_expression NULL
+--- ---
+table_catalog def
+table_schema test
+table_name t1
+column_name b
+ordinal_position 2
+column_default NULL
+is_nullable YES
+data_type timestamp
+character_maximum_length NULL
+character_octet_length NULL
+numeric_precision NULL
+numeric_scale NULL
+datetime_precision 6
+character_set_name NULL
+collation_name NULL
+column_type timestamp(6)
+column_key
+extra VIRTUAL GENERATED
+column_comment
+is_generated ALWAYS
+generation_expression `a` + interval 1 day
+--- ---
+table_catalog def
+table_schema test
+table_name t1
+column_name c
+ordinal_position 3
+column_default NULL
+is_nullable YES
+data_type timestamp
+character_maximum_length NULL
+character_octet_length NULL
+numeric_precision NULL
+numeric_scale NULL
+datetime_precision 6
+character_set_name NULL
+collation_name NULL
+column_type timestamp(6)
+column_key
+extra STORED GENERATED
+column_comment
+is_generated ALWAYS
+generation_expression `a` + interval 1 month
+--- ---
+table_catalog def
+table_schema test
+table_name t1
+column_name d
+ordinal_position 4
+column_default NULL
+is_nullable NO
+data_type timestamp
+character_maximum_length NULL
+character_octet_length NULL
+numeric_precision NULL
+numeric_scale NULL
+datetime_precision 6
+character_set_name NULL
+collation_name NULL
+column_type timestamp(6)
+column_key
+extra STORED GENERATED
+column_comment
+is_generated ALWAYS
+generation_expression ROW START
+--- ---
+table_catalog def
+table_schema test
+table_name t1
+column_name e
+ordinal_position 5
+column_default NULL
+is_nullable NO
+data_type timestamp
+character_maximum_length NULL
+character_octet_length NULL
+numeric_precision NULL
+numeric_scale NULL
+datetime_precision 6
+character_set_name NULL
+collation_name NULL
+column_type timestamp(6)
+column_key
+extra STORED GENERATED
+column_comment
+is_generated ALWAYS
+generation_expression ROW END
+--- ---
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/sysvars.result b/mysql-test/suite/versioning/r/sysvars.result
new file mode 100644
index 00000000000..cd858d6cf69
--- /dev/null
+++ b/mysql-test/suite/versioning/r/sysvars.result
@@ -0,0 +1,177 @@
+create table t (a int) with system versioning;
+insert into t values (1);
+update t set a= 2;
+show global variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof DEFAULT
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof DEFAULT
+select * from t;
+a
+2
+set system_versioning_asof= '2031-1-1 0:0:0';
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 2031-01-01 00:00:00.000000
+select * from t;
+a
+2
+set system_versioning_asof= '2011-1-1 0:0:0';
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 2011-01-01 00:00:00.000000
+select * from t;
+a
+set global system_versioning_asof= 'alley';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
+set global system_versioning_asof= null;
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'NULL'
+set global system_versioning_asof= 1;
+ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set global system_versioning_asof= 1.1;
+ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set global system_versioning_asof= '2011-02-29 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
+set global system_versioning_asof= '2011-02-28 24:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
+set global system_versioning_asof= '2011-00-28 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
+set global system_versioning_asof= '0000-00-00 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
+set system_versioning_asof= 'alley';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
+set system_versioning_asof= null;
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'NULL'
+set system_versioning_asof= 1;
+ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set system_versioning_asof= 1.1;
+ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set system_versioning_asof= '2011-02-29 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
+set system_versioning_asof= '2011-02-28 24:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
+set system_versioning_asof= '2011-00-28 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
+set system_versioning_asof= '0000-00-00 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
+# GLOBAL @@system_versioning_asof
+set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
+Warnings:
+Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
+Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
+show global variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1911-11-11 11:11:11.111111
+set global system_versioning_asof= '1900-01-01 00:00:00';
+show global variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1900-01-01 00:00:00.000000
+set global system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
+Warnings:
+Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
+show global variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1911-11-11 11:11:11.111111
+set @ts= timestamp'1900-01-01 00:00:00';
+set global system_versioning_asof= @ts;
+show global variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1900-01-01 00:00:00.000000
+set global system_versioning_asof= default;
+select @@global.system_versioning_asof;
+@@global.system_versioning_asof
+DEFAULT
+# SESSION @@system_versioning_asof
+set system_versioning_asof= '1911-11-11 11:11:11.1111119';
+Warnings:
+Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
+Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1911-11-11 11:11:11.111111
+set system_versioning_asof= '1900-01-01 00:00:00';
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1900-01-01 00:00:00.000000
+set system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
+Warnings:
+Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1911-11-11 11:11:11.111111
+set @ts= timestamp'1900-01-01 00:00:00';
+set system_versioning_asof= @ts;
+show variables like 'system_versioning_asof';
+Variable_name Value
+system_versioning_asof 1900-01-01 00:00:00.000000
+# DEFAULT: value is copied from GLOBAL to SESSION
+set global system_versioning_asof= timestamp'1911-11-11 11:11:11.111111';
+set system_versioning_asof= '1900-01-01 00:00:00';
+select @@global.system_versioning_asof != @@system_versioning_asof as different;
+different
+1
+set system_versioning_asof= default;
+select @@global.system_versioning_asof = @@system_versioning_asof as equal;
+equal
+1
+set global system_versioning_asof= DEFAULT;
+set system_versioning_asof= DEFAULT;
+select @@global.system_versioning_asof, @@system_versioning_asof;
+@@global.system_versioning_asof @@system_versioning_asof
+DEFAULT DEFAULT
+select * from t for system_time all;
+a
+2
+1
+select * from t;
+a
+2
+select * from t for system_time as of timestamp current_timestamp(6);
+a
+2
+select * from t for system_time all;
+a
+2
+1
+select * from t for system_time from '1970-01-01 00:00' to current_timestamp(6);
+a
+2
+1
+select * from t for system_time between '1970-01-01 00:00' and current_timestamp(6);
+a
+2
+1
+show status like "Feature_system_versioning";
+Variable_name Value
+Feature_system_versioning 2
+drop table t;
+#
+# MDEV-22906 Disallow system_versioning_asof in DML
+#
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int);
+insert into t1 values (1);
+insert into t2 values (1);
+set system_versioning_asof= '1970-01-01 00:00:00';
+delete t1, t2 from t1 join t2 where t1.x = t2.y;
+select * from t1 for system_time as of timestamp now(6);
+x
+insert into t1 values (1);
+insert into t2 values (1);
+update t1, t2 set x= 2, y= 2 where x = y;
+select * from t1 for system_time as of timestamp now(6);
+x
+2
+replace t2 select x + 1 from t1;
+select * from t2;
+y
+2
+3
+insert t2 select x + 2 from t1;
+select * from t2;
+y
+2
+3
+4
+drop tables t1, t2;
diff --git a/mysql-test/suite/versioning/r/truncate_privilege.result b/mysql-test/suite/versioning/r/truncate_privilege.result
new file mode 100644
index 00000000000..e2b48c494be
--- /dev/null
+++ b/mysql-test/suite/versioning/r/truncate_privilege.result
@@ -0,0 +1,33 @@
+connect root,localhost,root,,test;
+connection root;
+create database mysqltest;
+create user mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
+connection root;
+create table mysqltest.t (a int) with system versioning;
+connection user1;
+show grants;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+delete history from mysqltest.t before system_time now();
+ERROR 42000: DELETE HISTORY command denied to user 'mysqltest_1'@'localhost' for table 't'
+connection root;
+grant delete history on mysqltest.* to mysqltest_1@localhost;
+grant delete history on mysqltest.t to mysqltest_1@localhost;
+connection user1;
+show grants;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.`t` TO `mysqltest_1`@`localhost`
+delete history from mysqltest.t before system_time now();
+connection root;
+grant all on *.* to mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT ALL PRIVILEGES ON *.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.`t` TO `mysqltest_1`@`localhost`
+drop user mysqltest_1@localhost;
+drop database mysqltest;
diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result
new file mode 100644
index 00000000000..a140052439c
--- /dev/null
+++ b/mysql-test/suite/versioning/r/trx_id.result
@@ -0,0 +1,500 @@
+set default_storage_engine= innodb;
+create or replace table t1 (
+x int,
+sys_trx_start bigint(20) unsigned as row start invisible,
+sys_trx_end bigint(20) unsigned as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning;
+insert into t1 (x) values (1);
+# ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
+set @@system_versioning_alter_history=keep;
+create or replace table t1 (x int);
+insert into t1 values (1);
+alter table t1
+add column s bigint unsigned as row start,
+add column e bigint unsigned as row end,
+add period for system_time(s, e),
+add system versioning,
+algorithm=inplace;
+select s from t1 into @trx_start;
+select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
+count(*) = 1
+1
+create or replace table t1 (x int);
+select count(*) from mysql.transaction_registry into @tmp;
+alter table t1
+add column s bigint unsigned as row start,
+add column e bigint unsigned as row end,
+add period for system_time(s, e),
+add system versioning,
+algorithm=inplace;
+select count(*) = @tmp from mysql.transaction_registry;
+count(*) = @tmp
+1
+create or replace table t1 (x int);
+insert into t1 values (1);
+alter table t1
+add column s bigint unsigned as row start,
+add column e bigint unsigned as row end,
+add period for system_time(s, e),
+add system versioning,
+algorithm=copy;
+select s from t1 into @trx_start;
+select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
+count(*) = 1
+1
+create or replace table t1 (x int);
+select count(*) from mysql.transaction_registry into @tmp;
+alter table t1
+add column s bigint unsigned as row start,
+add column e bigint unsigned as row end,
+add period for system_time(s, e),
+add system versioning,
+algorithm=copy;
+select count(*) = @tmp + 1 from mysql.transaction_registry;
+count(*) = @tmp + 1
+1
+# TRX_ID to TIMESTAMP versioning switch
+create or replace table t1 (
+x int,
+sys_start bigint unsigned as row start invisible,
+sys_end bigint unsigned as row end invisible,
+period for system_time (sys_start, sys_end)
+) with system versioning;
+insert into t1 values (1);
+alter table t1 drop column sys_start, drop column sys_end;
+select row_end = 18446744073709551615 as transaction_based from t1 for system_time all;
+transaction_based
+1
+# Simple vs SEES algorithms
+create or replace table t1 (
+x int,
+sys_start bigint(20) unsigned as row start invisible,
+sys_end bigint(20) unsigned as row end invisible,
+period for system_time (sys_start, sys_end)
+) with system versioning;
+set transaction isolation level read committed;
+start transaction;
+insert into t1 values (1);
+connect con1,localhost,root,,test;
+set transaction isolation level read committed;
+start transaction;
+insert into t1 values (2);
+connect con2,localhost,root,,test;
+set transaction isolation level read committed;
+start transaction;
+insert into t1 values (3);
+commit;
+disconnect con2;
+connection default;
+set @ts1= sysdate(6);
+connection con1;
+commit;
+disconnect con1;
+connection default;
+set @ts2= sysdate(6);
+commit;
+set @ts3= sysdate(6);
+select sys_start from t1 where x = 1 into @trx_id1;
+select sys_start from t1 where x = 2 into @trx_id2;
+select sys_start from t1 where x = 3 into @trx_id3;
+select @trx_id1 < @trx_id2, @trx_id2 < @trx_id3;
+@trx_id1 < @trx_id2 @trx_id2 < @trx_id3
+1 1
+select @ts1 < @ts2, @ts2 < @ts3;
+@ts1 < @ts2 @ts2 < @ts3
+1 1
+# MVCC is resolved
+select * from t1 for system_time as of transaction @trx_id1;
+x
+1
+2
+3
+select * from t1 for system_time as of timestamp @ts1;
+x
+3
+select * from t1 for system_time as of transaction @trx_id2;
+x
+2
+3
+select * from t1 for system_time as of timestamp @ts2;
+x
+2
+3
+select * from t1 for system_time as of transaction @trx_id3;
+x
+3
+select * from t1 for system_time as of timestamp @ts3;
+x
+1
+2
+3
+#
+# MDEV-15427 IB: TRX_ID based operations inside transaction generate history
+#
+create or replace table t1(
+x int(10),
+row_start bigint(20) unsigned as row start,
+row_end bigint(20) unsigned as row end,
+period for system_time(row_start, row_end)
+) with system versioning;
+begin;
+insert into t1 (x) values (1);
+delete from t1;
+commit;
+select x from t1 for system_time all;
+x
+insert into t1 (x) values (2);
+begin;
+update t1 set x= 3;
+update t1 set x= 4;
+commit;
+select x, row_start < row_end from t1 for system_time all;
+x row_start < row_end
+4 1
+2 1
+# MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL
+create or replace table t1 (
+x int,
+row_start bigint unsigned as row start invisible,
+row_end bigint unsigned as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning engine innodb;
+insert into t1 (x) values (1);
+delete from t1;
+select * from t1 for system_time as of timestamp'1990-1-1 00:00';
+x
+select * from t1 for system_time as of NULL;
+x
+# MDEV-16024 transaction_registry.begin_timestamp is wrong for explicit transactions
+create or replace table t1 (
+x int(11) default null,
+row_start bigint(20) unsigned generated always as row start invisible,
+row_end bigint(20) unsigned generated always as row end invisible,
+period for system_time (row_start, row_end)
+) engine=innodb with system versioning;
+begin;
+set @ts1= now(6);
+insert into t1 values (1);
+commit;
+select row_start from t1 into @trx_id;
+select trt_begin_ts(@trx_id) <= @ts1 as BEGIN_TS_GOOD;
+BEGIN_TS_GOOD
+1
+drop table t1;
+#
+# MDEV-16100 FOR SYSTEM_TIME erroneously resolves string user variables as transaction IDs
+#
+CREATE TABLE t1 (
+x INT,
+sys_trx_start BIGINT UNSIGNED AS ROW START,
+sys_trx_end BIGINT UNSIGNED AS ROW END,
+PERIOD FOR SYSTEM_TIME (sys_trx_start, sys_trx_end)
+) WITH SYSTEM VERSIONING ENGINE=INNODB;
+INSERT INTO t1 (x) VALUES (1);
+SET @ts= DATE_ADD(NOW(), INTERVAL 1 YEAR);
+EXPLAIN EXTENDED SELECT x FROM t1 FOR SYSTEM_TIME AS OF TRANSACTION @ts;
+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 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`x` AS `x` from `test`.`t1` FOR SYSTEM_TIME ALL where trt_trx_sees(`test`.`t1`.`sys_trx_end`,@`ts`) and trt_trx_sees_eq(@`ts`,`test`.`t1`.`sys_trx_start`)
+EXPLAIN EXTENDED SELECT x FROM t1 FOR SYSTEM_TIME AS OF TIMESTAMP @ts;
+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 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`x` AS `x` from `test`.`t1` FOR SYSTEM_TIME ALL where trt_trx_sees(`test`.`t1`.`sys_trx_end`,<cache>(trt_trx_id(@`ts`))) and trt_trx_sees_eq(<cache>(trt_trx_id(@`ts`)),`test`.`t1`.`sys_trx_start`)
+EXPLAIN EXTENDED SELECT x FROM t1 FOR SYSTEM_TIME AS OF @ts;
+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 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`x` AS `x` from `test`.`t1` FOR SYSTEM_TIME ALL where trt_trx_sees(`test`.`t1`.`sys_trx_end`,<cache>(trt_trx_id(@`ts`))) and trt_trx_sees_eq(<cache>(trt_trx_id(@`ts`)),`test`.`t1`.`sys_trx_start`)
+DROP TABLE t1;
+#
+# Testing AS OF with expressions of various kinds and data types
+#
+CREATE TABLE t1
+(
+x INT,
+sys_trx_start BIGINT UNSIGNED AS ROW START INVISIBLE,
+sys_trx_end BIGINT UNSIGNED AS ROW END INVISIBLE,
+PERIOD FOR SYSTEM_TIME (sys_trx_start, sys_trx_end)
+) WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2
+(
+x INT,
+sys_trx_start TIMESTAMP(6) AS ROW START INVISIBLE,
+sys_trx_end TIMESTAMP(6) AS ROW END INVISIBLE,
+PERIOD FOR SYSTEM_TIME (sys_trx_start, sys_trx_end)
+) WITH SYSTEM VERSIONING;
+INSERT INTO t2 VALUES (1);
+#
+# ROW is not supported
+#
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (1,1);
+ERROR HY000: Illegal parameter data type row for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (1,1);
+ERROR HY000: Illegal parameter data type row for operation 'FOR SYSTEM_TIME'
+#
+# DOUBLE is not supported, use explicit CAST
+#
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF RAND();
+ERROR HY000: Illegal parameter data type double for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (RAND());
+ERROR HY000: Illegal parameter data type double for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF COALESCE(RAND());
+ERROR HY000: Illegal parameter data type double for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF RAND();
+ERROR HY000: Illegal parameter data type double for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (RAND());
+ERROR HY000: Illegal parameter data type double for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF COALESCE(RAND());
+ERROR HY000: Illegal parameter data type double for operation 'FOR SYSTEM_TIME'
+#
+# DECIMAL is not supported, use explicit CAST
+#
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF 10.1;
+ERROR HY000: Illegal parameter data type decimal for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF COALESCE(10.1);
+ERROR HY000: Illegal parameter data type decimal for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF 10.1;
+ERROR HY000: Illegal parameter data type decimal for operation 'FOR SYSTEM_TIME'
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF COALESCE(10.1);
+ERROR HY000: Illegal parameter data type decimal for operation 'FOR SYSTEM_TIME'
+#
+# YEAR is not supported, use explicit CAST
+#
+BEGIN NOT ATOMIC
+DECLARE var YEAR;
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Illegal parameter data type year for operation 'FOR SYSTEM_TIME'
+BEGIN NOT ATOMIC
+DECLARE var YEAR;
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Illegal parameter data type year for operation 'FOR SYSTEM_TIME'
+#
+# ENUM is not supported, use explicit CAST
+#
+BEGIN NOT ATOMIC
+DECLARE var ENUM('xxx') DEFAULT 'xxx';
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Illegal parameter data type enum for operation 'FOR SYSTEM_TIME'
+BEGIN NOT ATOMIC
+DECLARE var ENUM('xxx') DEFAULT 'xxx';
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Illegal parameter data type enum for operation 'FOR SYSTEM_TIME'
+#
+# SET is not supported, use explicit CAST
+#
+BEGIN NOT ATOMIC
+DECLARE var SET('xxx') DEFAULT 'xxx';
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Illegal parameter data type set for operation 'FOR SYSTEM_TIME'
+BEGIN NOT ATOMIC
+DECLARE var SET('xxx') DEFAULT 'xxx';
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Illegal parameter data type set for operation 'FOR SYSTEM_TIME'
+#
+# BIT is resolved to TRANSACTION
+#
+BEGIN NOT ATOMIC
+DECLARE var BIT(10);
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+x
+BEGIN NOT ATOMIC
+DECLARE var BIT(10);
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+ERROR HY000: Transaction-precise system versioning for `t2` is not supported
+#
+# String literals resolve to TIMESTAMP
+#
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF '2038-12-30 00:00:00';
+x
+1
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF '2038-12-30 00:00:00';
+x
+#
+# HEX hybrids resolve to TRANSACTION
+#
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0xFFFFFFFF);
+ERROR HY000: TRX_ID 4294967295 not found in `mysql.transaction_registry`
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0xFFFFFFFF);
+ERROR HY000: Transaction-precise system versioning for `t2` is not supported
+#
+# BIT literals resolve to TRANSACTION
+#
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111');
+ERROR HY000: TRX_ID 4294967295 not found in `mysql.transaction_registry`
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111');
+ERROR HY000: Transaction-precise system versioning for `t2` is not supported
+DROP TABLE t1, t2;
+#
+# MDEV-16094 Crash when using AS OF with a stored function
+#
+CREATE FUNCTION fts() RETURNS DATETIME RETURN '2001-01-01 10:20:30';
+CREATE FUNCTION ftx() RETURNS BIGINT UNSIGNED RETURN 1;
+CREATE TABLE ttx
+(
+x INT,
+start_timestamp BIGINT UNSIGNED GENERATED ALWAYS AS ROW START,
+end_timestamp BIGINT UNSIGNED GENERATED ALWAYS AS ROW END,
+PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp)
+) ENGINE=InnoDB WITH SYSTEM VERSIONING;
+CREATE TABLE tts
+(
+x INT,
+start_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW START,
+end_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW END,
+PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp)
+) ENGINE=InnoDB WITH SYSTEM VERSIONING;
+SELECT * FROM tts FOR SYSTEM_TIME AS OF fts();
+x start_timestamp end_timestamp
+SELECT * FROM tts FOR SYSTEM_TIME AS OF ftx();
+ERROR HY000: Transaction-precise system versioning for `tts` is not supported
+SELECT * FROM ttx FOR SYSTEM_TIME AS OF fts();
+x start_timestamp end_timestamp
+SELECT * FROM ttx FOR SYSTEM_TIME AS OF ftx();
+x start_timestamp end_timestamp
+DROP TABLE tts;
+DROP TABLE ttx;
+DROP FUNCTION fts;
+DROP FUNCTION ftx;
+#
+# MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
+#
+SET @@SYSTEM_VERSIONING_ALTER_HISTORY=KEEP;
+CREATE TABLE t (
+a INT,
+b INT,
+row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
+row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
+PERIOD FOR SYSTEM_TIME(row_start, row_end)
+) WITH SYSTEM VERSIONING ENGINE=INNODB;
+INSERT INTO t VALUES (1,1);
+# without table rebuild
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ON c.table_id=t.table_id
+WHERE t.name='test/t' AND c.name='a';
+prtype
+50179
+ALTER TABLE t
+CHANGE a a INT WITHOUT SYSTEM VERSIONING;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ON c.table_id=t.table_id
+WHERE t.name='test/t' AND c.name='a';
+prtype
+1027
+UPDATE t SET a=11;
+SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
+COUNT(*)
+1
+# with table rebuild
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ON c.table_id=t.table_id
+WHERE t.name='test/t' AND c.name='a';
+prtype
+1027
+ALTER TABLE t
+CHANGE a a INT WITH SYSTEM VERSIONING,
+ADD PRIMARY KEY pk(a);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ON c.table_id=t.table_id
+WHERE t.name='test/t' AND c.name='a';
+prtype
+50435
+UPDATE t SET a=1;
+SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
+COUNT(*)
+2
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ `row_start` bigint(20) unsigned GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` bigint(20) unsigned GENERATED ALWAYS AS ROW END INVISIBLE,
+ PRIMARY KEY (`a`,`row_end`),
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+# handles VIRTUAL columns too
+CREATE OR REPLACE TABLE t (
+a INT AS (b + 1),
+b INT,
+row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
+row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
+PERIOD FOR SYSTEM_TIME(row_start, row_end)
+) WITH SYSTEM VERSIONING ENGINE=INNODB;
+INSERT INTO t VALUES (DEFAULT, 1);
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ON c.table_id=t.table_id
+WHERE t.name='test/t' AND c.name='b';
+prtype
+50179
+ALTER TABLE t
+CHANGE b b INT WITHOUT SYSTEM VERSIONING;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ON c.table_id=t.table_id
+WHERE t.name='test/t' AND c.name='b';
+prtype
+1027
+UPDATE t SET b=11;
+SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
+COUNT(*)
+1
+DROP TABLE t;
+SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
+SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+count(*)
+0
+# MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
+# trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
+# ALTER TABLE with versioning
+create or replace table t (x int) engine=innodb;
+set autocommit= 0;
+alter table t
+algorithm=copy,
+add column row_start bigint unsigned as row start,
+add column row_end bigint unsigned as row end,
+add period for system_time(row_start,row_end),
+with system versioning;
+set autocommit= 1;
+# MDEV-18865 Assertion `t->first->versioned_by_id()'
+# failed in innodb_prepare_commit_versioned
+create or replace table t (x int) engine=innodb;
+insert into t values (0);
+alter table t add `row_start` bigint unsigned as row start,
+add `row_end` bigint unsigned as row end,
+add period for system_time(`row_start`,`row_end`),
+modify x int after row_start,
+with system versioning;
+create or replace database test;
diff --git a/mysql-test/suite/versioning/r/update,trx_id.rdiff b/mysql-test/suite/versioning/r/update,trx_id.rdiff
new file mode 100644
index 00000000000..7ce75714235
--- /dev/null
+++ b/mysql-test/suite/versioning/r/update,trx_id.rdiff
@@ -0,0 +1,16 @@
+--- update.result 2018-12-19 13:55:35.873917389 +0300
++++ update,trx_id.reject 2018-12-19 13:55:35.533917399 +0300
+@@ -81,12 +81,10 @@
+ commit;
+ select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all order by sys_trx_end, x, y;
+ x y current
+-3 1 0
+ 2 1 0
+-3 2 0
++3 1 0
+ 4 1 0
+ 5 1 0
+-5 2 0
+ 1 1 1
+ 2 2 1
+ 3 3 1
diff --git a/mysql-test/suite/versioning/r/update-big.result b/mysql-test/suite/versioning/r/update-big.result
new file mode 100644
index 00000000000..89297fe5d89
--- /dev/null
+++ b/mysql-test/suite/versioning/r/update-big.result
@@ -0,0 +1,25 @@
+#
+# MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
+#
+create or replace table t1 (a int);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8);
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+connect con1,localhost,root,,test;
+alter table t1 add system versioning;
+connection default;
+update t1 set a= 7 where a = 3;
+update t1 set a= 2 where a = 7;
+update t1 set a= 5 where a = 2;
+update t1 set a= 1 where a = 5;
+update t1 set a= 8 where a = 1;
+update t1 set a= 4 where a = 8;
+update t1 set a= 6;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
new file mode 100644
index 00000000000..cd26c341113
--- /dev/null
+++ b/mysql-test/suite/versioning/r/update.result
@@ -0,0 +1,352 @@
+create table t1(
+x int unsigned,
+y int unsigned,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
+select x, y from t1 order by x, y;
+x y
+1 1000
+2 2000
+3 3000
+4 4000
+5 5000
+6 6000
+7 7000
+8 8000
+9 9000
+update t1 set y = y + 1 where x > 7;
+select x, y from t1 order by x, y;
+x y
+1 1000
+2 2000
+3 3000
+4 4000
+5 5000
+6 6000
+7 7000
+8 8001
+9 9001
+select x, y from t1 for system_time all order by sys_trx_end, x, y;
+x y
+8 8000
+9 9000
+1 1000
+2 2000
+3 3000
+4 4000
+5 5000
+6 6000
+7 7000
+8 8001
+9 9001
+drop table t1;
+create table t1 (
+id bigint primary key,
+x int,
+y int without system versioning,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+insert into t1 values(1, 1, 1);
+set @ins_t= now(6);
+select sys_trx_start into @tmp1 from t1;
+update t1 set x= 11, y= 11 where id = 1;
+select @tmp1 < sys_trx_start as A1, x, y from t1;
+A1 x y
+1 11 11
+select sys_trx_start into @tmp1 from t1;
+update t1 set y= 1 where id = 1;
+select @tmp1 = sys_trx_start as A2, x from t1;
+A2 x
+1 11
+drop table t1;
+create table t1 (
+x int,
+y int,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning;
+insert into t1 (x, y) values (1, 1), (2, 1), (3, 1), (4, 1), (5, 1);
+start transaction;
+update t1 set y= y + 1 where x = 3;
+update t1 set y= y + 1 where x = 2;
+update t1 set y= y + 1 where x = 3;
+update t1 set y= y + 1 where x > 3;
+update t1 set y= y + 1 where x > 4;
+commit;
+select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all order by sys_trx_end, x, y;
+x y current
+3 1 0
+2 1 0
+3 2 0
+4 1 0
+5 1 0
+5 2 0
+1 1 1
+2 2 1
+3 3 1
+4 2 1
+5 3 1
+drop table t1;
+create table t1 (
+id int primary key auto_increment,
+x int,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+set @t0= now(6);
+insert into t1 (x) values (1);
+set @t1= now(6);
+update t1 set x= 2 where id = 1;
+set @t2= now(6);
+update t1 set x= 3 where id = 1;
+select x from t1 for system_time as of timestamp @t0;
+x
+select x from t1 for system_time as of timestamp @t1;
+x
+1
+select x from t1 for system_time as of timestamp @t2;
+x
+2
+select x from t1 for system_time as of timestamp now(6);
+x
+3
+drop table t1;
+create table t1(
+x int unsigned,
+sys_trx_end SYS_DATATYPE as row end invisible,
+sys_trx_start SYS_DATATYPE as row start invisible,
+y int unsigned,
+period for system_time (sys_trx_start, sys_trx_end),
+primary key(x, y))
+with system versioning;
+insert into t1(x, y) values (1, 1000), (3, 3000), (4, 4000), (5, 5000);
+insert into t1(x, y) values(3, 3000) on duplicate key update y = y+1;
+insert into t1(x, y) values(4, 4444) on duplicate key update y = y+1;
+select x, y from t1 for system_time all order by sys_trx_end, x, y;
+x y
+3 3000
+1 1000
+3 3001
+4 4000
+4 4444
+5 5000
+select x, y from t1 order by x, y;
+x y
+1 1000
+3 3001
+4 4000
+4 4444
+5 5000
+drop table t1;
+create table t1 (
+x int unsigned,
+y int unsigned,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+create table t2 like t1;
+insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
+insert into t2(x, y) values (1, 1010), (2, 2010), (3, 3010), (4, 4010), (5, 5010), (6, 6010), (7, 7010), (8, 8010), (9, 9010);
+update t1, t2 set t1.y = t1.x + t1.y, t2.y = t2.x + t2.y where t1.x > 7 and t2.x < 7;
+select x, y from t1 for system_time all order by sys_trx_end, x, y;
+x y
+8 8000
+9 9000
+1 1000
+2 2000
+3 3000
+4 4000
+5 5000
+6 6000
+7 7000
+8 8008
+9 9009
+select x, y from t1 order by x, y;
+x y
+1 1000
+2 2000
+3 3000
+4 4000
+5 5000
+6 6000
+7 7000
+8 8008
+9 9009
+select x, y from t2 for system_time all order by sys_trx_end, x, y;
+x y
+1 1010
+2 2010
+3 3010
+4 4010
+5 5010
+6 6010
+1 1011
+2 2012
+3 3013
+4 4014
+5 5015
+6 6016
+7 7010
+8 8010
+9 9010
+select x, y from t2 order by x, y;
+x y
+1 1011
+2 2012
+3 3013
+4 4014
+5 5015
+6 6016
+7 7010
+8 8010
+9 9010
+drop table t1;
+drop table t2;
+create table t1 (
+id bigint primary key without system versioning,
+name varchar(128),
+salary bigint without system versioning,
+sys_trx_start SYS_DATATYPE as row start invisible,
+sys_trx_end SYS_DATATYPE as row end invisible,
+period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+create table t2 like t1;
+insert into t1 values (1, "Jeremy", 3000);
+insert into t2 values (1, "Jeremy", 4000);
+select sys_trx_start into @tmp1 from t1;
+select sys_trx_start into @tmp2 from t2;
+update t1, t2 set t1.name= "Jerry", t2.name= "Jerry" where t1.id = t2.id and t1.name = "Jeremy";
+select @tmp1 < sys_trx_start as A1, name from t1;
+A1 name
+1 Jerry
+select @tmp2 < sys_trx_start as A2, name from t2;
+A2 name
+1 Jerry
+select sys_trx_start into @tmp1 from t1;
+select sys_trx_start into @tmp2 from t2;
+update t1, t2 set t1.salary= 2500, t2.salary= 2500 where t1.id = t2.id and t1.name = "Jerry";
+select @tmp1 = sys_trx_start as B1, salary from t1;
+B1 salary
+1 2500
+select @tmp2 = sys_trx_start as B2, salary from t2;
+B2 salary
+1 2500
+drop table t1;
+drop table t2;
+### Issue tempesta-tech/mariadb#365, bug 7 (duplicate of historical row)
+create or replace table t1 (a int primary key, b int)
+with system versioning engine myisam;
+insert into t1 (a) values (1);
+replace t1 values (1,2),(1,3),(2,4);
+#
+# MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
+#
+set @old_lock_wait_timeout= @@innodb_lock_wait_timeout;
+set @@innodb_lock_wait_timeout= 1073741824;
+create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
+engine=innodb with system versioning;
+insert into t1 (pk) values (1);
+connect con1,localhost,root,,test;
+start transaction;
+select * from t1 for update;
+pk a b
+1 NULL NULL
+connection default;
+update t1 set b = 'foo';
+connection con1;
+update t1 set a = 'bar';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+disconnect con1;
+connection default;
+drop table t1;
+set @@innodb_lock_wait_timeout= @old_lock_wait_timeout;
+#
+# MDEV-19406 Assertion on updating view of join with versioned table
+#
+create or replace table t1 (pk int primary key, a date, b int, index(b)) engine=innodb with system versioning;
+create or replace table t2 (c int);
+create or replace view v as select * from t1 join t2;
+insert into t1 (pk) values (1);
+update t1 set a= '2012-12-12';
+update v set a= '2000-01-01' order by b limit 1;
+drop view v;
+drop table t1, t2;
+#
+# MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
+#
+create or replace table t1 (a varchar(8))
+engine=aria row_format=fixed
+with system versioning;
+insert into t1 (a) values ('foo');
+update t1 set a = 'bar';
+drop table t1;
+#
+# MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
+#
+create or replace table t1 (
+pk int, a char(8), b char(8),
+primary key (pk)
+) with system versioning;
+create or replace view v1 as select * from t1;
+insert into t1 values (1, null, 'd') , (2, null, 'i') ;
+update v1 set a= null where b = '';
+create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
+insert into t1 values (1,1),(2,2);
+create or replace view v1 as select * from t1;
+update v1 set id= 2 where k = 0;
+create or replace table t1 (a int) with system versioning;
+create or replace view v1 as select * from t1;
+create or replace procedure sp() update v1 set xx = 1;
+call sp;
+ERROR 42S22: Unknown column 'xx' in 'field list'
+call sp;
+ERROR 42S22: Unknown column 'xx' in 'field list'
+drop procedure sp;
+drop view v1;
+drop table t1;
+#
+# MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table
+#
+create or replace table t1 (f point, key(f)) with system versioning engine=myisam;
+update t1 set f = null where f = 'foo';
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+#
+# MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon REPLACE on a system-versioned table
+#
+create or replace table t1 (
+a int,
+b int,
+row_start bigint(20) unsigned generated always as row start,
+row_end bigint(20) unsigned generated always as row end,
+unique key (b,row_end),
+key (row_start),
+period for system_time (row_start,row_end)
+) engine=innodb with system versioning;
+insert into t1 (a, b) values (1, 2);
+replace into t1 (a, b) values (3, 2);
+replace into t1 (a, b) values (4, 2);
+drop table t1;
+#
+# MDEV-20661 Virtual fields are not recalculated on system fields value assignment
+#
+create table t1 (
+a int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end),
+v1 bigint unsigned as (a ^ row_start) unique,
+v2 bigint unsigned as (a ^ row_end) unique
+) engine=innodb with system versioning;
+insert into t1 (a) values (1), (2);
+update ignore t1 set a= 3;
+delete history from t1;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/view.result b/mysql-test/suite/versioning/r/view.result
new file mode 100644
index 00000000000..e9e74899790
--- /dev/null
+++ b/mysql-test/suite/versioning/r/view.result
@@ -0,0 +1,281 @@
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+select now(6) into @t1;
+update t1 set x= 2;
+select now(6) into @t2;
+delete from t1;
+set @vt1= concat("create or replace view vt1 as select * from t1 for system_time as of timestamp '", @t1, "'");
+prepare stmt from @vt1;
+execute stmt;
+drop prepare stmt;
+set @vt2= concat("create or replace view vt2 as select *, row_end from t1 for system_time as of timestamp '", @t2, "'");
+prepare stmt from @vt2;
+execute stmt;
+drop prepare stmt;
+select * from t1;
+x
+create or replace view vt1 as select * from t1;
+show create view vt1;
+View Create View character_set_client collation_connection
+vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`x` AS `x` from `t1` latin1 latin1_swedish_ci
+drop view vt1;
+drop view vt2;
+create or replace view vt1 as select * from t1 for system_time all;
+select * from vt1;
+x
+2
+1
+prepare stmt from 'select * from vt1';
+execute stmt;
+x
+2
+1
+drop prepare stmt;
+set @str= concat('create or replace view vt1 as
+select * from t1 for system_time as of timestamp "', @t1, '"');
+prepare stmt from @str;
+execute stmt;
+drop prepare stmt;
+select * from t1 for system_time as of timestamp @t1;
+x
+1
+select * from vt1;
+x
+1
+insert into vt1 values (3);
+select * from t1;
+x
+3
+select * from vt1;
+x
+1
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1), (2);
+set @t1=now(6);
+delete from t1 where x=2;
+set @t2=now(6);
+delete from t1 where x=1;
+set @t3=now(6);
+set @tmp= concat("create or replace view vt1 as select * from t1 for system_time as of timestamp '", @t1, "'");
+prepare stmt from @tmp;
+execute stmt;
+drop prepare stmt;
+select * from vt1;
+x
+1
+2
+# VIEW with parameters [tempesta-tech/mariadb#151]
+create or replace table t1 (x int) with system versioning;
+create or replace view vt1(c) as select x from t1;
+show create view vt1;
+View Create View character_set_client collation_connection
+vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`x` AS `c` from `t1` latin1 latin1_swedish_ci
+# VIEW over JOIN of versioned tables [tempesta-tech/mariadb#153]
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+create or replace view vt12 as select * from t1 cross join t2;
+select * from vt12;
+a b
+1 2
+create or replace view vt12 as select * from t1 for system_time as of timestamp ('1970-01-01 00:00') cross join t2;
+select * from vt12;
+a b
+# VIEW improvements [tempesta-tech/mariadb#183]
+create or replace table t3 (x int);
+create or replace view vt1 as select * from t1, t2, t3;
+show create view vt1;
+View Create View character_set_client collation_connection
+vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,`t3`.`x` AS `x` from ((`t1` join `t2`) join `t3`) latin1 latin1_swedish_ci
+create or replace view vt1 as select * from t3, t2, t1;
+show create view vt1;
+View Create View character_set_client collation_connection
+vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t3`.`x` AS `x`,`t2`.`b` AS `b`,`t1`.`a` AS `a` from ((`t3` join `t2`) join `t1`) latin1 latin1_swedish_ci
+create or replace view vt1 as select a, t2.row_end as endo from t3, t1, t2;
+show create view vt1;
+View Create View character_set_client collation_connection
+vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`row_end` AS `endo` from ((`t3` join `t1`) join `t2`) latin1 latin1_swedish_ci
+# VIEW over UNION [tempesta-tech/mariadb#269]
+create or replace view vt1 as select * from t1 union select * from t1;
+select * from vt1;
+a
+1
+# VIEW over UNION with non-versioned [tempesta-tech/mariadb#393]
+create or replace table t2 (a int);
+create or replace view vt1 as select * from t1 union select * from t2;
+select * from vt1;
+a
+1
+#
+# MDEV-14689 crash on second PS execute
+#
+create or replace table t1 (a int);
+create or replace view v1 as select * from t1;
+create or replace table t2 (b int) with system versioning;
+prepare stmt from 'select a from v1 inner join t2 group by a order by a';
+execute stmt;
+a
+execute stmt;
+a
+drop view v1;
+drop tables t1, t2;
+#
+# MDEV-15146 SQLError[4122]: View is not system versioned
+#
+create or replace table t1 (a int) with system versioning;
+insert t1 values (1),(2);
+set @a=now(6);
+create or replace view v1 as select * from t1;
+delete from t1;
+select * from v1;
+a
+select * from v1 for system_time as of @a;
+a
+1
+2
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
+#
+# MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
+#
+create or replace table t1 (i int) with system versioning;
+select * from t1 for system_time as of now() - interval 6 second;
+i
+create or replace view v1 as select * from t1 for system_time as of date_sub(now(), interval 6 second);
+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` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp() - interval 6 second latin1 latin1_swedish_ci
+drop view v1, vt1, vt12;
+drop tables t1, t3;
+#
+# MDEV-18727 improve DML operation of System Versioning
+#
+create or replace table t1 (
+x int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1), (2);
+create or replace view v1 as select * from t1 where x > 1;
+# update, delete
+update v1 set x= x + 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+insert v1 values (4);
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+4 CURRENT ROW
+delete from v1 where x < 4;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 CURRENT ROW
+# multi-update
+create or replace table t2 like t1;
+insert into t2 values (1), (2);
+create or replace view v2 as select * from t2 where x > 1;
+update v1, v2 set v1.x= v1.x + 1, v2.x= v2.x + 1 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 HISTORICAL ROW
+5 CURRENT ROW
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+# multi-delete
+delete v1, v2 from v1 join v2 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 HISTORICAL ROW
+5 HISTORICAL ROW
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+# replace
+create or replace table t1 (
+x int primary key, y int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1, 0), (2, 0);
+create or replace view v1 as select * from t1 where x > 1;
+replace v1 values (1, 1);
+replace v1 values (2, 1);
+replace v1 values (3, 1);
+# REPLACE ignores VIEW condition because itself doesn't use WHERE
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+x y check_row(row_start, row_end)
+1 0 HISTORICAL ROW
+1 1 CURRENT ROW
+2 0 HISTORICAL ROW
+2 1 CURRENT ROW
+3 1 CURRENT ROW
+# insert-select, on duplicate key
+insert v1 select * from t1 where x = 1 on duplicate key update x = v1.x - 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+x y check_row(row_start, row_end)
+0 1 CURRENT ROW
+1 0 HISTORICAL ROW
+1 1 HISTORICAL ROW
+2 0 HISTORICAL ROW
+2 1 CURRENT ROW
+3 1 CURRENT ROW
+drop view v1, v2;
+drop tables t1, t2;
+#
+# MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA
+#
+create table t1 (a int);
+create view v1 as select * from t1;
+create or replace table t1 (b int) with system versioning;
+load data infile 'xx' into table v1;
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+drop view v1;
+drop table t1;
+#
+# MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
+#
+create table t1 (a int);
+insert into t1 values (1);
+create table t2 (
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t2 values (2);
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+create or replace view v1 as select * from t2;
+delete from v2;
+select * from t1;
+a
+1
+select *, check_row(row_start, row_end) from t2 for system_time all;
+b check_row(row_start, row_end)
+2 HISTORICAL ROW
+drop view v2;
+drop view v1;
+drop table t1, t2;
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
new file mode 100644
index 00000000000..9d8f0a1bb7b
--- /dev/null
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -0,0 +1,594 @@
+--source include/default_charset.inc
+--source suite/versioning/common.inc
+
+select @@system_versioning_alter_history;
+
+create table t(
+ a int
+);
+show create table t;
+--error ER_VERS_NOT_VERSIONED
+alter table t drop system versioning;
+
+alter table t add system versioning;
+show create table t;
+
+--error ER_VERS_ALTER_NOT_ALLOWED
+alter table t add column y int;
+--error ER_VERS_ALTER_NOT_ALLOWED
+alter table t add primary key (a);
+--error ER_VERS_ALTER_NOT_ALLOWED
+alter table t add unique key (a);
+--error ER_VERS_ALTER_ENGINE_PROHIBITED
+alter table t engine innodb;
+
+alter table t drop system versioning;
+show create table t;
+
+set system_versioning_alter_history= keep;
+
+alter table t add system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t drop system versioning, drop column row_start;
+alter table t drop system versioning;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+alter table t
+ add column trx_start bigint(20) unsigned as row start invisible,
+ add column trx_end bigint(20) unsigned as row end invisible,
+ add period for system_time(trx_start, trx_end),
+ add system versioning;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+alter table t
+ add column trx_start timestamp as row start invisible,
+ add column trx_end timestamp as row end invisible,
+ add period for system_time(trx_start, trx_end),
+ add system versioning;
+
+--error ER_PARSE_ERROR
+alter table t
+ add column trx_start timestamp(6) not null as row start invisible,
+ add column trx_end timestamp(6) not null as row end invisible,
+ add period for system_time(trx_start, trx_end),
+ add system versioning;
+
+alter table t
+ add column trx_start timestamp(6) as row start invisible,
+ add column trx_end timestamp(6) as row end invisible,
+ add period for system_time(trx_start, trx_end),
+ add system versioning;
+show create table t;
+
+--error ER_MISSING
+alter table t drop system versioning;
+
+alter table t drop column trx_start, drop column trx_end;
+select row_start from t;
+alter table t drop system versioning;
+show create table t;
+
+--error ER_VERS_DUPLICATE_ROW_START_END
+alter table t add column trx_start timestamp(6) as row start;
+
+alter table t add system versioning;
+show create table t;
+
+--error ER_VERS_DUPLICATE_ROW_START_END
+alter table t add column trx_start timestamp(6) as row start;
+--error ER_VERS_DUPLICATE_ROW_START_END
+alter table t modify a int as row start;
+
+alter table t add column b int;
+show create table t;
+
+alter table t add column c int;
+show create table t;
+
+alter table t add column d int first;
+show create table t;
+
+alter table t add column e int after d;
+show create table t;
+
+alter table t drop column a;
+show create table t;
+
+create or replace table t (
+ a int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end))
+with system versioning;
+
+select * from t for system_time all;
+--error ER_MISSING
+alter table t drop column row_start;
+--error ER_MISSING
+alter table t drop column row_end;
+alter table t drop column row_start, drop column row_end;
+select * from t for system_time all;
+show create table t;
+
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t drop column row_start;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t drop column row_end;
+
+create or replace table t (
+ a int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end))
+with system versioning;
+
+select * from t for system_time all;
+alter table t drop column row_start, drop column row_end;
+select * from t for system_time all;
+
+create or replace table t(
+ a int
+);
+insert into t values(1);
+alter table t add system versioning;
+show create table t;
+insert into t values(2);
+select * from t for system_time all;
+select * from t;
+
+update t set a=3 where a=1;
+select * from t;
+select * from t for system_time all;
+select row_start from t where a=3 into @tm;
+alter table t add column b int;
+select @tm=row_start from t where a=3;
+show create table t;
+select * from t;
+select * from t for system_time all;
+
+alter table t drop system versioning;
+select * from t;
+show create table t;
+
+--error ER_VERS_NOT_VERSIONED
+alter table t modify a int with system versioning;
+--error ER_VERS_NOT_VERSIONED
+alter table t modify a int without system versioning;
+
+alter table t add system versioning;
+
+alter table t modify a int without system versioning;
+show create table t;
+
+alter table t modify a int with system versioning;
+show create table t;
+
+# TODO: move TRX_ID cases to separate test
+create or replace table t(
+ a int
+) engine=innodb;
+
+alter table t
+ add column trx_start timestamp(6) as row start invisible,
+ add column trx_end timestamp(6) as row end invisible,
+ add period for system_time(trx_start, trx_end),
+ add system versioning;
+
+show create table t;
+--echo # Issue #211: drop of system columns required before drop system versioning
+alter table t drop column trx_start, drop column trx_end;
+show create table t;
+
+alter table t drop system versioning;
+
+insert into t values(1);
+
+call verify_trt;
+alter table t
+ add column trx_start bigint(20) unsigned as row start invisible,
+ add column trx_end bigint(20) unsigned as row end invisible,
+ add period for system_time(trx_start, trx_end),
+ add system versioning;
+call verify_trt;
+
+show create table t;
+alter table t drop column trx_start, drop column trx_end;
+
+call verify_trt;
+alter table t drop system versioning, algorithm=copy;
+call verify_trt;
+
+alter table t add system versioning, algorithm=copy;
+call verify_trt;
+
+show create table t;
+
+update t set a= 2;
+select * from t for system_time all;
+
+alter table t add column b int, algorithm=copy;
+show create table t;
+select * from t;
+call verify_trt;
+
+alter table t drop column b, algorithm=copy;
+show create table t;
+select * from t for system_time all;
+call verify_trt;
+
+## FIXME: #414 IB: inplace for VERS_TIMESTAMP versioning
+if (0)
+{
+alter table t drop system versioning, algorithm=inplace;
+call verify_trt;
+
+alter table t add system versioning, algorithm=inplace;
+call verify_trt;
+show create table t;
+
+update t set a= 1;
+select * from t for system_time all;
+call verify_trt;
+
+alter table t add column b int, algorithm=inplace;
+show create table t;
+select * from t;
+call verify_trt;
+
+alter table t drop column b, algorithm=inplace;
+show create table t;
+select * from t for system_time all;
+}
+## FIXME END
+
+alter table t drop system versioning, algorithm=copy;
+show create table t;
+call verify_trt;
+
+# nullable autoinc test w/o versioning
+create or replace table t (a int);
+insert t values (1),(2),(3),(4);
+alter table t add b int auto_increment null unique;
+select * from t;
+drop table t;
+
+create or replace table t (a int) with system versioning engine=innodb;
+insert into t values (1), (2), (3);
+delete from t where a<3;
+--error ER_DUP_ENTRY, ER_DUP_ENTRY
+alter table t add b int not null unique;
+--error ER_UNSUPPORTED_EXTENSION, ER_UNSUPPORTED_EXTENSION
+alter table t add b int auto_increment unique;
+alter table t add b int auto_increment null unique;
+select * from t;
+select * from t for system_time all;
+insert into t values (4, 0);
+select * from t for system_time all;
+
+create or replace table t (a int) with system versioning;
+insert into t values (1), (2), (3);
+delete from t where a<3;
+--error ER_DUP_ENTRY, ER_DUP_ENTRY
+alter table t add b int not null unique;
+--error ER_UNSUPPORTED_EXTENSION, ER_UNSUPPORTED_EXTENSION
+alter table t add b int auto_increment unique;
+alter table t add b int auto_increment null unique;
+select * from t;
+select * from t for system_time all;
+insert into t values (4, 0);
+select * from t for system_time all;
+
+create or replace table t (a int, b int primary key, c int unique) with system versioning;
+insert t values (1,2,3),(1,3,4),(1,4,5);
+alter table t drop system versioning;
+show create table t;
+select * from t;
+
+create or replace table t (
+ a int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+--error ER_VERS_ALTER_SYSTEM_FIELD
+alter table t change column row_start asdf timestamp(6);
+insert into t values (1);
+--error ER_VERS_ALTER_SYSTEM_FIELD
+alter table t modify column row_start bigint unsigned;
+
+## These experimental options are now disabled
+
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_alter_history= SURVIVE;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_alter_history= 'DROP';
+
+if (0)
+{
+create or replace table t (a int) with system versioning engine innodb;
+insert into t values (1);
+update t set a = 2;
+select * from t for system_time all;
+alter table t add column b int;
+select * from t for system_time all;
+
+create or replace table t (a int) with system versioning engine myisam;
+insert into t values (1);
+update t set a = 2;
+select * from t for system_time all;
+alter table t add column b int;
+select * from t for system_time all;
+
+create or replace table non_empty (
+ a int,
+ row_start bigint(20) unsigned,
+ row_end bigint(20) unsigned
+) engine innodb;
+insert into non_empty values (1, 100, 200);
+
+--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
+alter table non_empty
+ change column row_start row_start bigint(20) unsigned as row start invisible;
+--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
+alter table non_empty
+ change column row_end row_end bigint(20) unsigned as row end invisible;
+drop table non_empty;
+
+create or replace table t (a int primary key) with system versioning;
+insert into t values (1);
+update t set a=2;
+alter table t drop primary key, add primary key (a), drop system versioning;
+select * from t;
+--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
+show create table t;
+
+create or replace table t (a int primary key) with system versioning;
+insert into t values (1);
+update t set a=2;
+alter table t drop system versioning;
+select * from t;
+--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
+show create table t;
+
+
+call verify_trt;
+}
+
+create or replace table t (a int) with system versioning;
+--error ER_VERS_ALREADY_VERSIONED
+alter table t add system versioning;
+--error ER_VERS_ALREADY_VERSIONED
+alter table t add system versioning, drop system versioning;
+
+set @@system_versioning_alter_history=keep;
+create or replace table t(x int, y int) with system versioning engine=innodb;
+alter table t modify y int without system versioning;
+insert into t values(1, 1);
+update t set y=2;
+
+--echo # MDEV-14681 Bogus ER_UNSUPPORTED_EXTENSION
+create or replace table t1 (pk int auto_increment unique) with system versioning;
+insert into t1 values (1);
+delete from t1;
+alter table t1 engine=myisam;
+
+--echo # MDEV-14692 crash in MDL_context::upgrade_shared_lock()
+create or replace temporary table t (a int);
+--error ER_VERS_TEMPORARY
+alter table t change column if exists b c bigint unsigned generated always as row start;
+--error ER_VERS_TEMPORARY
+alter table t change column if exists b c bigint unsigned generated always as row end;
+--error ER_VERS_TEMPORARY
+alter table t add system versioning;
+drop table t;
+
+--echo # MDEV-14744 trx_id-based and transaction-based mixup in assertion
+create or replace table t (c text) engine=innodb with system versioning;
+show create table t;
+alter table t add fulltext key (c);
+
+create or replace table t (a int) with system versioning;
+--error ER_VERS_TABLE_MUST_HAVE_COLUMNS
+alter table t drop column a;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t drop column a, drop column a;
+
+create or replace table t1 (row_start int);
+--error ER_DUP_FIELDNAME
+alter table t1 with system versioning;
+
+create or replace table t1 (row_end int);
+--error ER_DUP_FIELDNAME
+alter table t1 with system versioning;
+
+--error ER_DUP_FIELDNAME
+create or replace table t1 (a int, row_start int) with system versioning;
+
+create or replace table t1 (a int) with system versioning;
+
+--error ER_DUP_FIELDNAME
+set statement system_versioning_alter_history=keep for
+alter table t1 add column row_start int;
+
+--error ER_DUP_FIELDNAME
+set statement system_versioning_alter_history=keep for
+alter table t1 add column row_start timestamp(6);
+
+--echo # MDEV-14798 Add, drop system versioning semantic and syntax
+create or replace table t (
+ a int,
+ row_start timestamp(6) generated always as row start,
+ row_end timestamp(6) generated always as row end,
+ period for system_time(row_start, row_end)
+) with system versioning;
+show create table t;
+
+alter table t
+ drop column row_start,
+ drop column row_end,
+ drop period for system_time,
+ drop system versioning;
+show create table t;
+
+--error ER_VERS_NOT_VERSIONED
+alter table t drop period for system_time;
+
+create or replace table t (
+ a int,
+ row_start timestamp(6) generated always as row start,
+ row_end timestamp(6) generated always as row end,
+ period for system_time(row_start, row_end)
+) with system versioning;
+--error ER_MISSING
+alter table t drop period for system_time;
+--error ER_MISSING
+alter table t drop column sys_trx_start, drop period for system_time;
+--error ER_MISSING
+alter table t drop column sys_trx_end, drop period for system_time;
+
+--error ER_VERS_ALREADY_VERSIONED
+alter table t add period for system_time(sys_trx_start, sys_trx_end);
+
+--echo #
+--echo # MDEV-14790 System versioning for system tables does not work as expected
+--echo #
+use mysql;
+--error ER_VERS_DB_NOT_SUPPORTED
+create or replace table t (x int) with system versioning;
+--error ER_VERS_DB_NOT_SUPPORTED
+alter table user add system versioning;
+use test;
+
+--echo # MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column
+create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning;
+--error ER_VERS_DUPLICATE_ROW_START_END
+alter table t1 modify s timestamp(6) as row start;
+
+--echo # ignore CHECK for historical rows
+create or replace table t (a int) with system versioning;
+insert into t values (0), (1);
+delete from t where a = 0;
+--error ER_CONSTRAINT_FAILED
+alter table t add check (a > 1);
+alter table t add check (a > 0);
+--error ER_CONSTRAINT_FAILED
+insert into t values (0);
+insert into t values (2);
+
+--echo #
+--echo # MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning
+--echo #
+set system_versioning_alter_history= keep;
+create or replace table t1 (a int, b int generated always as (0) stored) engine=innodb with system versioning;
+insert into t1 (a) values (1);
+--enable_info
+alter table t1 modify a int without system versioning, algorithm=copy;
+alter table t1 modify a int with system versioning, algorithm=copy;
+alter table t1 modify a int without system versioning;
+alter table t1 modify a int with system versioning;
+--disable_info
+show create table t1;
+select * from t1;
+--enable_info
+--error ER_PARSE_ERROR
+alter table t1 modify b int generated always as (0) stored without system versioning;
+--error ER_PARSE_ERROR
+alter table t1 modify b int generated always as (0) stored with system versioning;
+alter table t1 modify b int without system versioning;
+--disable_info
+show create table t1;
+select * from t1;
+
+create or replace table t1 (a int, b int generated always as (0) virtual) engine=innodb with system versioning;
+insert into t1 (a) values (1);
+--enable_info
+alter table t1 modify a int without system versioning, algorithm=copy;
+alter table t1 modify a int with system versioning, algorithm=copy;
+alter table t1 modify a int without system versioning;
+alter table t1 modify a int with system versioning;
+select * from t1;
+--disable_info
+
+--echo #
+--echo # MDEV-19304 Segfault in ALTER TABLE after UPDATE for SIMULTANEOUS_ASSIGNMENT
+--echo #
+create or replace table t1 (a int, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) engine=myisam with system versioning;
+insert into t1 values (null, null, null);
+insert into t1 values (null, null, null);
+set sql_mode= 'simultaneous_assignment';
+update t1 set e= 1;
+alter table t1 force;
+set sql_mode= default;
+
+--echo #
+--echo # MDEV-18862 Unfortunate error message upon attempt to drop system versioning
+--echo #
+set system_versioning_alter_history= keep;
+create or replace table t1 (x int) with system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop period for system_time;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop column `row_end`;
+
+--echo #
+--echo # MDEV-19127 Assertion `row_start_field' failed in vers_prepare_keys upon ALTER TABLE
+--echo #
+set system_versioning_alter_history=keep;
+create or replace table t1 (f1 int) with system versioning;
+alter table t1 add f2 int with system versioning, drop system versioning;
+create or replace table t1 (f1 int) with system versioning;
+--error ER_VERS_NOT_VERSIONED
+alter table t1 drop system versioning, add f2 int with system versioning;
+
+drop table t1;
+--source suite/versioning/common_finish.inc
+--echo # MDEV-16490 It's possible to make a system versioned table without any versioning field
+
+set @@system_versioning_alter_history=keep;
+create or replace table t (a int) with system versioning engine=innodb;
+--error ER_VERS_TABLE_MUST_HAVE_COLUMNS
+alter table t change column a a int without system versioning;
+
+alter table t
+ change column a a int without system versioning,
+ add column b int with system versioning;
+show create table t;
+
+alter table t
+ change column a new_a int,
+ drop system versioning;
+show create table t;
+
+alter table t add system versioning;
+alter table t change column new_a a int without system versioning;
+show create table t;
+
+--error ER_VERS_TABLE_MUST_HAVE_COLUMNS
+alter table t
+ add column c int,
+ change column c c int without system versioning,
+ change column b b int without system versioning;
+
+alter table t
+ add column c int without system versioning,
+ change column c c int,
+ change column b b int without system versioning;
+
+drop table t;
+
+--echo #
+--echo # MDEV-21688 Assertion or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table
+--echo #
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (128);
+delete from t1;
+set statement system_versioning_alter_history=keep for
+alter table t1 drop system versioning, modify column a tinyint;
+
+# cleanup
+drop table t1;
diff --git a/mysql-test/suite/versioning/t/auto_increment.test b/mysql-test/suite/versioning/t/auto_increment.test
new file mode 100644
index 00000000000..804c0424179
--- /dev/null
+++ b/mysql-test/suite/versioning/t/auto_increment.test
@@ -0,0 +1,50 @@
+-- source suite/versioning/engines.inc
+-- source suite/versioning/common.inc
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table t1(
+ id int unsigned auto_increment primary key,
+ x int unsigned,
+ y int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+ with system versioning;
+
+eval create table t2(
+ id int unsigned auto_increment primary key,
+ x int unsigned,
+ y int unsigned);
+
+insert into t1(x, y) values(1, 11);
+insert into t2(x, y) values(1, 11);
+insert into t1(x, y) values(2, 12);
+insert into t2(x, y) values(2, 12);
+insert into t1(x, y) values(3, 13);
+insert into t2(x, y) values(3, 13);
+insert into t1(x, y) values(4, 14);
+insert into t2(x, y) values(4, 14);
+insert into t1(x, y) values(5, 15);
+insert into t2(x, y) values(5, 15);
+insert into t1(x, y) values(6, 16);
+insert into t2(x, y) values(6, 16);
+insert into t1(x, y) values(7, 17);
+insert into t2(x, y) values(7, 17);
+insert into t1(x, y) values(8, 18);
+insert into t2(x, y) values(8, 18);
+insert into t1(x, y) values(9, 19);
+insert into t2(x, y) values(9, 19);
+
+select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner join t2 on t1.id = t2.id;
+delete from t1 where x = 2;
+delete from t2 where x = 2;
+
+select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner join t2 on t1.id = t2.id;
+delete from t1 where x > 7;
+delete from t2 where x > 7;
+
+select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner join t2 on t1.id = t2.id;
+drop table t1;
+drop table t2;
+
+-- source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/commit_id.test b/mysql-test/suite/versioning/t/commit_id.test
new file mode 100644
index 00000000000..0f9cf1eb391
--- /dev/null
+++ b/mysql-test/suite/versioning/t/commit_id.test
@@ -0,0 +1,94 @@
+-- source suite/versioning/common.inc
+
+create table t1(
+ id int auto_increment primary key,
+ sys_trx_start bigint unsigned as row start invisible,
+ sys_trx_end bigint unsigned as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end)
+)
+with system versioning
+engine innodb;
+
+
+# TRT_TRX_ID, TRT_COMMIT_ID, TRT_TRX_SEES #
+
+insert into t1 values ();
+
+--real_sleep 0.01
+set @ts0= now(6);
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx0;
+select transaction_id = @tx0 from mysql.transaction_registry
+order by transaction_id desc limit 1;
+
+set @ts1= now(6);
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx1;
+select transaction_id = @tx1 from mysql.transaction_registry
+order by transaction_id desc limit 1;
+
+set @ts2= now(6);
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx2;
+select transaction_id = @tx2 from mysql.transaction_registry
+order by transaction_id desc limit 1;
+
+set @ts3= now(6);
+
+select
+ trt_trx_id(@ts0) < @tx0 as A,
+ trt_trx_id(@ts0, true) = @tx0 as B,
+ trt_trx_id(@ts1) = @tx0 as C,
+ trt_trx_id(@ts1, true) = @tx1 as D,
+ trt_trx_id(@ts2) = @tx1 as E,
+ trt_trx_id(@ts2, true) = @tx2 as F,
+ trt_trx_id(@ts3) = @tx2 as G,
+ trt_trx_id(@ts3, true) is null as H;
+
+select
+ trt_commit_id(@ts0) < @tx0 as A,
+ trt_commit_id(@ts0, true) = trt_commit_id(null, @tx0) as B,
+ trt_commit_id(@ts1) = trt_commit_id(null, @tx0) as C,
+ trt_commit_id(@ts1, true) = trt_commit_id(null, @tx1) as D,
+ trt_commit_id(@ts2) = trt_commit_id(null, @tx1) as E,
+ trt_commit_id(@ts2, true) = trt_commit_id(null, @tx2) as F,
+ trt_commit_id(@ts3) = trt_commit_id(null, @tx2) as G,
+ trt_commit_id(@ts3, true) is null as H;
+
+select
+ trt_trx_sees(@tx1, @tx0) as A,
+ not trt_trx_sees(@tx0, @tx1) as B,
+ trt_trx_sees_eq(@tx1, @tx1) as C,
+ not trt_trx_sees(@tx1, @tx1) as D,
+ trt_trx_sees(@tx2, 0) as E,
+ trt_trx_sees(-1, @tx2) as F;
+
+select trt_trx_sees(0, @tx2);
+
+# TRT_ISO_LEVEL #
+
+set transaction isolation level read uncommitted;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx3;
+select isolation_level = 'READ-UNCOMMITTED' from mysql.transaction_registry where transaction_id = @tx3;
+
+set transaction isolation level read committed;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx4;
+select isolation_level = 'READ-COMMITTED' from mysql.transaction_registry where transaction_id = @tx4;
+
+set transaction isolation level serializable;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx5;
+select isolation_level = 'SERIALIZABLE' from mysql.transaction_registry where transaction_id = @tx5;
+
+set transaction isolation level repeatable read;
+insert into t1 values ();
+select sys_trx_start from t1 where id = last_insert_id() into @tx6;
+select isolation_level = 'REPEATABLE-READ' from mysql.transaction_registry where transaction_id = @tx6;
+
+
+drop table t1;
+call verify_trt;
+
+-- source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test
new file mode 100644
index 00000000000..fc4120ef2aa
--- /dev/null
+++ b/mysql-test/suite/versioning/t/create.test
@@ -0,0 +1,408 @@
+--source suite/versioning/engines.inc
+--source suite/versioning/common.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+--replace_result $default_engine DEFAULT_ENGINE $sys_datatype_expl SYS_DATATYPE NULL ''
+eval create table t1 (
+ x1 int unsigned,
+ Sys_start $sys_datatype_expl as row start invisible comment 'start',
+ Sys_end $sys_datatype_expl as row end invisible comment 'end',
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE $sys_datatype_expl SYS_DATATYPE
+show create table t1;
+
+--query_vertical select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1'
+--query_vertical select table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,character_maximum_length,character_octet_length,character_set_name,collation_name,column_key,extra,column_comment,is_generated,generation_expression from information_schema.columns where table_name='t1'
+
+--echo # Implicit fields test
+create or replace table t1 (
+ x2 int unsigned
+) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_VERS_PERIOD_COLUMNS
+eval create or replace table t1 (
+ x3 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (x, Sys_end)
+) with system versioning;
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_VERS_PERIOD_COLUMNS
+eval create or replace table t1 (
+ x4 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end2 timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_VERS_PERIOD_COLUMNS
+eval create or replace table t1 (
+ x5 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, x)
+) with system versioning;
+
+--error ER_MISSING
+create or replace table t1 (
+ x6 int unsigned,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_MISSING
+eval create or replace table t1 (
+ x7 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+);
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_VERS_PERIOD_COLUMNS
+eval create or replace table t1 (
+ x8 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (sys_insert, sys_remove)
+) with system versioning;
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_MISSING
+eval create or replace table t1 (
+ x9 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+);
+
+--replace_result $default_engine DEFAULT_ENGINE
+--error ER_MISSING
+eval create or replace table t1 (
+ x10 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_start)
+);
+
+--error ER_VERS_FIELD_WRONG_TYPE, ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1 (
+ x11 int unsigned,
+ Sys_start bigint unsigned as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+
+--error ER_VERS_FIELD_WRONG_TYPE, ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1 (
+ x12 int unsigned,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end bigint unsigned as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1 (
+ x13 int unsigned,
+ Sys_start bigint as row start invisible,
+ Sys_end bigint unsigned as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning engine innodb;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1 (
+ x14 int unsigned,
+ Sys_start bigint unsigned as row start invisible,
+ Sys_end bigint as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning engine innodb;
+
+# columns with/without system versioning
+
+create or replace table t1 (
+ x15 int with system versioning,
+ B int
+);
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+create or replace table t1 (
+ x16 int with system versioning,
+ B int
+) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+create or replace table t1 (
+ x17 int,
+ B int without system versioning
+);
+
+create or replace table t1 (
+ x18 int,
+ B int without system versioning
+) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+create or replace table t1 (
+ x19 int with system versioning,
+ B int without system versioning
+);
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+create or replace table t1 (
+ x20 int with system versioning,
+ B int without system versioning
+) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+create or replace table t1 (
+ x21 int without system versioning
+);
+
+--error ER_VERS_TABLE_MUST_HAVE_COLUMNS
+create or replace table t1 (
+ x22 int without system versioning
+) with system versioning;
+
+# CREATE TABLE ... LIKE
+create or replace table t1 (a int) with system versioning;
+create table tt1 like t1;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table tt1;
+drop table tt1;
+create temporary table tt1 like t1;
+--echo # Temporary is stripped from versioning
+--replace_result $default_engine DEFAULT_ENGINE
+show create table tt1;
+
+--echo # CREATE TABLE ... SELECT
+create or replace table t1 (x23 int) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE
+eval create or replace table t0(
+ y int,
+ st timestamp(6) as row start,
+ en timestamp(6) as row end,
+ period for system_time (st, en)
+) with system versioning;
+
+--echo ## For non-versioned table:
+--echo ### 1. invisible fields are not included
+create or replace table t2 as select * from t1;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t2;
+
+--echo ### 2. all visible fields are included
+create or replace table t3 as select * from t0;
+select * from t0;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+
+--echo ## For versioned table
+insert into t1 values (1);
+select row_start from t1 into @row_start;
+insert into t0 (y) values (2);
+select st from t0 into @st;
+
+create or replace table t2 with system versioning as select * from t1;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t2;
+--echo #### invisible fields are not copied
+select * from t2;
+select * from t2 where row_start <= @row_start;
+
+--echo ### 2. source table with visible system fields, target with invisible
+create or replace table t3 with system versioning as select * from t0;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+select * from t3 where y > 2;
+select y from t3 where st = @st and row_start > @st;
+
+--echo ### 3. source and target table with visible system fields
+--replace_result $default_engine DEFAULT_ENGINE
+eval create or replace table t3 (
+ st timestamp(6) as row start invisible,
+ en timestamp(6) as row end invisible,
+ period for system_time (st, en)
+) with system versioning as select * from t0;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+select y from t3;
+select y from t3 where st = @st;
+
+--echo ### 4. system fields not or wrongly selected
+create or replace table t3 with system versioning select x23 from t1;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+select * from t3;
+--error ER_DUP_FIELDNAME
+create or replace table t3 with system versioning select x23, row_start from t1;
+--error ER_DUP_FIELDNAME
+create or replace table t3 with system versioning select x23, row_end from t1;
+
+--echo # Prepare checking for historical row
+delete from t1;
+select row_end from t1 for system_time all into @row_end;
+delete from t0;
+select en from t0 for system_time all into @en;
+
+--echo ## Combinations of versioned + non-versioned
+create or replace table t2 (y int);
+insert into t2 values (3);
+create or replace table t3 with system versioning select * from t1 for system_time all, t2;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+select * from t3 for system_time all;
+select * from t3 for system_time all where row_start = @row_start and row_end = @row_end;
+
+create or replace table t2 like t0;
+insert into t2 (y) values (1), (2);
+delete from t2 where y = 2;
+
+create or replace table t3 select * from t2 for system_time all;
+select st, en from t3 where y = 1 into @st, @en;
+select y from t2 for system_time all where st = @st and en = @en;
+select st, en from t3 where y = 2 into @st, @en;
+select y from t2 for system_time all where st = @st and en = @en;
+
+--echo ## Default engine detection
+--replace_result $non_default_engine NON_DEFAULT_ENGINE
+eval create or replace table t1 (x25 int) with system versioning engine $non_default_engine;
+create or replace table t2
+as select x25, row_start, row_end from t1 for system_time all;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t2;
+
+create or replace table t2 with system versioning
+as select x25, row_start rs, row_end re from t1;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t2;
+
+create or replace table t1 (
+ x26 int,
+ st bigint unsigned as row start,
+ en bigint unsigned as row end,
+ period for system_time (st, en)
+) with system versioning engine innodb;
+create or replace table t2 with system versioning engine myisam
+as select * from t1;
+show create table t2;
+
+--replace_result $non_default_engine NON_DEFAULT_ENGINE
+eval create or replace table t1 (x27 int, id int) with system versioning engine $non_default_engine;
+create or replace table t2 (b int, id int);
+create or replace table t3 with system versioning
+as select t2.b, t1.x27, t1.row_start rs, t1.row_end re from t2 inner join t1 on t2.id=t1.id;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+
+--echo ## Errors
+
+--error ER_VERS_TEMPORARY
+create or replace temporary table t (x28 int) with system versioning;
+
+--error ER_VERS_DUPLICATE_ROW_START_END
+create or replace table t1 (
+ x29 int unsigned,
+ Sys_start0 timestamp(6) as row start invisible,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+
+--error ER_VERS_DUPLICATE_ROW_START_END
+create or replace table t1 (
+ x29 int unsigned,
+ Sys_end0 timestamp(6) as row end invisible,
+ Sys_start timestamp(6) as row start invisible,
+ Sys_end timestamp(6) as row end invisible,
+ period for system_time (Sys_start, Sys_end)
+) with system versioning;
+
+--echo ## System fields detection
+create or replace table t1 (x30 int) with system versioning;
+--replace_result $default_engine DEFAULT_ENGINE
+eval create or replace table t2 (
+ y int,
+ st timestamp(6) as row start invisible,
+ en timestamp(6) as row end invisible,
+ period for system_time (st, en)
+) with system versioning;
+
+create or replace table t3
+as select x30, y, row_start, row_end, st, en from t1, t2;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+
+--replace_result $default_engine DEFAULT_ENGINE
+eval create or replace table t3 (
+ y int,
+ st timestamp(6) as row start invisible,
+ en timestamp(6) as row end invisible,
+ period for system_time (st, en)
+) with system versioning
+as select x30, y, row_start, row_end, st, en from t1, t2;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t3;
+
+--echo # MDEV-14828 Server crashes in JOIN::prepare / setup_fields on 2nd execution of PS [#437]
+create or replace table t1 (x int) with system versioning;
+prepare bad from 'create or replace table t2 with system versioning as select * from t1';
+execute bad; execute bad; execute bad; execute bad; execute bad; execute bad; execute bad; execute bad;
+--echo # bad is good.
+
+--echo # MDEV-15413 Unexpected errors upon CREATE TABLE .. WITH SYSTEM VERSIONING AS SELECT ...
+create or replace table t1 with system versioning as select 1 as i;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+create or replace table t1 (i int) with system versioning as select 1 as i;
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1 (
+ a int,
+ row_start bigint as row start,
+ row_end bigint as row end,
+ period for system_time (row_start, row_end)
+) engine=innodb with system versioning;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1 (
+ a int,
+ row_start bigint as row start,
+ row_end bigint as row end,
+ period for system_time (row_start, row_end)
+) engine=myisam with system versioning;
+
+--error ER_VERS_FIELD_WRONG_TYPE
+create table t (
+ a int,
+ row_start datetime(6) generated always as row start,
+ row_end datetime(6) generated always as row end,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+--source suite/versioning/common_finish.inc
+--echo # MDEV-16490 It's possible to make a system versioned table without any versioning field
+create or replace table t1 (x int without system versioning)
+with system versioning
+select 1 as y;
+--error ER_VERS_TABLE_MUST_HAVE_COLUMNS
+create or replace table t1 (x int without system versioning)
+with system versioning
+select 1 as x;
+
+drop tables t0, t1, t2, t3;
diff --git a/mysql-test/suite/versioning/t/cte.test b/mysql-test/suite/versioning/t/cte.test
new file mode 100644
index 00000000000..5a8fb1f8211
--- /dev/null
+++ b/mysql-test/suite/versioning/t/cte.test
@@ -0,0 +1,228 @@
+--source include/have_innodb.inc
+--source include/default_optimizer_switch.inc
+
+set time_zone="+00:00";
+set default_storage_engine=innodb;
+create or replace table dept (
+ dept_id int(10) primary key,
+ name varchar(100)
+) with system versioning;
+
+create or replace table emp (
+ emp_id int(10) primary key,
+ dept_id int(10) not null,
+ name varchar(100) not null,
+ mgr int(10),
+ salary int(10) not null,
+ constraint `dept-emp-fk`
+ foreign key (dept_id) references dept (dept_id)
+ on delete cascade
+ on update restrict,
+ constraint `mgr-fk`
+ foreign key (mgr) references emp (emp_id)
+ on delete restrict
+ on update restrict
+) with system versioning;
+
+insert into dept (dept_id, name) values (10, "accounting");
+
+insert into emp (emp_id, name, salary, dept_id, mgr) values
+(1, "bill", 1000, 10, null),
+(20, "john", 500, 10, 1),
+(30, "jane", 750, 10,1 );
+
+select row_start into @ts_1 from emp where name="jane";
+
+update emp set mgr=30 where name ="john";
+
+explain extended
+with ancestors as (
+ select e.emp_id, e.name, e.mgr, e.salary from emp as e where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary from emp as e
+) select * from ancestors for system_time as of @ts_1;
+
+select row_start into @ts_2 from emp where name="john";
+
+let $q=
+/* All report to 'Bill' */
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp for system_time as of timestamp @ts_1 as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp for system_time as of timestamp @ts_1 as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors;
+
+eval explain extended $q;
+eval $q;
+
+let $q=with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of timestamp @ts_1;
+
+eval explain extended $q;
+eval $q;
+
+let $q=with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select name from emp where emp_id in (select emp_id from ancestors for system_time as of timestamp @ts_1);
+
+eval explain extended $q;
+eval $q;
+
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2,
+ ancestors for system_time as of @ts_2 a2;
+
+--error ER_CONFLICTING_FOR_SYSTEM_TIME
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2,
+ ancestors for system_time as of now() a2;
+
+--error ER_CONFLICTING_FOR_SYSTEM_TIME
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors,
+ ancestors for system_time as of @ts_2 a2;
+
+--error ER_CONFLICTING_FOR_SYSTEM_TIME
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2,
+ ancestors a2;
+
+--error ER_CONFLICTING_FOR_SYSTEM_TIME
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e
+ where name = 'bill'
+ union
+ select e.emp_id, e.name, e.mgr, e.salary
+ from emp as e,
+ ancestors as a
+ where e.mgr = a.emp_id
+)
+select * from ancestors for system_time as of @ts_2
+ where emp_id in (select * from ancestors);
+
+--echo # SYSTEM_TIME to internal recursive instance is prohibited
+--error ER_VERS_NOT_VERSIONED
+with recursive cte as
+(
+ select * from emp
+ union all
+ select * from cte for system_time as of @ts_1
+)
+select * from cte;
+
+create or replace table emp ( emp_id int, name varchar(127), mgr int) with system versioning;
+create or replace table addr ( emp_id int, address varchar(100)) with system versioning;
+insert emp values (1, 'bill', 0), (2, 'bill', 1), (3, 'kate', 1);
+insert addr values (1, 'Moscow'), (2, 'New York'), (3, 'London');
+set @ts=now(6);
+delete from emp;
+delete from addr;
+
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp for system_time as of timestamp @ts as e
+ where name = 'bill'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp for system_time as of timestamp @ts as ee, ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors;
+
+insert emp values (4, 'john', 1);
+insert addr values (4, 'Paris');
+with ancestors as (select * from emp natural join addr) select * from ancestors;
+with ancestors as (select * from emp natural join addr) select * from ancestors for system_time all;
+with ancestors as (select * from (select * from emp natural join addr) for system_time all as t) select * from ancestors;
+select * from (select * from emp natural join addr) for system_time all as t;
+
+drop table emp;
+drop table dept;
+drop table addr;
diff --git a/mysql-test/suite/versioning/t/debug.test b/mysql-test/suite/versioning/t/debug.test
new file mode 100644
index 00000000000..c6d5bd60861
--- /dev/null
+++ b/mysql-test/suite/versioning/t/debug.test
@@ -0,0 +1,35 @@
+--source include/have_debug.inc
+
+create table t1 (a int);
+show create table t1;
+
+--error ER_VERS_TEMPORARY
+create temporary table tt1 (a int) with system versioning;
+
+set @old_dbug=@@global.debug_dbug;
+set global debug_dbug='+d,sysvers_force';
+
+create table t2 (a int);
+show create table t2;
+
+create temporary table tt2 (a int) with system versioning;
+show create table tt2;
+
+--connect con1, localhost, root
+
+create table t3 (a int);
+show create table t3;
+
+create temporary table tt3 (a int) with system versioning;
+show create table tt3;
+--disconnect con1
+--connection default
+
+set debug_dbug='+d,sysvers_show';
+
+show create table t3;
+create table t4 (a int);
+show create table t4;
+
+set global debug_dbug=@old_dbug;
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/suite/versioning/t/delete.test b/mysql-test/suite/versioning/t/delete.test
new file mode 100644
index 00000000000..492463f9395
--- /dev/null
+++ b/mysql-test/suite/versioning/t/delete.test
@@ -0,0 +1,97 @@
+source suite/versioning/engines.inc;
+source suite/versioning/common.inc;
+
+--echo # Basic + delete from view
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ XNo int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+ with system versioning;
+
+insert into t1(XNo) values(0);
+insert into t1(XNo) values(1);
+insert into t1(XNo) values(2);
+insert into t1(XNo) values(3);
+insert into t1(XNo) values(4);
+insert into t1(XNo) values(5);
+insert into t1(XNo) values(6);
+insert into t1(XNo) values(7);
+insert into t1(XNo) values(8);
+insert into t1(XNo) values(9);
+replace_result $sys_datatype_max MAXVAL;
+eval select XNo, sys_end < $sys_datatype_max from t1 for system_time all;
+delete from t1 where XNo = 0;
+delete from t1 where XNo = 1;
+delete from t1 where XNo > 5;
+create view vt1 as select XNo from t1;
+select XNo as XNo_vt1 from vt1;
+delete from vt1 where XNo = 3;
+select XNo as XNo_vt1 from vt1;
+drop view vt1;
+drop table t1;
+
+--echo # Check sys_start, sys_end
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ x int,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+ with system versioning;
+
+insert into t1(x) values (1);
+select sys_start into @sys_start from t1;
+delete from t1;
+select * from t1;
+select x = 1 as A, sys_start = @sys_start as B, sys_end > sys_start as C from t1 for system_time all;
+drop table t1;
+
+--echo # Multi-delete
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ x int,
+ y int,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+ with system versioning;
+create or replace table t2 like t1;
+insert into t1(x, y) values (1, 1), (2, 2), (3, 3), (14, 4);
+insert into t2(x, y) values (11, 1), (12, 2), (13, 32), (14, 4);
+delete t1, t2 from t1 join t2 where t1.y = 3 and t2.y = 32;
+select x as t1_x from t1;
+select x as t2_x from t2;
+delete t1, t2 from t1 join t2 where t1.x = t2.x;
+select x as t1_x from t1;
+select x as t2_x from t2;
+select x as t1_x_all from t1 for system_time all;
+select x as t2_x_all from t2 for system_time all;
+drop table t1;
+drop table t2;
+
+--echo # Update + delete
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+update t1 set x= 2;
+delete from t1;
+select x from t1 for system_time all;
+drop table t1;
+
+--echo #
+--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+--echo #
+create or replace table t1 (a int) with system versioning;
+replace into t1 values (1), (2);
+create or replace trigger tr before delete on t1 for each row delete from xx;
+create or replace procedure pr() delete from t1;
+--error ER_NO_SUCH_TABLE
+call pr;
+--error ER_NO_SUCH_TABLE
+call pr;
+drop procedure pr;
+drop trigger tr;
+drop table t1;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/delete_history.test b/mysql-test/suite/versioning/t/delete_history.test
new file mode 100644
index 00000000000..8a7f8e84a76
--- /dev/null
+++ b/mysql-test/suite/versioning/t/delete_history.test
@@ -0,0 +1,144 @@
+--source suite/versioning/common.inc
+--source include/have_partition.inc
+--source suite/versioning/engines.inc
+
+create table t (a int);
+--error ER_VERS_NOT_VERSIONED
+delete history from t before system_time now();
+
+# TRUNCATE is not DELETE and trigger must not be called.
+--replace_result $sys_datatype_expl SYS_TYPE
+eval create or replace table t (
+ a int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end))
+with system versioning;
+insert into t values (1);
+update t set a=2;
+set @test = 'correct';
+create trigger trg_before before delete on t for each row set @test = 'incorrect';
+create trigger trg_after after delete on t for each row set @test = 'incorrect';
+delete history from t;
+select @test from t;
+drop table t;
+
+--replace_result $sys_datatype_expl SYS_TYPE
+eval create or replace table t (
+ a int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end))
+with system versioning;
+insert into t values (1), (2);
+update t set a=11 where a=1;
+--real_sleep 0.01
+set @ts1=now(6);
+--real_sleep 0.01
+update t set a=22 where a=2;
+select * from t for system_time all;
+delete history from t before system_time timestamp @ts1;
+select * from t for system_time all;
+prepare stmt from 'delete history from t';
+execute stmt; drop prepare stmt;
+select * from t for system_time all;
+delete from t;
+
+delimiter ~~;
+create or replace procedure truncate_sp()
+begin
+ delete history from t before system_time timestamp now(6);
+end~~
+delimiter ;~~
+call truncate_sp;
+select * from t for system_time all;
+
+drop procedure truncate_sp;
+
+--echo # Truncate partitioned
+create or replace table t (a int)
+with system versioning
+partition by system_time limit 1 (
+ partition p0 history,
+ partition p1 history,
+ partition pn current);
+insert into t values (1);
+update t set a= 2;
+update t set a= 3;
+delete history from t;
+select * from t for system_time all;
+
+--echo # VIEW
+--replace_result $sys_datatype_expl SYS_TYPE
+eval create or replace table t (
+ i int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end))
+with system versioning;
+delete history from t;
+create or replace view v as select * from t;
+--error ER_IT_IS_A_VIEW
+delete history from v;
+
+create or replace table t (i int);
+--error ER_VERS_NOT_VERSIONED
+delete history from t;
+create or replace view v as select * from t;
+--error ER_IT_IS_A_VIEW
+delete history from v;
+--error ER_VERS_NOT_VERSIONED
+prepare stmt from 'delete history from t';
+
+drop table t;
+drop view v;
+
+#
+# MDEV-15402 Assertion `table' failed in mysql_delete on attempt to delete history from view
+#
+create or replace table t (i int);
+create or replace view v as select * from t;
+--error ER_IT_IS_A_VIEW
+drop table v;
+lock table v write;
+--error ER_IT_IS_A_VIEW
+delete history from v before system_time now(6);
+unlock tables;
+drop view v;
+drop table t;
+
+#
+# MDEV-16783 Assertion `!conds' failed in mysql_delete upon 2nd execution of SP with DELETE HISTORY
+#
+create table t1 (i int) with system versioning;
+create procedure pr() delete history from t1 before system_time now();
+call pr;
+call pr;
+drop procedure pr;
+drop table t1;
+
+--echo #
+--echo # MDEV-19814 Assertion `update->n_fields < ulint(table->n_cols + table->n_v_cols)' on DELETE HISTORY
+--echo #
+--replace_result $sys_datatype_expl SYS_TYPE
+eval create or replace table t1 (
+ f varchar(1),
+ row_start $sys_datatype_expl as row start,
+ row_end $sys_datatype_expl as row end,
+ period for system_time (row_start, row_end))
+with system versioning;
+insert into t1 (f) values ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h');
+delete from t1;
+delete history from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-20186 Wrong result or Assertion on INSERT after DELETE HISTORY
+--echo #
+create or replace table t1 (a int check (a > 0)) with system versioning;
+delete history from t1;
+insert into t1 values (1);
+select * from t1;
+drop table t1;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/derived.test b/mysql-test/suite/versioning/t/derived.test
new file mode 100644
index 00000000000..9d96856f01f
--- /dev/null
+++ b/mysql-test/suite/versioning/t/derived.test
@@ -0,0 +1,238 @@
+--source include/default_optimizer_switch.inc
+
+create table emp
+(
+ emp_id int,
+ name varchar(127),
+ mgr int
+) with system versioning;
+
+insert into emp values (1, 'bill', 0),
+ (2, 'bill', 1),
+ (3, 'kate', 1);
+set @ts=now(6);
+delete from emp;
+insert into emp values (4, 'john', 1);
+
+with ancestors as (select * from emp) select * from ancestors;
+set @tmp= "with ancestors as (select * from emp) select * from ancestors";
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+with ancestors as (select * from emp for system_time all) select * from ancestors;
+set @tmp= "with ancestors as (select * from emp for system_time all) select * from ancestors";
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+with recursive ancestors as (select * from emp) select * from ancestors;
+set @tmp= "with recursive ancestors as (select * from emp) select * from ancestors";
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+select emp_id from (select emp_id from emp where row_end>'2031-1-1') as tmp;
+set @tmp= "select emp_id from (select emp_id from emp where row_end>'2031-1-1') as tmp";
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp as e
+ where name = 'john'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp as ee, ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors;
+set @tmp= "
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp as e
+ where name = 'john'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp as ee, ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors";
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+#385
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp for system_time as of timestamp @ts as e
+ where name = 'bill'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp for system_time as of timestamp @ts as ee,
+ ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors;
+set @tmp= "
+with recursive
+ancestors
+as
+(
+ select e.emp_id, e.name, e.mgr
+ from emp for system_time as of timestamp @ts as e
+ where name = 'bill'
+ union
+ select ee.emp_id, ee.name, ee.mgr
+ from emp for system_time as of timestamp @ts as ee,
+ ancestors as a
+ where ee.mgr = a.emp_id
+)
+select * from ancestors";
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+drop table emp;
+
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int) with system versioning;
+insert into t1 values (1);
+set @t0= now(6);
+delete from t1;
+insert into t1 values (2);
+insert into t2 values (10);
+
+--replace_column 2 # 3 #
+select * from (select *, t1.row_end, t1.row_end as endo from t1) as s0;
+--replace_column 3 # 4 #
+select * from (select *, t1.row_end, t2.row_start from t1, t2) as s0;
+
+--echo # SYSTEM_TIME propagation from inner to outer
+select * from (select * from t1 for system_time as of timestamp @t0, t2) as s0;
+with s1 as (select * from t1 for system_time as of timestamp @t0, t2) select * from s1;
+--echo # leading table selection
+--replace_column 3 #
+select * from (select *, t1.row_end from t2, t1 for system_time as of timestamp @t0) as s2;
+--replace_column 3 #
+with s3 as (select *, t1.row_end from t2, t1 for system_time as of timestamp @t0) select * from s3;
+
+--echo ### VIEW instead of t1
+set @q= concat("create view vt1 as select * from t1 for system_time as of timestamp '", @t0, "'");
+prepare q from @q; execute q; drop prepare q;
+create view vt2 as select * from t1;
+
+--echo # SYSTEM_TIME propagation from view
+select * from vt1;
+--echo # SYSTEM_TIME propagation from inner to outer
+select * from (select * from vt1, t2) as s0;
+
+--echo ### SYSTEM_TIME clash
+--error ER_VERS_NOT_VERSIONED
+select * from (select * from t1 for system_time all) for system_time all as dt0;
+--error ER_VERS_NOT_VERSIONED
+select * from vt1 for system_time all;
+--error ER_VERS_NOT_VERSIONED
+with dt1 as (select * from t1 for system_time all)
+select * from dt1 for system_time all;
+
+--echo ### UNION
+set @t1= now(6);
+delete from t2;
+insert into t2 values (3);
+--echo # SYSTEM_TIME is not propagated
+select x from t1 union
+select y from t2;
+select x from t1 for system_time as of @t0 union
+select y from t2;
+select x from t1 union
+select y from t2 for system_time as of @t1;
+select x from t1 for system_time as of @t0 union
+select y from t2 for system_time as of @t1;
+
+--echo # LEFT/RIGHT JOIN
+create or replace table t1 (x int, y int) with system versioning;
+create or replace table t2 (x int, y int) with system versioning;
+
+insert into t1 values (1, 1), (1, 2), (1, 3), (4, 4), (5, 5);
+insert into t2 values (1, 2), (2, 1), (3, 1);
+
+--echo ## Outer or inner SYSTEM_TIME produces same expression
+
+--disable_warnings
+--disable_query_log
+explain extended
+select * from (
+ select t1.x, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 join t2 on t1.x = t2.x) for system_time as of now() as t;
+
+let $a=`show warnings`;
+--echo Query A:
+echo $a;
+
+explain extended
+select * from (
+ select t1.x, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 for system_time as of now()
+ join t2 for system_time as of now() on t1.x = t2.x) as t;
+
+let $b=`show warnings`;
+--echo Query B:
+echo $b;
+
+if ($a == $b)
+{
+ --echo Fine result: queries A and B are equal.
+}
+--enable_query_log
+--enable_warnings
+
+--echo ## LEFT JOIN: t1, t2 versioned
+select * from (
+ select t1.x as LJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 left join t2 on t1.x = t2.x)
+as derived;
+
+alter table t2 drop system versioning;
+
+--echo ## LEFT JOIN: t1 versioned
+select * from (
+ select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 left join t2 on t1.x = t2.x)
+as derived;
+
+alter table t1 drop system versioning;
+alter table t2 add system versioning;
+
+--echo ## LEFT JOIN: t2 versioned
+select * from (
+ select t1.x as LJ3_x1, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 left join t2 on t1.x = t2.x)
+as derived;
+
+alter table t1 add system versioning;
+
+--echo ## RIGHT JOIN: t1, t2 versioned
+select * from (
+ select t1.x as RJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 right join t2 on t1.x = t2.x)
+as derived;
+
+alter table t2 drop system versioning;
+
+--echo ## RIGHT JOIN: t1 versioned
+select * from (
+ select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 right join t2 on t1.x = t2.x)
+as derived;
+
+alter table t1 drop system versioning;
+alter table t2 add system versioning;
+
+--echo ## RIGHT JOIN: t2 versioned
+select * from (
+ select t1.x as RJ3_x1, t1.y as y1, t2.x as x2, t2.y as y2
+ from t1 right join t2 on t1.x = t2.x)
+as derived;
+
+drop table t1, t2;
+drop view vt1, vt2;
+
diff --git a/mysql-test/suite/versioning/t/foreign.combinations b/mysql-test/suite/versioning/t/foreign.combinations
new file mode 100644
index 00000000000..1a0812cfafe
--- /dev/null
+++ b/mysql-test/suite/versioning/t/foreign.combinations
@@ -0,0 +1,5 @@
+[timestamp]
+default-storage-engine=innodb
+
+[trx_id]
+default-storage-engine=innodb
diff --git a/mysql-test/suite/versioning/t/foreign.test b/mysql-test/suite/versioning/t/foreign.test
new file mode 100644
index 00000000000..7493f99cba7
--- /dev/null
+++ b/mysql-test/suite/versioning/t/foreign.test
@@ -0,0 +1,461 @@
+--source suite/versioning/key_type.inc
+--source suite/versioning/common.inc
+
+--echo #################
+--echo # Test RESTRICT #
+--echo #################
+
+--replace_result "$KEY_TYPE" KEY_TYPE
+eval create table parent(
+ id int,
+ $KEY_TYPE (id)
+) engine innodb;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table child(
+ parent_id int,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end),
+ foreign key(parent_id) references parent(id)
+ on delete restrict
+ on update restrict
+) engine innodb with system versioning;
+
+insert into parent values(1);
+insert into child values(1);
+
+-- error ER_ROW_IS_REFERENCED_2
+delete from parent where id = 1;
+delete from child where parent_id = 1;
+delete from parent where id = 1;
+
+insert into parent values(1);
+insert into child values(1);
+-- error ER_ROW_IS_REFERENCED_2
+update parent set id=id+1;
+delete from child;
+update parent set id=id+1;
+select * from child for system_time all;
+
+drop table child;
+drop table parent;
+
+--echo ##############################################
+--echo # Test when clustered index is a foreign key #
+--echo ##############################################
+
+--replace_result "$KEY_TYPE" KEY_TYPE
+eval create table parent(
+ id int(10) unsigned,
+ $KEY_TYPE (id)
+) engine innodb;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table child(
+ parent_id int(10) unsigned primary key,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end),
+ foreign key(parent_id) references parent(id)
+) engine innodb with system versioning;
+
+insert into parent values(1);
+insert into child values(1);
+
+-- error ER_ROW_IS_REFERENCED_2
+delete from parent where id = 1;
+
+drop table child;
+drop table parent;
+
+--echo ################
+--echo # Test CASCADE #
+--echo ################
+
+--replace_result "$KEY_TYPE" KEY_TYPE
+eval create table parent(
+ id int,
+ $KEY_TYPE (id)
+) engine innodb;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table child(
+ parent_id int,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end),
+ foreign key(parent_id) references parent(id)
+ on delete cascade
+ on update cascade
+) engine innodb with system versioning;
+
+insert into parent values(1);
+insert into child values(1);
+
+delete from parent where id = 1;
+select * from child;
+select * from child for system_time all;
+
+insert into parent values(1);
+insert into child values(1);
+update parent set id = id + 1;
+select * from child;
+select * from child for system_time all;
+
+drop table child;
+drop table parent;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE "$KEY_TYPE" KEY_TYPE
+eval create or replace table parent (
+ id int,
+ $KEY_TYPE(id),
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end)
+) with system versioning
+engine innodb;
+
+create or replace table child (
+ x int,
+ parent_id int not null,
+ constraint `parent-fk`
+ foreign key (parent_id) references parent (id)
+ on delete cascade
+ on update restrict
+)
+engine innodb;
+
+insert into parent (id) values (2);
+insert into child (x, parent_id) values (2, 2);
+delete from parent;
+select * from child;
+
+drop table child;
+drop table parent;
+
+--replace_result "$KEY_TYPE" KEY_TYPE
+eval create or replace table parent (
+ id int,
+ $KEY_TYPE(id)
+)
+engine innodb;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table child (
+ id int primary key,
+ parent_id int not null,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end),
+ constraint `parent-fk`
+ foreign key (parent_id) references parent (id)
+ on delete cascade
+ on update restrict
+) with system versioning
+engine innodb;
+
+insert into parent (id) values (3);
+insert into child (id, parent_id) values (3, 3);
+delete from parent;
+select * from child;
+select *, check_row(row_start, row_end) from child for system_time all;
+
+drop table child;
+drop table parent;
+
+--echo #################
+--echo # Test SET NULL #
+--echo #################
+
+--replace_result "$KEY_TYPE" KEY_TYPE
+eval create table parent(
+ id int,
+ $KEY_TYPE (id)
+) engine innodb;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table child(
+ parent_id int,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end),
+ foreign key(parent_id) references parent(id)
+ on delete set null
+ on update set null
+) engine innodb with system versioning;
+
+insert into parent values(1);
+insert into child values(1);
+delete from child;
+insert into child values(1);
+
+delete from parent where id = 1;
+select * from child;
+select *, current_row(sys_end) as current_row from child for system_time all order by sys_end;
+delete from child;
+
+insert into parent values(1);
+insert into child values(1);
+update parent set id= id + 1;
+select * from child;
+select *, current_row(sys_end) as current_row from child for system_time all order by sys_end;
+
+drop table child;
+drop table parent;
+
+--echo ###########################
+--echo # Parent table is foreign #
+--echo ###########################
+
+--replace_result $sys_datatype_expl SYS_DATATYPE "$KEY_TYPE" KEY_TYPE
+eval create or replace table parent(
+ id int,
+ $KEY_TYPE (id),
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end)
+) engine innodb with system versioning;
+
+create or replace table child(
+ parent_id int,
+ foreign key(parent_id) references parent(id)
+) engine innodb;
+
+insert into parent values(1);
+insert into child values(1);
+-- error ER_ROW_IS_REFERENCED_2
+delete from parent;
+-- error ER_ROW_IS_REFERENCED_2
+update parent set id=2;
+
+delete from child;
+delete from parent;
+
+-- error ER_NO_REFERENCED_ROW_2
+insert into child values(1);
+
+insert into parent values(1);
+insert into child values(1);
+-- error ER_ROW_IS_REFERENCED_2
+delete from parent;
+-- error ER_ROW_IS_REFERENCED_2
+update parent set id=2;
+
+drop table child;
+drop table parent;
+
+--echo ###################
+--echo # crash on DELETE #
+--echo ###################
+
+--replace_result $sys_datatype_expl SYS_DATATYPE "$KEY_TYPE" KEY_TYPE
+eval create or replace table a (
+ cola int(10),
+ $KEY_TYPE (cola),
+ v_cola int(10) as (cola mod 10) virtual,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end)
+) engine=innodb with system versioning;
+
+create index v_cola on a (v_cola);
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table b(
+ cola int(10),
+ v_cola int(10),
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end)
+) engine=innodb with system versioning;
+
+alter table b add constraint `v_cola_fk`
+foreign key (v_cola) references a (v_cola);
+
+insert into a(cola) values (12);
+insert into b(cola, v_cola) values (10,2);
+--error ER_ROW_IS_REFERENCED_2
+delete from a;
+
+drop table b, a;
+
+--echo ###############################################
+--echo # CASCADE UPDATE foreign not system versioned #
+--echo ###############################################
+create or replace table parent (
+ id smallint unsigned not null auto_increment,
+ value int unsigned not null,
+ primary key (id, value)
+) engine = innodb;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table child (
+ id mediumint unsigned not null auto_increment primary key,
+ parent_id smallint unsigned not null,
+ parent_value int unsigned not null,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time(sys_start, sys_end),
+ constraint `fk_child_parent`
+ foreign key (parent_id, parent_value) references parent (id, value)
+ on delete cascade
+ on update cascade
+) engine = innodb with system versioning;
+
+create or replace table subchild (
+ id int not null auto_increment primary key,
+ parent_id smallint unsigned not null,
+ parent_value int unsigned not null,
+ constraint `fk_subchild_child_parent`
+ foreign key (parent_id, parent_value) references child (parent_id, parent_value)
+ on delete cascade
+ on update cascade
+) engine=innodb;
+
+insert into parent (value) values (23);
+select id, value from parent into @id, @value;
+insert into child values (default, @id, @value);
+insert into subchild values (default, @id, @value);
+
+select parent_id from subchild;
+update parent set id = 11, value = value + 1;
+select parent_id from subchild;
+select * from child;
+
+delete from parent;
+select count(*) from child;
+select * from child for system_time all;
+select count(*) from subchild;
+
+drop table subchild, child, parent;
+
+--echo #
+--echo # MDEV-18057 Assertion `(node->state == 5) || (node->state == 6)' failed in row_upd_sec_step upon DELETE after UPDATE failed due to FK violation
+--echo #
+create or replace table t1 (f1 int, key(f1)) engine=innodb;
+create or replace table t2 (f2 int, foreign key (f2) references t1 (f1)) engine=innodb with system versioning;
+
+set foreign_key_checks= off;
+insert ignore into t2 values (1);
+
+set foreign_key_checks= on;
+--error ER_NO_REFERENCED_ROW_2
+update t2 set f2= 2;
+delete from t2;
+
+drop table t2, t1;
+
+--echo #
+--echo # MDEV-18879 Corrupted record inserted by FOREIGN KEY operation
+--echo #
+SET timestamp = 1;
+SET time_zone='+02:00';
+SELECT now();
+CREATE TABLE t1 (
+ pk INT UNSIGNED PRIMARY KEY,
+ f1 varchar(255) CHARACTER SET ucs2,
+ f2 longtext CHARACTER SET ucs2,
+ f3 varchar(255),
+ f4 char(255),
+ f5 longtext CHARACTER SET ucs2,
+ f6 INT UNSIGNED,
+ f7 INT UNSIGNED,
+ f8 INT UNSIGNED,
+ f9 INT UNSIGNED,
+ f10 INT UNSIGNED,
+ f11 INT UNSIGNED,
+ f12 varchar(255) CHARACTER SET ucs2,
+ f13 char(255) CHARACTER SET ucs2,
+ f14 char(255) CHARACTER SET ucs2,
+ f15 varchar(255),
+ f16 longtext,
+ f17 char(255)
+) ENGINE=InnoDB WITH SYSTEM VERSIONING;
+
+INSERT INTO t1 VALUES
+(1, 'a', 'e', 'f', 'a', 'generate', 1, 2, 3, 4, 5, 6, 'main', 'against', 'b', 'u', 'explode', 'tomorrow'),
+(2, REPEAT('a',127), 'f', 'k', 'game', 'g', 2, 3, 4, 5, 6, 7, REPEAT('o',222), 'oven', 'flower', REPEAT('r',120), 'l', 'g'),
+(3, 'weekly', 'x', 'v', 'r', 'c', 3, 4, 5, 6, 7, 8, 'validity', 'y', 'h', 'oxygen', 'venture', 'uncertainty'),
+(4, 'r', 't', REPEAT('b',153), 'modern', 'h', 4, 5, 6, 7, 8, 9, REPEAT('g',128), 'a', 'w', 'f', 'b', 'b'),
+(5, 'h', 'y', REPEAT('v',107), 'knife', 'profession', 5, 6, 7, 8, 9, 0, 'infection', 'u', 'likelihood', REPEAT('n',149), 'folk', 'd'),
+(6, 'g', 'violent', REPEAT('o',28), 'capital', 'p', 6, 7, 8, 9, 0, 1, 'w', 'patron', 'd', 'y', 'originally', 'k'),
+(7, 'k', 'uncomfortable', REPEAT('v',248), 'y', 'link', 7, 8, 9, 0, 1, 2, REPEAT('j',204), 'j', 'statute', 'emphasis', 'u', 'water'),
+(8, 'preparation', 'water', 'suck', 'silver', 'a', 8, 9, 0, 1, 2, 3, 'h', 'q', 'o', 't', 'k', 'y'),
+(9, 'y', 'f', 'e', 'a', 'dawn', 9, 0, 1, 2, 3, 4, 'peak', 'parking', 'b', 't', 'timber', 'c'),
+(10, REPEAT('h',78), 'apologize', 'direct', 'u', 'frankly', 0, 1, 2, 3, 4, 5, 'h', 'exhibit', 'f', 'd', 'effective', 'c'),
+(11, 'i', 'h', 'a', 'y', 'u', 1, 2, 3, 4, 5, 6, 'l', 'b', 'm', 'respond', 'ideological', 'credibility');
+
+CREATE TABLE t2 (
+ pk int primary key,
+ f char(255) CHARACTER SET ucs2,
+ key(f)
+) ENGINE=InnoDB;
+
+INSERT INTO t2 VALUES (1,'against'),(2,'q');
+
+SET SQL_MODE= '';
+SET timestamp = 2;
+SELECT * FROM t1 INTO OUTFILE 't1.data';
+SET timestamp = 3;
+UPDATE t1 SET f13 = 'q';
+SET timestamp = 4;
+LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
+SELECT * FROM t1 INTO OUTFILE 't1.data.2' ;
+SET timestamp = 5;
+LOAD DATA INFILE 't1.data.2' REPLACE INTO TABLE t1;
+SELECT * FROM t2 INTO OUTFILE 't2.data';
+SET timestamp = 6;
+LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2;
+SET FOREIGN_KEY_CHECKS = OFF;
+ALTER TABLE t1 ADD FOREIGN KEY (f13) REFERENCES t2 (f) ON DELETE SET NULL;
+SET timestamp = 7;
+LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
+SET FOREIGN_KEY_CHECKS = ON;
+
+SET SESSION SQL_MODE= 'NO_BACKSLASH_ESCAPES';
+SET timestamp = 8;
+LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
+SET timestamp = 9;
+REPLACE INTO t2 SELECT * FROM t2;
+
+# Cleanup
+DROP TABLE t1, t2;
+--let $datadir= `select @@datadir`
+--remove_file $datadir/test/t1.data
+--remove_file $datadir/test/t1.data.2
+--remove_file $datadir/test/t2.data
+
+--echo #
+--echo # MDEV-16210 FK constraints on versioned tables use historical rows, which may cause constraint violation
+--echo #
+create or replace table t1 (a int, key(a)) engine innodb with system versioning;
+create or replace table t2 (b int, foreign key (b) references t1(a)) engine innodb;
+insert into t1 values (1),(2);
+insert into t2 values (1);
+--echo # DELETE from referenced table is not allowed
+--error ER_ROW_IS_REFERENCED_2
+delete from t1 where a = 1;
+drop tables t2, t1;
+
+--echo #
+--echo # MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 or server crash in row_ins_foreign_report_err upon DELETE from versioned table with FK
+--echo #
+create or replace table t1 (x int primary key) engine innodb;
+create or replace table t2 (x int, foreign key (x) references t1(x)) engine innodb with system versioning;
+set foreign_key_checks= off;
+insert into t2 values (1), (1);
+set foreign_key_checks= on;
+--echo # DELETE from foreign table is allowed
+delete from t2;
+drop tables t2, t1;
+
+create or replace table t1 (a int, key(a)) engine innodb;
+insert into t1 values (1);
+create or replace table t2 (b int, foreign key (b) references t1(a)) engine innodb with system versioning;
+insert into t2 values (1), (1);
+--echo # DELETE from foreign table is allowed
+delete from t2;
+drop tables t2, t1;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/insert.test b/mysql-test/suite/versioning/t/insert.test
new file mode 100644
index 00000000000..0324df64d0c
--- /dev/null
+++ b/mysql-test/suite/versioning/t/insert.test
@@ -0,0 +1,82 @@
+source suite/versioning/engines.inc;
+source suite/versioning/common.inc;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ x int unsigned,
+ y int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning;
+
+insert into t1(x, y) values(3, 4);
+insert into t1(x, y) values(2, 3);
+insert into t1 values(40, 33);
+replace_result $sys_datatype_max MAXVAL;
+eval select x, y, sys_end < $sys_datatype_max from t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ id int unsigned auto_increment primary key,
+ x int unsigned,
+ y int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning;
+
+insert into t1(x, y) values(33, 44);
+insert into t1(id, x, y) values(20, 33, 44);
+insert into t1 values(40, 33, 44);
+replace_result $sys_datatype_max MAXVAL;
+eval select id, x, y, sys_end < $sys_datatype_max from t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ x int unsigned,
+ y int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning;
+create view vt1_1 as select x, y from t1;
+insert into t1(x, y) values(8001, 9001);
+insert into vt1_1(x, y) values(1001, 2001);
+insert into vt1_1 values(1002, 2002);
+replace_result $sys_datatype_max MAXVAL;
+eval select x, y, sys_end < $sys_datatype_max from t1;
+select x, y from vt1_1;
+drop view vt1_1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1( id bigint primary key, a int, b int) with system versioning;
+insert into t1 values(1, 1, 1);
+select row_start, row_end from t1 into @sys_start, @sys_end;
+select id, a, b from t1;
+insert into t1 values(2, 2, 2);
+select id, a, b, row_start > @sys_start as C, row_end = @sys_end as D from t1 where id = 2;
+drop table t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create or replace table t1(
+ x int unsigned,
+ y int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning;
+create or replace table t2 like t1;
+insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
+delete from t1 where x >= 1;
+insert into t1(x, y) values (1, 1001), (2, 2001), (3, 3001), (4, 4001), (5, 5001), (6, 6001);
+insert into t1(x, y, sys_start) values (7, 7001, DEFAULT);
+insert into t1(x, y, sys_end) values (8, 8001, DEFAULT);
+insert into t1(x, y, sys_start, sys_end) values (9, 9001, DEFAULT, DEFAULT);
+insert into t2 select x, y from t1 for system_time all;
+select x, y from t1;
+select x, y from t2;
+drop table t1;
+drop table t2;
+
+-- source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/insert2.test b/mysql-test/suite/versioning/t/insert2.test
new file mode 100644
index 00000000000..1e7d2166064
--- /dev/null
+++ b/mysql-test/suite/versioning/t/insert2.test
@@ -0,0 +1,86 @@
+--source include/have_innodb.inc
+
+# TRT test
+
+create table t1(
+ x int unsigned,
+ sys_start bigint unsigned as row start invisible,
+ sys_end bigint unsigned as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning engine=innodb;
+
+create table t2(x int unsigned) engine=innodb;
+
+start transaction;
+insert into t1(x) values(1);
+commit;
+
+start transaction;
+insert into t2(x) values(1);
+savepoint a;
+insert into t1(x) values(1);
+rollback to a;
+commit;
+
+insert into t2(x) values (1);
+
+# virtual columns
+create or replace table t1 (
+ x int,
+ y int as (x) virtual,
+ sys_trx_start bigint unsigned as row start invisible,
+ sys_trx_end bigint unsigned as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end)
+) engine=innodb with system versioning;
+insert into t1 values (1, null);
+update t1 set x= x + 1;
+select x, y, sys_trx_end = 18446744073709551615 as current from t1 for system_time all;
+
+create or replace table t1 (
+ x int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1), (2);
+--error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
+insert into t1 (row_start) select row_end from t1;
+set sql_mode='';
+insert into t1 (row_start, row_end) values (DEFAULT, 1);
+set sql_mode=default;
+select @@sql_mode into @saved_mode;
+set sql_mode= '';
+insert into t1 (x, row_start, row_end) values (3, 4, 5);
+set sql_mode= @saved_mode;
+insert into t1 (row_start, row_end) values (DEFAULT, DEFAULT);
+select * from t1;
+
+--echo # MDEV-14792 INSERT without column list into table with explicit versioning columns produces bad data
+create or replace table t1 (
+ i int,
+ s timestamp(6) as row start,
+ e timestamp(6) as row end,
+ c varchar(8),
+ period for system_time(s, e))
+with system versioning;
+insert into t1 values (1, null, null, 'foo');
+select i, c, e>TIMESTAMP'2038-01-01 00:00:00' AS current_row from t1;
+
+drop table t1;
+drop table t2;
+
+--echo #
+--echo # MDEV-14871 Server crashes in fill_record / fill_record_n_invoke_before_triggers upon inserting into versioned table with trigger
+--echo #
+create or replace table t1 (pk int primary key) with system versioning;
+create trigger tr before insert on t1 for each row select 1 into @a;
+insert into t1 values (1),(2);
+drop table t1;
+
+#
+# MDEV-14794 Limitations which the row end as a part of PK imposes due to CURRENT_TIMESTAMP behavior and otherwise
+#
+create table t1 (pk int primary key, i int) with system versioning;
+replace into t1 values (1,10),(1,100),(1,1000);
+select pk,i,row_end > '2038-01-01' from t1 for system_time all;
+drop table t1;
diff --git a/mysql-test/suite/versioning/t/load_data.test b/mysql-test/suite/versioning/t/load_data.test
new file mode 100644
index 00000000000..4db6eee6c4d
--- /dev/null
+++ b/mysql-test/suite/versioning/t/load_data.test
@@ -0,0 +1,12 @@
+#
+# MDEV-15330 Server crash or assertion `table->insert_values' failure in write_record upon LOAD DATA
+#
+CREATE TABLE t1 (a INT, b INT, c INT, vc INT AS (c), UNIQUE(a), UNIQUE(b)) WITH SYSTEM VERSIONING;
+INSERT IGNORE INTO t1 (a,b,c) VALUES (1,2,3);
+
+SELECT a, b, c FROM t1 INTO OUTFILE '15330.data';
+LOAD DATA INFILE '15330.data' IGNORE INTO TABLE t1 (a,b,c);
+LOAD DATA INFILE '15330.data' REPLACE INTO TABLE t1 (a,b,c);
+
+# Cleanup
+DROP TABLE t1;
diff --git a/mysql-test/suite/versioning/t/online.test b/mysql-test/suite/versioning/t/online.test
new file mode 100644
index 00000000000..cff3193407b
--- /dev/null
+++ b/mysql-test/suite/versioning/t/online.test
@@ -0,0 +1,139 @@
+--source suite/versioning/innodb.inc
+--source suite/versioning/common.inc
+--source include/maybe_debug.inc
+
+set system_versioning_alter_history=keep;
+
+create or replace table t (a int);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t add system versioning, lock=none;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t add system versioning, algorithm=inplace;
+alter table t add system versioning, lock=shared;
+
+alter table t add column b int, change column a a int without system versioning, lock=none;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t drop system versioning, lock=none;
+alter table t drop system versioning, algorithm=inplace;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t (
+ a int, b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t values (1, 0);
+insert into t values (2, 0);
+delete from t where a = 2;
+alter table t drop column b, lock=none;
+alter table t add index idx(a), lock=none;
+
+select a, check_row(row_start, row_end) from t for system_time all order by a;
+
+--echo # MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL -
+--echo # generates error if table uses SYSTEM VERSIONING [tempesta-tech/mariadb#540]
+create or replace table t1 (a int, key(a)) with system versioning;
+create or replace table t2 like t;
+alter table t2 add foreign key(a) references t1(a);
+alter table t2 modify column a int not null, lock=none;
+
+drop table t2;
+drop table t1;
+
+--echo # MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ a int,
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t2 (
+ a int without system versioning,
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+insert into t1 values (1,1);
+insert into t2 values (1,1);
+
+set @@system_versioning_alter_history=keep;
+
+--enable_info
+--echo # without rebuild
+alter table t1
+ change a a int without system versioning,
+ algorithm=instant;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t2
+ change a a int with system versioning,
+ add primary key pk (a),
+ algorithm=instant;
+
+--echo # with rebuild
+alter table t2
+ change a a int with system versioning,
+ add primary key pk (a);
+--disable_info
+
+--source include/restart_mysqld.inc
+
+update t1 set a=2;
+select count(*) from t1 for system_time all;
+
+update t2 set a=2;
+select count(*) from t2 for system_time all;
+
+drop table t1, t2;
+
+--echo # rollback ALTER TABLE: nothing should change
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t (
+ a int,
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+insert into t values (1, 1);
+
+select c.prtype from information_schema.innodb_sys_columns as c
+ join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+ where t.name='test/t' and c.name='b';
+
+set @@system_versioning_alter_history=keep;
+
+if ($have_debug) {
+--disable_query_log
+--disable_result_log
+set debug_dbug='+d,ib_commit_inplace_fail_1';
+--error ER_INTERNAL_ERROR
+alter table t
+ change b b int without system versioning;
+set debug_dbug= default;
+--enable_query_log
+--enable_result_log
+}
+
+select c.prtype from information_schema.innodb_sys_columns as c
+ join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+ where t.name='test/t' and c.name='b';
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+show create table t;
+
+select count(*) from t for system_time all;
+update t set b=11;
+select count(*) from t for system_time all;
+
+drop table t;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/optimized.test b/mysql-test/suite/versioning/t/optimized.test
new file mode 100644
index 00000000000..054c1d32559
--- /dev/null
+++ b/mysql-test/suite/versioning/t/optimized.test
@@ -0,0 +1,40 @@
+create table t (
+ a int,
+ b int without system versioning
+) with system versioning;
+
+insert into t values(1, 2);
+insert into t values(3, 4);
+select * from t;
+select a from t for system_time as of timestamp now(6);
+select a, b, b+0 from t for system_time as of timestamp now(6);
+select * from t for system_time as of timestamp now(6);
+select count(*) from t for system_time as of timestamp now(6) group by b;
+select * from t for system_time as of timestamp now(6) order by b asc;
+select * from t for system_time as of timestamp now(6) order by b desc;
+select * from t for system_time as of timestamp now(6) group by a having a=2;
+select * from t for system_time as of timestamp now(6) group by b having b=2;
+select a from t for system_time as of timestamp now(6) where b=2;
+select a from t for system_time as of timestamp now(6) where b=NULL;
+select a from t for system_time as of timestamp now(6) where b is NULL;
+select count(*), b from t for system_time as of timestamp now(6) group by b having b=NULL;
+select a, b from t;
+
+create or replace table t (
+ a int,
+ b int not null without system versioning
+) with system versioning;
+
+insert into t values (1, 2), (3, 4);
+
+select * from t for system_time as of timestamp now(6);
+select * from t for system_time as of timestamp now(6) where b is NULL;
+
+#
+# MDEV-15062 Information Schema COLUMNS Table does not show system versioning information
+#
+create or replace table t (x int with system versioning, y int);
+select column_name, extra from information_schema.columns where table_name='t';
+show create table t;
+
+drop table t;
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
new file mode 100644
index 00000000000..957fddc730d
--- /dev/null
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -0,0 +1,657 @@
+-- source include/have_partition.inc
+-- source suite/versioning/common.inc
+-- source suite/versioning/engines.inc
+
+set system_versioning_alter_history=keep;
+--echo # Check conventional partitioning on temporal tables
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ x int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end))
+with system versioning
+partition by range columns (x) (
+ partition p0 values less than (100),
+ partition p1 values less than (1000));
+
+insert into t1 values (3), (300);
+select * from t1;
+select * from t1 partition (p0);
+select * from t1 partition (p1);
+
+delete from t1;
+select * from t1;
+select * from t1 partition (p0);
+select * from t1 partition (p1);
+select * from t1 for system_time all;
+select * from t1 partition (p0) for system_time all;
+select * from t1 partition (p1) for system_time all;
+
+--echo # Engine change native <-> non-native versioning prohibited
+--replace_result $sys_datatype_expl SYS_DATATYPE $default_engine DEFAULT_ENGINE
+eval create or replace table t1 (
+ i int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end))
+engine=$default_engine
+with system versioning partition by hash(i);
+--replace_result $non_default_engine NON_DEFAULT_ENGINE
+--error ER_VERS_ALTER_ENGINE_PROHIBITED
+eval alter table t1 engine=$non_default_engine;
+
+
+--echo ## CREATE TABLE
+
+--error ER_VERS_NOT_VERSIONED
+create or replace table t1 (x int)
+partition by system_time (
+ partition p0 history,
+ partition pn current);
+
+create or replace table t1 (x int);
+--error ER_VERS_NOT_VERSIONED
+alter table t1
+partition by system_time (
+ partition p0 history,
+ partition pn current);
+
+--error ER_VERS_WRONG_PARTS
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition p0 current);
+
+--error ER_VERS_WRONG_PARTS
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition p0 current,
+ partition p1 current);
+
+--error ER_VERS_WRONG_PARTS
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition p0 history,
+ partition p1 history);
+
+--error ER_VERS_WRONG_PARTS
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition pn current,
+ partition p0 history);
+
+--error ER_VERS_WRONG_PARTS
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition p0,
+ partition pn current);
+
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition p0 history,
+ partition pn current);
+
+
+--echo ## ALTER TABLE
+
+--error ER_VERS_WRONG_PARTS
+alter table t1 add partition (
+ partition p1 current);
+
+alter table t1 add partition (
+ partition p1 history);
+
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+insert into t1 values (1), (2);
+
+--error ER_VERS_WRONG_PARTS
+alter table t1 drop partition pn;
+alter table t1 drop partition p1;
+--error ER_VERS_WRONG_PARTS
+alter table t1 drop partition p0;
+
+select x from t1;
+
+--echo # Bug #260: incorrect IB partitioning warning
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 1 (
+ partition p0 history,
+ partition pn current);
+alter table t1 change x big int;
+
+create or replace table t1 (i int) engine myisam partition by hash(i) partitions 2;
+--error ER_PARTITION_WRONG_TYPE
+alter table t1 add partition (partition px history);
+
+
+--echo ## INSERT, UPDATE, DELETE
+create or replace table t1 (x int)
+with system versioning
+partition by system_time (
+ partition p0 history,
+ partition pn current);
+
+set @now= now(6);
+insert into t1 values (1);
+set @str= concat('select x, row_start < @now as A, row_end > @now as B from t1 partition (p0)');
+prepare select_p0 from @str;
+set @str= concat('select x, row_start > @now as C, row_end = timestamp\'2038-01-19 03:14:07.999999\' as D from t1 partition (pn)');
+prepare select_pn from @str;
+
+execute select_p0;
+execute select_pn;
+
+set @str= concat('select row_start from t1 partition (pn) into @ts0');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+
+--source suite/versioning/wait_system_clock.inc
+
+set @now= now(6);
+delete from t1;
+execute select_p0;
+execute select_pn;
+
+set @str= concat('select row_start from t1 partition (p0) into @ts1');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+
+select @ts0 = @ts1;
+
+set @now= now(6);
+insert into t1 values (2);
+
+--source suite/versioning/wait_system_clock.inc
+
+execute select_p0;
+execute select_pn;
+
+set @str= concat('select row_start from t1 partition (pn) into @ts0');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+
+set @now= now(6);
+update t1 set x = x + 1;
+
+--source suite/versioning/wait_system_clock.inc
+
+execute select_p0;
+execute select_pn;
+
+drop prepare select_p0;
+drop prepare select_pn;
+
+set @str= concat('select row_start from t1 partition (p0) where x = 2 into @ts1');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+set @str= concat('select row_end from t1 partition (p0) where x = 2 into @ts2');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+set @str= concat('select row_start from t1 partition (pn) into @ts3');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+
+select @ts0 = @ts1;
+select @ts2 = @ts3;
+
+--echo ## rotation by LIMIT
+--error ER_PART_WRONG_VALUE
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 0 (
+ partition p0 history,
+ partition p1 history,
+ partition pn current);
+
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 2 (
+ partition p0 history,
+ partition p1 history,
+ partition pn current);
+
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+--error ER_DROP_PARTITION_NON_EXISTENT
+alter table t1 drop partition non_existent;
+
+insert into t1 values (1), (2), (3), (4), (5), (6);
+select * from t1 partition (pn);
+delete from t1 where x < 4;
+delete from t1;
+select * from t1 partition (p0);
+select * from t1 partition (p1);
+
+insert into t1 values (7), (8);
+--echo ### warn about full partition
+delete from t1;
+select * from t1 partition (p1) order by x;
+
+--echo ### Assertion in ALTER on warning from partitioning LIMIT [#446]
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1), (2);
+delete from t1;
+alter table t1 partition by system_time limit 1 (
+ partition p1 history,
+ partition pn current);
+
+--echo ## rotation by INTERVAL
+--error ER_PART_WRONG_VALUE
+create or replace table t1 (x int)
+with system versioning
+partition by system_time interval 0 second (
+ partition p0 history,
+ partition p1 history,
+ partition pn current);
+
+--error ER_PARSE_ERROR
+create or replace table t1 (x int)
+with system versioning
+partition by system_time interval 1 second starts 12345 (
+ partition p0 history,
+ partition p1 history,
+ partition pn current);
+
+--error ER_PARSE_ERROR
+create table t1 (i int) with system versioning
+ partition by system_time interval 6 day limit 98
+ (partition p0 history, partition ver_pn current);
+
+--echo ## Subpartitions
+create or replace table t1 (x int)
+with system versioning
+partition by system_time limit 2
+subpartition by key (x)
+subpartitions 2 (
+ partition p0 history,
+ partition p1 history,
+ partition pn current);
+
+insert into t1 (x) values (1), (2), (3), (4), (5);
+select * from t1 partition (pnsp0);
+select * from t1 partition (pnsp1);
+
+--echo ### warn about full partition
+delete from t1 where x < 3;
+delete from t1;
+delete from t1;
+select * from t1 partition (p0sp0);
+select * from t1 partition (p0sp1);
+select * from t1 partition (p1sp0);
+select * from t1 partition (p1sp1);
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ a bigint,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end))
+with system versioning
+partition by range (a)
+(partition p0 values less than (20) engine innodb,
+ partition p1 values less than maxvalue engine innodb);
+insert into t1 values (1);
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ f_int1 integer default 0,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning
+partition by range(f_int1)
+subpartition by hash(f_int1)
+( partition part1 values less than (1000)
+(subpartition subpart11 storage engine = 'innodb',
+subpartition subpart12 storage engine = 'innodb'));
+insert into t1 values (1);
+
+create or replace table t1 (i int) engine=innodb partition by key(i);
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval alter table t1
+ add column row_start $sys_datatype_expl as row start invisible,
+ add column row_end $sys_datatype_expl as row end invisible,
+ add period for system_time(row_start, row_end),
+ add system versioning;
+insert into t1 values();
+
+--echo # MDEV-14722 Assertion in ha_commit_trans for sub-statement
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 day (
+ partition p1 history,
+ partition pc current);
+create or replace table t2 (f int);
+create or replace trigger tr before insert on t2
+for each row select table_rows from information_schema.tables
+where table_name = 't1' into @a;
+insert into t2 values (1);
+
+--echo # MDEV-14740 Locking assertion for system_time partitioning
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 week (
+ partition p1 history,
+ partition pn current);
+create or replace table t2 (f int);
+create or replace trigger tr before insert on t2
+for each row select count(*) from t1 into @a;
+insert into t2 values (1);
+
+--echo # MDEV-14741 Assertion `(trx)->start_file == 0' failed in row_truncate_table_for_mysql()
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 hour (
+ partition p1 history,
+ partition pn current);
+set autocommit= off;
+truncate table t1;
+set autocommit= on;
+
+--echo # MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLES
+create or replace table t1 (x int) with system versioning;
+lock table t1 write;
+alter table t1 partition by system_time interval 1 week (
+ partition p1 history,
+ partition pn current);
+unlock tables;
+
+--echo # MDEV-14748 Assertion in ha_myisammrg::attach_children()
+create or replace table t1 (x int) engine=myisam with system versioning
+ partition by system_time interval 1 month (partition p1 history, partition pn current);
+create or replace table t2 (x int) engine=myisam;
+create or replace table t3 (x int) engine=merge union=(t2);
+create or replace table t4 (x int) engine=myisam;
+create or replace trigger tr after insert on t4 for each row insert into t2
+ ( select x from t3 ) union ( select x from t1 );
+insert into t4 values (1);
+
+--echo # MDEV-14821 Assertion failure
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (0), (1);
+update t1 set x= x + 1;
+alter table t1 partition by system_time limit 1 (
+ partition p1 history,
+ partition p2 history,
+ partition pn current);
+delete from t1 where x = 1;
+delete from t1 where x = 2;
+
+--echo # MDEV-14923 Assertion upon INSERT into locked versioned partitioned table
+create or replace table t1 (x int) with system versioning
+partition by system_time (partition p1 history, partition pn current);
+lock table t1 write;
+--error ER_SAME_NAME_PARTITION
+alter table t1 add partition (partition p1 history);
+insert into t1 values (1);
+unlock tables;
+
+--error ER_DATA_OUT_OF_RANGE
+create or replace table t1 (pk int) with system versioning
+partition by system_time interval 10 year (
+ partition p1 history,
+ partition p2 history,
+ partition pn current
+);
+
+# INTERVAL and ALTER TABLE
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 hour (
+ partition p0 history, partition pn current);
+
+set @ts=(select partition_description from information_schema.partitions
+ where table_schema='test' and table_name='t1' and partition_name='p0');
+
+alter table t1 add column b int;
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+alter table t1 add partition (partition p1 history, partition p2 history);
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+alter table t1 drop partition p0;
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+--error ER_VERS_DROP_PARTITION_INTERVAL
+alter table t1 drop partition p2;
+select partition_name,partition_ordinal_position,partition_method,timediff(partition_description, @ts) from information_schema.partitions where table_schema='test' and table_name='t1';
+
+--echo #
+--echo # MDEV-15103 Assertion in ha_partition::part_records() for updating VIEW
+--echo #
+create or replace table t1 (pk int primary key, f int) with system versioning
+partition by system_time limit 100 (partition p1 history, partition pn current);
+insert into t1 values (1,10), (2,20);
+create or replace view v1 as select * from t1;
+update v1 set f= 30;
+
+--echo #
+--echo # MDEV-15168 Unexpected ER_VERS_ENGINE_UNSUPPORTED upon dropping versioning on a partitioned table
+--echo #
+create or replace table t (a int) with system versioning
+ partition by system_time (partition p1 history, partition pn current);
+--error ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION
+alter table t drop system versioning;
+
+--echo # MDEV-15191 Assertion `bit < (map)->n_bits' failed in bitmap_is_set upon INSERT
+create or replace table t1 (i int) with system versioning;
+insert into t1 values (1), (2);
+update t1 set i= 3;
+alter table t1 partition by system_time interval 1 month (partition p1 history, partition pn current);
+lock table t1 write;
+alter table t1 add partition (partition p2 history);
+insert into t1 values (4);
+unlock tables;
+
+--echo # MDEV-15036 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' in Diagnostics_area::set_ok_status or unexpected ER_RANGE_NOT_INCREASING_ERROR
+create or replace table t1 (a int) with system versioning
+partition by system_time limit 2 (
+ partition p1 history, partition p2 history,
+ partition p3 history, partition pn current);
+insert into t1 values (1),(2),(3);
+update t1 set a = 4;
+delete from t1;
+delete from t1 where a is not null;
+
+--echo # MDEV-14823 Wrong error message upon selecting from a system_time partition
+create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current);
+--error ER_VERS_QUERY_IN_PARTITION
+select * from t1 partition (p0) for system_time all;
+--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 partition (p0) for system_time all;
+--error ER_VERS_QUERY_IN_PARTITION
+call sp;
+--error ER_VERS_QUERY_IN_PARTITION
+call sp;
+drop procedure sp;
+
+--echo # MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
+create or replace table t1 (pk int primary key)
+ engine=myisam
+ with system versioning
+ partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+--echo Same test but for Aria storage engine
+create or replace table t1 (pk int primary key)
+ engine=aria
+ with system versioning
+ partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+
+--echo #
+--echo # MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments
+--echo #
+create or replace table t1 (pk int) with system versioning
+partition by system_time interval 7 second (
+ partition ver_p1 history,
+ partition ver_pn current);
+alter table t1
+partition by system_time interval column_get(column_create(7,7), 7 as int) second (
+ partition ver_p1 history,
+ partition ver_pn current);
+--replace_result $default_engine DEFAULT_ENGINE
+show create table t1;
+
+--echo #
+--echo # MDEV-19175 Server crashes in ha_partition::vers_can_native upon INSERT DELAYED into versioned partitioned table
+--echo #
+create or replace table t1 (f int) with system versioning partition by hash(f);
+# delayed works differently in embedded server
+--error 0,ER_DELAYED_NOT_SUPPORTED
+insert delayed into t1 values (1);
+
+--echo #
+--echo # MDEV-20068 History partition rotation is not done under LOCK TABLES
+--echo #
+create or replace table t1 (x int) with system versioning partition by system_time limit 1
+(partition p1 history, partition pn current);
+lock tables t1 write;
+insert into t1 values (0), (1), (2), (3);
+delete from t1 where x < 3;
+delete from t1;
+unlock tables;
+
+--echo #
+--echo # MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
+--echo #
+create or replace table t1 (pk int primary key) with system versioning partition by system_time limit 100 (partition p1 history, partition pn current);
+execute immediate 'select * from t1 for update';
+
+drop view v1;
+drop tables t, t1, t2, t3, t4;
+
+--echo #
+--echo # MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables
+--echo #
+create or replace table t1 (
+ x int,
+ a varchar(255)
+) with system versioning partition by system_time (partition p1 history, partition pn current);
+
+insert into t1 (x) values (1), (2), (3), (4);
+update t1 set a= 'foo' limit 3;
+update t1 set a= 'bar' limit 4;
+select * from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
+--echo #
+create table t1 (a int) with system versioning
+partition by system_time limit 3
+(partition p1 history, partition p2 history, partition pn current);
+insert into t1 values (1),(2),(3),(4);
+delete from t1;
+delete from t1;
+check table t1;
+
+# cleanup
+drop table t1;
+
+--echo #
+--echo # MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
+--echo #
+create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2;
+insert into t1 values (1,'foo'),(2,'bar');
+
+create table t2 (b int);
+insert into t2 values (1),(2);
+
+update t1, t2 set a = 1;
+
+# cleanup
+drop table t1, t2;
+
+--echo #
+--echo # MDEV-20515 multi-update tries to position updated table by null reference
+--echo #
+create or replace table t1 (a int);
+insert into t1 values (0), (1);
+
+create or replace table t2 (b int) with system versioning
+partition by system_time
+(partition p1 history, partition pn current);
+
+insert into t2 values (0), (2);
+update t1 left join t2 on a > b set b= 2 order by b;
+
+# cleanup
+drop table t1, t2;
+
+--echo #
+--echo # MDEV-17091 Assertion `old_part_id == m_last_part' failed in
+--echo # ha_partition::update_row or `part_id == m_last_part' in
+--echo # ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
+--echo #
+create or replace table t1 (pk int primary key, f int) engine=innodb
+ with system versioning
+ partition by key() partitions 2;
+insert into t1 values (1,10),(2,20);
+--echo # expected to hit same partition
+select * from t1 partition (p0);
+alter table t1 drop system versioning;
+
+--echo # 1 and 2 are expected to be in different partitions
+select * from t1 partition(p0);
+select * from t1 partition(p1);
+
+update t1 set f=pk;
+delete from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-22413 Server hangs upon UPDATE/DELETE on a view reading from versioned partitioned table
+--echo #
+create or replace table t1 (f char(6)) engine innodb with system versioning;
+
+insert into t1 values (null);
+update t1 set f= 'foo';
+update t1 set f= 'bar';
+
+create or replace view v1 as select * from t1 for system_time all;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+update v1 set f = '';
+
+create or replace table t1 (f char(6)) engine innodb with system versioning
+partition by system_time limit 1
+(partition p1 history, partition p2 history, partition pn current);
+
+insert into t1 values (null);
+update t1 set f= 'foo';
+update t1 set f= 'bar';
+
+create or replace view v1 as select * from t1 for system_time all;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+update v1 set f= '';
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+delete from v1;
+
+# cleanup
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # MDEV-22112 Assertion `tab_part_info->part_type == RANGE_PARTITION || tab_part_info->part_type == LIST_PARTITION' failed in prep_alter_part_table
+--echo #
+
+### TMP: Please remove this error check in 10.5 (MDEV-19903)
+--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
+create table t1 (a int) with system versioning partition by system_time;
+### TMP end
+
+create table t1 (a int) with system versioning partition by system_time
+(partition p1 history, partition pn current);
+--error ER_PARTITION_WRONG_TYPE
+alter table t1 add partition (partition p2);
+
+# Cleanup
+drop table t1;
+
+--echo # End of 10.3 tests
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/partition_innodb.test b/mysql-test/suite/versioning/t/partition_innodb.test
new file mode 100644
index 00000000000..29ec58af13c
--- /dev/null
+++ b/mysql-test/suite/versioning/t/partition_innodb.test
@@ -0,0 +1,94 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+--source suite/versioning/common.inc
+
+--echo # MDEV-15951 system versioning by trx id doesn't work with partitioning
+--echo # currently trx_id does not support partitioning by system_time
+--error ER_VERS_FIELD_WRONG_TYPE
+create or replace table t1(
+ i int,
+ row_start bigint unsigned generated always as row start,
+ row_end bigint unsigned generated always as row end,
+ period for system_time(row_start, row_end)
+) engine=InnoDB with system versioning partition by system_time (
+ partition p0 history,
+ partition pn current
+);
+
+create or replace table t1(
+ i int,
+ row_start bigint unsigned generated always as row start,
+ row_end bigint unsigned generated always as row end,
+ period for system_time(row_start, row_end)
+) engine=InnoDB with system versioning;
+
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+--error ER_VERS_FIELD_WRONG_TYPE
+alter table t1 partition by system_time (
+ partition p0 history,
+ partition pn current
+);
+
+drop table t1;
+
+--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED
+create or replace table t (
+ a int primary key,
+ row_start bigint unsigned as row start invisible,
+ row_end bigint unsigned as row end invisible,
+ period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by key() (
+ partition p1,
+ partition p2
+);
+
+--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED
+create or replace table t (
+ a int primary key,
+ row_start bigint unsigned as row start invisible,
+ row_end bigint unsigned as row end invisible,
+ period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by key(a, row_start) (
+ partition p1,
+ partition p2
+);
+
+--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED
+create or replace table t (
+ a int primary key,
+ row_start bigint unsigned as row start invisible,
+ row_end bigint unsigned as row end invisible,
+ period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by hash(a + row_end * 2) (
+ partition p1,
+ partition p2
+);
+
+--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED
+create or replace table t (
+ a int primary key,
+ row_start bigint unsigned as row start invisible,
+ row_end bigint unsigned as row end invisible,
+ period for system_time(row_start, row_end)
+) engine=innodb with system versioning
+partition by range columns (a, row_start) (
+ partition p1 values less than (100, 100)
+);
+
+--echo #
+--echo # MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table
+--echo #
+create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i))
+engine=innodb with system versioning partition by key() partitions 2;
+insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b');
+alter table t1 drop system versioning;
+replace into t1 select * from t1;
+select * from t1 where i > 0 or pk = 1000 limit 1;
+drop table t1;
+
+--echo # End of 10.3 tests
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/partition_rotation.test b/mysql-test/suite/versioning/t/partition_rotation.test
new file mode 100644
index 00000000000..efcd393c7e0
--- /dev/null
+++ b/mysql-test/suite/versioning/t/partition_rotation.test
@@ -0,0 +1,58 @@
+--source include/have_partition.inc
+
+#
+# partition rotation
+#
+set timestamp=unix_timestamp('2001-02-03 10:20:30');
+create or replace table t1 (i int) with system versioning
+partition by system_time interval 1 day
+ subpartition by key (i) subpartitions 2
+ (partition p1 history, partition pn current);
+set timestamp=unix_timestamp('2001-02-03 10:20:40');
+insert t1 values (1); delete from t1;
+set timestamp=unix_timestamp('2001-02-04 10:20:50');
+insert t1 values (2); delete from t1;
+
+select subpartition_name,partition_description,table_rows from information_schema.partitions where table_schema='test' and table_name='t1';
+
+set timestamp=unix_timestamp('2001-02-04 10:20:55');
+alter table t1 add partition (partition p0 history, partition p2 history);
+set timestamp=unix_timestamp('2001-02-04 10:30:00');
+insert t1 values (4),(5);
+set timestamp=unix_timestamp('2001-02-04 10:30:10');
+update t1 set i=6 where i=5;
+
+select subpartition_name,partition_description,table_rows from information_schema.partitions where table_schema='test' and table_name='t1';
+
+--echo ## pruning check
+set @ts=(select partition_description from information_schema.partitions
+ where table_schema='test' and table_name='t1' and partition_name='p0' limit 1);
+--sorted_result
+select * from t1;
+explain partitions select * from t1;
+--replace_column 10 #
+explain partitions select * from t1 for system_time as of '2001-02-04 10:20:30';
+set @ts=(select row_end from t1 for system_time all where i=1);
+select * from t1 for system_time all where row_end = @ts;
+--replace_column 5 # 10 # 11 #
+explain partitions select * from t1 for system_time all where row_end = @ts;
+
+--echo #
+--echo # MDEV-16023 Unfortunate error message WARN_VERS_PART_FULL
+--echo #
+
+set timestamp= unix_timestamp('2020-07-29 10:30:10');
+create or replace table t1 (a int) with system versioning
+ partition by system_time interval 1 second (
+ partition p0 history,
+ partition p1 history,
+ partition pc current
+ );
+
+set timestamp= unix_timestamp('2020-07-29 10:30:14');
+insert into t1 values (1),(2),(3);
+show warnings;
+
+--echo # Cleanup
+set timestamp= default;
+drop table t1;
diff --git a/mysql-test/suite/versioning/t/replace.test b/mysql-test/suite/versioning/t/replace.test
new file mode 100644
index 00000000000..392c0ffcf35
--- /dev/null
+++ b/mysql-test/suite/versioning/t/replace.test
@@ -0,0 +1,62 @@
+--source suite/versioning/key_type.inc
+if ($MTR_COMBINATION_SEC)
+{
+ --skip pk or unique only
+}
+--source suite/versioning/common.inc
+--source suite/versioning/engines.inc
+
+--replace_result $sys_datatype_expl SYS_DATATYPE "$KEY_TYPE" KEY_TYPE
+eval create or replace table t(
+ id int,
+ $KEY_TYPE(id),
+ x int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+insert t values (1, 2);
+replace t values (1, 3);
+select *, current_row(row_end) as current from t for system_time all order by x;
+drop table t;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table t (
+ id int unique,
+ x int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+
+insert t values (1, 2);
+replace t values (1, 3);
+select *, current_row(row_end) as current from t for system_time all order by x;
+drop table t;
+
+--echo # MDEV-15645 Assertion `table->insert_values' failed in write_record upon REPLACE into a view with underlying versioned table
+create or replace table t1 (a int, b int, primary key (a), unique(b)) with system versioning;
+insert into t1 values (1,1);
+create or replace table t2 (c int);
+create or replace view v as select t1.* from t1 join t2;
+replace into v (a, b) select a, b from t1;
+drop view v;
+drop tables t1, t2;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval CREATE TABLE t1 (
+ pk INT AUTO_INCREMENT,
+ f INT,
+ row_start $sys_datatype_expl AS ROW START INVISIBLE,
+ row_end $sys_datatype_expl AS ROW END INVISIBLE,
+ PRIMARY KEY(pk),
+ UNIQUE(f),
+ PERIOD FOR SYSTEM_TIME(row_start, row_end)
+) WITH SYSTEM VERSIONING;
+INSERT INTO t1 () VALUES (),(),(),(),(),();
+UPDATE IGNORE t1 SET f = 1;
+REPLACE t1 SELECT * FROM t1;
+DROP TABLE t1;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test
new file mode 100644
index 00000000000..b5be68feece
--- /dev/null
+++ b/mysql-test/suite/versioning/t/rpl.test
@@ -0,0 +1,136 @@
+--source suite/versioning/engines.inc
+--source include/have_partition.inc
+--source include/master-slave.inc
+
+#BUG#12662190 - COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS
+#Testing command counters -BEFORE.
+#Storing the before counts of Slave
+connection slave;
+let $slave_com_commit_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_commit', Value, 1);
+let $slave_com_insert_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_insert', Value, 1);
+let $slave_com_delete_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_delete', Value, 1);
+let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_update', Value, 1);
+
+connection master;
+CREATE TABLE t1 (x int) with system versioning;
+insert into t1 values (1);
+select * from t1 order by x;
+delete from t1;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+connection master;
+insert into t1 values (2);
+sync_slave_with_master;
+select * from t1 order by x;
+
+connection master;
+update t1 set x = 3;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+--echo # check unversioned -> versioned replication
+connection master;
+create or replace table t1 (x int primary key);
+sync_slave_with_master;
+alter table t1 with system versioning;
+
+connection master;
+insert into t1 values (1);
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+connection master;
+update t1 set x= 2 where x = 1;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+connection master;
+delete from t1;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+--echo # same thing (UPDATE, DELETE), but without PK
+connection master;
+create or replace table t1 (x int);
+sync_slave_with_master;
+alter table t1 with system versioning;
+
+connection master;
+insert into t1 values (1);
+update t1 set x= 2 where x = 1;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+connection master;
+delete from t1;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t1 for system_time all order by row_end, x;
+
+--echo # multi-update
+connection master;
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (x int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+update t1, t2 set t1.x=11, t2.x=22;
+sync_slave_with_master;
+select * from t1 order by x;
+select * from t2 order by x;
+select * from t1 for system_time all order by row_end, x;
+select * from t2 for system_time all order by row_end, x;
+
+--echo # MDEV-14767 system_versioning_alter_history breaks ALTER replication
+--echo ## Case 1: KEEP on the master, ALTER will work on the slave
+connection master;
+create or replace table t1 (a int) with system versioning;
+set system_versioning_alter_history= KEEP;
+alter table t1 add column b int;
+sync_slave_with_master;
+--replace_result InnoDB ENGINE MyISAM ENGINE MEMORY ENGINE
+show create table t1;
+
+--echo ## Case 2: ERROR on the master, it'll fail on the master, the slave won't see it
+connection master;
+set system_versioning_alter_history= ERROR;
+--error ER_VERS_ALTER_NOT_ALLOWED
+alter table t1 drop column b;
+sync_slave_with_master;
+--replace_result InnoDB ENGINE MyISAM ENGINE MEMORY ENGINE
+show create table t1;
+
+--echo ## Case 3: table is not versioned on the master, ALTER will work on the slave
+connection master;
+create or replace table t1 (a int);
+sync_slave_with_master;
+create or replace table t1 (a int) with system versioning;
+connection master;
+alter table t1 add column b int;
+sync_slave_with_master;
+--replace_result InnoDB ENGINE MyISAM ENGINE MEMORY ENGINE
+show create table t1;
+
+connection master;
+drop table t1, t2;
+
+#
+# MDEV-15395 Wrong result or Assertion `old_part_id == m_last_part' failed in ha_partition::update_row on slave
+#
+create table t1 (i int) with system versioning partition by system_time limit 8 ( partition p1 history, partition p2 history, partition pn current );
+insert into t1 values (1);
+update t1 set i = 1;
+update t1 set i = 0;
+sync_slave_with_master;
+connection master;
+drop table t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/t/rpl_mix.test b/mysql-test/suite/versioning/t/rpl_mix.test
new file mode 100644
index 00000000000..64025c74625
--- /dev/null
+++ b/mysql-test/suite/versioning/t/rpl_mix.test
@@ -0,0 +1,19 @@
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+#
+# MDEV-15405 Mixed replication fails with "Could not execute Delete_rows_v1 event" upon DELETE HISTORY
+#
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES (1,10),(2,20);
+UPDATE t1 SET i = 100;
+# This is to imitiate any real-life situation which causes a switch to row format
+SET BINLOG_FORMAT= ROW;
+DELETE HISTORY FROM t1;
+--sync_slave_with_master
+
+connection master;
+drop table t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/t/rpl_row.test b/mysql-test/suite/versioning/t/rpl_row.test
new file mode 100644
index 00000000000..17ce2dfdcf8
--- /dev/null
+++ b/mysql-test/suite/versioning/t/rpl_row.test
@@ -0,0 +1,18 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--echo # MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables
+set @old_row_image= @@binlog_row_image;
+set binlog_row_image= minimal;
+
+create or replace table t1 (pk int, i int, primary key(pk))
+with system versioning;
+insert into t1 values (1,10),(2,20);
+update t1 set i = 0;
+
+--sync_slave_with_master
+--connection master
+drop table t1;
+set binlog_row_image= @old_row_image;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test
new file mode 100644
index 00000000000..c70f2714fff
--- /dev/null
+++ b/mysql-test/suite/versioning/t/select.test
@@ -0,0 +1,427 @@
+--source suite/versioning/engines.inc
+--source suite/versioning/common.inc
+--source include/default_optimizer_switch.inc
+
+# test_01
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ x int unsigned,
+ y int unsigned,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning;
+
+insert into t1 (x, y) values
+ (0, 100),
+ (1, 101),
+ (2, 102),
+ (3, 103),
+ (4, 104),
+ (5, 105),
+ (6, 106),
+ (7, 107),
+ (8, 108),
+ (9, 109);
+
+set @t0= now(6);
+if ($MTR_COMBINATION_TRX_ID)
+{
+--disable_query_log
+ select sys_trx_start from t1 limit 1 into @x0;
+--enable_query_log
+}
+
+delete from t1 where x = 3;
+delete from t1 where x > 7;
+
+insert into t1(x, y) values(3, 33);
+select sys_trx_start from t1 where x = 3 and y = 33 into @t1;
+if ($MTR_COMBINATION_TRX_ID)
+{
+--disable_query_log
+ set @x1= @t1;
+ select trt_commit_ts(@x1) into @t1;
+--enable_query_log
+}
+
+select x, y from t1;
+select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
+select x as FROMTO_x, y from t1 for system_time from timestamp '1970-01-01 00:00:00' to timestamp @t1;
+select x as BETWAND_x, y from t1 for system_time between timestamp '1970-01-01 00:00:00' and timestamp @t1;
+select x as ALL_x, y from t1 for system_time all;
+
+--disable_query_log
+if ($MTR_COMBINATION_TRX_ID)
+{
+ select x as ASOF2_x, y from t1 for system_time as of @x0;
+ select x as FROMTO2_x, y from t1 for system_time from @x0 to @x1;
+ select x as BETWAND2_x, y from t1 for system_time between transaction @x0 and transaction @x1;
+}
+if ($MTR_COMBINATION_TIMESTAMP)
+{
+ select x as ASOF2_x, y from t1 for system_time as of @t0;
+ select x as FROMTO2_x, y from t1 for system_time from timestamp '1970-01-01 00:00:00' to timestamp @t1;
+ select x as BETWAND2_x, y from t1 for system_time between timestamp '1970-01-01 00:00:00' and timestamp @t1;
+}
+--enable_query_log
+
+# test_02
+
+create or replace table t1 (
+ x int unsigned,
+ y int unsigned
+) with system versioning;
+create or replace table t2 (
+ x int unsigned,
+ y int unsigned
+) with system versioning;
+
+insert into t1 values (1, 1), (1, 2), (1, 3), (4, 4), (5, 5);
+insert into t2 values (1, 2), (2, 1), (3, 1);
+set @t0= now(6);
+
+select t1.x as IJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x;
+select t1.x as LJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x;
+select t1.x as RJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x;
+
+delete from t1;
+delete from t2;
+
+#384
+explain extended select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+explain extended select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+#383
+explain extended select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+
+select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+
+drop table t1;
+drop table t2;
+
+# Wildcard expansion on hidden fields
+
+create table t1(
+ A int
+) with system versioning;
+insert into t1 values(1);
+select * from t1;
+
+create or replace table t1 (x int);
+insert into t1 values (1);
+--error ER_VERS_NOT_VERSIONED
+select * from t1 for system_time all;
+
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+select * from t1 for system_time all for update;
+
+create or replace table t1 (a int not null auto_increment primary key) with system versioning;
+select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
+
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (a int) with system versioning;
+insert into t1 values(1);
+insert into t2 values(1);
+create view v1 as select * from t2 inner join t1 using (a);
+select * from v1;
+drop view v1;
+
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create view vt1 as select a from t1;
+select * from t1 natural join vt1;
+drop view vt1;
+
+create or replace table t1(x int) with system versioning;
+select * from (t1 as r left join t1 as u using (x)), t1;
+
+# @end should be max
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create trigger read_end after update on t1
+ for each row set @end = old.row_end;
+update t1 set a=2;
+--replace_result 18446744073709551615 MAX_RESULT "2038-01-19 03:14:07.999999" MAX_RESULT
+select @end;
+
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+select * from (select * from t1 cross join t2) as tmp;
+select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
+select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00:00')) as tmp;
+
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+select * from t1 for system_time all natural left join t2 for system_time all;
+
+# natural join of a view and table
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+create or replace view v1 as select a1 from t1;
+
+select * from v1 natural join t2;
+select * from v1 natural left join t2;
+select * from v1 natural right join t2;
+
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+explain extended
+select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
+select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
+
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int) with system versioning;
+insert into t1 values (1), (2), (3);
+delete from t1 where x = 3;
+insert into t2 values (1);
+select * from t1, t2 for system_time all;
+
+--error ER_VERS_NOT_VERSIONED
+select * from (select * from t1 for system_time all, t2 for system_time all)
+for system_time all as t;
+
+--echo # TRANSACTION/TIMESTAMP specifier in SYSTEM_TIME [MDEV-14645, Issue #396]
+create or replace table t1 (x int) with system versioning engine myisam;
+--error ER_VERS_ENGINE_UNSUPPORTED
+select * from t1 for system_time as of transaction 1;
+--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 for system_time as of transaction 1;
+--error ER_VERS_ENGINE_UNSUPPORTED
+call sp;
+--error ER_VERS_ENGINE_UNSUPPORTED
+call sp;
+create or replace table t1 (a int);
+create or replace procedure sp()
+select * from t1 for system_time all;
+--error ER_VERS_NOT_VERSIONED
+call sp;
+--error ER_VERS_NOT_VERSIONED
+call sp;
+drop procedure sp;
+
+create or replace table t1 (
+ x int,
+ sys_trx_start bigint unsigned as row start invisible,
+ sys_trx_end bigint unsigned as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning engine innodb;
+insert into t1 values (1);
+set @ts= now(6);
+delete from t1;
+select sys_trx_start from t1 for system_time all into @trx_start;
+
+--echo ## ensure @trx_start is much lower than unix timestamp
+select @trx_start < unix_timestamp(@ts) - 100 as trx_start_good;
+
+--echo ## TIMESTAMP specifier
+select x from t1 for system_time as of timestamp @ts;
+
+set @ts= timestamp'1-1-1 0:0:0';
+
+select x from t1 for system_time as of timestamp @ts;
+
+--echo ## TRANSACTION specifier
+select x from t1 for system_time as of transaction @trx_start;
+
+--echo ## no specifier (auto-detection)
+select x from t1 for system_time as of @ts;
+select x from t1 for system_time as of @trx_start;
+
+--echo ### Issue #365, bug 4 (related to #226, optimized fields)
+create or replace table t1 (i int, b int) with system versioning;
+insert into t1 values (0, 0), (0, 0);
+select min(i) over (partition by b) as f
+from (select i + 0 as i, b from t1) as tt
+order by i;
+
+--echo ### Issue #365, bug 5 (dangling AND)
+create or replace table t1 (a int);
+create or replace table t2 (b int) with system versioning;
+select * from t1
+where exists (select 1 from t2 where t2.b = t1.a and t2.b = t1.a);
+
+--echo ### Issue #365, bug 9 (not a derived subquery)
+create or replace table t1 (x int) with system versioning;
+select t1.x in (select x from t1) a from t1, (select x from t1) b;
+
+--echo ### Issue #365, bug 10 (WHERE cond freed prematurely for PS)
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+create or replace view v1 as select x from t1 where x = 1;
+prepare stmt from "
+select x from t1 where x in (select x from v1);";
+execute stmt;
+execute stmt;
+
+--echo ### Issue #365, bug 11 (WHERE cond not top level item)
+create or replace table t1 (a int, b int, key idx(a)) with system versioning;
+insert into t1 values (1, 1), (2, 2);
+select * from t1 where (a, 2) in ((1, 1), (2, 2)) and b = 1;
+
+--echo ### Issue #398, NOW is now non-magic
+create or replace table t1 (x int) with system versioning;
+select * from t1 for system_time as of current_timestamp;
+--error ER_BAD_FIELD_ERROR
+select * from t1 for system_time as of now;
+
+--echo ### Issue #405, NATURAL JOIN failure
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int);
+create or replace view v1 as select a, row_start, row_end from t1 where a > round(rand()*1000);
+select * from v1 natural join t2;
+
+--echo #
+--echo # Issue #406, MDEV-14633 Assertion on TRT read
+--echo #
+create or replace table t1 (pk int primary key, i int, t time, key (i)) with system versioning;
+insert into t1 values (1, 10, '15:01:53'), (2, 20, '00:00:00');
+delete from t1;
+--disable_warnings
+select * from t1 where t = '00:00:00' and i > 0 and row_end <> '2012-12-12 00:00:00';
+--enable_warnings
+
+--echo #
+--echo # MDEV-14816 Assertion `join->best_read < double(1.797...e+308L)' failed in bool greedy_search
+--echo #
+create or replace table t1 (f1 int) with system versioning;
+create or replace table t2 (f2 int) with system versioning;
+create or replace table t3 (f3 int);
+create or replace table t4 (f4 int);
+insert into t1 values (1), (2), (3), (4);
+insert into t2 values (1), (2), (3);
+insert into t3 values (1), (2);
+insert into t4 values (1);
+select * from
+ t1 as t1a
+ left join t2 as t2a left join (t3 as t3a inner join t1) on t2a.f2 = t3a.f3 on t1a.f1 = t2a.f2
+ left join (t2 join t3 inner join t4) on t2a.f2 = t1a.f1;
+
+--echo #
+--echo # MDEV-15004 parser greedily parses AS OF TIMESTAMP
+--echo #
+--error ER_WRONG_VALUE
+select timestamp'2016-02-30 08:07:06';
+--error ER_WRONG_VALUE
+select * from t1 for system_time as of timestamp'2016-02-30 08:07:06';
+select timestamp('2003-12-31 12:00:00','12:00:00');
+select * from t1 for system_time as of timestamp('2003-12-31 12:00:00','12:00:00');
+
+
+--echo #
+--echo # MDEV-15391 Server crashes in JOIN::fix_all_splittings_in_plan or Assertion `join->best_read < double(1.79...e+308L)' failed [tempesta-tech#475]
+--echo #
+create or replace table t1 (f1 int) with system versioning;
+insert t1 values (1),(2);
+create or replace table t2 (f2 int);
+create or replace table t3 (f3 int);
+create or replace table t4 (f4 int) with system versioning;
+select f1 from t1 join t2 left join t3 left join t4 on f3 = f4 on f3 = f2;
+insert t2 values (1),(2);
+insert t3 values (1),(2);
+insert t4 values (1),(2);
+explain extended
+select f1 from t1 join t2 left join t3 left join t4 on f3 = f4 on f3 = f2;
+
+drop view v1;
+drop table t1, t2, t3, t4;
+
+--echo #
+--echo # MDEV-15980 FOR SYSTEM_TIME BETWEEN and FROM .. TO work with negative intervals
+--echo #
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ a int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1);
+delete from t1;
+select row_start from t1 for system_time all into @t1;
+select row_end from t1 for system_time all into @t2;
+select * from t1 for system_time between @t1 and @t2;
+select * from t1 for system_time between @t2 and @t1;
+select * from t1 for system_time from @t1 to @t2;
+select * from t1 for system_time from @t2 to @t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-15991 Server crashes in setup_on_expr upon calling SP or function executing DML on versioned tables
+--echo #
+create or replace table t1 (i int);
+insert into t1 values (1);
+--delimiter $
+create or replace procedure p(n int)
+begin
+ select * from t1;
+end $
+--delimiter ;
+call p(1);
+alter table t1 add system versioning;
+call p(2);
+call p(3);
+
+--echo #
+--echo # MDEV-15947 ASAN heap-use-after-free in Item_ident::print or in my_strcasecmp_utf8 or unexpected ER_BAD_FIELD_ERROR upon call of stored procedure reading from versioned table
+--echo #
+create or replace table t1 (i int) with system versioning;
+create or replace procedure p() select * from t1;
+call p;
+flush tables;
+call p;
+call p;
+drop procedure p;
+drop table t1;
+
+--echo #
+--echo # MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
+--echo #
+create table t1 (a varchar(8));
+insert into t1 values ('foo'),('bar');
+create table t2 (b date);
+
+create procedure pr() insert into t2 select * from t1;
+--error ER_TRUNCATED_WRONG_VALUE
+call pr;
+prepare stmt from 'insert into t2 select * from t1';
+--error ER_TRUNCATED_WRONG_VALUE
+execute stmt;
+alter table t1 add system versioning;
+--error ER_TRUNCATED_WRONG_VALUE
+call pr;
+--error ER_TRUNCATED_WRONG_VALUE
+call pr;
+--error ER_TRUNCATED_WRONG_VALUE
+execute stmt;
+--error ER_TRUNCATED_WRONG_VALUE
+execute stmt;
+drop prepare stmt;
+
+# cleanup
+drop procedure pr;
+drop table t1, t2;
+
+
+call verify_trt_dummy(34);
+
+-- source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/select2.test b/mysql-test/suite/versioning/t/select2.test
new file mode 100644
index 00000000000..7ede218cabf
--- /dev/null
+++ b/mysql-test/suite/versioning/t/select2.test
@@ -0,0 +1,217 @@
+--source suite/versioning/engines.inc
+--source suite/versioning/common.inc
+
+replace_result $default_engine ENGINE $sys_datatype_expl SYS_TYPE;
+eval create table t1(
+ x int unsigned,
+ y int unsigned,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning engine=$default_engine;
+
+insert into t1 (x, y) values
+ (0, 100),
+ (1, 101),
+ (2, 102),
+ (3, 103),
+ (4, 104),
+ (5, 105),
+ (6, 106),
+ (7, 107),
+ (8, 108),
+ (9, 109);
+set @t0= now(6);
+select sys_start from t1 limit 1 into @x0;
+
+delete from t1 where x = 3;
+delete from t1 where x > 7;
+
+insert into t1(x, y) values(3, 33);
+select sys_start from t1 where x = 3 and y = 33 into @t1;
+if($MTR_COMBINATION_TRX_ID) {
+ set @x1= @t1;
+ select trt_commit_ts(@x1) into @t1;
+}
+
+select x, y from t1;
+select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
+select x as FROMTO_x, y from t1 for system_time from '1970-01-01 00:00' to timestamp @t1;
+select x as BETWAND_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
+select x as ALL_x, y from t1 for system_time all;
+
+if($MTR_COMBINATION_TRX_ID) {
+ select x as ASOF2_x, y from t1 for system_time as of @x0;
+ select x as FROMTO2_x, y from t1 for system_time from @x0 to @x1;
+ select x as BETWAND2_x, y from t1 for system_time between transaction @x0 and transaction @x1;
+}
+if(!$MTR_COMBINATION_TRX_ID) {
+ select x as ASOF2_x, y from t1 for system_time as of @t0;
+ select x as FROMTO2_x, y from t1 for system_time from '1970-01-01 00:00' to @t1;
+ select x as BETWAND2_x, y from t1 for system_time between timestamp '1970-01-01 00:00' and timestamp @t1;
+}
+
+drop table t1;
+
+replace_result $default_engine ENGINE $sys_datatype_expl SYS_TYPE;
+eval create table t1(
+ x int,
+ y int,
+ sys_start $sys_datatype_expl as row start invisible,
+ sys_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_start, sys_end))
+with system versioning engine=$default_engine;
+
+create table t2 like t1;
+
+insert into t1 values (1, 1), (1, 2), (1, 3), (4, 4), (5, 5);
+insert into t2 values (1, 2), (2, 1), (3, 1);
+set @t0= now(6);
+
+select t1.x as IJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x;
+select t1.x as LJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x;
+select t1.x as RJ1_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x;
+
+delete from t1;
+delete from t2;
+
+select IJ2_x1,y1,x2,y2 from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+select LJ2_x1,y1,x2,y2 from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+select RJ2_x1,y1,x2,y2 from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
+for system_time as of timestamp @t0 as t;
+
+drop table t1;
+drop table t2;
+
+--echo # MDEV-14686 Server crashes in Item_field::used_tables on 2nd call of SP [#422]
+create or replace table t1 (called int, bad int) with system versioning;
+create or replace procedure bad() select * from t1 where bad in (select called from t1);
+--disable_query_log
+call bad; call bad; call bad; call bad; call bad; call bad; call bad; call bad;
+drop procedure bad;
+--enable_query_log
+--echo # bad() is good.
+
+--echo # MDEV-14751 Server crashes in TABLE::versioned on 2nd execution of SP [#431]
+create or replace table t1 (called_bad int);
+create or replace table t2 (b int);
+create or replace procedure bad() select * from t1 where ( 5, 6 ) in ( select b, b from t2 ) and called_bad in ( select max(b) from t2 );
+--disable_query_log
+call bad; call bad; call bad; call bad; call bad; call bad; call bad; call bad;
+drop procedure bad;
+--enable_query_log
+--echo # bad() is good.
+
+--echo # MDEV-14786 Server crashes in Item_cond::transform on 2nd execution of SP querying from a view [#436]
+create or replace table t1 (called_bad int) with system versioning;
+create or replace view v1 as select called_bad from t1 where called_bad < 5;
+create or replace procedure bad() select called_bad from v1;
+--disable_query_log
+call bad; call bad; call bad; call bad; call bad; call bad; call bad; call bad;
+drop procedure bad;
+--enable_query_log
+--echo # bad() is good.
+
+--echo # wildcard expansion on hidden fields.
+create or replace table t1(
+ A int
+) with system versioning;
+insert into t1 values(1);
+select * from t1;
+
+create or replace table t1 (x int);
+insert into t1 values (1);
+--error ER_VERS_NOT_VERSIONED
+select * from t1 for system_time all;
+
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+select * from t1 for system_time as of now() for update;
+
+create or replace table t1 (a int not null auto_increment primary key) with system versioning;
+select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
+
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (a int) with system versioning;
+insert into t1 values(1);
+insert into t2 values(1);
+create or replace view v1 as select * from t2 inner join t1 using (a);
+select * from v1;
+drop view v1;
+
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create view vt1 as select a from t1;
+select * from t1 natural join vt1;
+drop view vt1;
+
+create or replace table t1(x int) with system versioning;
+select * from (t1 as r left join t1 as u using (x)), t1;
+
+# @end should be max
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+create trigger read_end after update on t1
+ for each row set @end = old.row_end;
+update t1 set a=2;
+--replace_result 18446744073709551615 MAX_RESULT "2038-01-19 03:14:07.999999" MAX_RESULT
+select @end;
+
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+select * from (select * from t1 cross join t2) as tmp;
+select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
+select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00')) as tmp;
+
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+select * from t1 for system_time all natural left join t2 for system_time all;
+
+# natural join of a view and table
+create or replace table t1(a1 int) with system versioning;
+create or replace table t2(a2 int) with system versioning;
+insert into t1 values(1),(2);
+insert into t2 values(1),(2);
+create or replace view v1 as select a1 from t1;
+
+select * from v1 natural join t2;
+select * from v1 natural left join t2;
+select * from v1 natural right join t2;
+
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
+
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int) with system versioning;
+insert into t1 values (1), (2), (3);
+delete from t1 where x = 3;
+insert into t2 values (1);
+select * from t1, t2 for system_time all;
+
+--error ER_VERS_NOT_VERSIONED
+select * from (select * from t1 for system_time all, t2 for system_time all) for system_time all as t;
+--error ER_PARSE_ERROR
+select * from (t1 for system_time all join t2 for system_time all) for system_time all;
+
+--echo # MDEV-16043 Assertion thd->Item_change_list::is_empty() failed in mysql_parse upon SELECT from a view reading from a versioned table
+create or replace table t1 (a int) with system versioning;
+create or replace view v1 as select * from t1;
+prepare stmt from "select * from t1 where exp( '20010609211642053929' )";
+--error ER_DATA_OUT_OF_RANGE
+execute stmt;
+select a from v1;
+
+drop view v1;
+drop table t1, t2;
+
+-- source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/simple.test b/mysql-test/suite/versioning/t/simple.test
new file mode 100644
index 00000000000..b550b3967d9
--- /dev/null
+++ b/mysql-test/suite/versioning/t/simple.test
@@ -0,0 +1,89 @@
+-- source include/have_innodb.inc
+set default_storage_engine=innodb;
+create or replace table dept (
+ dept_id int(10) primary key,
+ name varchar(100)
+)
+with system versioning;
+
+create or replace table emp (
+ emp_id int(10) primary key,
+ dept_id int(10),
+ name varchar(100),
+ salary int(10),
+ constraint `dept-emp-fk`
+ foreign key (dept_id) references dept (dept_id)
+ on delete restrict
+ on update restrict
+)
+with system versioning;
+
+select now() into @ts_0;
+
+insert into dept (dept_id, name) values (10, "accounting");
+commit;
+
+select row_start into @ts_1 from dept where dept_id=10;
+
+insert into emp (emp_id, name, salary, dept_id) values (1, "bill", 1000, 10);
+commit;
+
+select row_start into @ts_2 from emp where name="bill";
+
+select * from emp;
+
+update emp set salary=2000 where name="bill";
+commit;
+
+select row_start into @ts_3 from emp where name="bill";
+
+select * from emp;
+select * from emp for system_time as of timestamp @ts_2;
+select * from emp for system_time as of timestamp @ts_3;
+select * from emp e, dept d
+where d.dept_id = 10
+ and d.dept_id = e.dept_id;
+
+select * from
+ emp for system_time from timestamp @ts_1 to timestamp @ts_2 e,
+ dept for system_time from timestamp @ts_1 to timestamp @ts_2 d
+where d.dept_id = 10
+ and d.dept_id = e.dept_id;
+
+set statement system_versioning_asof=@ts_0 for
+select * from emp e, dept d
+where d.dept_id = 10
+ and d.dept_id = e.dept_id;
+
+set statement system_versioning_asof=@ts_1 for
+select * from emp e, dept d
+where d.dept_id = 10
+ and d.dept_id = e.dept_id;
+
+set statement system_versioning_asof=@ts_2 for
+select * from emp e, dept d
+where d.dept_id = 10
+ and d.dept_id = e.dept_id;
+
+set statement system_versioning_asof=@ts_3 for
+select * from emp e, dept d
+where d.dept_id = 10
+ and d.dept_id = e.dept_id;
+
+drop table emp, dept;
+
+#
+# MDEV-16804 SYSTEM VERSIONING columns not showing as GENERATED
+#
+create table t1 (
+ a timestamp(6),
+ b timestamp(6) generated always as (a + interval 1 day),
+ c timestamp(6) generated always as (a + interval 1 month) stored,
+ d timestamp(6) generated always as row start,
+ e timestamp(6) generated always as row end,
+ period for system_time(d,e)
+) with system versioning;
+show columns from t1;
+query_vertical select 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,column_comment,is_generated,generation_expression,'---' from information_schema.columns where table_name='t1';
+drop table t1;
+
diff --git a/mysql-test/suite/versioning/t/sysvars.test b/mysql-test/suite/versioning/t/sysvars.test
new file mode 100644
index 00000000000..2f62262fc8e
--- /dev/null
+++ b/mysql-test/suite/versioning/t/sysvars.test
@@ -0,0 +1,129 @@
+create table t (a int) with system versioning;
+insert into t values (1);
+update t set a= 2;
+
+show global variables like 'system_versioning_asof';
+show variables like 'system_versioning_asof';
+select * from t;
+
+set system_versioning_asof= '2031-1-1 0:0:0';
+show variables like 'system_versioning_asof';
+select * from t;
+
+set system_versioning_asof= '2011-1-1 0:0:0';
+show variables like 'system_versioning_asof';
+select * from t;
+
+# global
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= 'alley';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= null;
+--error ER_WRONG_TYPE_FOR_VAR
+set global system_versioning_asof= 1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global system_versioning_asof= 1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-02-29 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-02-28 24:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-00-28 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '0000-00-00 00:00';
+
+# session
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= 'alley';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= null;
+--error ER_WRONG_TYPE_FOR_VAR
+set system_versioning_asof= 1;
+--error ER_WRONG_TYPE_FOR_VAR
+set system_versioning_asof= 1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-02-29 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-02-28 24:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-00-28 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '0000-00-00 00:00';
+
+--echo # GLOBAL @@system_versioning_asof
+set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
+show global variables like 'system_versioning_asof';
+
+set global system_versioning_asof= '1900-01-01 00:00:00';
+show global variables like 'system_versioning_asof';
+
+set global system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
+show global variables like 'system_versioning_asof';
+
+set @ts= timestamp'1900-01-01 00:00:00';
+set global system_versioning_asof= @ts;
+show global variables like 'system_versioning_asof';
+
+set global system_versioning_asof= default;
+select @@global.system_versioning_asof;
+
+--echo # SESSION @@system_versioning_asof
+set system_versioning_asof= '1911-11-11 11:11:11.1111119';
+show variables like 'system_versioning_asof';
+
+set system_versioning_asof= '1900-01-01 00:00:00';
+show variables like 'system_versioning_asof';
+
+set system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
+show variables like 'system_versioning_asof';
+
+set @ts= timestamp'1900-01-01 00:00:00';
+set system_versioning_asof= @ts;
+show variables like 'system_versioning_asof';
+
+--echo # DEFAULT: value is copied from GLOBAL to SESSION
+set global system_versioning_asof= timestamp'1911-11-11 11:11:11.111111';
+set system_versioning_asof= '1900-01-01 00:00:00';
+select @@global.system_versioning_asof != @@system_versioning_asof as different;
+set system_versioning_asof= default;
+select @@global.system_versioning_asof = @@system_versioning_asof as equal;
+
+set global system_versioning_asof= DEFAULT;
+set system_versioning_asof= DEFAULT;
+select @@global.system_versioning_asof, @@system_versioning_asof;
+
+select * from t for system_time all;
+
+select * from t;
+select * from t for system_time as of timestamp current_timestamp(6);
+select * from t for system_time all;
+select * from t for system_time from '1970-01-01 00:00' to current_timestamp(6);
+select * from t for system_time between '1970-01-01 00:00' and current_timestamp(6);
+
+show status like "Feature_system_versioning";
+
+drop table t;
+
+--echo #
+--echo # MDEV-22906 Disallow system_versioning_asof in DML
+--echo #
+create or replace table t1 (x int) with system versioning;
+create or replace table t2 (y int);
+insert into t1 values (1);
+insert into t2 values (1);
+set system_versioning_asof= '1970-01-01 00:00:00';
+delete t1, t2 from t1 join t2 where t1.x = t2.y;
+select * from t1 for system_time as of timestamp now(6);
+
+insert into t1 values (1);
+insert into t2 values (1);
+update t1, t2 set x= 2, y= 2 where x = y;
+select * from t1 for system_time as of timestamp now(6);
+
+replace t2 select x + 1 from t1;
+select * from t2;
+
+insert t2 select x + 2 from t1;
+select * from t2;
+
+drop tables t1, t2;
diff --git a/mysql-test/suite/versioning/t/truncate_privilege.test b/mysql-test/suite/versioning/t/truncate_privilege.test
new file mode 100644
index 00000000000..dcdad59039a
--- /dev/null
+++ b/mysql-test/suite/versioning/t/truncate_privilege.test
@@ -0,0 +1,41 @@
+# Can't test with embedded server
+-- source include/not_embedded.inc
+
+--source include/have_innodb.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+connect (root,localhost,root,,test);
+connection root;
+
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+create user mysqltest_1@localhost;
+connect (user1,localhost,mysqltest_1,,test);
+connection user1;
+
+connection root;
+create table mysqltest.t (a int) with system versioning;
+
+connection user1;
+show grants;
+--error ER_TABLEACCESS_DENIED_ERROR
+delete history from mysqltest.t before system_time now();
+
+connection root;
+grant delete history on mysqltest.* to mysqltest_1@localhost;
+grant delete history on mysqltest.t to mysqltest_1@localhost;
+
+connection user1;
+show grants;
+delete history from mysqltest.t before system_time now();
+
+connection root;
+grant all on *.* to mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+
+drop user mysqltest_1@localhost;
+drop database mysqltest;
diff --git a/mysql-test/suite/versioning/t/trx_id.opt b/mysql-test/suite/versioning/t/trx_id.opt
new file mode 100644
index 00000000000..b55a187cb13
--- /dev/null
+++ b/mysql-test/suite/versioning/t/trx_id.opt
@@ -0,0 +1 @@
+--plugin-load-add=$TEST_VERSIONING_SO
diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test
new file mode 100644
index 00000000000..38724a47fd1
--- /dev/null
+++ b/mysql-test/suite/versioning/t/trx_id.test
@@ -0,0 +1,527 @@
+if (!$TEST_VERSIONING_SO)
+{
+ --skip needs test_versioning plugin
+}
+--source include/have_innodb.inc
+--source include/default_charset.inc
+
+set default_storage_engine= innodb;
+
+create or replace table t1 (
+ x int,
+ sys_trx_start bigint(20) unsigned as row start invisible,
+ sys_trx_end bigint(20) unsigned as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning;
+
+insert into t1 (x) values (1);
+
+--echo # ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
+set @@system_versioning_alter_history=keep;
+
+create or replace table t1 (x int);
+insert into t1 values (1);
+alter table t1
+ add column s bigint unsigned as row start,
+ add column e bigint unsigned as row end,
+ add period for system_time(s, e),
+ add system versioning,
+ algorithm=inplace;
+select s from t1 into @trx_start;
+select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
+
+create or replace table t1 (x int);
+select count(*) from mysql.transaction_registry into @tmp;
+alter table t1
+ add column s bigint unsigned as row start,
+ add column e bigint unsigned as row end,
+ add period for system_time(s, e),
+ add system versioning,
+ algorithm=inplace;
+select count(*) = @tmp from mysql.transaction_registry;
+
+create or replace table t1 (x int);
+insert into t1 values (1);
+alter table t1
+ add column s bigint unsigned as row start,
+ add column e bigint unsigned as row end,
+ add period for system_time(s, e),
+ add system versioning,
+ algorithm=copy;
+select s from t1 into @trx_start;
+select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
+
+create or replace table t1 (x int);
+select count(*) from mysql.transaction_registry into @tmp;
+alter table t1
+ add column s bigint unsigned as row start,
+ add column e bigint unsigned as row end,
+ add period for system_time(s, e),
+ add system versioning,
+ algorithm=copy;
+# With MDEV-14511 the transaction will be registered even for empty tables.
+select count(*) = @tmp + 1 from mysql.transaction_registry;
+
+--echo # TRX_ID to TIMESTAMP versioning switch
+create or replace table t1 (
+ x int,
+ sys_start bigint unsigned as row start invisible,
+ sys_end bigint unsigned as row end invisible,
+ period for system_time (sys_start, sys_end)
+) with system versioning;
+insert into t1 values (1);
+alter table t1 drop column sys_start, drop column sys_end;
+select row_end = 18446744073709551615 as transaction_based from t1 for system_time all;
+
+--echo # Simple vs SEES algorithms
+create or replace table t1 (
+ x int,
+ sys_start bigint(20) unsigned as row start invisible,
+ sys_end bigint(20) unsigned as row end invisible,
+ period for system_time (sys_start, sys_end)
+) with system versioning;
+
+set transaction isolation level read committed;
+start transaction;
+insert into t1 values (1);
+--connect (con1,localhost,root,,test)
+set transaction isolation level read committed;
+start transaction;
+insert into t1 values (2);
+--connect (con2,localhost,root,,test)
+set transaction isolation level read committed;
+start transaction;
+insert into t1 values (3);
+commit;
+--disconnect con2
+--connection default
+--sleep 0.01
+set @ts1= sysdate(6);
+--connection con1
+commit;
+--disconnect con1
+--connection default
+--sleep 0.01
+set @ts2= sysdate(6);
+commit;
+--sleep 0.01
+set @ts3= sysdate(6);
+
+select sys_start from t1 where x = 1 into @trx_id1;
+select sys_start from t1 where x = 2 into @trx_id2;
+select sys_start from t1 where x = 3 into @trx_id3;
+
+select @trx_id1 < @trx_id2, @trx_id2 < @trx_id3;
+select @ts1 < @ts2, @ts2 < @ts3;
+
+--echo # MVCC is resolved
+select * from t1 for system_time as of transaction @trx_id1;
+select * from t1 for system_time as of timestamp @ts1;
+select * from t1 for system_time as of transaction @trx_id2;
+select * from t1 for system_time as of timestamp @ts2;
+select * from t1 for system_time as of transaction @trx_id3;
+select * from t1 for system_time as of timestamp @ts3;
+
+--echo #
+--echo # MDEV-15427 IB: TRX_ID based operations inside transaction generate history
+--echo #
+create or replace table t1(
+ x int(10),
+ row_start bigint(20) unsigned as row start,
+ row_end bigint(20) unsigned as row end,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+begin;
+insert into t1 (x) values (1);
+delete from t1;
+commit;
+select x from t1 for system_time all;
+
+insert into t1 (x) values (2);
+begin;
+update t1 set x= 3;
+update t1 set x= 4;
+commit;
+select x, row_start < row_end from t1 for system_time all;
+
+--echo # MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL
+create or replace table t1 (
+ x int,
+ row_start bigint unsigned as row start invisible,
+ row_end bigint unsigned as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning engine innodb;
+insert into t1 (x) values (1);
+delete from t1;
+select * from t1 for system_time as of timestamp'1990-1-1 00:00';
+select * from t1 for system_time as of NULL;
+
+--echo # MDEV-16024 transaction_registry.begin_timestamp is wrong for explicit transactions
+create or replace table t1 (
+ x int(11) default null,
+ row_start bigint(20) unsigned generated always as row start invisible,
+ row_end bigint(20) unsigned generated always as row end invisible,
+ period for system_time (row_start, row_end)
+) engine=innodb with system versioning;
+begin;
+set @ts1= now(6);
+--sleep 0.01
+insert into t1 values (1);
+commit;
+
+select row_start from t1 into @trx_id;
+select trt_begin_ts(@trx_id) <= @ts1 as BEGIN_TS_GOOD;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-16100 FOR SYSTEM_TIME erroneously resolves string user variables as transaction IDs
+--echo #
+
+CREATE TABLE t1 (
+ x INT,
+ sys_trx_start BIGINT UNSIGNED AS ROW START,
+ sys_trx_end BIGINT UNSIGNED AS ROW END,
+ PERIOD FOR SYSTEM_TIME (sys_trx_start, sys_trx_end)
+) WITH SYSTEM VERSIONING ENGINE=INNODB;
+INSERT INTO t1 (x) VALUES (1);
+SET @ts= DATE_ADD(NOW(), INTERVAL 1 YEAR);
+EXPLAIN EXTENDED SELECT x FROM t1 FOR SYSTEM_TIME AS OF TRANSACTION @ts;
+EXPLAIN EXTENDED SELECT x FROM t1 FOR SYSTEM_TIME AS OF TIMESTAMP @ts;
+EXPLAIN EXTENDED SELECT x FROM t1 FOR SYSTEM_TIME AS OF @ts;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing AS OF with expressions of various kinds and data types
+--echo #
+
+CREATE TABLE t1
+(
+ x INT,
+ sys_trx_start BIGINT UNSIGNED AS ROW START INVISIBLE,
+ sys_trx_end BIGINT UNSIGNED AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (sys_trx_start, sys_trx_end)
+) WITH SYSTEM VERSIONING;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2
+(
+ x INT,
+ sys_trx_start TIMESTAMP(6) AS ROW START INVISIBLE,
+ sys_trx_end TIMESTAMP(6) AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (sys_trx_start, sys_trx_end)
+) WITH SYSTEM VERSIONING;
+INSERT INTO t2 VALUES (1);
+
+--echo #
+--echo # ROW is not supported
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (1,1);
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (1,1);
+
+
+--echo #
+--echo # DOUBLE is not supported, use explicit CAST
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF RAND();
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (RAND());
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF COALESCE(RAND());
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF RAND();
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (RAND());
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF COALESCE(RAND());
+
+
+--echo #
+--echo # DECIMAL is not supported, use explicit CAST
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF 10.1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF COALESCE(10.1);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF 10.1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF COALESCE(10.1);
+
+
+--echo #
+--echo # YEAR is not supported, use explicit CAST
+--echo #
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+BEGIN NOT ATOMIC
+ DECLARE var YEAR;
+ SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+BEGIN NOT ATOMIC
+ DECLARE var YEAR;
+ SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # ENUM is not supported, use explicit CAST
+--echo #
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+BEGIN NOT ATOMIC
+ DECLARE var ENUM('xxx') DEFAULT 'xxx';
+ SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+BEGIN NOT ATOMIC
+ DECLARE var ENUM('xxx') DEFAULT 'xxx';
+ SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # SET is not supported, use explicit CAST
+--echo #
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+BEGIN NOT ATOMIC
+ DECLARE var SET('xxx') DEFAULT 'xxx';
+ SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+BEGIN NOT ATOMIC
+ DECLARE var SET('xxx') DEFAULT 'xxx';
+ SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # BIT is resolved to TRANSACTION
+--echo #
+
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE var BIT(10);
+ SELECT * FROM t1 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_VERS_ENGINE_UNSUPPORTED
+BEGIN NOT ATOMIC
+ DECLARE var BIT(10);
+ SELECT * FROM t2 FOR SYSTEM_TIME AS OF var;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # String literals resolve to TIMESTAMP
+--echo #
+
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF '2038-12-30 00:00:00';
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF '2038-12-30 00:00:00';
+
+
+--echo #
+--echo # HEX hybrids resolve to TRANSACTION
+--echo #
+
+--error ER_VERS_NO_TRX_ID
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0xFFFFFFFF);
+--error ER_VERS_ENGINE_UNSUPPORTED
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0xFFFFFFFF);
+
+
+--echo #
+--echo # BIT literals resolve to TRANSACTION
+--echo #
+
+--error ER_VERS_NO_TRX_ID
+SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111');
+--error ER_VERS_ENGINE_UNSUPPORTED
+SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111');
+
+DROP TABLE t1, t2;
+
+
+--echo #
+--echo # MDEV-16094 Crash when using AS OF with a stored function
+--echo #
+
+CREATE FUNCTION fts() RETURNS DATETIME RETURN '2001-01-01 10:20:30';
+CREATE FUNCTION ftx() RETURNS BIGINT UNSIGNED RETURN 1;
+
+CREATE TABLE ttx
+(
+ x INT,
+ start_timestamp BIGINT UNSIGNED GENERATED ALWAYS AS ROW START,
+ end_timestamp BIGINT UNSIGNED GENERATED ALWAYS AS ROW END,
+ PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp)
+) ENGINE=InnoDB WITH SYSTEM VERSIONING;
+
+CREATE TABLE tts
+(
+ x INT,
+ start_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW START,
+ end_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW END,
+ PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp)
+) ENGINE=InnoDB WITH SYSTEM VERSIONING;
+
+SELECT * FROM tts FOR SYSTEM_TIME AS OF fts();
+--error ER_VERS_ENGINE_UNSUPPORTED
+SELECT * FROM tts FOR SYSTEM_TIME AS OF ftx();
+SELECT * FROM ttx FOR SYSTEM_TIME AS OF fts();
+SELECT * FROM ttx FOR SYSTEM_TIME AS OF ftx();
+
+DROP TABLE tts;
+DROP TABLE ttx;
+DROP FUNCTION fts;
+DROP FUNCTION ftx;
+
+--echo #
+--echo # MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
+--echo #
+
+SET @@SYSTEM_VERSIONING_ALTER_HISTORY=KEEP;
+CREATE TABLE t (
+ a INT,
+ b INT,
+ row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
+ row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME(row_start, row_end)
+) WITH SYSTEM VERSIONING ENGINE=INNODB;
+
+INSERT INTO t VALUES (1,1);
+
+--echo # without table rebuild
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ ON c.table_id=t.table_id
+ WHERE t.name='test/t' AND c.name='a';
+--enable_info
+ALTER TABLE t
+ CHANGE a a INT WITHOUT SYSTEM VERSIONING;
+--disable_info
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ ON c.table_id=t.table_id
+ WHERE t.name='test/t' AND c.name='a';
+
+UPDATE t SET a=11;
+SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
+
+--echo # with table rebuild
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ ON c.table_id=t.table_id
+ WHERE t.name='test/t' AND c.name='a';
+--enable_info
+ALTER TABLE t
+ CHANGE a a INT WITH SYSTEM VERSIONING,
+ ADD PRIMARY KEY pk(a);
+--disable_info
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ ON c.table_id=t.table_id
+ WHERE t.name='test/t' AND c.name='a';
+
+UPDATE t SET a=1;
+SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
+
+SHOW CREATE TABLE t;
+
+-- echo # handles VIRTUAL columns too
+CREATE OR REPLACE TABLE t (
+ a INT AS (b + 1),
+ b INT,
+ row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
+ row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME(row_start, row_end)
+) WITH SYSTEM VERSIONING ENGINE=INNODB;
+
+INSERT INTO t VALUES (DEFAULT, 1);
+
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ ON c.table_id=t.table_id
+ WHERE t.name='test/t' AND c.name='b';
+--enable_info
+ALTER TABLE t
+ CHANGE b b INT WITHOUT SYSTEM VERSIONING;
+--disable_info
+SELECT c.prtype FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS c
+ INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t
+ ON c.table_id=t.table_id
+ WHERE t.name='test/t' AND c.name='b';
+
+UPDATE t SET b=11;
+SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
+
+DROP TABLE t;
+SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
+
+SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+
+--echo # MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
+--echo # trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
+--echo # ALTER TABLE with versioning
+create or replace table t (x int) engine=innodb;
+set autocommit= 0;
+alter table t
+ algorithm=copy,
+ add column row_start bigint unsigned as row start,
+ add column row_end bigint unsigned as row end,
+ add period for system_time(row_start,row_end),
+ with system versioning;
+set autocommit= 1;
+
+--echo # MDEV-18865 Assertion `t->first->versioned_by_id()'
+--echo # failed in innodb_prepare_commit_versioned
+
+create or replace table t (x int) engine=innodb;
+insert into t values (0);
+alter table t add `row_start` bigint unsigned as row start,
+ add `row_end` bigint unsigned as row end,
+ add period for system_time(`row_start`,`row_end`),
+ modify x int after row_start,
+ with system versioning;
+
+
+create or replace database test;
diff --git a/mysql-test/suite/versioning/t/update-big.test b/mysql-test/suite/versioning/t/update-big.test
new file mode 100644
index 00000000000..175bfc79a48
--- /dev/null
+++ b/mysql-test/suite/versioning/t/update-big.test
@@ -0,0 +1,34 @@
+source include/big_test.inc;
+source suite/versioning/engines.inc;
+source suite/versioning/common.inc;
+
+--echo #
+--echo # MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
+--echo #
+create or replace table t1 (a int);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8);
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+
+--connect (con1,localhost,root,,test)
+alter table t1 add system versioning;
+
+--connection default
+update t1 set a= 7 where a = 3;
+update t1 set a= 2 where a = 7;
+update t1 set a= 5 where a = 2;
+update t1 set a= 1 where a = 5;
+update t1 set a= 8 where a = 1;
+update t1 set a= 4 where a = 8;
+update t1 set a= 6;
+
+drop table t1;
+
+source suite/versioning/common_finish.inc;
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
new file mode 100644
index 00000000000..06f81ea9064
--- /dev/null
+++ b/mysql-test/suite/versioning/t/update.test
@@ -0,0 +1,289 @@
+source suite/versioning/engines.inc;
+source suite/versioning/common.inc;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1(
+ x int unsigned,
+ y int unsigned,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end))
+ with system versioning;
+
+insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
+select x, y from t1 order by x, y;
+update t1 set y = y + 1 where x > 7;
+select x, y from t1 order by x, y;
+select x, y from t1 for system_time all order by sys_trx_end, x, y;
+drop table t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1 (
+ id bigint primary key,
+ x int,
+ y int without system versioning,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+insert into t1 values(1, 1, 1);
+set @ins_t= now(6);
+select sys_trx_start into @tmp1 from t1;
+update t1 set x= 11, y= 11 where id = 1;
+select @tmp1 < sys_trx_start as A1, x, y from t1;
+select sys_trx_start into @tmp1 from t1;
+update t1 set y= 1 where id = 1;
+select @tmp1 = sys_trx_start as A2, x from t1;
+drop table t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1 (
+ x int,
+ y int,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end)
+) with system versioning;
+
+insert into t1 (x, y) values (1, 1), (2, 1), (3, 1), (4, 1), (5, 1);
+
+start transaction;
+update t1 set y= y + 1 where x = 3;
+update t1 set y= y + 1 where x = 2;
+update t1 set y= y + 1 where x = 3;
+update t1 set y= y + 1 where x > 3;
+update t1 set y= y + 1 where x > 4;
+commit;
+
+replace_result $sys_datatype_max MAXVAL;
+eval select x, y, sys_trx_end = $sys_datatype_max as current from t1 for system_time all order by sys_trx_end, x, y;
+
+drop table t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1 (
+ id int primary key auto_increment,
+ x int,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end))
+with system versioning;
+
+set @t0= now(6);
+insert into t1 (x) values (1);
+set @t1= now(6);
+update t1 set x= 2 where id = 1;
+set @t2= now(6);
+update t1 set x= 3 where id = 1;
+
+select x from t1 for system_time as of timestamp @t0;
+select x from t1 for system_time as of timestamp @t1;
+select x from t1 for system_time as of timestamp @t2;
+select x from t1 for system_time as of timestamp now(6);
+
+drop table t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1(
+ x int unsigned,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ y int unsigned,
+ period for system_time (sys_trx_start, sys_trx_end),
+ primary key(x, y))
+with system versioning;
+insert into t1(x, y) values (1, 1000), (3, 3000), (4, 4000), (5, 5000);
+insert into t1(x, y) values(3, 3000) on duplicate key update y = y+1;
+insert into t1(x, y) values(4, 4444) on duplicate key update y = y+1;
+select x, y from t1 for system_time all order by sys_trx_end, x, y;
+select x, y from t1 order by x, y;
+drop table t1;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1 (
+ x int unsigned,
+ y int unsigned,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end))
+ with system versioning;
+create table t2 like t1;
+insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
+insert into t2(x, y) values (1, 1010), (2, 2010), (3, 3010), (4, 4010), (5, 5010), (6, 6010), (7, 7010), (8, 8010), (9, 9010);
+update t1, t2 set t1.y = t1.x + t1.y, t2.y = t2.x + t2.y where t1.x > 7 and t2.x < 7;
+select x, y from t1 for system_time all order by sys_trx_end, x, y;
+select x, y from t1 order by x, y;
+select x, y from t2 for system_time all order by sys_trx_end, x, y;
+select x, y from t2 order by x, y;
+drop table t1;
+drop table t2;
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1 (
+ id bigint primary key without system versioning,
+ name varchar(128),
+ salary bigint without system versioning,
+ sys_trx_start $sys_datatype_expl as row start invisible,
+ sys_trx_end $sys_datatype_expl as row end invisible,
+ period for system_time (sys_trx_start, sys_trx_end))
+ with system versioning;
+create table t2 like t1;
+
+insert into t1 values (1, "Jeremy", 3000);
+insert into t2 values (1, "Jeremy", 4000);
+
+select sys_trx_start into @tmp1 from t1;
+select sys_trx_start into @tmp2 from t2;
+update t1, t2 set t1.name= "Jerry", t2.name= "Jerry" where t1.id = t2.id and t1.name = "Jeremy";
+select @tmp1 < sys_trx_start as A1, name from t1;
+select @tmp2 < sys_trx_start as A2, name from t2;
+
+select sys_trx_start into @tmp1 from t1;
+select sys_trx_start into @tmp2 from t2;
+update t1, t2 set t1.salary= 2500, t2.salary= 2500 where t1.id = t2.id and t1.name = "Jerry";
+select @tmp1 = sys_trx_start as B1, salary from t1;
+select @tmp2 = sys_trx_start as B2, salary from t2;
+
+drop table t1;
+drop table t2;
+
+--echo ### Issue tempesta-tech/mariadb#365, bug 7 (duplicate of historical row)
+create or replace table t1 (a int primary key, b int)
+with system versioning engine myisam;
+insert into t1 (a) values (1);
+
+replace t1 values (1,2),(1,3),(2,4);
+
+--echo #
+--echo # MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
+--echo #
+set @old_lock_wait_timeout= @@innodb_lock_wait_timeout;
+set @@innodb_lock_wait_timeout= 1073741824;
+create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
+ engine=innodb with system versioning;
+
+insert into t1 (pk) values (1);
+connect (con1,localhost,root,,test);
+start transaction;
+select * from t1 for update;
+connection default;
+send update t1 set b = 'foo';
+connection con1;
+let $wait_condition= select count(*) from information_schema.innodb_lock_waits;
+source include/wait_condition.inc;
+error ER_LOCK_DEADLOCK;
+update t1 set a = 'bar';
+disconnect con1;
+connection default;
+reap;
+drop table t1;
+set @@innodb_lock_wait_timeout= @old_lock_wait_timeout;
+
+--echo #
+--echo # MDEV-19406 Assertion on updating view of join with versioned table
+--echo #
+--disable_warnings
+create or replace table t1 (pk int primary key, a date, b int, index(b)) engine=innodb with system versioning;
+create or replace table t2 (c int);
+create or replace view v as select * from t1 join t2;
+
+insert into t1 (pk) values (1);
+update t1 set a= '2012-12-12';
+update v set a= '2000-01-01' order by b limit 1; # point of failure
+drop view v;
+drop table t1, t2;
+--enable_warnings
+
+--echo #
+--echo # MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
+--echo #
+create or replace table t1 (a varchar(8))
+engine=aria row_format=fixed
+with system versioning;
+
+insert into t1 (a) values ('foo');
+update t1 set a = 'bar';
+drop table t1;
+
+--echo #
+--echo # MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
+--echo #
+create or replace table t1 (
+ pk int, a char(8), b char(8),
+ primary key (pk)
+) with system versioning;
+
+create or replace view v1 as select * from t1;
+insert into t1 values (1, null, 'd') , (2, null, 'i') ;
+update v1 set a= null where b = '';
+
+create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
+insert into t1 values (1,1),(2,2);
+create or replace view v1 as select * from t1;
+update v1 set id= 2 where k = 0;
+
+create or replace table t1 (a int) with system versioning;
+create or replace view v1 as select * from t1;
+create or replace procedure sp() update v1 set xx = 1;
+--error ER_BAD_FIELD_ERROR
+call sp;
+--error ER_BAD_FIELD_ERROR
+call sp;
+
+# cleanup
+drop procedure sp;
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table
+--echo #
+create or replace table t1 (f point, key(f)) with system versioning engine=myisam;
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+update t1 set f = null where f = 'foo';
+
+# cleanup
+drop table t1;
+
+--echo #
+--echo # MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon REPLACE on a system-versioned table
+--echo #
+create or replace table t1 (
+ a int,
+ b int,
+ row_start bigint(20) unsigned generated always as row start,
+ row_end bigint(20) unsigned generated always as row end,
+ unique key (b,row_end),
+ key (row_start),
+ period for system_time (row_start,row_end)
+) engine=innodb with system versioning;
+
+insert into t1 (a, b) values (1, 2);
+replace into t1 (a, b) values (3, 2);
+replace into t1 (a, b) values (4, 2);
+
+# cleanup
+drop table t1;
+
+--echo #
+--echo # MDEV-20661 Virtual fields are not recalculated on system fields value assignment
+--echo #
+
+replace_result $sys_datatype_expl SYS_DATATYPE;
+eval create table t1 (
+ a int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end),
+ v1 bigint unsigned as (a ^ row_start) unique,
+ v2 bigint unsigned as (a ^ row_end) unique
+) engine=innodb with system versioning;
+
+insert into t1 (a) values (1), (2);
+update ignore t1 set a= 3;
+delete history from t1;
+
+# cleanup
+drop table t1;
+
+source suite/versioning/common_finish.inc;
diff --git a/mysql-test/suite/versioning/t/view.test b/mysql-test/suite/versioning/t/view.test
new file mode 100644
index 00000000000..37676a7fb50
--- /dev/null
+++ b/mysql-test/suite/versioning/t/view.test
@@ -0,0 +1,216 @@
+--source suite/versioning/engines.inc
+--source suite/versioning/common.inc
+
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+
+select now(6) into @t1;
+update t1 set x= 2;
+
+select now(6) into @t2;
+delete from t1;
+
+set @vt1= concat("create or replace view vt1 as select * from t1 for system_time as of timestamp '", @t1, "'");
+prepare stmt from @vt1; execute stmt; drop prepare stmt;
+
+set @vt2= concat("create or replace view vt2 as select *, row_end from t1 for system_time as of timestamp '", @t2, "'");
+prepare stmt from @vt2; execute stmt; drop prepare stmt;
+
+select * from t1;
+
+create or replace view vt1 as select * from t1;
+--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
+show create view vt1;
+
+drop view vt1;
+drop view vt2;
+
+create or replace view vt1 as select * from t1 for system_time all;
+select * from vt1;
+prepare stmt from 'select * from vt1'; execute stmt; drop prepare stmt;
+
+set @str= concat('create or replace view vt1 as
+select * from t1 for system_time as of timestamp "', @t1, '"');
+prepare stmt from @str; execute stmt; drop prepare stmt;
+select * from t1 for system_time as of timestamp @t1;
+select * from vt1;
+
+insert into vt1 values (3);
+select * from t1;
+select * from vt1;
+
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1), (2);
+set @t1=now(6);
+delete from t1 where x=2;
+set @t2=now(6);
+delete from t1 where x=1;
+set @t3=now(6);
+
+set @tmp= concat("create or replace view vt1 as select * from t1 for system_time as of timestamp '", @t1, "'");
+prepare stmt from @tmp; execute stmt; drop prepare stmt;
+
+select * from vt1;
+
+--echo # VIEW with parameters [tempesta-tech/mariadb#151]
+create or replace table t1 (x int) with system versioning;
+create or replace view vt1(c) as select x from t1;
+--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
+show create view vt1;
+
+--echo # VIEW over JOIN of versioned tables [tempesta-tech/mariadb#153]
+create or replace table t1 (a int) with system versioning;
+create or replace table t2 (b int) with system versioning;
+insert into t1 values (1);
+insert into t2 values (2);
+create or replace view vt12 as select * from t1 cross join t2;
+select * from vt12;
+create or replace view vt12 as select * from t1 for system_time as of timestamp ('1970-01-01 00:00') cross join t2;
+select * from vt12;
+
+--echo # VIEW improvements [tempesta-tech/mariadb#183]
+create or replace table t3 (x int);
+create or replace view vt1 as select * from t1, t2, t3;
+--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
+show create view vt1;
+create or replace view vt1 as select * from t3, t2, t1;
+--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
+show create view vt1;
+create or replace view vt1 as select a, t2.row_end as endo from t3, t1, t2;
+--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
+show create view vt1;
+
+--echo # VIEW over UNION [tempesta-tech/mariadb#269]
+create or replace view vt1 as select * from t1 union select * from t1;
+select * from vt1;
+
+--echo # VIEW over UNION with non-versioned [tempesta-tech/mariadb#393]
+create or replace table t2 (a int);
+create or replace view vt1 as select * from t1 union select * from t2;
+select * from vt1;
+
+--echo #
+--echo # MDEV-14689 crash on second PS execute
+--echo #
+create or replace table t1 (a int);
+create or replace view v1 as select * from t1;
+create or replace table t2 (b int) with system versioning;
+prepare stmt from 'select a from v1 inner join t2 group by a order by a';
+execute stmt;
+execute stmt;
+drop view v1;
+drop tables t1, t2;
+
+--echo #
+--echo # MDEV-15146 SQLError[4122]: View is not system versioned
+--echo #
+create or replace table t1 (a int) with system versioning;
+insert t1 values (1),(2);
+set @a=now(6);
+create or replace view v1 as select * from t1;
+delete from t1;
+select * from v1;
+select * from v1 for system_time as of @a;
+show create view v1;
+
+--echo #
+--echo # MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
+--echo #
+create or replace table t1 (i int) with system versioning;
+select * from t1 for system_time as of now() - interval 6 second;
+create or replace view v1 as select * from t1 for system_time as of date_sub(now(), interval 6 second);
+show create view v1;
+
+drop view v1, vt1, vt12;
+drop tables t1, t3;
+
+--echo #
+--echo # MDEV-18727 improve DML operation of System Versioning
+--echo #
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ x int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1), (2);
+create or replace view v1 as select * from t1 where x > 1;
+--echo # update, delete
+update v1 set x= x + 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+insert v1 values (4);
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+delete from v1 where x < 4;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+--echo # multi-update
+create or replace table t2 like t1;
+insert into t2 values (1), (2);
+create or replace view v2 as select * from t2 where x > 1;
+update v1, v2 set v1.x= v1.x + 1, v2.x= v2.x + 1 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+--echo # multi-delete
+delete v1, v2 from v1 join v2 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+--echo # replace
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ x int primary key, y int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1, 0), (2, 0);
+create or replace view v1 as select * from t1 where x > 1;
+replace v1 values (1, 1);
+replace v1 values (2, 1);
+replace v1 values (3, 1);
+--echo # REPLACE ignores VIEW condition because itself doesn't use WHERE
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+--echo # insert-select, on duplicate key
+insert v1 select * from t1 where x = 1 on duplicate key update x = v1.x - 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+drop view v1, v2;
+drop tables t1, t2;
+
+--echo #
+--echo # MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA
+--echo #
+create table t1 (a int);
+create view v1 as select * from t1;
+create or replace table t1 (b int) with system versioning;
+--error ER_VIEW_INVALID
+load data infile 'xx' into table v1;
+
+# cleanup
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
+--echo #
+create table t1 (a int);
+insert into t1 values (1);
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table t2 (
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t2 values (2);
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+create or replace view v1 as select * from t2;
+delete from v2;
+select * from t1;
+select *, check_row(row_start, row_end) from t2 for system_time all;
+
+# cleanup
+drop view v2;
+drop view v1;
+drop table t1, t2;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/wait_system_clock.inc b/mysql-test/suite/versioning/wait_system_clock.inc
new file mode 100644
index 00000000000..21bbe7aea21
--- /dev/null
+++ b/mysql-test/suite/versioning/wait_system_clock.inc
@@ -0,0 +1,10 @@
+#
+# windows has a rather low-resolution system clock
+# wait until the event from the past will actually be in the past
+#
+if (`select @@version_compile_os in ("win32","win64","windows")`)
+{
+ let $_past=`select max(row_start) from t1`;
+ --let $wait_condition=select TIMESTAMP'$_past' < sysdate(6)
+ --source include/wait_condition.inc
+}
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 3abc861f3d0..d1e5b9a4a28 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -19,7 +19,6 @@ SET GLOBAL wsrep_provider=none;
# variables when using "_"
#
CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
-# wsrep
SHOW GLOBAL STATUS LIKE 'wsrep%';
Variable_name Value
wsrep_applier_thread_count #
@@ -78,6 +77,65 @@ wsrep_replicated #
wsrep_replicated_bytes #
wsrep_rollbacker_thread_count #
wsrep_thread_count #
+
+SHOW GLOBAL STATUS LIKE 'wsrep_%';
+Variable_name Value
+wsrep_applier_thread_count #
+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_open_connections #
+wsrep_open_transactions #
+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_rollbacker_thread_count #
+wsrep_thread_count #
SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
Variable_name Value
wsrep_local_state_comment #
@@ -85,9 +143,6 @@ wsrep_local_state_comment #
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
@@ -141,14 +196,15 @@ wsrep_thread_count 0
# applier/rollbacker threads.
SET GLOBAL wsrep_cluster_address= 'gcomm://';
# Wait for applier thread to get created 1.
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-VARIABLE_VALUE
+# Wait for applier thread to get created 2.
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_1
1
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
-VARIABLE_VALUE
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
+EXPECT_1
1
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
-VARIABLE_VALUE
+SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
+EXPECT_2
2
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
@@ -169,14 +225,14 @@ wsrep_thread_count 2
SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
SET GLOBAL wsrep_slave_threads= 10;
# Wait for 9 applier threads to get created.
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-VARIABLE_VALUE
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_10
10
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
-VARIABLE_VALUE
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
+EXPECT_1
1
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
-VARIABLE_VALUE
+SELECT VARIABLE_VALUE AS EXPECT_11 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
+EXPECT_11
11
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
index 5336fae17b6..d3bcdd345af 100644
--- a/mysql-test/suite/wsrep/t/variables.test
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -28,19 +28,19 @@ SET GLOBAL wsrep_provider=none;
CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
---disable_result_log
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--let $galera_version=25.3.24
source include/check_galera_version.inc;
---enable_result_log
--enable_query_log
---echo # wsrep
---sorted_result
--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';
@@ -50,15 +50,11 @@ 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
+# The following 2 variables are used by mariabackup
# SST.
--echo
--replace_column 2 #
@@ -106,15 +102,15 @@ SHOW STATUS LIKE 'wsrep_thread_count';
SET GLOBAL wsrep_cluster_address= 'gcomm://';
--echo # Wait for applier thread to get created 1.
---let $wait_timeout=600
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
--source include/wait_condition.inc
+--echo # Wait for applier thread to get created 2.
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
--source include/wait_condition.inc
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
+SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
@@ -131,9 +127,9 @@ SET GLOBAL wsrep_slave_threads= 10;
--let $wait_condition = SELECT VARIABLE_VALUE = 10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
--source include/wait_condition.inc
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count';
+SELECT VARIABLE_VALUE AS EXPECT_11 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count';
SHOW STATUS LIKE 'threads_connected';