summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml8
-rw-r--r--CMakeLists.txt3
-rw-r--r--client/mysql_upgrade.c1
-rw-r--r--cmake/build_configurations/mysql_release.cmake2
-rw-r--r--cmake/check_linker_flag.cmake27
-rw-r--r--configure.cmake5
-rw-r--r--debian/additions/Docs__Images__Makefile.in6
-rw-r--r--debian/additions/Docs__Makefile.in6
-rwxr-xr-xdebian/additions/debian-start.inc.sh14
-rw-r--r--debian/additions/enable_encryption.preset20
-rw-r--r--debian/additions/innotop/innotop140
-rw-r--r--debian/additions/innotop/innotop.150
-rw-r--r--debian/additions/mariadb.cnf9
-rw-r--r--debian/additions/mariadb.conf.d/50-client.cnf9
-rw-r--r--debian/additions/mariadb.conf.d/50-mysqld_safe.cnf14
-rw-r--r--debian/additions/mariadb.conf.d/60-galera.cnf19
l---------debian/additions/mariadb.conf.d/99-enable-encryption.cnf.preset1
-rwxr-xr-xdebian/autobake-deb.sh77
-rw-r--r--debian/control27
-rw-r--r--debian/mariadb-plugin-columnstore.install11
-rw-r--r--debian/mariadb-plugin-columnstore.postinst4
-rw-r--r--debian/mariadb-plugin-columnstore.postrm27
-rw-r--r--debian/mariadb-plugin-columnstore.prerm1
-rw-r--r--debian/mariadb-plugin-columnstore.triggers1
-rw-r--r--debian/mariadb-plugin-cracklib-password-check.install2
-rw-r--r--debian/mariadb-plugin-gssapi-server.install2
-rw-r--r--debian/mariadb-plugin-rocksdb.lintian-overrides2
-rw-r--r--debian/mariadb-plugin-s3.install1
-rw-r--r--debian/mariadb-server-10.6.postrm3
-rw-r--r--debian/mariadb-server-10.6.preinst3
-rw-r--r--debian/not-installed9
-rwxr-xr-xdebian/rules29
-rw-r--r--debian/salsa-ci.yml27
-rw-r--r--debian/source/lintian-overrides2
-rw-r--r--extra/comp_err.c5
-rw-r--r--extra/mariabackup/xtrabackup.cc9
-rw-r--r--include/ilist.h103
-rw-r--r--include/m_ctype.h18
-rw-r--r--include/my_global.h2
-rw-r--r--include/my_rdtsc.h14
-rw-r--r--include/my_sys.h9
-rw-r--r--include/my_time.h7
-rw-r--r--include/mysql/psi/mysql_socket.h24
-rw-r--r--include/mysql/service_wsrep.h5
-rw-r--r--include/mysys_err.h3
-rw-r--r--include/violite.h2
-rw-r--r--man/CMakeLists.txt1
-rw-r--r--man/aria_s3_copy.152
-rw-r--r--mysql-test/include/binlog_parallel_replication_marks.test2
-rw-r--r--mysql-test/include/mix1.inc4
-rw-r--r--mysql-test/main/create_drop_function.result17
-rw-r--r--mysql-test/main/create_drop_function.test24
-rw-r--r--mysql-test/main/ctype_ldml.result12
-rw-r--r--mysql-test/main/ctype_ldml.test13
-rw-r--r--mysql-test/main/func_math.result106
-rw-r--r--mysql-test/main/grant.result2
-rw-r--r--mysql-test/main/grant4.result2
-rw-r--r--mysql-test/main/grant5.result6
-rw-r--r--mysql-test/main/grant5.test10
-rw-r--r--mysql-test/main/information_schema.result70
-rw-r--r--mysql-test/main/information_schema.test67
-rw-r--r--mysql-test/main/information_schema_all_engines-master.opt1
-rw-r--r--mysql-test/main/mdev-21101.opt1
-rw-r--r--mysql-test/main/mdev-21101.result43
-rw-r--r--mysql-test/main/mdev-21101.test54
-rw-r--r--mysql-test/main/mdl.result3
-rw-r--r--mysql-test/main/mdl.test3
-rw-r--r--mysql-test/main/metadata.result40
-rw-r--r--mysql-test/main/mysqlbinlog-innodb.result8
-rw-r--r--mysql-test/main/mysqlbinlog.result74
-rw-r--r--mysql-test/main/mysqlbinlog_row_compressed.result16
-rw-r--r--mysql-test/main/mysqlbinlog_row_minimal.result18
-rw-r--r--mysql-test/main/mysqlbinlog_stmt_compressed.result16
-rw-r--r--mysql-test/main/mysqld--help-aria.test2
-rw-r--r--mysql-test/main/mysqltest_tracking_info.result16
-rw-r--r--mysql-test/main/mysqltest_tracking_info.test17
-rw-r--r--mysql-test/main/order_by.result77
-rw-r--r--mysql-test/main/order_by.test37
-rw-r--r--mysql-test/main/parser.result78
-rw-r--r--mysql-test/main/parser.test79
-rw-r--r--mysql-test/main/partition_explicit_prune.result18
-rw-r--r--mysql-test/main/partition_explicit_prune.test12
-rw-r--r--mysql-test/main/plugin.result14
-rw-r--r--mysql-test/main/plugin.test23
-rw-r--r--mysql-test/main/rowid_filter_myisam.result21
-rw-r--r--mysql-test/main/rowid_filter_myisam.test1625
-rw-r--r--mysql-test/main/signal.result6
-rw-r--r--mysql-test/main/signal.test6
-rw-r--r--mysql-test/main/sp-error.result17
-rw-r--r--mysql-test/main/sp-error.test23
-rw-r--r--mysql-test/main/sp.result18
-rw-r--r--mysql-test/main/sp.test18
-rw-r--r--mysql-test/main/stat_tables_innodb.result24
-rw-r--r--mysql-test/main/stat_tables_innodb.test20
-rw-r--r--mysql-test/main/subselect_exists2in.result8
-rw-r--r--mysql-test/main/subselect_exists2in.test8
-rw-r--r--mysql-test/main/type_bit.result983
-rw-r--r--mysql-test/main/type_bit.test29
-rw-r--r--mysql-test/main/type_date.result14
-rw-r--r--mysql-test/main/type_date.test8
-rw-r--r--mysql-test/main/type_datetime_hires.result165
-rw-r--r--mysql-test/main/type_datetime_hires.test98
-rw-r--r--mysql-test/main/type_enum.result21
-rw-r--r--mysql-test/main/type_enum.test13
-rw-r--r--mysql-test/main/type_hex_hybrid.result158
-rw-r--r--mysql-test/main/type_hex_hybrid.test30
-rw-r--r--mysql-test/main/type_int.result216
-rw-r--r--mysql-test/main/type_int.test35
-rw-r--r--mysql-test/main/type_set.result21
-rw-r--r--mysql-test/main/type_set.test13
-rw-r--r--mysql-test/main/type_time_hires.result237
-rw-r--r--mysql-test/main/type_time_hires.test123
-rw-r--r--mysql-test/main/type_timestamp_hires.result12
-rw-r--r--mysql-test/main/type_timestamp_hires.test10
-rw-r--r--mysql-test/main/type_year.result27
-rw-r--r--mysql-test/main/type_year.test15
-rw-r--r--mysql-test/main/union.result29
-rw-r--r--mysql-test/main/union.test21
-rw-r--r--mysql-test/main/upgrade_MDEV-19650.result1
-rw-r--r--mysql-test/main/upgrade_MDEV-19650.test4
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-1.result286
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-1.test163
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-2.result262
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-2.test141
-rw-r--r--mysql-test/main/user_var-binlog.result4
-rw-r--r--mysql-test/main/view_grant.result1
-rw-r--r--mysql-test/main/win.result52
-rw-r--r--mysql-test/main/win.test34
-rw-r--r--mysql-test/main/win_ntile.result78
-rw-r--r--mysql-test/main/win_ntile.test43
-rw-r--r--mysql-test/std_data/ldml/Index.xml9
-rwxr-xr-xmysql-test/std_data/wsrep_notify.sh18
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result206
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result358
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result40
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result40
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result16
-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.result72
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result14
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result28
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result14
-rw-r--r--mysql-test/suite/binlog/r/flashback.result20
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.result36
-rw-r--r--mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result100
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/sp.result8
-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/sp-cursor-rowtype.test2
-rw-r--r--mysql-test/suite/compat/oracle/t/sp.test8
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result3
-rw-r--r--mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test2
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_privileges.result1
-rw-r--r--mysql-test/suite/galera/disabled.def3
-rw-r--r--mysql-test/suite/galera/include/galera_st_clean_slave.inc6
-rw-r--r--mysql-test/suite/galera/include/galera_st_disconnect_slave.inc6
-rw-r--r--mysql-test/suite/galera/include/galera_st_kill_slave.inc6
-rw-r--r--mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc5
-rw-r--r--mysql-test/suite/galera/include/galera_st_shutdown_slave.inc6
-rw-r--r--mysql-test/suite/galera/r/MDEV-22458.result10
-rw-r--r--mysql-test/suite/galera/r/MW-328A.result3
-rw-r--r--mysql-test/suite/galera/r/galera_bf_kill.result18
-rw-r--r--mysql-test/suite/galera/r/galera_bf_kill_debug.result54
-rw-r--r--mysql-test/suite/galera/r/galera_bf_lock_wait.result2
-rw-r--r--mysql-test/suite/galera/r/galera_toi_truncate.result6
-rw-r--r--mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result33
-rw-r--r--mysql-test/suite/galera/r/galera_var_notify_cmd.result2
-rw-r--r--mysql-test/suite/galera/r/mdev_21718.result16
-rw-r--r--mysql-test/suite/galera/suite.pm1
-rw-r--r--mysql-test/suite/galera/t/MDEV-22458.test21
-rw-r--r--mysql-test/suite/galera/t/MW-328A.test4
-rw-r--r--mysql-test/suite/galera/t/galera_bf_kill.test51
-rw-r--r--mysql-test/suite/galera/t/galera_bf_kill_debug.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_bf_kill_debug.test140
-rw-r--r--mysql-test/suite/galera/t/galera_bf_lock_wait.test4
-rw-r--r--mysql-test/suite/galera/t/galera_toi_truncate.test11
-rw-r--r--mysql-test/suite/galera/t/galera_var_cluster_conf_id.test4
-rw-r--r--mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test50
-rw-r--r--mysql-test/suite/galera/t/mdev_21718.cnf4
-rw-r--r--mysql-test/suite/galera/t/mdev_21718.test35
-rw-r--r--mysql-test/suite/galera_3nodes/suite.pm7
-rw-r--r--mysql-test/suite/galera_3nodes/t/GCF-354.test9
-rw-r--r--mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.test3
-rw-r--r--mysql-test/suite/galera_sr/suite.pm3
-rw-r--r--mysql-test/suite/gcol/r/gcol_bugfixes.result66
-rw-r--r--mysql-test/suite/gcol/t/gcol_bugfixes.test70
-rw-r--r--mysql-test/suite/innodb/disabled.def2
-rw-r--r--mysql-test/suite/innodb/r/alter_primary_key.result26
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff10
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff10
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb_buffer_pool_resize_debug.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result26
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug42101.result22
-rw-r--r--mysql-test/suite/innodb/r/innodb_ctype_ldml.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result3
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_bugs.result8
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_charset.result103
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result5
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff31
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_extend.resultbin8684 -> 9115 bytes
-rw-r--r--mysql-test/suite/innodb/r/mvcc.result14
-rw-r--r--mysql-test/suite/innodb/r/truncate_foreign.result1
-rw-r--r--mysql-test/suite/innodb/t/alter_primary_key.test34
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_alter.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test22
-rw-r--r--mysql-test/suite/innodb/t/innodb.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test20
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101.test18
-rw-r--r--mysql-test/suite/innodb/t/innodb_ctype_ldml.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt2
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test10
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_charset.test113
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test3
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_extend.test9
-rw-r--r--mysql-test/suite/innodb/t/mvcc.test20
-rw-r--r--mysql-test/suite/innodb/t/truncate_foreign.test1
-rw-r--r--mysql-test/suite/maria/maria-connect.result2
-rw-r--r--mysql-test/suite/maria/max_length.test2
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.result4
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.test8
-rw-r--r--mysql-test/suite/parts/r/alter_table.result7
-rw-r--r--mysql-test/suite/parts/t/alter_table.test11
-rw-r--r--mysql-test/suite/perfschema/r/nesting.result295
-rw-r--r--mysql-test/suite/plugins/r/audit_null_debug.result1
-rw-r--r--mysql-test/suite/plugins/t/audit_null_debug.test3
-rw-r--r--mysql-test/suite/roles/set_role-table-column-priv.result2
-rw-r--r--mysql-test/suite/roles/set_role-table-simple.result2
-rw-r--r--mysql-test/suite/rpl/r/parallel_backup.result40
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_virt.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result52
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result18
-rw-r--r--mysql-test/suite/rpl/t/parallel_backup.test75
-rw-r--r--mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_virt.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test41
-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/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result26
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result68
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff122
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result36
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test7
-rw-r--r--mysql-test/suite/versioning/r/partition.result30
-rw-r--r--mysql-test/suite/versioning/r/update.result31
-rw-r--r--mysql-test/suite/versioning/t/partition.test19
-rw-r--r--mysql-test/suite/versioning/t/update.test41
-rw-r--r--mysys/CMakeLists.txt3
-rw-r--r--mysys/charset-def.c2
-rw-r--r--mysys/charset.c100
-rw-r--r--mysys/crc32/crc32_arm64.c13
-rw-r--r--mysys/errors.c4
-rw-r--r--mysys/my_largepage.c8
-rw-r--r--mysys/my_rdtsc.c32
-rw-r--r--mysys/my_static.c1
-rw-r--r--mysys/mysys_priv.h1
-rw-r--r--plugin/auth_pam/CMakeLists.txt2
-rw-r--r--plugin/auth_pam/auth_pam.c27
-rw-r--r--plugin/type_inet/sql_type_inet.cc13
-rw-r--r--scripts/CMakeLists.txt30
-rw-r--r--scripts/mysql_system_tables.sql12
-rw-r--r--sql-common/client.c2
-rw-r--r--sql/field.cc21
-rw-r--r--sql/filesort.cc35
-rw-r--r--sql/filesort_utils.cc9
-rw-r--r--sql/ha_partition.cc7
-rw-r--r--sql/handler.cc100
-rw-r--r--sql/handler.h5
-rw-r--r--sql/item.cc68
-rw-r--r--sql/item.h38
-rw-r--r--sql/item_cmpfunc.cc28
-rw-r--r--sql/item_cmpfunc.h80
-rw-r--r--sql/item_create.cc2
-rw-r--r--sql/item_func.cc112
-rw-r--r--sql/item_func.h55
-rw-r--r--sql/item_strfunc.cc4
-rw-r--r--sql/item_subselect.cc53
-rw-r--r--sql/item_subselect.h180
-rw-r--r--sql/item_timefunc.cc14
-rw-r--r--sql/item_windowfunc.cc6
-rw-r--r--sql/item_windowfunc.h12
-rw-r--r--sql/log.cc4
-rw-r--r--sql/log.h6
-rw-r--r--sql/log_event_client.cc9
-rw-r--r--sql/log_event_server.cc14
-rw-r--r--sql/mdl.cc4
-rw-r--r--sql/mdl.h5
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/net_serv.cc12
-rw-r--r--sql/opt_subselect.cc112
-rw-r--r--sql/partition_info.cc5
-rw-r--r--sql/protocol.cc86
-rw-r--r--sql/protocol.h79
-rw-r--r--sql/rpl_parallel.cc2
-rw-r--r--sql/rpl_rli.cc4
-rw-r--r--sql/service_wsrep.cc34
-rw-r--r--sql/session_tracker.cc8
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sp.cc14
-rw-r--r--sql/sql_acl.cc37
-rw-r--r--sql/sql_alter.cc14
-rw-r--r--sql/sql_alter.h9
-rw-r--r--sql/sql_base.cc54
-rw-r--r--sql/sql_class.cc26
-rw-r--r--sql/sql_class.h40
-rw-r--r--sql/sql_connect.cc1
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_lex.cc43
-rw-r--r--sql/sql_lex.h22
-rw-r--r--sql/sql_locale.h2
-rw-r--r--sql/sql_parse.cc63
-rw-r--r--sql/sql_partition_admin.cc6
-rw-r--r--sql/sql_plugin.cc74
-rw-r--r--sql/sql_plugin_services.ic3
-rw-r--r--sql/sql_prepare.cc41
-rw-r--r--sql/sql_select.cc34
-rw-r--r--sql/sql_sequence.cc5
-rw-r--r--sql/sql_show.cc11
-rw-r--r--sql/sql_statistics.cc14
-rw-r--r--sql/sql_statistics.h18
-rw-r--r--sql/sql_string.h24
-rw-r--r--sql/sql_table.cc34
-rw-r--r--sql/sql_time.cc22
-rw-r--r--sql/sql_time.h4
-rw-r--r--sql/sql_type.cc158
-rw-r--r--sql/sql_type.h122
-rw-r--r--sql/sql_window.cc8
-rw-r--r--sql/sql_yacc.yy4
-rw-r--r--sql/sys_vars.cc21
-rw-r--r--sql/sys_vars.ic13
-rw-r--r--sql/table.cc41
-rw-r--r--sql/table.h2
-rw-r--r--sql/threadpool.h1
-rw-r--r--sql/threadpool_common.cc22
-rw-r--r--sql/threadpool_generic.cc22
-rw-r--r--sql/unireg.cc19
-rw-r--r--sql/winservice.c30
-rw-r--r--sql/wsrep_dummy.cc2
-rw-r--r--sql/wsrep_high_priority_service.cc7
-rw-r--r--sql/wsrep_mysqld.cc2
-rw-r--r--sql/wsrep_schema.cc11
-rw-r--r--sql/xa.cc4
-rw-r--r--storage/columnstore/CMakeLists.txt2
m---------storage/columnstore/columnstore0
-rw-r--r--storage/innobase/CMakeLists.txt2
-rw-r--r--storage/innobase/btr/btr0btr.cc13
-rw-r--r--storage/innobase/btr/btr0bulk.cc105
-rw-r--r--storage/innobase/btr/btr0cur.cc34
-rw-r--r--storage/innobase/btr/btr0sea.cc21
-rw-r--r--storage/innobase/buf/buf0buf.cc41
-rw-r--r--storage/innobase/buf/buf0dblwr.cc135
-rw-r--r--storage/innobase/buf/buf0flu.cc14
-rw-r--r--storage/innobase/buf/buf0lru.cc3
-rw-r--r--storage/innobase/buf/buf0rea.cc13
-rw-r--r--storage/innobase/dict/dict0dict.cc15
-rw-r--r--storage/innobase/dict/dict0mem.cc41
-rw-r--r--storage/innobase/fil/fil0crypt.cc6
-rw-r--r--storage/innobase/fil/fil0fil.cc74
-rw-r--r--storage/innobase/fsp/fsp0file.cc17
-rw-r--r--storage/innobase/fsp/fsp0fsp.cc34
-rw-r--r--storage/innobase/handler/ha_innodb.cc799
-rw-r--r--storage/innobase/handler/handler0alter.cc19
-rw-r--r--storage/innobase/handler/i_s.cc53
-rw-r--r--storage/innobase/handler/i_s.h1
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc2
-rw-r--r--storage/innobase/include/btr0bulk.h3
-rw-r--r--storage/innobase/include/btr0cur.h1
-rw-r--r--storage/innobase/include/buf0buf.h15
-rw-r--r--storage/innobase/include/dict0dict.h4
-rw-r--r--storage/innobase/include/dict0mem.h38
-rw-r--r--storage/innobase/include/fil0fil.h59
-rw-r--r--storage/innobase/include/ha_prototypes.h5
-rw-r--r--storage/innobase/include/ibuf0ibuf.ic2
-rw-r--r--storage/innobase/include/log0recv.h46
-rw-r--r--storage/innobase/include/mtr0log.h12
-rw-r--r--storage/innobase/include/mtr0mtr.h30
-rw-r--r--storage/innobase/include/mtr0mtr.ic38
-rw-r--r--storage/innobase/include/mtr0types.h13
-rw-r--r--storage/innobase/include/que0types.h1
-rw-r--r--storage/innobase/include/rem0rec.h7
-rw-r--r--storage/innobase/include/row0ins.h3
-rw-r--r--storage/innobase/include/row0upd.h45
-rw-r--r--storage/innobase/include/srv0conc.h93
-rw-r--r--storage/innobase/include/srv0srv.h52
-rw-r--r--storage/innobase/include/srv0start.h4
-rw-r--r--storage/innobase/include/sync0policy.h15
-rw-r--r--storage/innobase/include/sync0rw.h15
-rw-r--r--storage/innobase/include/sync0sync.h2
-rw-r--r--storage/innobase/include/sync0types.h24
-rw-r--r--storage/innobase/include/trx0i_s.h5
-rw-r--r--storage/innobase/include/trx0trx.h15
-rw-r--r--storage/innobase/lock/lock0wait.cc18
-rw-r--r--storage/innobase/log/log0log.cc5
-rw-r--r--storage/innobase/log/log0recv.cc118
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc206
-rw-r--r--storage/innobase/os/os0file.cc9
-rw-r--r--storage/innobase/page/page0cur.cc6
-rw-r--r--storage/innobase/page/page0page.cc15
-rw-r--r--storage/innobase/page/page0zip.cc2
-rw-r--r--storage/innobase/row/row0import.cc11
-rw-r--r--storage/innobase/row/row0ins.cc10
-rw-r--r--storage/innobase/row/row0mysql.cc60
-rw-r--r--storage/innobase/row/row0quiesce.cc7
-rw-r--r--storage/innobase/row/row0upd.cc83
-rw-r--r--storage/innobase/row/row0vers.cc8
-rw-r--r--storage/innobase/srv/srv0conc.cc327
-rw-r--r--storage/innobase/srv/srv0srv.cc58
-rw-r--r--storage/innobase/srv/srv0start.cc20
-rw-r--r--storage/innobase/sync/sync0debug.cc179
-rw-r--r--storage/innobase/sync/sync0rw.cc24
-rw-r--r--storage/innobase/sync/sync0sync.cc10
-rw-r--r--storage/innobase/trx/trx0i_s.cc2
-rw-r--r--storage/innobase/trx/trx0roll.cc8
-rw-r--r--storage/innobase/trx/trx0rseg.cc2
-rw-r--r--storage/innobase/trx/trx0sys.cc2
-rw-r--r--storage/innobase/trx/trx0trx.cc37
-rw-r--r--storage/innobase/ut/ut0crc32.cc6
-rw-r--r--storage/maria/CMakeLists.txt5
-rw-r--r--storage/maria/aria_s3_copy.cc2
-rw-r--r--storage/maria/ha_maria.cc4
-rw-r--r--storage/maria/ha_maria.h1
-rw-r--r--storage/maria/s3.cnf26
-rw-r--r--storage/myisam/mi_key.c10
-rw-r--r--storage/perfschema/my_thread.h4
-rw-r--r--storage/rocksdb/CMakeLists.txt7
-rw-r--r--storage/rocksdb/build_rocksdb.cmake26
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test2
-rw-r--r--storage/spider/spd_malloc.cc3
-rw-r--r--storage/spider/spider.cnf6
-rw-r--r--strings/ctype-big5.c10
-rw-r--r--strings/ctype-bin.c4
-rw-r--r--strings/ctype-cp932.c13
-rw-r--r--strings/ctype-czech.c2
-rw-r--r--strings/ctype-euc_kr.c9
-rw-r--r--strings/ctype-eucjpms.c10
-rw-r--r--strings/ctype-gb2312.c10
-rw-r--r--strings/ctype-gbk.c9
-rw-r--r--strings/ctype-latin1.c12
-rw-r--r--strings/ctype-sjis.c9
-rw-r--r--strings/ctype-tis620.c10
-rw-r--r--strings/ctype-uca.c293
-rw-r--r--strings/ctype-ucs2.c36
-rw-r--r--strings/ctype-ujis.c9
-rw-r--r--strings/ctype-utf8.c20
-rw-r--r--strings/ctype-win1250ch.c3
-rw-r--r--strings/ctype.c6
-rw-r--r--strings/strings_def.h9
-rw-r--r--vio/vio_priv.h1
-rw-r--r--vio/viopipe.c6
-rw-r--r--vio/viosocket.c29
m---------wsrep-lib0
472 files changed, 12259 insertions, 4829 deletions
diff --git a/.travis.yml b/.travis.yml
index a096de35766..54a6759e369 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,7 +40,14 @@ addons:
- g++-9 # ubuntu-toolchain-r/test (xenial and bionic)
- gdb
- libaio-dev
+ - libboost-atomic-dev
+ - libboost-chrono-dev
+ - libboost-date-time-dev
- libboost-dev
+ - libboost-filesystem-dev
+ - libboost-regex-dev
+ - libboost-system-dev
+ - libboost-thread-dev
- libcrack2-dev
- libcurl3-dev
- libdbd-mysql
@@ -52,6 +59,7 @@ addons:
- libnuma-dev
- libpam0g-dev
- libpcre2-dev
+ - libreadline-gplv2-dev
- libsnappy-dev
- libssl-dev
- libstemmer-dev
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c52d6621bb1..80fac4b2ccc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -197,6 +197,7 @@ ENDIF()
OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)
INCLUDE(check_compiler_flag)
+INCLUDE(check_linker_flag)
OPTION(WITH_ASAN "Enable address sanitizer" OFF)
@@ -250,7 +251,7 @@ OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protec
IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN)
# security-enhancing flags
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
- MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
+ MY_CHECK_AND_SET_LINKER_FLAG("-Wl,-z,relro,-z,now")
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
ENDIF()
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index a6af46e6d7b..c262b7d80bd 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -896,6 +896,7 @@ static const char *expected_errors[]=
"ERROR 1290", /* RR_OPTION_PREVENTS_STATEMENT */
"ERROR 1347", /* 'mysql.user' is not of type 'BASE TABLE' */
"ERROR 1348", /* Column 'Show_db_priv' is not updatable */
+ "ERROR 1356", /* definer of view lack rights (UPDATE) */
0
};
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 0376a8838f0..b6375c0ca08 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -128,7 +128,7 @@ ENDIF()
IF(UNIX)
SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
- SET(PLUGIN_AUTH_PAM YES)
+ SET(PLUGIN_AUTH_PAM YES CACHE BOOL "")
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
IF(NOT IGNORE_AIO_CHECK)
diff --git a/cmake/check_linker_flag.cmake b/cmake/check_linker_flag.cmake
new file mode 100644
index 00000000000..ff4b91e89f6
--- /dev/null
+++ b/cmake/check_linker_flag.cmake
@@ -0,0 +1,27 @@
+include(CheckCXXSourceCompiles)
+
+FUNCTION(MY_CHECK_AND_SET_LINKER_FLAG flag_to_set)
+ # Let's avoid expensive compiler tests on Windows:
+ IF(WIN32)
+ RETURN()
+ ENDIF()
+ STRING(REGEX REPLACE "[-,= +]" "_" result "HAVE_LINK_FLAG_${flag_to_set}")
+ SET(SAVE_CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_REQUIRED_LINK_OPTIONS}")
+ STRING(REGEX REPLACE "^-Wno-" "-W" flag_to_check ${flag_to_set})
+ SET(CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS} ${flag_to_check})
+ CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result})
+ SET(CMAKE_REQUIRED_LINK_OPTIONS "${SAVE_CMAKE_REQUIRED_LINK_OPTIONS}")
+ IF (${result})
+ FOREACH(linktype SHARED MODULE EXE)
+ IF(ARGN)
+ FOREACH(type ${ARGN})
+ SET(CMAKE_${linktype}_LINKER_FLAGS_${type}
+ "${CMAKE_${linktype}_LINKER_FLAGS_${type}} ${flag_to_set}" PARENT_SCOPE)
+ ENDFOREACH()
+ ELSE()
+ SET(CMAKE_${linktype}_LINKER_FLAGS
+ "${CMAKE_${linktype}_LINKER_FLAGS} ${flag_to_set}" PARENT_SCOPE)
+ ENDIF()
+ ENDFOREACH()
+ ENDIF()
+ENDFUNCTION()
diff --git a/configure.cmake b/configure.cmake
index a7e044b13d2..deef3c5f366 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -69,6 +69,11 @@ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
SET(PLUGIN_QUERY_RESPONSE_TIME NO CACHE BOOL "Disabled, gcc is too old")
ENDIF()
+# use runtime atomic-support detection in aarch64
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+ MY_CHECK_AND_SET_COMPILER_FLAG("-moutline-atomics")
+ENDIF()
+
IF(WITHOUT_DYNAMIC_PLUGINS)
MESSAGE("Dynamic plugins are disabled.")
ENDIF(WITHOUT_DYNAMIC_PLUGINS)
diff --git a/debian/additions/Docs__Images__Makefile.in b/debian/additions/Docs__Images__Makefile.in
deleted file mode 100644
index f7316d4e345..00000000000
--- a/debian/additions/Docs__Images__Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-all:
-
-distclean:
- -rm -f Makefile
-
-.PHONY: all distclean clean install check
diff --git a/debian/additions/Docs__Makefile.in b/debian/additions/Docs__Makefile.in
deleted file mode 100644
index f7316d4e345..00000000000
--- a/debian/additions/Docs__Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-all:
-
-distclean:
- -rm -f Makefile
-
-.PHONY: all distclean clean install check
diff --git a/debian/additions/debian-start.inc.sh b/debian/additions/debian-start.inc.sh
index fa5b1299bdc..005aa290866 100755
--- a/debian/additions/debian-start.inc.sh
+++ b/debian/additions/debian-start.inc.sh
@@ -5,7 +5,7 @@
## Check MyISAM and Aria unclosed tables.
# - Requires the server to be up.
-# - Is supposed to run silently in background.
+# - Is supposed to run silently in background.
function check_for_crashed_tables() {
set -e
set -u
@@ -15,7 +15,7 @@ function check_for_crashed_tables() {
# Checking for $? is unreliable so the size of the output is checked.
# Some table handlers like HEAP do not support CHECK TABLE.
- tempfile=`tempfile`
+ tempfile=$(mktemp)
# We have to use xargs in this case, because a for loop barfs on the
# spaces in the thing to be looped over.
@@ -25,7 +25,7 @@ function check_for_crashed_tables() {
LC_ALL=C $MYSQL --skip-column-names --batch -e '
select concat('\''select count(*) into @discard from `'\'',
- TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'')
+ TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'')
from information_schema.TABLES where TABLE_SCHEMA<>'\''INFORMATION_SCHEMA'\'' and TABLE_SCHEMA<>'\''PERFORMANCE_SCHEMA'\'' and ( ENGINE='\''MyISAM'\'' or ENGINE='\''Aria'\'' )' | \
xargs -i $MYSQL --skip-column-names --silent --batch \
--force -e "{}" &>$tempfile
@@ -39,8 +39,8 @@ function check_for_crashed_tables() {
$MYADMIN processlist status
) >> $tempfile
# Check for presence as a dependency on mailx would require an MTA.
- if [ -x /usr/bin/mailx ]; then
- mailx -e -s"$MYCHECK_SUBJECT" $MYCHECK_RCPT < $tempfile
+ if [ -x /usr/bin/mailx ]; then
+ mailx -e -s"$MYCHECK_SUBJECT" $MYCHECK_RCPT < $tempfile
fi
(echo "$MYCHECK_SUBJECT"; cat $tempfile) | logger -p daemon.warn -i -t$0
fi
@@ -49,7 +49,7 @@ function check_for_crashed_tables() {
## Check for tables needing an upgrade.
# - Requires the server to be up.
-# - Is supposed to run silently in background.
+# - Is supposed to run silently in background.
function upgrade_system_tables_if_necessary() {
set -e
set -u
@@ -69,7 +69,7 @@ function upgrade_system_tables_if_necessary() {
function check_root_accounts() {
set -e
set -u
-
+
logger -p daemon.info -i -t$0 "Checking for insecure root accounts."
ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='' and plugin in ('', 'mysql_native_password', 'mysql_old_password');" | $MYSQL --skip-column-names )
diff --git a/debian/additions/enable_encryption.preset b/debian/additions/enable_encryption.preset
deleted file mode 100644
index 287bc03413a..00000000000
--- a/debian/additions/enable_encryption.preset
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# !include this file into your my.cnf (or any of *.cnf files in /etc/mysql/conf.d)
-# and it will enable data at rest encryption. This is a simple way to
-# ensure that everything that can be encrypted will be and your
-# data will not leak unencrypted.
-#
-# DO NOT EDIT THIS FILE! On MariaDB upgrades it might be replaced with a
-# newer version and your edits will be lost. Instead, add your edits
-# to the .cnf file after the !include directive.
-#
-# NOTE that you also need to install an encryption plugin for the encryption
-# to work. See https://mariadb.com/kb/en/mariadb/data-at-rest-encryption/#encryption-key-management
-#
-[mariadb]
-aria-encrypt-tables
-encrypt-binlog
-encrypt-tmp-disk-tables
-encrypt-tmp-files
-loose-innodb-encrypt-log
-loose-innodb-encrypt-tables
diff --git a/debian/additions/innotop/innotop b/debian/additions/innotop/innotop
index 941d3c901cb..19229a57a82 100644
--- a/debian/additions/innotop/innotop
+++ b/debian/additions/innotop/innotop
@@ -3,7 +3,7 @@
# vim: tw=160:nowrap:expandtab:tabstop=3:shiftwidth=3:softtabstop=3
# This program is copyright (c) 2006 Baron Schwartz, baron at xaprb dot com.
-# Maintainers since 2013 : Kenny Gryp - Frédéric Descamps
+# Maintainers since 2013 : Kenny Gryp - Frédéric Descamps
# Feedback and improvements are gratefully received.
#
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
@@ -640,7 +640,7 @@ sub parse_fk_section {
} else {
( $ts, $type ) = $fulltext =~ m/^$s\s+(\w+)/m;
$section->{'ts'} = [ parse_innodb_timestamp( $ts ) ];
- }
+ }
$section->{'timestring'} = ts_to_string($section->{'ts'});
$section->{'type'} = $type;
@@ -715,7 +715,7 @@ sub parse_fk_bad_constraint_error {
@{$section}{ qw(reason) } = $fulltext =~ m/:\s*([^:]+)(?= Constraint:|$)/ms;
$section->{'reason'} =~ s/\s+/ /g
if $section->{'reason'};
-
+
# Certain data may not be present. Make them '' if not present.
map { $section->{$_} ||= "" }
qw(child_index fk_name col_name parent_table parent_col);
@@ -1042,7 +1042,7 @@ sub parse_tx_text {
if ( $txn =~ m/^TABLE LOCK|RECORD LOCKS/ ) {
$locks = [parse_innodb_record_locks($txn, $complete, $debug, $full)];
}
-
+
my ( $tables_in_use, $tables_locked )
= $txn
=~ m/^mysql tables in use $d, locked $d$/m;
@@ -1544,7 +1544,7 @@ innotop is a MySQL and InnoDB transaction/status monitor, like 'top' for
MySQL. It displays queries, InnoDB transactions, lock waits, deadlocks,
foreign key errors, open tables, replication status, buffer information,
row operations, logs, I/O operations, load graph, and more. You can
-monitor many servers at once with innotop.
+monitor many servers at once with innotop.
USAGE
exit(1);
@@ -4695,23 +4695,23 @@ sub main {
if ( !$windows ) {
delete $config{max_height};
}
-
+
# Try to lower my priority.
eval { setpriority(0, 0, getpriority(0, 0) + 10); };
-
+
# Print stuff to the screen immediately, don't wait for a newline.
$OUTPUT_AUTOFLUSH = 1;
-
+
# Clear the screen and load the configuration.
$clear_screen_sub->();
load_config();
-
+
# Override config variables with command-line options
my %cmdline =
map { $_->{c} => $opts{$_->{k}} }
grep { exists $_->{c} && exists $opts{$_->{k}} }
@opt_spec;
-
+
foreach my $name (keys %cmdline) {
next if not defined $cmdline{$name};
my $val = $cmdline{$name};
@@ -4719,23 +4719,23 @@ sub main {
$config{$name}->{val} = $val;
}
}
-
+
post_process_tbl_meta();
-
+
# Make sure no changes are written to config file in non-interactive mode.
if ( $opts{n} ) {
$config{readonly}->{val} = 1;
}
-
+
eval {
-
+
# Open the file for InnoDB status
if ( @ARGV ) {
my $filename = shift @ARGV;
open $file, "<", $filename
or die "Cannot open '$filename': $OS_ERROR";
}
-
+
# In certain modes we might have to collect data for two cycles
# before printing anything out, so we need to bump up the count one.
if ( $opts{n} && $opts{count} && $config{status_inc}->{val}
@@ -4743,16 +4743,16 @@ sub main {
{
$opts{count}++;
}
-
+
while (++$clock) {
-
+
my $mode = $config{mode}->{val} || 'Q';
if ( !$modes{$mode} ) {
die "Mode '$mode' doesn't exist; try one of these:\n"
. join("\n", map { " $_ $modes{$_}->{hdr}" } sort keys %modes)
. "\n";
}
-
+
if ( !$opts{n} ) {
@last_term_size = @this_term_size;
@this_term_size = Term::ReadKey::GetTerminalSize(\*STDOUT);
@@ -4763,13 +4763,13 @@ sub main {
}
die("Can't read terminal size") unless @this_term_size;
}
-
+
# If there's no connection to a database server, we need to fix that...
if ( !%connections ) {
print "You have not defined any database connections.\n\n";
add_new_dsn();
}
-
+
# See whether there are any connections defined for this mode. If there's only one
# connection total, assume the user wants to just use innotop for a single server
# and don't ask which server to connect to. Also, if we're monitoring from a file,
@@ -4782,20 +4782,20 @@ sub main {
choose_connections();
}
}
-
+
# Term::ReadLine might have re-set $OUTPUT_AUTOFLUSH.
$OUTPUT_AUTOFLUSH = 1;
-
+
# Prune old data
my $sets = $config{num_status_sets}->{val};
foreach my $store ( values %vars ) {
delete @{$store}{ grep { $_ < $clock - $sets } keys %$store };
}
%info_gotten = ();
-
+
# Call the subroutine to display this mode.
$modes{$mode}->{display_sub}->();
-
+
# It may be time to quit now.
if ( $opts{count} && $clock >= $opts{count} ) {
finish();
@@ -4805,7 +4805,7 @@ sub main {
foreach my $cxn ( grep { $dbhs{$_}->{failed} } keys %dbhs ) {
eval { connect_to_db($cxn); }; # Ignore errors entirely here.
}
-
+
# Wait for a bit.
if ( $opts{n} ) {
sleep($config{interval}->{val});
@@ -4815,10 +4815,10 @@ sub main {
$char = ReadKey($config{interval}->{val});
ReadMode('normal');
}
-
+
# Handle whatever action the key indicates.
do_key_action();
-
+
}
};
if ( $EVAL_ERROR ) {
@@ -5620,7 +5620,7 @@ sub display_M {
push @slave_io_status, extract_values($set, $set, $pre, 'slave_io_status');
}
}
- if ( $linecount < 1 ) {
+ if ( $linecount < 1 ) {
$channel = 'no_channels';
my $chcxn = $channel . '=' . $cxn;
get_slave_status($cxn,$channel);
@@ -6546,7 +6546,7 @@ sub set_to_tbl {
map { push @group_by, $_ if $_ !~ /^cxn$/ } @{$meta->{group_by}};
$meta->{group_by} = \@group_by;
}
- # if cxn is not visible and there is now more than one connection,
+ # if cxn is not visible and there is now more than one connection,
# make cxn visible again. assume it's not in group_by if it's not
# visible
else {
@@ -7187,7 +7187,7 @@ sub distill {
}
$query .= " " . $t;
}
- }
+ }
# die $orig_query if $query eq 'LOCK lock';
return $query;
@@ -7524,7 +7524,7 @@ sub do_stmt {
# Test if the cxn should not even be tried
return undef if $dbhs{$cxn}
- && $dbhs{$cxn}->{failed}
+ && $dbhs{$cxn}->{failed}
&& ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} );
my $sth;
@@ -7599,7 +7599,7 @@ sub do_query {
# Test if the cxn should not even be tried
return undef if $dbhs{$cxn}
- && $dbhs{$cxn}->{failed}
+ && $dbhs{$cxn}->{failed}
&& ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} );
my $sth;
@@ -7627,7 +7627,7 @@ sub do_query {
}
}
}
-
+
return $sth;
}
@@ -7892,17 +7892,17 @@ sub migrate_config {
# load_config {{{3
sub load_config {
-
+
my ($old_filename, $answer);
if ( $opts{u} or $opts{p} or $opts{h} or $opts{P} or $opts{S} ) {
my @params = $dsn_parser->get_cxn_params(\%opts); # dsn=$params[0]
- add_new_dsn($opts{h} || 'localhost', $params[0], 'test.innotop_dl',
+ add_new_dsn($opts{h} || 'localhost', $params[0], 'test.innotop_dl',
$opts{u} ? 1 : 0, $opts{u}, $opts{p} ? 1 : 0, $opts{p});
}
if ($opts{c}) {
$conf_file = $opts{c};
- }
+ }
# If we don't have a new config file but we do have an old one,
# innotop got upgraded and this is an old config file. Convert it, but
# don't overwrite something existing.
@@ -7930,14 +7930,14 @@ sub load_config {
$conf_file = $default_central_conf;
}
else {
- # If no config file was loaded, set readonly to 0 if the user wants to
+ # If no config file was loaded, set readonly to 0 if the user wants to
# write a config
$config{readonly}->{val} = 0 if $opts{w};
- # If no connections have been defined, connect to a MySQL database
+ # If no connections have been defined, connect to a MySQL database
# on localhost using mariadb_read_default_group=client
if (!%connections) {
- add_new_dsn('localhost',
- 'DBI:MariaDB:;host=localhost;mariadb_read_default_group=client',
+ add_new_dsn('localhost',
+ 'DBI:MariaDB:;host=localhost;mariadb_read_default_group=client',
'test.innotop_dl');
}
}
@@ -8476,7 +8476,7 @@ sub save_config {
elsif ($conf_file and $opts{w}) {
print "Loaded config file on start-up, so ignoring -w (see --help)\n"
}
-
+
my $dirname = dirname($conf_file);
# if directories don't exist, create them. This could cause errors
@@ -9819,7 +9819,7 @@ sub get_slave_status {
}
} else {
my $dbh = connect_to_db($cxn);
- my $sql = 'SHOW SLAVE STATUS FOR CHANNEL \'' . $channel . '\'';
+ my $sql = 'SHOW SLAVE STATUS FOR CHANNEL \'' . $channel . '\'';
my $stmt = $dbh->prepare($sql ) ;
$stmt->execute();
my $res = $stmt->fetchall_arrayref({});
@@ -9835,8 +9835,8 @@ sub get_slave_status {
}
}
}
-
-
+
+
sub is_func {
@@ -9902,8 +9902,8 @@ host, use the -h option.
After you've connected, innotop should show you something like the following:
[RO] Query List (? for help) localhost, 01:11:19, 449.44 QPS, 14/7/163 con/run
-
- CXN When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut
+
+ CXN When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut
localhost Total 0.00 1.07k 697 0.00% 98.17% 476.83k 242.83k
CXN Cmd ID User Host DB Time Query
@@ -10070,7 +10070,7 @@ L<"cmd_summary"> table, which looks something like the following:
Command Summary (? for help) localhost, 25+07:16:43, 2.45 QPS, 3 thd, 5.0.40
_____________________ Command Summary _____________________
- Name Value Pct Last Incr Pct
+ Name Value Pct Last Incr Pct
Select_scan 3244858 69.89% 2 100.00%
Select_range 1354177 29.17% 0 0.00%
Select_full_join 39479 0.85% 0 0.00%
@@ -11189,7 +11189,7 @@ L<"STATUS_VARIABLES">.
=item slave_io_status
-Displays data about the slave I/O thread. Data source:
+Displays data about the slave I/O thread. Data source:
L<"STATUS_VARIABLES">.
=item slave_sql_status
@@ -11438,8 +11438,8 @@ L<"processlist"> table when prompted).
Your display might now look like the following:
Query List (? for help) localhost, 32:33, 0.11 QPS, 1 thd, 5.0.38-log
-
- CXN Cmd Cnt ID User Host Time Query
+
+ CXN Cmd Cnt ID User Host Time Query
localhost Query 49 12933 webusr localhost 19:38 SELECT * FROM
localhost Sending Da 23 2383 webusr localhost 12:43 SELECT col1,
localhost Sleep 120 140 webusr localhost 5:18:12
@@ -11488,14 +11488,14 @@ matches the row; if it does, the row gets the specified color, and no further
rules are evaluated. The rules look like the following:
state eq Locked black on_red
- cmd eq Sleep white
- user eq system user white
- cmd eq Connect white
- cmd eq Binlog Dump white
- time > 600 red
- time > 120 yellow
- time > 60 green
- time > 30 cyan
+ cmd eq Sleep white
+ user eq system user white
+ cmd eq Connect white
+ cmd eq Binlog Dump white
+ time > 600 red
+ time > 120 yellow
+ time > 60 green
+ time > 30 cyan
This is the default rule set for the L<"processlist"> table. In order of
priority, these rules make locked queries black on a red background, "gray out"
@@ -11639,9 +11639,9 @@ screen, it will prompt you to choose one of them. Once you do, innotop will
show you something like this:
Editing table definition for Buffer Pool. Press ? for help, q to quit.
-
- name hdr label src
- cxn CXN Connection from which cxn
+
+ name hdr label src
+ cxn CXN Connection from which cxn
buf_pool_size Size Buffer pool size IB_bp_buf_poo
buf_free Free Bufs Buffers free in the b IB_bp_buf_fre
pages_total Pages Pages total IB_bp_pages_t
@@ -11931,15 +11931,15 @@ whitespace).
use strict;
use warnings FATAL => 'all';
-
+
package Innotop::Plugin::Example;
# description: Adds an 'example' column to every table
-
+
sub new {
my ( $class, %vars ) = @_;
# Store reference to innotop's variables in $self
my $self = bless { %vars }, $class;
-
+
# Design the example column
my $col = {
hdr => 'Example',
@@ -11951,7 +11951,7 @@ whitespace).
tbl => '',
trans => [],
};
-
+
# Add the column to every table.
my $tbl_meta = $vars{tbl_meta};
foreach my $tbl ( values %$tbl_meta ) {
@@ -11960,17 +11960,17 @@ whitespace).
# Add the column to the list of visible columns
unshift @{$tbl->{visible}}, 'example';
}
-
+
# Be sure to return a reference to the object.
return $self;
}
-
+
# I'd like to be called when a data set is being rendered into a table, please.
sub register_for_events {
my ( $self ) = @_;
return qw(set_to_tbl_pre_filter);
}
-
+
# This method will be called when the event fires.
sub set_to_tbl_pre_filter {
my ( $self, $rows, $tbl ) = @_;
@@ -11979,7 +11979,7 @@ whitespace).
$row->{example} = 1;
}
}
-
+
1;
=head2 Plugin Editor
@@ -12181,7 +12181,7 @@ Allen K. Smith,
Aurimas Mikalauskas,
Bartosz Fenski,
Brian Miezejewski,
-Christian Hammers,
+Christian Hammers,
Cyril Scetbon,
Dane Miller,
David Multer,
diff --git a/debian/additions/innotop/innotop.1 b/debian/additions/innotop/innotop.1
index fefea717cd6..65da5dc0dfb 100644
--- a/debian/additions/innotop/innotop.1
+++ b/debian/additions/innotop/innotop.1
@@ -193,8 +193,8 @@ After you've connected, innotop should show you something like the following:
.PP
.Vb 1
\& [RO] Query List (? for help) localhost, 01:11:19, 449.44 QPS, 14/7/163 con/run
-\&
-\& CXN When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut
+\&
+\& CXN When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut
\& localhost Total 0.00 1.07k 697 0.00% 98.17% 476.83k 242.83k
\&
\& CXN Cmd ID User Host DB Time Query
@@ -324,7 +324,7 @@ This mode is similar to mytop's Command Summary mode. It shows the
.Vb 8
\& Command Summary (? for help) localhost, 25+07:16:43, 2.45 QPS, 3 thd, 5.0.40
\& _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ Command Summary _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_
-\& Name Value Pct Last Incr Pct
+\& Name Value Pct Last Incr Pct
\& Select_scan 3244858 69.89% 2 100.00%
\& Select_range 1354177 29.17% 0 0.00%
\& Select_full_join 39479 0.85% 0 0.00%
@@ -1261,7 +1261,7 @@ Displays data about InnoDB's semaphores and mutexes. Data source:
\&\*(L"\s-1STATUS_VARIABLES\*(R"\s0.
.IP "slave_io_status" 4
.IX Item "slave_io_status"
-Displays data about the slave I/O thread. Data source:
+Displays data about the slave I/O thread. Data source:
\&\*(L"\s-1STATUS_VARIABLES\*(R"\s0.
.IP "slave_sql_status" 4
.IX Item "slave_sql_status"
@@ -1472,8 +1472,8 @@ Your display might now look like the following:
.PP
.Vb 1
\& Query List (? for help) localhost, 32:33, 0.11 QPS, 1 thd, 5.0.38\-log
-\&
-\& CXN Cmd Cnt ID User Host Time Query
+\&
+\& CXN Cmd Cnt ID User Host Time Query
\& localhost Query 49 12933 webusr localhost 19:38 SELECT * FROM
\& localhost Sending Da 23 2383 webusr localhost 12:43 SELECT col1,
\& localhost Sleep 120 140 webusr localhost 5:18:12
@@ -1526,13 +1526,13 @@ rules are evaluated. The rules look like the following:
.PP
.Vb 9
\& state eq Locked black on_red
-\& cmd eq Sleep white
-\& user eq system user white
-\& cmd eq Connect white
-\& cmd eq Binlog Dump white
-\& time > 600 red
-\& time > 120 yellow
-\& time > 60 green
+\& cmd eq Sleep white
+\& user eq system user white
+\& cmd eq Connect white
+\& cmd eq Binlog Dump white
+\& time > 600 red
+\& time > 120 yellow
+\& time > 60 green
\& time > 30 cyan
.Ve
.PP
@@ -1669,9 +1669,9 @@ show you something like this:
.PP
.Vb 1
\& Editing table definition for Buffer Pool. Press ? for help, q to quit.
-\&
-\& name hdr label src
-\& cxn CXN Connection from which cxn
+\&
+\& name hdr label src
+\& cxn CXN Connection from which cxn
\& buf_pool_size Size Buffer pool size IB_bp_buf_poo
\& buf_free Free Bufs Buffers free in the b IB_bp_buf_fre
\& pages_total Pages Pages total IB_bp_pages_t
@@ -1924,15 +1924,15 @@ whitespace).
.Vb 2
\& use strict;
\& use warnings FATAL => \*(Aqall\*(Aq;
-\&
+\&
\& package Innotop::Plugin::Example;
\& # description: Adds an \*(Aqexample\*(Aq column to every table
-\&
+\&
\& sub new {
\& my ( $class, %vars ) = @_;
\& # Store reference to innotop\*(Aqs variables in $self
\& my $self = bless { %vars }, $class;
-\&
+\&
\& # Design the example column
\& my $col = {
\& hdr => \*(AqExample\*(Aq,
@@ -1944,7 +1944,7 @@ whitespace).
\& tbl => \*(Aq\*(Aq,
\& trans => [],
\& };
-\&
+\&
\& # Add the column to every table.
\& my $tbl_meta = $vars{tbl_meta};
\& foreach my $tbl ( values %$tbl_meta ) {
@@ -1953,17 +1953,17 @@ whitespace).
\& # Add the column to the list of visible columns
\& unshift @{$tbl\->{visible}}, \*(Aqexample\*(Aq;
\& }
-\&
+\&
\& # Be sure to return a reference to the object.
\& return $self;
\& }
-\&
+\&
\& # I\*(Aqd like to be called when a data set is being rendered into a table, please.
\& sub register_for_events {
\& my ( $self ) = @_;
\& return qw(set_to_tbl_pre_filter);
\& }
-\&
+\&
\& # This method will be called when the event fires.
\& sub set_to_tbl_pre_filter {
\& my ( $self, $rows, $tbl ) = @_;
@@ -1972,7 +1972,7 @@ whitespace).
\& $row\->{example} = 1;
\& }
\& }
-\&
+\&
\& 1;
.Ve
.SS "Plugin Editor"
@@ -2137,7 +2137,7 @@ Allen K. Smith,
Aurimas Mikalauskas,
Bartosz Fenski,
Brian Miezejewski,
-Christian Hammers,
+Christian Hammers,
Cyril Scetbon,
Dane Miller,
David Multer,
diff --git a/debian/additions/mariadb.cnf b/debian/additions/mariadb.cnf
index 8b283e21d3f..62b4ea8f11e 100644
--- a/debian/additions/mariadb.cnf
+++ b/debian/additions/mariadb.cnf
@@ -1,6 +1,7 @@
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
+# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
@@ -11,15 +12,17 @@
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
+#
+# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/
#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
-
-socket = /run/mysqld/mysqld.sock
-#port = 3306
+# Port or socket location where to connect
+# port = 3306
+socket = /run/mysqld/mysqld.sock
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
diff --git a/debian/additions/mariadb.conf.d/50-client.cnf b/debian/additions/mariadb.conf.d/50-client.cnf
index 4b9bcf78089..54cfb44ac2d 100644
--- a/debian/additions/mariadb.conf.d/50-client.cnf
+++ b/debian/additions/mariadb.conf.d/50-client.cnf
@@ -4,15 +4,12 @@
#
[client]
-# Default is Latin1, if you need UTF-8 set this (also in server section)
-# default-character-set = utf8mb4
-
# Example of client certificate usage
-# ssl-cert=/etc/mysql/client-cert.pem
-# ssl-key=/etc/mysql/client-key.pem
+# ssl-cert = /etc/mysql/client-cert.pem
+# ssl-key = /etc/mysql/client-key.pem
#
# Allow only TLS encrypted connections
-# ssl-verify-server-cert=on
+# ssl-verify-server-cert = on
# This group is *never* read by mysql client library, though this
# /etc/mysql/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL
diff --git a/debian/additions/mariadb.conf.d/50-mysqld_safe.cnf b/debian/additions/mariadb.conf.d/50-mysqld_safe.cnf
index df8e82f5b3c..e24f96a9e65 100644
--- a/debian/additions/mariadb.conf.d/50-mysqld_safe.cnf
+++ b/debian/additions/mariadb.conf.d/50-mysqld_safe.cnf
@@ -9,12 +9,12 @@
# with the following contents:
#
# [Service]
-# User=mysql
-# StandardOutput=syslog
-# StandardError=syslog
-# SyslogFacility=daemon
-# SyslogLevel=err
-# SyslogIdentifier=mysqld
+# User = mysql
+# StandardOutput = syslog
+# StandardError = syslog
+# SyslogFacility = daemon
+# SyslogLevel = err
+# SyslogIdentifier = mysqld
#
# For more information, please read https://mariadb.com/kb/en/mariadb/systemd/
@@ -23,6 +23,6 @@
# It has been reported that passwords should be enclosed with ticks/quotes
# especially if they contain "#" chars...
-nice = 0
+nice = 0
skip_log_error
syslog
diff --git a/debian/additions/mariadb.conf.d/60-galera.cnf b/debian/additions/mariadb.conf.d/60-galera.cnf
index 945c05281c9..55d7c0b0322 100644
--- a/debian/additions/mariadb.conf.d/60-galera.cnf
+++ b/debian/additions/mariadb.conf.d/60-galera.cnf
@@ -2,19 +2,20 @@
# * Galera-related settings
#
# See the examples of server wsrep.cnf files in /usr/share/mysql
+# and read more at https://mariadb.com/kb/en/galera-cluster/
[galera]
# Mandatory settings
-#wsrep_on=ON
-#wsrep_provider=
-#wsrep_cluster_address=
-#binlog_format=row
-#default_storage_engine=InnoDB
-#innodb_autoinc_lock_mode=2
+#wsrep_on = ON
+#wsrep_provider =
+#wsrep_cluster_address =
+#binlog_format = row
+#default_storage_engine = InnoDB
+#innodb_autoinc_lock_mode = 2
# Allow server to accept connections on all interfaces.
-#bind-address=0.0.0.0
+#bind-address = 0.0.0.0
# Optional settings
-#wsrep_slave_threads=1
-#innodb_flush_log_at_trx_commit=0
+#wsrep_slave_threads = 1
+#innodb_flush_log_at_trx_commit = 0
diff --git a/debian/additions/mariadb.conf.d/99-enable-encryption.cnf.preset b/debian/additions/mariadb.conf.d/99-enable-encryption.cnf.preset
new file mode 120000
index 00000000000..53e8f5c645c
--- /dev/null
+++ b/debian/additions/mariadb.conf.d/99-enable-encryption.cnf.preset
@@ -0,0 +1 @@
+../../../support-files/rpm/enable_encryption.preset \ No newline at end of file
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh
index 3375bbf0fcd..4417f18ded0 100755
--- a/debian/autobake-deb.sh
+++ b/debian/autobake-deb.sh
@@ -2,6 +2,11 @@
#
# Build MariaDB .deb packages for test and release at mariadb.org
#
+# Purpose of this script:
+# Always keep the actual packaging as up-to-date as possible following the latest
+# Debian policy and targeting Debian Sid. Then case-by-case run in autobake-deb.sh
+# tests for backwards compatibility and strip away parts on older builders or
+# specfic build environments.
# Exit immediately on any error
set -e
@@ -17,21 +22,32 @@ if [[ $TRAVIS ]] || [[ $GITLAB_CI ]]
then
# On both Travis and Gitlab the output log must stay under 4MB so make the
# build less verbose
- sed -i -e '/Add support for verbose builds/,/^$/d' debian/rules
+ sed '/Add support for verbose builds/,/^$/d' -i debian/rules
+
+ # MCOL-4149: ColumnStore builds are so slow and big that they must be skipped on
+ # both Travis-CI and Gitlab-CI
+ sed 's|-DPLUGIN_COLUMNSTORE=YES|-DPLUGIN_COLUMNSTORE=NO|' -i debian/rules
+ sed "/Package: mariadb-plugin-columnstore/,/^$/d" -i debian/control
fi
-# Travis-CI optimizations to keep build small (in both duration and disk space)
+# Don't build or try to put files in a package for selected plugins and compontents on Travis-CI
+# in order to keep build small (in both duration and disk space)
if [[ $TRAVIS ]]
then
- # Don't include test suite package on Travis-CI to make the build time shorter
+ # Test suite package not relevant on Travis-CI
+ sed 's|DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test|DINSTALL_MYSQLTESTDIR=false|' -i debian/rules
sed '/Package: mariadb-test-data/,/^$/d' -i debian/control
sed '/Package: mariadb-test$/,/^$/d' -i debian/control
- # Don't build the test package at all to save time and disk space
- sed 's|DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test|DINSTALL_MYSQLTESTDIR=false|' -i debian/rules
-
- # Also skip building RocksDB, Mroonga etc to save even more time and disk space
- sed 's|-DDEB|-DPLUGIN_MROONGA=NO -DPLUGIN_SPIDER=NO -DPLUGIN_OQGRAPH=NO -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_SPHINX=NO -DDEB|' -i debian/rules
+ # Extra plugins such as Mroonga, Spider, OQgraph, Sphinx and the embedded build can safely be skipped
+ sed 's|-DDEB|-DPLUGIN_MROONGA=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_SPIDER=NO -DPLUGIN_OQGRAPH=NO -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_SPHINX=NO -DWITH_EMBEDDED_SERVER=OFF -DDEB|' -i debian/rules
+ sed "/Package: mariadb-plugin-mroonga/,/^$/d" -i debian/control
+ sed "/Package: mariadb-plugin-rocksdb/,/^$/d" -i debian/control
+ sed "/Package: mariadb-plugin-spider/,/^$/d" -i debian/control
+ sed "/Package: mariadb-plugin-oqgraph/,/^$/d" -i debian/control
+ sed "/ha_sphinx.so/d" -i debian/mariadb-server-10.6.install
+ sed "/Package: libmariadbd19/,/^$/d" -i debian/control
+ sed "/Package: libmariadbd-dev/,/^$/d" -i debian/control
fi
# Convert gcc version to numberical value. Format is Mmmpp where M is Major
@@ -41,19 +57,6 @@ GCCVERSION=$(gcc -dumpfullversion -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g
-e 's/\.\([0-9]\)/0\1/g' \
-e 's/^[0-9]\{3,4\}$/&00/')
-# Look up distro-version specific stuff
-#
-# Always keep the actual packaging as up-to-date as possible following the latest
-# Debian policy and targeting Debian Sid. Then case-by-case run in autobake-deb.sh
-# tests for backwards compatibility and strip away parts on older builders.
-
-# If libzstd-dev is not available (before Debian Stretch and Ubuntu Xenial)
-# remove the dependency from server and RocksDB so it can build properly
-if ! apt-cache madison libzstd-dev | grep 'libzstd-dev' >/dev/null 2>&1
-then
- sed '/libzstd-dev/d' -i debian/control
-fi
-
# If rocksdb-tools is not available (before Debian Buster and Ubuntu Disco)
# remove the dependency from the RocksDB plugin so it can install properly
# and instead ship the one built from MariaDB sources
@@ -70,38 +73,6 @@ then
sed 's/libcurl4/libcurl3/g' -i debian/control
fi
-# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
-# x86 32 bit.
-if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
-then
- sed '/Package: mariadb-plugin-rocksdb/,/^$/d' -i debian/control
- sed -i 's|-DPLUGIN_ROCKSDB=YES|-DPLUGIN_ROCKSDB=NO|' debian/rules
-fi
-
-# If libpcre2-dev is not available (before Debian Stretch and Ubuntu Xenial)
-# attempt to build using older libpcre3-dev (SIC!)
-if ! apt-cache madison libpcre2-dev | grep --quiet 'libpcre2-dev'
-then
- sed 's/libcurl4-openssl-dev | libcurl4-dev/libpcre3-dev/' -i debian/control
-fi
-
-# Mroonga, Spider etc never built on Travis CI anyway, see build flags above
-if [[ $TRAVIS ]]
-then
- sed -i -e "/Package: mariadb-plugin-mroonga/,/^$/d" debian/control
- sed -i -e "/Package: mariadb-plugin-spider/,/^$/d" debian/control
- sed -i -e "/Package: mariadb-plugin-oqgraph/,/^$/d" debian/control
- sed -i -e "/usr\/lib\/mysql\/plugin\/ha_sphinx.so/d" debian/mariadb-server-10.6.install
- sed -i -e "/Package: libmariadbd-dev/,/^$/d" debian/control
-fi
-
-if [[ $TRAVIS ]] || ! [[ $(arch) =~ 86 ]]
-then
- sed -i -e "/Package: mariadb-plugin-columnstore/,/^$/d" debian/control
- sed -i '/flex/d' debian/control
- sed -i 's|-DPLUGIN_COLUMNSTORE=YES|-DPLUGIN_COLUMNSTORE=NO|' debian/rules
-fi
-
# Adjust changelog, add new version
echo "Incrementing changelog and starting build scripts"
diff --git a/debian/control b/debian/control
index 79cfb9ef0e0..68f0c88da3b 100644
--- a/debian/control
+++ b/debian/control
@@ -9,10 +9,17 @@ Build-Depends: bison,
dh-apparmor,
dh-exec,
dh-systemd,
- flex,
+ flex [i386 amd64],
gdb,
libaio-dev [linux-any],
+ libboost-atomic-dev [i386 amd64],
+ libboost-chrono-dev [i386 amd64],
+ libboost-date-time-dev [i386 amd64],
libboost-dev,
+ libboost-filesystem-dev [i386 amd64],
+ libboost-regex-dev [i386 amd64],
+ libboost-system-dev [i386 amd64],
+ libboost-thread-dev [i386 amd64],
libcrack2-dev (>= 2.9.0),
libcurl4-openssl-dev | libcurl4-dev,
libedit-dev,
@@ -490,8 +497,7 @@ Package: mariadb-server-10.6
Architecture: any
Suggests: mailx,
mariadb-test,
- netcat-openbsd,
- tinyca
+ netcat-openbsd
Recommends: libhtml-template-perl
Pre-Depends: adduser (>= 3.40),
debconf,
@@ -642,12 +648,15 @@ Depends: libcurl4,
mariadb-server-10.6 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
-Description: S3 storage engine for MariaDB
- Read only table stored in S3.
+Description: Amazon S3 archival storage engine for MariaDB
+ The S3 storage engine allows one to archive MariaDB tables in Amazon S3 (or any
+ third-party public or private cloud that implements S3 API), but still have
+ them accessible in MariaDB in read-only mode.
Package: mariadb-plugin-rocksdb
Architecture: amd64 arm64 mips64el ppc64el
Depends: mariadb-server-10.6 (= ${binary:Version}),
+ python3,
rocksdb-tools,
${misc:Depends},
${shlibs:Depends}
@@ -665,11 +674,11 @@ Description: RocksDB storage engine for MariaDB
Package: mariadb-plugin-columnstore
Architecture: amd64 i386
-Depends: mariadb-server-10.6 (= ${binary:Version}),
- net-tools,
- binutils,
- libsnappy1 | libsnappy1v5,
+Depends: binutils,
libjemalloc1 | libjemalloc2,
+ libsnappy1 | libsnappy1v5,
+ mariadb-server-10.6 (= ${binary:Version}),
+ net-tools,
python3,
${misc:Depends},
${shlibs:Depends}
diff --git a/debian/mariadb-plugin-columnstore.install b/debian/mariadb-plugin-columnstore.install
index cd4461fe308..3b4c9619dc6 100644
--- a/debian/mariadb-plugin-columnstore.install
+++ b/debian/mariadb-plugin-columnstore.install
@@ -18,7 +18,6 @@ usr/bin/ProcMon
usr/bin/ServerMonitor
usr/bin/StorageManager
usr/bin/WriteEngineServer
-usr/bin/dbmsReport.sh
usr/bin/autoConfigure
usr/bin/bulklogReport.sh
usr/bin/clearShm
@@ -42,6 +41,7 @@ usr/bin/cpimport
usr/bin/cpimport.bin
usr/bin/cplogger
usr/bin/dbbuilder
+usr/bin/dbmsReport.sh
usr/bin/dbrmctl
usr/bin/ddlcleanup
usr/bin/disable-rep-columnstore.sh
@@ -51,8 +51,11 @@ usr/bin/hardwareReport.sh
usr/bin/idbmeminfo
usr/bin/load_brm
usr/bin/logReport.sh
+usr/bin/mariadb-columnstore-start.sh
+usr/bin/mariadb-columnstore-stop.sh
usr/bin/mariadb-command-line.sh
usr/bin/master-rep-columnstore.sh
+usr/bin/mcs-loadbrm.py
usr/bin/mcs-stop-controllernode.sh
usr/bin/mcsGetConfig
usr/bin/mcsSetConfig
@@ -82,10 +85,6 @@ usr/bin/smrm
usr/bin/startupTests.sh
usr/bin/viewtablelock
usr/bin/workernode
-usr/bin/mcs-start-storagemanager.py
-usr/bin/mcs-loadbrm.py
-usr/bin/mariadb-columnstore-start.sh
-usr/bin/mariadb-columnstore-stop.sh
usr/lib/*/libalarmmanager.so
usr/lib/*/libbatchloader.so
usr/lib/*/libbrm.so
@@ -146,9 +145,9 @@ usr/share/columnstore/mcs-dmlproc.service
usr/share/columnstore/mcs-exemgr.service
usr/share/columnstore/mcs-loadbrm.service
usr/share/columnstore/mcs-primproc.service
+usr/share/columnstore/mcs-storagemanager.service
usr/share/columnstore/mcs-workernode.service
usr/share/columnstore/mcs-writeengineserver.service
-usr/share/columnstore/mcs-storagemanager.service
usr/share/columnstore/mcstest-001.sh
usr/share/columnstore/mcstest-002.sh
usr/share/columnstore/mcstest-003.sh
diff --git a/debian/mariadb-plugin-columnstore.postinst b/debian/mariadb-plugin-columnstore.postinst
index b482002c9dc..97a1bba22c8 100644
--- a/debian/mariadb-plugin-columnstore.postinst
+++ b/debian/mariadb-plugin-columnstore.postinst
@@ -3,8 +3,6 @@
set -e
# Install ColumnStore
-columnstore-post-install --rpmmode=install
-
-echo "MariaDB ColumnStore install completed"
+columnstore-post-install install
#DEBHELPER#
diff --git a/debian/mariadb-plugin-columnstore.postrm b/debian/mariadb-plugin-columnstore.postrm
index cd8decbfe76..b2e19774ec1 100644
--- a/debian/mariadb-plugin-columnstore.postrm
+++ b/debian/mariadb-plugin-columnstore.postrm
@@ -8,22 +8,17 @@ if [ "$1" = "purge" ]; then
rm -f /etc/mysql/mariadb.conf.d/columnstore.cnf.rpmsave
fi
-running_systemd() {
- if [ "$(ps --no-headers -o comm 1)" = "systemd" ]; then
- echo 0
- else
- echo 1
- fi
-}
-
-if [ ! -z "$(pgrep -x mysqld)" ];then
- systemctl cat mariadb.service > /dev/null 2>&1
- if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
- systemctl restart mariadb.service > /dev/null 2>&1
- else
- pkill mysqld > /dev/null 2>&1
- /usr/bin/mysqld_safe &
+# Automatically restart MariaDB after ColumnStore plugin has been removed
+case "$1" in
+ purge|remove|disappear)
+ if [ -d /run/systemd/system ]; then
+ # If systemd
+ deb-systemd-invoke restart mariadb.service >/dev/null
+ elif [ -x "/etc/init.d/mariadb" ]; then
+ # Fall-back to SysV init
+ invoke-rc.d mariadb restart || exit $?
fi
-fi
+ ;;
+esac
#DEBHELPER#
diff --git a/debian/mariadb-plugin-columnstore.prerm b/debian/mariadb-plugin-columnstore.prerm
index 10e585a887b..f6a27f14499 100644
--- a/debian/mariadb-plugin-columnstore.prerm
+++ b/debian/mariadb-plugin-columnstore.prerm
@@ -4,6 +4,5 @@ set -e
columnstore-pre-uninstall
-exit 0
#DEBHELPER#
diff --git a/debian/mariadb-plugin-columnstore.triggers b/debian/mariadb-plugin-columnstore.triggers
new file mode 100644
index 00000000000..dd866036784
--- /dev/null
+++ b/debian/mariadb-plugin-columnstore.triggers
@@ -0,0 +1 @@
+activate-noawait ldconfig
diff --git a/debian/mariadb-plugin-cracklib-password-check.install b/debian/mariadb-plugin-cracklib-password-check.install
index 5419f05ed3d..6592c7f461b 100644
--- a/debian/mariadb-plugin-cracklib-password-check.install
+++ b/debian/mariadb-plugin-cracklib-password-check.install
@@ -1,2 +1,2 @@
-etc/mysql/mariadb.conf.d/cracklib_password_check.cnf
+etc/mysql/mariadb.conf.d/cracklib_password_check.cnf
usr/lib/mysql/plugin/cracklib_password_check.so
diff --git a/debian/mariadb-plugin-gssapi-server.install b/debian/mariadb-plugin-gssapi-server.install
index 70916b49052..8261db789f7 100644
--- a/debian/mariadb-plugin-gssapi-server.install
+++ b/debian/mariadb-plugin-gssapi-server.install
@@ -1,2 +1,2 @@
-etc/mysql/mariadb.conf.d/auth_gssapi.cnf
+etc/mysql/mariadb.conf.d/auth_gssapi.cnf
usr/lib/mysql/plugin/auth_gssapi.so
diff --git a/debian/mariadb-plugin-rocksdb.lintian-overrides b/debian/mariadb-plugin-rocksdb.lintian-overrides
deleted file mode 100644
index bc2ec13dbf9..00000000000
--- a/debian/mariadb-plugin-rocksdb.lintian-overrides
+++ /dev/null
@@ -1,2 +0,0 @@
-# Overridden temporarily to get Salsa-CI pass and not stall other dev work with broken pipeline
-python-script-but-no-python-dep usr/bin/myrocks_hotbackup #!python
diff --git a/debian/mariadb-plugin-s3.install b/debian/mariadb-plugin-s3.install
index a6f90b76f82..b951e49dd0b 100644
--- a/debian/mariadb-plugin-s3.install
+++ b/debian/mariadb-plugin-s3.install
@@ -1,3 +1,4 @@
etc/mysql/mariadb.conf.d/s3.cnf
usr/bin/aria_s3_copy
usr/lib/mysql/plugin/ha_s3.so
+usr/share/man/man1/aria_s3_copy.1
diff --git a/debian/mariadb-server-10.6.postrm b/debian/mariadb-server-10.6.postrm
index 00ff90dbb20..97789a038df 100644
--- a/debian/mariadb-server-10.6.postrm
+++ b/debian/mariadb-server-10.6.postrm
@@ -18,9 +18,12 @@ stop_server() {
# Return immediately if there are no mysql processes running
# as there is no point in trying to shutdown in that case.
if ! pgrep -x mariadbd > /dev/null; then return; fi
+ # Compatibility with versions that ran 'mysqld'
+ if ! pgrep -x mysqld > /dev/null; then return; fi
set +e
invoke-rc.d mariadb stop
+ invoke-rc.d mysql stop # Backwards compatibility
errno=$?
set -e
diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.6.preinst
index ce4ca3fee9d..919031066c9 100644
--- a/debian/mariadb-server-10.6.preinst
+++ b/debian/mariadb-server-10.6.preinst
@@ -31,9 +31,12 @@ stop_server() {
# Return immediately if there are no mysql processes running
# as there is no point in trying to shutdown in that case.
if ! pgrep -x --ns $$ mariadbd > /dev/null; then return; fi
+ # Compatibility with versions that ran 'mysqld'
+ if ! pgrep -x --ns $$ mysqld > /dev/null; then return; fi
set +e
invoke-rc.d mariadb stop
+ invoke-rc.d mysql stop # Backwards compatibility
errno=$?
set -e
diff --git a/debian/not-installed b/debian/not-installed
index e928b821bcf..4bce7f084c2 100644
--- a/debian/not-installed
+++ b/debian/not-installed
@@ -1,12 +1,17 @@
+etc/columnstore/storagemanager.cnf.example # Copy of etc/columnstore/storagemanager.cnf that is installed
lib/systemd/system/mariadb.service # Installed by rules file
lib/systemd/system/mariadb@.service # Installed by rules file
usr/bin/mysql_config # We already have the MariaDB variant
usr/bin/mytop # Mytop is distributed from a separate source package
usr/bin/sst_dump # Use the one from rocksdb-tools package
-usr/lib/sysusers.d/sysusers.conf
-usr/lib/tmpfiles.d/tmpfiles.conf
usr/lib/mysql/plugin/JavaWrappers.jar # These are only built if JNI/libjawt.so is installed from e.g. openjdk-8-jre-headless
usr/lib/mysql/plugin/JdbcInterface.jar # These are only built if JNI/libjawt.so is installed from e.g. openjdk-8-jre-headless
+usr/lib/sysusers.d/sysusers.conf
+usr/lib/tmpfiles.d/tmpfiles.conf
+usr/lib/*/libdbbc.a # ColumnStore header file
+usr/lib/*/libidbboot.a # ColumnStore header file
+usr/lib/*/libprocessor.a # ColumnStore header file
+usr/lib/*/libwe_xml.a # ColumnStore header file
usr/share/doc/mariadb-server-10.6/COPYING
usr/share/doc/mariadb-server-10.6/COPYING.AGPLv3
usr/share/doc/mariadb-server-10.6/COPYING.GPLv2
diff --git a/debian/rules b/debian/rules
index 92a1fd5a136..0684cbfd05a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,12 +1,10 @@
#!/usr/bin/make -f
-export DH_VERBOSE=1
-export DEB_BUILD_HARDENING=1
-
-# enable Debian Hardening
-# see: https://wiki.debian.org/Hardening
+# Enable Debian Hardening
+# https://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
+# Include all defaults, including buildflags.mk
include /usr/share/dpkg/default.mk
# CPPFLAGS are nor read by CMake, so copy them to CXXFLAGS
# See why at https://cmake.org/Bug/view.php?id=12928
@@ -22,6 +20,12 @@ TMP:=$(CURDIR)/debian/tmp
CC := $(DEB_HOST_GNU_TYPE)-gcc
CXX := $(DEB_HOST_GNU_TYPE)-g++
+# According to Debian Policy version 4.2.0 builds should be as verbose as
+# possible unless 'terse' is specifically passed.
+ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
+ export DH_VERBOSE=1
+endif
+
# Parallel build support as advised
# at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
@@ -39,6 +43,17 @@ else
TESTSUITE_FAIL_CMD:=exit 1
endif
+# RocksDB cannot build on 32-bit platforms
+ifeq (32,$(DEB_HOST_ARCH_BITS))
+ CMAKEFLAGS += -DWITHOUT_ROCKSDB=true
+endif
+
+# ColumnStore only attempts to build on a few platforms as dictated by CMake checks
+# Also note in debian/control the CS-only build deps marked '[i386 amd64]'
+ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),amd64 i386))
+ CMAKEFLAGS += -DPLUGIN_COLUMNSTORE=YES
+endif
+
# Add extra flag to avoid WolfSSL code crashing the entire mariadbd on s390x. This
# can be removed once upstream has made the code s390x compatible, see
# https://jira.mariadb.org/browse/MDEV-21705 and
@@ -81,11 +96,7 @@ endif
-DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \
-DBUILD_CONFIG=mysql_release \
- -DPLUGIN_TOKUDB=NO \
- -DPLUGIN_COLUMNSTORE=YES \
- -DPLUGIN_ROCKSDB=YES \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
- -WITH_EMBEDDED_SERVER=OFF \
-DDEB=$(DEB_VENDOR) ..'
# This is needed, otherwise 'make test' will run before binaries have been built
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
index 1a62bb2b52b..f62358a1e48 100644
--- a/debian/salsa-ci.yml
+++ b/debian/salsa-ci.yml
@@ -33,7 +33,8 @@ build:
- export CCACHE_DIR="${CCACHE_TMP_DIR}"
- update-ccache-symlinks; ccache -z # Zero out ccache counters
- mk-build-deps debian/control -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends" -r -i
- - debian/autobake-deb.sh
+ - while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent
+ - debian/autobake-deb.sh |& tail -n 10000 # Keep Gitlab-CI output under 4 MB
- cd ..; rm -rfv *.tmp # Clean away build files not to store as artifacts
- cp -v *.* ${WORKING_DIR}/
- du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB.
@@ -72,7 +73,6 @@ autopkgtest:
piuparts:
extends: .test-piuparts
stage: test extras
- allow_failure: true
blhc:
extends: .test-blhc
@@ -83,11 +83,9 @@ blhc:
lintian:
extends: .test-lintian
- allow_failure: true
missing-breaks:
extends: .test-missing-breaks
- allow_failure: true
# In addition to Salsa-CI, also run these fully MariaDB specific build jobs
@@ -123,7 +121,6 @@ fresh install:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
mariadb-10.3.x to mariadb-10.6.y upgrade:
stage: upgrade in Sid
@@ -164,7 +161,6 @@ mariadb-10.3.x to mariadb-10.6.y upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
mariadb-10.3.x buster to mariadb-10.6 upgrade:
stage: upgrade from Buster/Stretch/Jessie
@@ -209,7 +205,6 @@ mariadb-10.3.x buster to mariadb-10.6 upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
mariadb-10.1 to mariadb-10.6 upgrade:
stage: upgrade from Buster/Stretch/Jessie
@@ -254,7 +249,6 @@ mariadb-10.1 to mariadb-10.6 upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
test basic features:
stage: test
@@ -310,7 +304,6 @@ test basic features:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
# Build a piece of software that was designed for libmysqlclient-dev but using the
# libmariadb-dev-compat layer. Should always end up using libmariadb.so.3 run-time.
@@ -334,7 +327,6 @@ build mariadbclient consumer Python-MySQLdb:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
libmysql* to libmariadb* upgrade:
stage: test extras
@@ -374,7 +366,6 @@ libmysql* to libmariadb* upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
default-libmysqlclient-dev upgrade:
stage: upgrade in Sid
@@ -401,7 +392,6 @@ default-libmysqlclient-dev upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
default-libmysqlclient-dev on buster upgrade:
stage: upgrade from Buster/Stretch/Jessie
@@ -430,7 +420,6 @@ default-libmysqlclient-dev on buster upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
default-libmysqlclient-dev on stretch upgrade:
stage: upgrade from Buster/Stretch/Jessie
@@ -459,7 +448,6 @@ default-libmysqlclient-dev on stretch upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
mariadb-connector-c on stretch upgrade:
stage: upgrade from Buster/Stretch/Jessie
@@ -488,7 +476,6 @@ mariadb-connector-c on stretch upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
mysql-5.5 to mariadb-10.6 upgrade:
stage: upgrade from Buster/Stretch/Jessie
@@ -533,7 +520,6 @@ mysql-5.5 to mariadb-10.6 upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
# Upgrading from MySQL 5.7 involves automatic renaming of auth_socket plugin
# to unix_socket and automaticly re-adding Password column in user table.
@@ -580,7 +566,6 @@ mysql-5.7 to mariadb-10.6 upgrade:
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
- allow_failure: true
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
@@ -647,17 +632,14 @@ mariadb.org-10.5.x to mariadb-10.6 upgrade:
- sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- apt-get update
- - apt install -y curl systemctl # systemctl shim needed on platforms that don't have systemd
+ - apt install -y curl
- curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
- echo 'deb [arch=amd64,i386] http://mirror.one.com/mariadb/repo/10.5/debian sid main' > /etc/apt/sources.list.d/mariadb.list
- apt-get update
- apt-get install -y mariadb-server-10.5
# Verify installation of MySQL from Sid
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- # MariaDB.org version of 10.4 and early 10.5 do not install an init file, so
- # it must be installed here manually
- - cp /usr/share/mysql/mysql.init /etc/init.d/mysql; chmod +x /etc/init.d/mysql; service mysql start; sleep 5
- - service mysql status
+ - service mariadb status
- mysql --skip-column-names -e "SELECT @@version, @@version_comment"
- mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql
- mysql -e "SELECT * FROM plugin;" mysql
@@ -667,7 +649,6 @@ mariadb.org-10.5.x to mariadb-10.6 upgrade:
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- - service mysql status
- service mariadb status
- mkdir -p debug # Ensure dir exists before using it
- find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory"
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
index c8adb576864..aff88487254 100644
--- a/debian/source/lintian-overrides
+++ b/debian/source/lintian-overrides
@@ -1,5 +1,3 @@
-# Upstream fix pending: https://github.com/wolfSSL/wolfssl/pull/2785
-source-is-missing extra/wolfssl/wolfssl/doc/formats/html/html_changes/menu.js line length is 679 characters (>512)
# Necessary for drop-in-place-replacement upgrades on mysql-server/-client
# since package breaks/replaces these but at the same time also provides them
version-substvar-for-external-package mariadb-client-core-10.6 -> mysql-client-5.5
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 6fe26c4e4be..5e1e042f6ed 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -66,6 +66,7 @@ const char *empty_string= ""; /* For empty states */
*/
const char *default_language= "eng";
+my_bool default_language_changed= 0;
uint er_offset= 1000;
my_bool info_flag= 0;
@@ -440,7 +441,8 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
struct errors *tmp_error, *next_error;
uint count, i;
- my_free((void*) default_language);
+ if (default_language_changed)
+ my_free((void*) default_language);
for (tmp_lang= lang_head; tmp_lang; tmp_lang= next_language)
{
@@ -562,6 +564,7 @@ static uint parse_input_file(const char *file_name, struct errors **top_error,
"Failed to parse the default language line. Aborting\n");
DBUG_RETURN(0);
}
+ default_language_changed= 1;
continue;
}
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index f4c793fc1d8..650ab49fbcd 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -244,14 +244,6 @@ static char* innobase_ignored_opt;
char* innobase_data_home_dir;
char* innobase_data_file_path;
-/* The following counter is used to convey information to InnoDB
-about server activity: in selects it is not sensible to call
-srv_active_wake_master_thread after each fetch or search, we only do
-it every INNOBASE_WAKE_INTERVAL'th step. */
-
-#define INNOBASE_WAKE_INTERVAL 32
-ulong innobase_active_counter = 0;
-
#ifndef _WIN32
static char *xtrabackup_debug_sync = NULL;
#endif
@@ -5384,7 +5376,6 @@ static bool xtrabackup_prepare_func(char** argv)
xb_filters_init();
srv_log_group_home_dir = NULL;
- srv_thread_concurrency = 1;
if (xtrabackup_incremental) {
srv_operation = SRV_OPERATION_RESTORE_DELTA;
diff --git a/include/ilist.h b/include/ilist.h
index 74cb472cd4e..822f0334022 100644
--- a/include/ilist.h
+++ b/include/ilist.h
@@ -16,7 +16,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
*/
-#pragma once
+#ifndef ILIST_H
+#define ILIST_H
#include <cstddef>
#include <iterator>
@@ -24,15 +25,17 @@
// Derive your class from this struct to insert to a linked list.
template <class Tag= void> struct ilist_node
{
- ilist_node()
+ ilist_node() noexcept
#ifndef DBUG_OFF
- :
- next(NULL), prev(NULL)
+ : next(NULL), prev(NULL)
#endif
{
}
- ilist_node(ilist_node *next, ilist_node *prev) : next(next), prev(prev) {}
+ ilist_node(ilist_node *next, ilist_node *prev) noexcept
+ : next(next), prev(prev)
+ {
+ }
ilist_node *next;
ilist_node *prev;
@@ -70,40 +73,40 @@ public:
typedef T *pointer;
typedef T &reference;
- Iterator(ListNode *node) : node_(node) {}
+ Iterator(ListNode *node) noexcept : node_(node) {}
- Iterator &operator++()
+ Iterator &operator++() noexcept
{
node_= node_->next;
return *this;
}
- Iterator operator++(int)
+ Iterator operator++(int) noexcept
{
Iterator tmp(*this);
operator++();
return tmp;
}
- Iterator &operator--()
+ Iterator &operator--() noexcept
{
node_= node_->prev;
return *this;
}
- Iterator operator--(int)
+ Iterator operator--(int) noexcept
{
Iterator tmp(*this);
operator--();
return tmp;
}
- reference operator*() { return *static_cast<pointer>(node_); }
- pointer operator->() { return static_cast<pointer>(node_); }
+ reference operator*() noexcept { return *static_cast<pointer>(node_); }
+ pointer operator->() noexcept { return static_cast<pointer>(node_); }
- friend bool operator==(const Iterator &lhs, const Iterator &rhs)
+ friend bool operator==(const Iterator &lhs, const Iterator &rhs) noexcept
{
return lhs.node_ == rhs.node_;
}
- friend bool operator!=(const Iterator &lhs, const Iterator &rhs)
+ friend bool operator!=(const Iterator &lhs, const Iterator &rhs) noexcept
{
return !(lhs == rhs);
}
@@ -114,30 +117,36 @@ public:
friend class ilist;
};
- ilist() : sentinel_(&sentinel_, &sentinel_) {}
+ ilist() noexcept : sentinel_(&sentinel_, &sentinel_) {}
- reference front() { return *begin(); }
- reference back() { return *--end(); }
- const_reference front() const { return *begin(); }
- const_reference back() const { return *--end(); }
+ reference front() noexcept { return *begin(); }
+ reference back() noexcept { return *--end(); }
+ const_reference front() const noexcept { return *begin(); }
+ const_reference back() const noexcept { return *--end(); }
- iterator begin() { return iterator(sentinel_.next); }
- const_iterator begin() const
+ iterator begin() noexcept { return iterator(sentinel_.next); }
+ const_iterator begin() const noexcept
{
return iterator(const_cast<ListNode *>(sentinel_.next));
}
- iterator end() { return iterator(&sentinel_); }
- const_iterator end() const
+ iterator end() noexcept { return iterator(&sentinel_); }
+ const_iterator end() const noexcept
{
return iterator(const_cast<ListNode *>(&sentinel_));
}
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const { return reverse_iterator(end()); }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const { return reverse_iterator(begin()); }
+ reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }
+ const_reverse_iterator rbegin() const noexcept
+ {
+ return reverse_iterator(end());
+ }
+ reverse_iterator rend() noexcept { return reverse_iterator(begin()); }
+ const_reverse_iterator rend() const noexcept
+ {
+ return reverse_iterator(begin());
+ }
- bool empty() const { return sentinel_.next == &sentinel_; }
+ bool empty() const noexcept { return sentinel_.next == &sentinel_; }
// Not implemented because it's O(N)
// size_type size() const
@@ -145,13 +154,13 @@ public:
// return static_cast<size_type>(std::distance(begin(), end()));
// }
- void clear()
+ void clear() noexcept
{
sentinel_.next= &sentinel_;
sentinel_.prev= &sentinel_;
}
- iterator insert(iterator pos, reference value)
+ iterator insert(iterator pos, reference value) noexcept
{
ListNode *curr= pos.node_;
ListNode *prev= pos.node_->prev;
@@ -165,7 +174,7 @@ public:
return iterator(&value);
}
- iterator erase(iterator pos)
+ iterator erase(iterator pos) noexcept
{
ListNode *prev= pos.node_->prev;
ListNode *next= pos.node_->next;
@@ -182,15 +191,15 @@ public:
return next;
}
- void push_back(reference value) { insert(end(), value); }
- void pop_back() { erase(end()); }
+ void push_back(reference value) noexcept { insert(end(), value); }
+ void pop_back() noexcept { erase(end()); }
- void push_front(reference value) { insert(begin(), value); }
- void pop_front() { erase(begin()); }
+ void push_front(reference value) noexcept { insert(begin(), value); }
+ void pop_front() noexcept { erase(begin()); }
// STL version is O(n) but this is O(1) because an element can't be inserted
// several times in the same ilist.
- void remove(reference value) { erase(iterator(&value)); }
+ void remove(reference value) noexcept { erase(iterator(&value)); }
private:
ListNode sentinel_;
@@ -216,36 +225,38 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const iterator> const_reverse_iterator;
- sized_ilist() : size_(0) {}
+ sized_ilist() noexcept : size_(0) {}
- size_type size() const { return size_; }
+ size_type size() const noexcept { return size_; }
- void clear()
+ void clear() noexcept
{
BASE::clear();
size_= 0;
}
- iterator insert(iterator pos, reference value)
+ iterator insert(iterator pos, reference value) noexcept
{
++size_;
return BASE::insert(pos, value);
}
- iterator erase(iterator pos)
+ iterator erase(iterator pos) noexcept
{
--size_;
return BASE::erase(pos);
}
- void push_back(reference value) { insert(BASE::end(), value); }
- void pop_back() { erase(BASE::end()); }
+ void push_back(reference value) noexcept { insert(BASE::end(), value); }
+ void pop_back() noexcept { erase(BASE::end()); }
- void push_front(reference value) { insert(BASE::begin(), value); }
- void pop_front() { erase(BASE::begin()); }
+ void push_front(reference value) noexcept { insert(BASE::begin(), value); }
+ void pop_front() noexcept { erase(BASE::begin()); }
- void remove(reference value) { erase(iterator(&value)); }
+ void remove(reference value) noexcept { erase(iterator(&value)); }
private:
size_type size_;
};
+
+#endif
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 8440efa971c..59ac7814aee 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -226,9 +226,14 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_CHARSET_UNDEFINED 0
/* Character repertoire flags */
-#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
-#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
-#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
+typedef enum enum_repertoire_t
+{
+ MY_REPERTOIRE_NONE= 0,
+ MY_REPERTOIRE_ASCII= 1, /* Pure ASCII U+0000..U+007F */
+ MY_REPERTOIRE_EXTENDED= 2, /* Extended characters: U+0080..U+FFFF */
+ MY_REPERTOIRE_UNICODE30= 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
+} my_repertoire_t;
+
/* Flags for strxfrm */
#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */
@@ -1420,14 +1425,15 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
typedef struct
{
size_t char_length;
- uint repertoire;
+ my_repertoire_t repertoire;
} MY_STRING_METADATA;
void my_string_metadata_get(MY_STRING_METADATA *metadata,
CHARSET_INFO *cs, const char *str, size_t len);
-uint my_string_repertoire(CHARSET_INFO *cs, const char *str, size_t len);
+my_repertoire_t my_string_repertoire(CHARSET_INFO *cs,
+ const char *str, size_t len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
-uint my_charset_repertoire(CHARSET_INFO *cs);
+my_repertoire_t my_charset_repertoire(CHARSET_INFO *cs);
uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
diff --git a/include/my_global.h b/include/my_global.h
index 5d80b3881d4..86ef5f882f6 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -796,6 +796,8 @@ inline unsigned long long my_double2ulonglong(double d)
#define LONGLONG_MIN ((long long) 0x8000000000000000LL)
#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL)
#endif
+/* Max length needed for a buffer to hold a longlong or ulonglong + end \0 */
+#define LONGLONG_BUFFER_SIZE 21
#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)
/* First check for ANSI C99 definition: */
diff --git a/include/my_rdtsc.h b/include/my_rdtsc.h
index a2e5afcb79f..33d722764d4 100644
--- a/include/my_rdtsc.h
+++ b/include/my_rdtsc.h
@@ -77,7 +77,7 @@ C_MODE_START
/**
A cycle timer.
- On clang, we use __builtin_readcyclecounter().
+ On clang we use __builtin_readcyclecounter(), except for AARCH64.
On other compilers:
On IA-32 and AMD64, we use the RDTSC instruction.
@@ -88,6 +88,9 @@ C_MODE_START
On IBM S/390 System z we use the STCK instruction.
On ARM, we probably should use the Generic Timer, but should figure out
how to ensure that it can be accessed.
+ On AARCH64, we use the generic timer base register. We override clang
+ implementation for aarch64 as it access a PMU register which is not
+ guarenteed to be active.
Sadly, we have nothing for the Digital Alpha, MIPS, Motorola m68k,
HP PA-RISC or other non-mainstream (or obsolete) processors.
@@ -125,7 +128,7 @@ C_MODE_START
*/
static inline ulonglong my_timer_cycles(void)
{
-# if __has_builtin(__builtin_readcyclecounter)
+# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
return __builtin_readcyclecounter();
# elif defined _WIN32 || defined __i386__ || defined __x86_64__
return __rdtsc();
@@ -164,6 +167,12 @@ static inline ulonglong my_timer_cycles(void)
__asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
return result;
}
+#elif defined(__GNUC__) && defined (__aarch64__)
+ {
+ ulonglong result;
+ __asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result));
+ return result;
+ }
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
/* gethrtime may appear as either cycle or nanosecond counter */
return (ulonglong) gethrtime();
@@ -221,6 +230,7 @@ C_MODE_END
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_S390 28
+#define MY_TIMER_ROUTINE_AARCH64 29
#endif
diff --git a/include/my_sys.h b/include/my_sys.h
index 7cd417fd9cb..9e26aa4f8f4 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -915,6 +915,9 @@ extern MYSQL_PLUGIN_IMPORT my_crc32_t my_checksum;
#if defined(__GNUC__) && defined(HAVE_ARMV8_CRC)
int crc32_aarch64_available(void);
+#if defined(HAVE_ARMV8_CRYPTO)
+int crc32c_aarch64_available(void);
+#endif
#endif
#ifdef DBUG_ASSERT_EXISTS
@@ -1053,9 +1056,13 @@ extern my_bool resolve_collation(const char *cl_name,
CHARSET_INFO **cl);
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
-extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
+static inline my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
+{
+ return (cs1->csname == cs2->csname);
+}
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(struct charset_info_st *cs);
+extern void add_compiled_extra_collation(struct charset_info_st *cs);
extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
char *to, size_t to_length,
const char *from, size_t length);
diff --git a/include/my_time.h b/include/my_time.h
index bad2b8bf4b0..b7b54db5586 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -233,9 +233,16 @@ static inline long my_time_fraction_remainder(long nr, uint decimals)
DBUG_ASSERT(decimals <= TIME_SECOND_PART_DIGITS);
return nr % (long) log_10_int[TIME_SECOND_PART_DIGITS - decimals];
}
+static inline void my_datetime_trunc(MYSQL_TIME *ltime, uint decimals)
+{
+ ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
+}
static inline void my_time_trunc(MYSQL_TIME *ltime, uint decimals)
{
ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
+ if (!ltime->second_part && ltime->neg &&
+ !ltime->hour && !ltime->minute && !ltime->second)
+ ltime->neg= FALSE;
}
static inline void my_timeval_trunc(struct timeval *tv, uint decimals)
{
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index 765c5aa7793..aa85daaaab1 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -1135,10 +1135,14 @@ inline_mysql_socket_accept
#else
socket_accept.fd= accept(socket_listen.fd, addr, addr_len);
#ifdef FD_CLOEXEC
- flags= fcntl(socket_accept.fd, F_GETFD);
- if (flags != -1) {
- flags |= FD_CLOEXEC;
- fcntl(socket_accept.fd, F_SETFD, flags);
+ if (socket_accept.fd != INVALID_SOCKET)
+ {
+ flags= fcntl(socket_accept.fd, F_GETFD);
+ if (flags != -1)
+ {
+ flags |= FD_CLOEXEC;
+ fcntl(socket_accept.fd, F_SETFD, flags);
+ }
}
#endif
#endif
@@ -1156,10 +1160,14 @@ inline_mysql_socket_accept
#else
socket_accept.fd= accept(socket_listen.fd, addr, addr_len);
#ifdef FD_CLOEXEC
- flags= fcntl(socket_accept.fd, F_GETFD);
- if (flags != -1) {
- flags |= FD_CLOEXEC;
- fcntl(socket_accept.fd, F_SETFD, flags);
+ if (socket_accept.fd != INVALID_SOCKET)
+ {
+ flags= fcntl(socket_accept.fd, F_GETFD);
+ if (flags != -1)
+ {
+ flags |= FD_CLOEXEC;
+ fcntl(socket_accept.fd, F_SETFD, flags);
+ }
}
#endif
#endif
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index 5ffa476fdfb..1b1d54c036b 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -87,6 +87,7 @@ extern struct wsrep_service_st {
ulong (*wsrep_OSU_method_get_func)(const MYSQL_THD thd);
my_bool (*wsrep_thd_has_ignored_error_func)(const MYSQL_THD thd);
void (*wsrep_thd_set_ignored_error_func)(MYSQL_THD thd, my_bool val);
+ bool (*wsrep_thd_set_wsrep_aborter_func)(MYSQL_THD bf_thd, MYSQL_THD thd);
} *wsrep_service;
#define MYSQL_SERVICE_WSREP_INCLUDED
@@ -130,6 +131,7 @@ extern struct wsrep_service_st {
#define wsrep_OSU_method_get(T) wsrep_service->wsrep_OSU_method_get_func(T)
#define wsrep_thd_has_ignored_error(T) wsrep_service->wsrep_thd_has_ignored_error_func(T)
#define wsrep_thd_set_ignored_error(T,V) wsrep_service->wsrep_thd_set_ignored_error_func(T,V)
+#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2)
#else
#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
@@ -181,6 +183,8 @@ extern "C" my_bool wsrep_thd_is_local(const MYSQL_THD thd);
/* Return true if thd is in high priority mode */
/* todo: rename to is_high_priority() */
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
+/* set wsrep_aborter for the target THD */
+extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
/* Return true if thd is in TOI mode */
extern "C" my_bool wsrep_thd_is_toi(const MYSQL_THD thd);
/* Return true if thd is in replicating TOI mode */
@@ -224,5 +228,6 @@ extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
extern "C" ulong wsrep_OSU_method_get(const MYSQL_THD thd);
extern "C" my_bool wsrep_thd_has_ignored_error(const MYSQL_THD thd);
extern "C" void wsrep_thd_set_ignored_error(MYSQL_THD thd, my_bool val);
+extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
#endif
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */
diff --git a/include/mysys_err.h b/include/mysys_err.h
index 08463c9fedb..e0e97d0284a 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -72,7 +72,8 @@ extern const char *globerrs[]; /* my_error_messages is here */
#define EE_BADMEMORYRELEASE 36
#define EE_PERM_LOCK_MEMORY 37
#define EE_MEMCNTL 38
-#define EE_ERROR_LAST 38 /* Copy last error nr */
+#define EE_DUPLICATE_CHARSET 39
+#define EE_ERROR_LAST 39 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
diff --git a/include/violite.h b/include/violite.h
index c7feca683cc..6d09621bea6 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -112,9 +112,7 @@ my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
/* Wait for an I/O event notification. */
int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout);
my_bool vio_is_connected(Vio *vio);
-#ifndef DBUG_OFF
ssize_t vio_pending(Vio *vio);
-#endif
/* Set timeout for a network operation. */
extern int vio_timeout(Vio *vio, uint which, int timeout_sec);
extern void vio_set_wait_callback(void (*before_wait)(void),
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 4faaf062666..6c5fe2c2050 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -15,6 +15,7 @@
SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
aria_chk.1 aria_dump_log.1 aria_ftdump.1 aria_pack.1 aria_read_log.1
+ aria_s3_copy.1
myisamlog.1 myisampack.1 mysql.server.1 mariadb-conv.1
mysql_convert_table_format.1 mysql_fix_extensions.1
mysql_install_db.1
diff --git a/man/aria_s3_copy.1 b/man/aria_s3_copy.1
new file mode 100644
index 00000000000..5844d5a76f0
--- /dev/null
+++ b/man/aria_s3_copy.1
@@ -0,0 +1,52 @@
+.TH ARIA_S3_COPY "1" "June 2020" "aria_s3_copy Ver 1.0" "User Commands"
+.SH NAME
+aria_s3_copy \- Copy an Aria table to and from s3
+.SH DESCRIPTION
+Usage: aria_s3_copy \-\-aws\-access\-key=# \-\-aws\-secret\-access\-key=# \-\-aws\-region=# \-\-op=(from_s3 | to_s3 | delete_from_s3) [OPTIONS] tables[.MAI]
+.TP
+\fB\-?\fR, \fB\-h\fR, \fB\-\-help\fR
+Display help and exit.
+.TP
+\fB\-k\fR, \fB\-\-s3\-access\-key=name\fR
+AWS access key ID
+.TP
+\fB\-r\fR, \fB\-s3\-region=name\fR
+AWS region
+.TP
+\fB\-K\fR, \fB\-s3\-secret\-key=name\fR
+AWS secret access key ID
+.TP
+\fB\-b\fR, \fB\-s3\-bucket=name\fR
+AWS prefix for tables
+.TP
+\fB\-h\fR, \fB\-s3\-host\-name=name\fR
+Host name to S3 provider
+.TP
+\fB\-c\fR, \fB\-compress\fR
+Use compression
+.TP
+\fB\-o\fR, \fB\-op=name\fR
+Operation to execute. One of 'from_s3', 'to_s3' or 'delete_from_s3'
+.TP
+\fB\-d\fR, \fB\-database=name\fR
+Database for copied table (second prefix). If not given, the directory of the table file is used
+.TP
+\fB\-B\fR, \fB\-s3\-block\-size=#\fR
+Block size for data/index blocks in s3
+.TP
+\fB\-L\fR, \fB\-s3\-protocol\-version=name\fR
+Protocol used to communication with S3. One of "Auto", "Amazon" or "Original".
+.TP
+\fB\-f\fR, \fB\-force\fR
+Force copy even if target exists
+.TP
+\fB\-V\fR, \fB\-version\fR
+Print version and exit.
+.TP
+\fB\-\-s3\-debug\fR
+Output debug log from marias3 to stdout
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Be verbose.
+.PP
+For more information, please refer to the MariaDB Knowledge Base page https://mariadb.com/kb/en/aria_s3_copy/
diff --git a/mysql-test/include/binlog_parallel_replication_marks.test b/mysql-test/include/binlog_parallel_replication_marks.test
index 3976088ca43..29e86d64d3e 100644
--- a/mysql-test/include/binlog_parallel_replication_marks.test
+++ b/mysql-test/include/binlog_parallel_replication_marks.test
@@ -80,7 +80,7 @@ while (<F>) {
s/table id \d+/table id #/;
s/mapped to number \d+/mapped to number #/;
s/CRC32 0x[0-9a-f]+/CRC32 0x########/;
- print if /\b(GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/;
+ print if /\b(GTID|START TRANSACTION|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/;
}
close F;
EOF
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 30b17c2e063..2ec0868c39e 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -1183,10 +1183,6 @@ set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
set global innodb_autoextend_increment=8;
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
-set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
-set global innodb_commit_concurrency=0;
-set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
-
#
# Bug #37830: ORDER BY ASC/DESC - no difference
#
diff --git a/mysql-test/main/create_drop_function.result b/mysql-test/main/create_drop_function.result
index 3ba6581d61b..7f23c954d7f 100644
--- a/mysql-test/main/create_drop_function.result
+++ b/mysql-test/main/create_drop_function.result
@@ -52,3 +52,20 @@ body
DROP FUNCTION IF EXISTS f1;
Warnings:
Note 1305 FUNCTION test.f1 does not exist
+#
+# 10.1 Test
+#
+# MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+# is_bulk_op())' failed in Diagnostics_area::set_ok_status on FUNCTION replace
+#
+SET GLOBAL log_bin_trust_function_creators=0;
+CREATE FUNCTION f(c INT) RETURNS NUMERIC NO SQL RETURN 0;
+CREATE OR REPLACE FUNCTION f(c INT) RETURNS INT RETURN 0;
+ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+CREATE OR REPLACE FUNCTION sp1_thisisaveryverylongnamelongnameverylongname_thisisaveryverylongname234872934(a INT) RETURNS INT RETURN 0;
+ERROR 42000: Identifier name 'sp1_thisisaveryverylongnamelongnameverylongname_thisisaveryverylongname234872934' is too long
+DROP FUNCTION IF EXISTS f;
+Warnings:
+Note 1305 FUNCTION test.f does not exist
+SET GLOBAL log_bin_trust_function_creators=1;
+# End of 10.1 Test
diff --git a/mysql-test/main/create_drop_function.test b/mysql-test/main/create_drop_function.test
index e4d3d684cd5..3c4770e25e3 100644
--- a/mysql-test/main/create_drop_function.test
+++ b/mysql-test/main/create_drop_function.test
@@ -1,3 +1,5 @@
+source include/have_log_bin.inc;
+
SET timestamp=UNIX_TIMESTAMP('2014-09-30 08:00:00');
CREATE FUNCTION f1(str char(20))
@@ -39,3 +41,25 @@ DROP FUNCTION IF EXISTS f1;
SELECT body FROM mysql.proc WHERE name like 'f1';
DROP FUNCTION IF EXISTS f1;
+--echo #
+--echo # 10.1 Test
+--echo #
+--echo # MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+--echo # is_bulk_op())' failed in Diagnostics_area::set_ok_status on FUNCTION replace
+--echo #
+
+SET GLOBAL log_bin_trust_function_creators=0;
+
+CREATE FUNCTION f(c INT) RETURNS NUMERIC NO SQL RETURN 0;
+
+--error ER_BINLOG_UNSAFE_ROUTINE
+CREATE OR REPLACE FUNCTION f(c INT) RETURNS INT RETURN 0;
+
+--error ER_TOO_LONG_IDENT
+CREATE OR REPLACE FUNCTION sp1_thisisaveryverylongnamelongnameverylongname_thisisaveryverylongname234872934(a INT) RETURNS INT RETURN 0;
+
+DROP FUNCTION IF EXISTS f;
+
+SET GLOBAL log_bin_trust_function_creators=1;
+
+--echo # End of 10.1 Test
diff --git a/mysql-test/main/ctype_ldml.result b/mysql-test/main/ctype_ldml.result
index 3ce50331ed0..22b7a316111 100644
--- a/mysql-test/main/ctype_ldml.result
+++ b/mysql-test/main/ctype_ldml.result
@@ -447,7 +447,7 @@ Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
set names latin1;
show collation like 'latin1_test';
Collation Charset Id Default Compiled Sortlen
-latin1_test latin1 99 Yes 1
+latin1_test latin1 331 1
select "foo" = "foo " collate latin1_test;
"foo" = "foo " collate latin1_test
1
@@ -466,6 +466,7 @@ utf8mb4_test_ci utf8mb4 326 8
utf16_test_ci utf16 327 8
utf8mb4_test_400_ci utf8mb4 328 8
utf8mb4_test_520_nopad_ci utf8mb4 329 8
+latin1_test latin1 331 1
latin1_test2 latin1 332 1
latin1_test2_cs latin1 333 1
latin1_swedish_nopad2_ci latin1 334 1
@@ -490,7 +491,7 @@ utf32_test_ci utf32 391 8
utf8_maxuserid_ci utf8 2047 8
show collation like '%test%';
Collation Charset Id Default Compiled Sortlen
-latin1_test latin1 99 Yes 1
+latin1_test latin1 331 1
latin1_test2 latin1 332 1
latin1_test2_cs latin1 333 1
utf8_test_ci utf8 353 8
@@ -3034,3 +3035,10 @@ SELECT 'chž'< 'i';
1
SELECT 'a' COLLATE utf8_czech_test_bad_w2;
ERROR HY000: Unknown collation: 'utf8_czech_test_bad_w2'
+#
+# MDEV-7947 my_charset_same: strcmp() takes 0.37% in OLTP RO
+#
+SHOW COLLATION LIKE 'latin1_test_replace';
+Collation Charset Id Default Compiled Sortlen
+SELECT 'foo' = 'foo ' COLLATE latin1_test_replace;
+ERROR HY000: Unknown collation: 'latin1_test_replace'
diff --git a/mysql-test/main/ctype_ldml.test b/mysql-test/main/ctype_ldml.test
index a6cba4b9780..8baabdf2bcb 100644
--- a/mysql-test/main/ctype_ldml.test
+++ b/mysql-test/main/ctype_ldml.test
@@ -3,6 +3,10 @@
--source include/have_utf16.inc
--source include/have_utf32.inc
+--disable_query_log
+call mtr.add_suppression("Charset id.*trying to replace");
+--enable_query_log
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -602,3 +606,12 @@ SELECT 'chž'< 'i';
--error ER_UNKNOWN_COLLATION
SELECT 'a' COLLATE utf8_czech_test_bad_w2;
+
+
+--echo #
+--echo # MDEV-7947 my_charset_same: strcmp() takes 0.37% in OLTP RO
+--echo #
+
+SHOW COLLATION LIKE 'latin1_test_replace';
+--error ER_UNKNOWN_COLLATION
+SELECT 'foo' = 'foo ' COLLATE latin1_test_replace;
diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result
index 547339e56ac..97f66476919 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -2619,7 +2619,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(3) DEFAULT NULL
+ `c1` varchar(2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(4));
@@ -2664,7 +2664,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(5) DEFAULT NULL
+ `c1` varchar(3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(7));
@@ -2709,7 +2709,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(6) DEFAULT NULL
+ `c1` varchar(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(10));
@@ -2754,7 +2754,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(7) DEFAULT NULL
+ `c1` varchar(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(13));
@@ -2769,7 +2769,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(7) DEFAULT NULL
+ `c1` varchar(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(14));
@@ -2799,7 +2799,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(9) DEFAULT NULL
+ `c1` varchar(7) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(16));
@@ -2814,7 +2814,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(9) DEFAULT NULL
+ `c1` varchar(7) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(17));
@@ -2844,7 +2844,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(10) DEFAULT NULL
+ `c1` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(19));
@@ -2859,7 +2859,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(10) DEFAULT NULL
+ `c1` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(20));
@@ -2889,7 +2889,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(11) DEFAULT NULL
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(22));
@@ -2904,7 +2904,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(11) DEFAULT NULL
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(23));
@@ -2919,7 +2919,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(11) DEFAULT NULL
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(24));
@@ -2934,7 +2934,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(13) DEFAULT NULL
+ `c1` varchar(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(25));
@@ -2949,7 +2949,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(13) DEFAULT NULL
+ `c1` varchar(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(26));
@@ -2964,7 +2964,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(13) DEFAULT NULL
+ `c1` varchar(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(27));
@@ -2979,7 +2979,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(14) DEFAULT NULL
+ `c1` varchar(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(28));
@@ -2994,7 +2994,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(14) DEFAULT NULL
+ `c1` varchar(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(29));
@@ -3009,7 +3009,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(14) DEFAULT NULL
+ `c1` varchar(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(30));
@@ -3024,7 +3024,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(15) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(31));
@@ -3039,7 +3039,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(15) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(32));
@@ -3054,7 +3054,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(15) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(33));
@@ -3069,7 +3069,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(17) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(34));
@@ -3084,7 +3084,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(17) DEFAULT NULL
+ `c1` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(35));
@@ -3099,7 +3099,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(17) DEFAULT NULL
+ `c1` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(36));
@@ -3114,7 +3114,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(18) DEFAULT NULL
+ `c1` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(37));
@@ -3129,7 +3129,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(18) DEFAULT NULL
+ `c1` varchar(17) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(38));
@@ -3144,7 +3144,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(18) DEFAULT NULL
+ `c1` varchar(17) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(39));
@@ -3159,7 +3159,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(19) DEFAULT NULL
+ `c1` varchar(17) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(40));
@@ -3174,7 +3174,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(19) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(41));
@@ -3189,7 +3189,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(19) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(42));
@@ -3204,7 +3204,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(43));
@@ -3219,7 +3219,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(44));
@@ -3234,7 +3234,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(45));
@@ -3249,7 +3249,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(22) DEFAULT NULL
+ `c1` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(46));
@@ -3264,7 +3264,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(22) DEFAULT NULL
+ `c1` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(47));
@@ -3279,7 +3279,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(22) DEFAULT NULL
+ `c1` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(48));
@@ -3294,7 +3294,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(23) DEFAULT NULL
+ `c1` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(49));
@@ -3309,7 +3309,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(23) DEFAULT NULL
+ `c1` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(50));
@@ -3324,7 +3324,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(23) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(51));
@@ -3339,7 +3339,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(25) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(52));
@@ -3354,7 +3354,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(25) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(53));
@@ -3369,7 +3369,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(25) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(54));
@@ -3384,7 +3384,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(26) DEFAULT NULL
+ `c1` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(55));
@@ -3399,7 +3399,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(26) DEFAULT NULL
+ `c1` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(56));
@@ -3414,7 +3414,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(26) DEFAULT NULL
+ `c1` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(57));
@@ -3429,7 +3429,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(27) DEFAULT NULL
+ `c1` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(58));
@@ -3444,7 +3444,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(27) DEFAULT NULL
+ `c1` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(59));
@@ -3459,7 +3459,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(27) DEFAULT NULL
+ `c1` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(60));
@@ -3474,7 +3474,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(29) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(61));
@@ -3489,7 +3489,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(29) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(62));
@@ -3504,7 +3504,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(29) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(63));
@@ -3519,7 +3519,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(30) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(64));
@@ -3534,7 +3534,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(30) DEFAULT NULL
+ `c1` varchar(27) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (f float);
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index 20f670cbef4..ae365ea207a 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -975,7 +975,6 @@ select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
connect conn5,localhost,mysqltest_8,,;
select * from t1;
@@ -992,7 +991,6 @@ GRANT USAGE ON *.* TO `mysqltest_8`@`%`
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
flush privileges;
show grants for mysqltest_8@'';
diff --git a/mysql-test/main/grant4.result b/mysql-test/main/grant4.result
index f252a4c2ad5..29021b608aa 100644
--- a/mysql-test/main/grant4.result
+++ b/mysql-test/main/grant4.result
@@ -148,7 +148,7 @@ call mtr.add_suppression('mysql.user table is damaged');
rename table mysql.user to mysql.user1;
create table mysql.user (Host char(100), User char(100));
flush privileges;
-ERROR HY000: Unknown error
+ERROR HY000: Fatal error: mysql.user table is damaged or in unsupported 3.20 format
drop table mysql.user;
rename table mysql.user1 to mysql.user;
# switching back from mysql.user to mysql.global_priv
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result
index df09b1fcc64..2cc1c11f7d8 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -242,4 +242,10 @@ disconnect con1;
connection default;
drop database db;
drop user foo;
+call mtr.add_suppression('mysql.host table is damaged');
+create table mysql.host (c1 int);
+insert mysql.host values (1);
+flush privileges;
+ERROR HY000: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
+drop table mysql.host;
# End of 10.4 tests
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index 39fcff92435..054b16c0a6e 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -199,4 +199,14 @@ delete from db.t1 returning *;
drop database db;
drop user foo;
+#
+# MDEV-23009 SIGSEGV in get_field from acl_load (on optimized builds)
+#
+call mtr.add_suppression('mysql.host table is damaged');
+create table mysql.host (c1 int);
+insert mysql.host values (1);
+--error ER_UNKNOWN_ERROR
+flush privileges;
+drop table mysql.host;
+
--echo # End of 10.4 tests
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index 1e1f66e377c..fcc437f8c60 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -576,7 +576,6 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
drop view v1, v2, v3;
drop table t1;
@@ -2219,3 +2218,72 @@ SCHEMA_NAME
#
# End of 10.1 tests
#
+#
+# MDEV-21201:No records produced in information_schema query,
+# depending on projection
+#
+create table t (i int, constraint a check (i > 0));
+select
+tc.TABLE_SCHEMA,
+tc.TABLE_NAME,
+cc.CONSTRAINT_NAME,
+cc.CHECK_CLAUSE
+from information_schema.TABLE_CONSTRAINTS tc
+join information_schema.CHECK_CONSTRAINTS cc
+using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
+;
+TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+mysql global_priv Priv json_valid(`Priv`)
+test t a `i` > 0
+select
+tc.TABLE_SCHEMA,
+tc.TABLE_NAME,
+cc.CONSTRAINT_NAME,
+cc.CHECK_CLAUSE
+from information_schema.CHECK_CONSTRAINTS cc
+join information_schema.TABLE_CONSTRAINTS tc
+using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
+;
+TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+mysql global_priv Priv json_valid(`Priv`)
+test t a `i` > 0
+select
+tc.TABLE_SCHEMA,
+tc.TABLE_NAME,
+cc.CONSTRAINT_NAME,
+cc.CHECK_CLAUSE
+from information_schema.TABLE_CONSTRAINTS tc
+NATURAL join information_schema.CHECK_CONSTRAINTS cc
+;
+TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+mysql global_priv Priv json_valid(`Priv`)
+test t a `i` > 0
+select
+tc.TABLE_SCHEMA,
+tc.TABLE_NAME,
+cc.CONSTRAINT_NAME,
+cc.CHECK_CLAUSE
+from information_schema.CHECK_CONSTRAINTS cc
+NATURAL join information_schema.TABLE_CONSTRAINTS tc
+;
+TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+mysql global_priv Priv json_valid(`Priv`)
+test t a `i` > 0
+select
+tc.TABLE_SCHEMA,
+tc.TABLE_NAME,
+cc.CONSTRAINT_NAME,
+cc.CHECK_CLAUSE,
+tc.CONSTRAINT_CATALOG,
+tc.CONSTRAINT_SCHEMA
+from information_schema.TABLE_CONSTRAINTS tc
+join information_schema.CHECK_CONSTRAINTS cc
+using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
+;
+TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE CONSTRAINT_CATALOG CONSTRAINT_SCHEMA
+mysql global_priv Priv json_valid(`Priv`) def mysql
+test t a `i` > 0 def test
+drop table t;
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test
index 1df0d3f635f..a3231d94349 100644
--- a/mysql-test/main/information_schema.test
+++ b/mysql-test/main/information_schema.test
@@ -1920,3 +1920,70 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a'
--echo #
--echo # End of 10.1 tests
--echo #
+
+
+--echo #
+--echo # MDEV-21201:No records produced in information_schema query,
+--echo # depending on projection
+--echo #
+
+create table t (i int, constraint a check (i > 0));
+
+--disable_warnings
+--sorted_result
+select
+ tc.TABLE_SCHEMA,
+ tc.TABLE_NAME,
+ cc.CONSTRAINT_NAME,
+ cc.CHECK_CLAUSE
+from information_schema.TABLE_CONSTRAINTS tc
+ join information_schema.CHECK_CONSTRAINTS cc
+ using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
+;
+--sorted_result
+select
+ tc.TABLE_SCHEMA,
+ tc.TABLE_NAME,
+ cc.CONSTRAINT_NAME,
+ cc.CHECK_CLAUSE
+from information_schema.CHECK_CONSTRAINTS cc
+ join information_schema.TABLE_CONSTRAINTS tc
+ using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
+;
+--sorted_result
+select
+ tc.TABLE_SCHEMA,
+ tc.TABLE_NAME,
+ cc.CONSTRAINT_NAME,
+ cc.CHECK_CLAUSE
+from information_schema.TABLE_CONSTRAINTS tc
+ NATURAL join information_schema.CHECK_CONSTRAINTS cc
+;
+--sorted_result
+select
+ tc.TABLE_SCHEMA,
+ tc.TABLE_NAME,
+ cc.CONSTRAINT_NAME,
+ cc.CHECK_CLAUSE
+from information_schema.CHECK_CONSTRAINTS cc
+ NATURAL join information_schema.TABLE_CONSTRAINTS tc
+;
+--sorted_result
+select
+ tc.TABLE_SCHEMA,
+ tc.TABLE_NAME,
+ cc.CONSTRAINT_NAME,
+ cc.CHECK_CLAUSE,
+ tc.CONSTRAINT_CATALOG,
+ tc.CONSTRAINT_SCHEMA
+from information_schema.TABLE_CONSTRAINTS tc
+ join information_schema.CHECK_CONSTRAINTS cc
+ using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
+;
+--enable_warnings
+
+drop table t;
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysql-test/main/information_schema_all_engines-master.opt b/mysql-test/main/information_schema_all_engines-master.opt
index 43411c5033a..7ba5aa5b8b3 100644
--- a/mysql-test/main/information_schema_all_engines-master.opt
+++ b/mysql-test/main/information_schema_all_engines-master.opt
@@ -15,4 +15,3 @@
--loose-innodb-sys-tablestats
--loose-innodb-mutexes
--loose-innodb-tablespaces-encryption
---loose-innodb-tablespaces-scrubbing
diff --git a/mysql-test/main/mdev-21101.opt b/mysql-test/main/mdev-21101.opt
new file mode 100644
index 00000000000..b446a28986b
--- /dev/null
+++ b/mysql-test/main/mdev-21101.opt
@@ -0,0 +1 @@
+--thread-handling=pool-of-threads \ No newline at end of file
diff --git a/mysql-test/main/mdev-21101.result b/mysql-test/main/mdev-21101.result
new file mode 100644
index 00000000000..94da9c31108
--- /dev/null
+++ b/mysql-test/main/mdev-21101.result
@@ -0,0 +1,43 @@
+SELECT
+@@global.wait_timeout, @@global.thread_pool_max_threads, @@global.thread_pool_size,
+@@global.thread_pool_oversubscribe, @@global.thread_pool_stall_limit
+INTO
+@_wait_timeout,@_thread_pool_max_threads,@_thread_pool_size,
+@_thread_pool_oversubscribe,@_thread_pool_stall_limit;
+SET @@global.wait_timeout=1,
+@@global.thread_pool_max_threads=2,
+@@global.thread_pool_size=1,
+@@global.thread_pool_oversubscribe=1,
+@@global.thread_pool_stall_limit=10;
+connect c1, localhost, root,,;
+connect c2, localhost, root,,;
+connect c3, localhost, root,,;
+connection c1;
+select sleep(1.1);
+connection c2;
+select sleep(1.1);
+connection c3;
+select sleep(1.1);
+connection default;
+select sleep(1.1);
+connection c1;
+sleep(1.1)
+0
+connection c2;
+sleep(1.1)
+0
+connection c3;
+sleep(1.1)
+0
+connection default;
+sleep(1.1)
+0
+disconnect c1;
+disconnect c2;
+disconnect c3;
+connection default;
+SET @@global.wait_timeout=@_wait_timeout,
+@@global.thread_pool_max_threads=@_thread_pool_max_threads,
+@@global.thread_pool_size=@_thread_pool_size,
+@@global.thread_pool_oversubscribe=@_thread_pool_oversubscribe,
+@@global.thread_pool_stall_limit=@_thread_pool_stall_limit;
diff --git a/mysql-test/main/mdev-21101.test b/mysql-test/main/mdev-21101.test
new file mode 100644
index 00000000000..627e86462a1
--- /dev/null
+++ b/mysql-test/main/mdev-21101.test
@@ -0,0 +1,54 @@
+--source include/not_embedded.inc
+# Test that wait_timeout does not cause connection to be closed, when connection is delayed due to
+# threadpool internal problems, e.g misconfiguration - too few threads and queueing.
+# So if client did not cause wait_timeout, do not report it either.
+# See MDEV-21101 for details.
+
+# Intentionally misconfigure threadpool to have at most 1 or 2 threads (
+# depends on the implementation). Use minimal wait_timeout, do some slow queries from
+# different connections simultaneously, to force queueing occurs.
+# Verify connections are intact, even if queueing time exceeds wait_timeout
+
+SELECT
+ @@global.wait_timeout, @@global.thread_pool_max_threads, @@global.thread_pool_size,
+ @@global.thread_pool_oversubscribe, @@global.thread_pool_stall_limit
+INTO
+ @_wait_timeout,@_thread_pool_max_threads,@_thread_pool_size,
+ @_thread_pool_oversubscribe,@_thread_pool_stall_limit;
+
+SET @@global.wait_timeout=1,
+ @@global.thread_pool_max_threads=2,
+ @@global.thread_pool_size=1,
+ @@global.thread_pool_oversubscribe=1,
+ @@global.thread_pool_stall_limit=10;
+
+--connect (c1, localhost, root,,)
+--connect (c2, localhost, root,,)
+--connect (c3, localhost, root,,)
+--connection c1
+--send select sleep(1.1)
+--connection c2
+--send select sleep(1.1)
+--connection c3
+--send select sleep(1.1)
+--connection default
+--send select sleep(1.1)
+--connection c1
+--reap
+--connection c2
+--reap
+--connection c3
+--reap
+--connection default
+--reap
+--disconnect c1
+--disconnect c2
+--disconnect c3
+--connection default
+
+SET @@global.wait_timeout=@_wait_timeout,
+ @@global.thread_pool_max_threads=@_thread_pool_max_threads,
+ @@global.thread_pool_size=@_thread_pool_size,
+ @@global.thread_pool_oversubscribe=@_thread_pool_oversubscribe,
+ @@global.thread_pool_stall_limit=@_thread_pool_stall_limit;
+
diff --git a/mysql-test/main/mdl.result b/mysql-test/main/mdl.result
index 883f35674c0..fbf80312ac0 100644
--- a/mysql-test/main/mdl.result
+++ b/mysql-test/main/mdl.result
@@ -58,6 +58,8 @@ DROP TABLE t1,t3;
#
CREATE TABLE t1(a INT) ENGINE=InnoDB;
CREATE TABLE t3(a INT) ENGINE=myisam;
+connect purge_control,localhost,root,,;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
connect locker,localhost,root,,;
connection default;
FLUSH TABLES WITH READ LOCK;
@@ -85,6 +87,7 @@ MDL_SHARED_WRITE Table metadata lock test t3
unlock tables;
connection locker;
unlock tables;
+disconnect purge_control;
connection default;
disconnect locker;
DROP TABLE t1,t3;
diff --git a/mysql-test/main/mdl.test b/mysql-test/main/mdl.test
index 23a862f5212..0c1b7a13a0c 100644
--- a/mysql-test/main/mdl.test
+++ b/mysql-test/main/mdl.test
@@ -40,6 +40,8 @@ DROP TABLE t1,t3;
CREATE TABLE t1(a INT) ENGINE=InnoDB;
CREATE TABLE t3(a INT) ENGINE=myisam;
+connect(purge_control,localhost,root,,);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
connect (locker,localhost,root,,);
connection default;
@@ -75,6 +77,7 @@ unlock tables;
connection locker;
--reap
unlock tables;
+disconnect purge_control;
connection default;
disconnect locker;
diff --git a/mysql-test/main/metadata.result b/mysql-test/main/metadata.result
index 1f917bfe5ab..0704f5b8ae8 100644
--- a/mysql-test/main/metadata.result
+++ b/mysql-test/main/metadata.result
@@ -715,16 +715,16 @@ CEILING(11111111),
CEILING(111111111),
CEILING(1111111111) LIMIT 0;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def CEILING(1) 3 3 0 N 32897 0 63
-def CEILING(11) 3 4 0 N 32897 0 63
-def CEILING(111) 3 5 0 N 32897 0 63
-def CEILING(1111) 3 6 0 N 32897 0 63
-def CEILING(11111) 3 7 0 N 32897 0 63
-def CEILING(111111) 3 8 0 N 32897 0 63
-def CEILING(1111111) 3 9 0 N 32897 0 63
-def CEILING(11111111) 8 10 0 N 32897 0 63
-def CEILING(111111111) 8 11 0 N 32897 0 63
-def CEILING(1111111111) 8 12 0 N 32897 0 63
+def CEILING(1) 3 1 0 N 32897 0 63
+def CEILING(11) 3 2 0 N 32897 0 63
+def CEILING(111) 3 3 0 N 32897 0 63
+def CEILING(1111) 3 4 0 N 32897 0 63
+def CEILING(11111) 3 5 0 N 32897 0 63
+def CEILING(111111) 3 6 0 N 32897 0 63
+def CEILING(1111111) 3 7 0 N 32897 0 63
+def CEILING(11111111) 3 8 0 N 32897 0 63
+def CEILING(111111111) 3 9 0 N 32897 0 63
+def CEILING(1111111111) 8 10 0 N 32897 0 63
CEILING(1) CEILING(11) CEILING(111) CEILING(1111) CEILING(11111) CEILING(111111) CEILING(1111111) CEILING(11111111) CEILING(111111111) CEILING(1111111111)
SELECT
FLOOR(1),
@@ -738,16 +738,16 @@ FLOOR(11111111),
FLOOR(111111111),
FLOOR(1111111111) LIMIT 0;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def FLOOR(1) 3 3 0 N 32897 0 63
-def FLOOR(11) 3 4 0 N 32897 0 63
-def FLOOR(111) 3 5 0 N 32897 0 63
-def FLOOR(1111) 3 6 0 N 32897 0 63
-def FLOOR(11111) 3 7 0 N 32897 0 63
-def FLOOR(111111) 3 8 0 N 32897 0 63
-def FLOOR(1111111) 3 9 0 N 32897 0 63
-def FLOOR(11111111) 8 10 0 N 32897 0 63
-def FLOOR(111111111) 8 11 0 N 32897 0 63
-def FLOOR(1111111111) 8 12 0 N 32897 0 63
+def FLOOR(1) 3 1 0 N 32897 0 63
+def FLOOR(11) 3 2 0 N 32897 0 63
+def FLOOR(111) 3 3 0 N 32897 0 63
+def FLOOR(1111) 3 4 0 N 32897 0 63
+def FLOOR(11111) 3 5 0 N 32897 0 63
+def FLOOR(111111) 3 6 0 N 32897 0 63
+def FLOOR(1111111) 3 7 0 N 32897 0 63
+def FLOOR(11111111) 3 8 0 N 32897 0 63
+def FLOOR(111111111) 3 9 0 N 32897 0 63
+def FLOOR(1111111111) 8 10 0 N 32897 0 63
FLOOR(1) FLOOR(11) FLOOR(111) FLOOR(1111) FLOOR(11111) FLOOR(111111) FLOOR(1111111) FLOOR(11111111) FLOOR(111111111) FLOOR(1111111111)
SELECT
ROUND(1),
diff --git a/mysql-test/main/mysqlbinlog-innodb.result b/mysql-test/main/mysqlbinlog-innodb.result
index 342cd7cbd82..8428e4cd74b 100644
--- a/mysql-test/main/mysqlbinlog-innodb.result
+++ b/mysql-test/main/mysqlbinlog-innodb.result
@@ -24,7 +24,7 @@ FLUSH LOGS;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -39,7 +39,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
INSERT INTO t1 VALUES (1)
/*!*/;
COMMIT/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (2)
@@ -55,7 +55,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `foo`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -70,7 +70,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
INSERT INTO t1 VALUES (1)
/*!*/;
COMMIT/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (2)
diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result
index e514c951284..e31246efef9 100644
--- a/mysql-test/main/mysqlbinlog.result
+++ b/mysql-test/main/mysqlbinlog.result
@@ -37,7 +37,7 @@ create table t1 (word varchar(20))
SET TIMESTAMP=1000000000/*!*/;
create table t2 (id int auto_increment not null primary key)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")
@@ -45,7 +45,7 @@ insert into t1 values ("abirvalg")
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -54,7 +54,7 @@ insert into t2 values ()
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -62,7 +62,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -70,7 +70,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -78,7 +78,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -97,7 +97,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
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -114,7 +114,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
@@ -134,7 +134,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
@@ -147,28 +147,28 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
@@ -184,7 +184,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
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -231,7 +231,7 @@ create table t1 (word varchar(20))
SET TIMESTAMP=1000000000/*!*/;
create table t2 (id int auto_increment not null primary key)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")
@@ -239,7 +239,7 @@ insert into t1 values ("abirvalg")
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -248,7 +248,7 @@ insert into t2 values ()
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -256,7 +256,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -264,7 +264,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -272,7 +272,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -291,7 +291,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
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -308,7 +308,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
@@ -328,7 +328,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
@@ -341,28 +341,28 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
@@ -378,7 +378,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
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -553,7 +553,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a varchar(64) character set utf8)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
@@ -561,7 +561,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
@@ -570,7 +570,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
@@ -579,7 +579,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
@@ -587,7 +587,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
@@ -596,7 +596,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
@@ -605,7 +605,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` CHARACTER SET koi8r FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
diff --git a/mysql-test/main/mysqlbinlog_row_compressed.result b/mysql-test/main/mysqlbinlog_row_compressed.result
index d32c2c21b28..95a81c7305c 100644
--- a/mysql-test/main/mysqlbinlog_row_compressed.result
+++ b/mysql-test/main/mysqlbinlog_row_compressed.result
@@ -53,7 +53,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
# at 727
#<date> server id 1 end_log_pos 769 CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 769
# at 843
@@ -82,7 +82,7 @@ COMMIT
# at 1040
#<date> server id 1 end_log_pos 1082 CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1082
# at 1158
@@ -111,7 +111,7 @@ COMMIT
# at 1354
#<date> server id 1 end_log_pos 1396 CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1396
# at 1474
@@ -140,7 +140,7 @@ COMMIT
# at 1669
#<date> server id 1 end_log_pos 1711 CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1711
# at 1786
@@ -169,7 +169,7 @@ COMMIT
# at 1982
#<date> server id 1 end_log_pos 2024 CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2024
# at 2078
@@ -231,7 +231,7 @@ COMMIT
# at 2298
#<date> server id 1 end_log_pos 2340 CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2340
# at 2406
@@ -312,7 +312,7 @@ COMMIT
# at 2634
#<date> server id 1 end_log_pos 2676 CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2676
# at 2713
@@ -374,7 +374,7 @@ COMMIT
# at 2934
#<date> server id 1 end_log_pos 2976 CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2976
# at 3013
diff --git a/mysql-test/main/mysqlbinlog_row_minimal.result b/mysql-test/main/mysqlbinlog_row_minimal.result
index 7133381420a..f385b4ca69a 100644
--- a/mysql-test/main/mysqlbinlog_row_minimal.result
+++ b/mysql-test/main/mysqlbinlog_row_minimal.result
@@ -51,7 +51,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
# at 774
#<date> server id 1 end_log_pos 816 CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 816
# at 890
@@ -80,7 +80,7 @@ COMMIT
# at 1088
#<date> server id 1 end_log_pos 1130 CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1130
# at 1206
@@ -109,7 +109,7 @@ COMMIT
# at 1403
#<date> server id 1 end_log_pos 1445 CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1445
# at 1523
@@ -138,7 +138,7 @@ COMMIT
# at 1719
#<date> server id 1 end_log_pos 1761 CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1761
# at 1836
@@ -167,7 +167,7 @@ COMMIT
# at 2035
#<date> server id 1 end_log_pos 2077 CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2077
# at 2131
@@ -229,7 +229,7 @@ COMMIT
# at 2427
#<date> server id 1 end_log_pos 2469 CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2469
# at 2535
@@ -262,7 +262,7 @@ COMMIT
# at 2730
#<date> server id 1 end_log_pos 2772 CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2772
# at 2809
@@ -292,7 +292,7 @@ COMMIT
# at 2992
#<date> server id 1 end_log_pos 3034 CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 3034
# at 3071
@@ -357,7 +357,7 @@ DELIMITER /*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=16*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 429
# at 543
diff --git a/mysql-test/main/mysqlbinlog_stmt_compressed.result b/mysql-test/main/mysqlbinlog_stmt_compressed.result
index 82f36f42fcb..078e6a746ff 100644
--- a/mysql-test/main/mysqlbinlog_stmt_compressed.result
+++ b/mysql-test/main/mysqlbinlog_stmt_compressed.result
@@ -53,7 +53,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
# at 727
#<date> server id 1 end_log_pos 769 CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 769
#<date> server id 1 end_log_pos 897 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -68,7 +68,7 @@ COMMIT
# at 970
#<date> server id 1 end_log_pos 1012 CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1012
#<date> server id 1 end_log_pos 1140 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -83,7 +83,7 @@ COMMIT
# at 1213
#<date> server id 1 end_log_pos 1255 CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1255
#<date> server id 1 end_log_pos 1385 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -98,7 +98,7 @@ COMMIT
# at 1458
#<date> server id 1 end_log_pos 1500 CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1500
#<date> server id 1 end_log_pos 1627 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -113,7 +113,7 @@ COMMIT
# at 1700
#<date> server id 1 end_log_pos 1742 CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1742
#<date> server id 1 end_log_pos 1850 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -128,7 +128,7 @@ COMMIT
# at 1923
#<date> server id 1 end_log_pos 1965 CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1965
#<date> server id 1 end_log_pos 2082 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -143,7 +143,7 @@ COMMIT
# at 2155
#<date> server id 1 end_log_pos 2197 CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2197
#<date> server id 1 end_log_pos 2288 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -158,7 +158,7 @@ COMMIT
# at 2361
#<date> server id 1 end_log_pos 2403 CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2403
#<date> server id 1 end_log_pos 2494 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
diff --git a/mysql-test/main/mysqld--help-aria.test b/mysql-test/main/mysqld--help-aria.test
index 4082951b10a..253a46492f0 100644
--- a/mysql-test/main/mysqld--help-aria.test
+++ b/mysql-test/main/mysqld--help-aria.test
@@ -7,7 +7,7 @@
--source include/not_windows.inc
---let $args=--table-cache=5 --max-connections=10 --log-warnings=1 --silent-startup --help --verbose
+--let $args=--table-cache=5 --max-connections=10 --log-warnings=1 --silent-startup --lower-case-table-names=1 --help --verbose
--exec $MYSQLD_CMD $args > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err
--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /control file '.*aria_log_control'/aria_log_control/ /error: \d+/error: #/
diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result
index e044b4a070d..2a58ba430ca 100644
--- a/mysql-test/main/mysqltest_tracking_info.result
+++ b/mysql-test/main/mysqltest_tracking_info.result
@@ -35,10 +35,10 @@ SET @@session.session_track_system_variables= @save_session_track_system_variabl
#
set @save_optimizer_switch=@@optimizer_switch;
SET @@session.session_track_system_variables='optimizer_switch';
-set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,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=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
+set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,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=on,mrr_cost_based=on,mrr_sort_keys=on,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=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- optimizer_switch
--- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,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=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,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=on,mrr_cost_based=on,mrr_sort_keys=on,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=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
Warnings:
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
@@ -46,6 +46,18 @@ set @@optimizer_switch=@save_optimizer_switch;
SET @@session.session_track_system_variables= @save_session_track_system_variables;
# End of 10.2 tests
#
+# MDEV-22134 handle_fatal_signal (sig=11) in __strlen_avx2 on START
+# SLAVE | Assertion
+# `global_system_variables.session_track_system_variables' failed in
+# Session_sysvars_tracker::init | *** buffer overflow detected ***
+# (on optimized builds)
+#
+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;
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
+# End of 10.3 tests
+#
# MDEV-16470 - Session user variables tracker
#
# End of 10.5 tests
diff --git a/mysql-test/main/mysqltest_tracking_info.test b/mysql-test/main/mysqltest_tracking_info.test
index 0478ea560d5..a3dfbba53c0 100644
--- a/mysql-test/main/mysqltest_tracking_info.test
+++ b/mysql-test/main/mysqltest_tracking_info.test
@@ -36,7 +36,7 @@ set @save_optimizer_switch=@@optimizer_switch;
SET @@session.session_track_system_variables='optimizer_switch';
--enable_session_track_info
-set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,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=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
+set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,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=on,mrr_cost_based=on,mrr_sort_keys=on,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=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
--disable_session_track_info
set @@optimizer_switch=@save_optimizer_switch;
@@ -47,6 +47,21 @@ SET @@session.session_track_system_variables= @save_session_track_system_variabl
--echo # End of 10.2 tests
--echo #
+--echo # MDEV-22134 handle_fatal_signal (sig=11) in __strlen_avx2 on START
+--echo # SLAVE | Assertion
+--echo # `global_system_variables.session_track_system_variables' failed in
+--echo # Session_sysvars_tracker::init | *** buffer overflow detected ***
+--echo # (on optimized builds)
+--echo #
+
+--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 # End of 10.3 tests
+
+--echo #
--echo # MDEV-16470 - Session user variables tracker
--echo #
#SET @@session.session_track_user_variables=1;
diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result
index 7568095699c..bcadd02f224 100644
--- a/mysql-test/main/order_by.result
+++ b/mysql-test/main/order_by.result
@@ -3377,6 +3377,62 @@ SET @@sort_buffer_size= @save_sort_buffer_size;
SET @@max_sort_length= @save_max_sort_length;
DROP TABLE t1;
#
+# MDEV-22390: Assertion `m_next_rec_ptr >= m_rawmem' failed in Filesort_buffer::spaceleft |
+# SIGSEGV in __memmove_avx_unaligned_erms from my_b_write (on optimized)
+#
+SET @save_max_sort_length= @@max_sort_length;
+SET @save_sort_buffer_size= @@sort_buffer_size;
+SET @save_max_length_for_sort_data= @@max_length_for_sort_data;
+SET max_sort_length=8;
+SET sort_buffer_size=1024;
+SET max_length_for_sort_data=7000;
+CREATE TABLE t1(a VARCHAR(64), b VARCHAR(2048))DEFAULT CHARSET=utf8;
+INSERT INTO t1 SELECT seq,seq from seq_1_to_100;
+ANALYZE FORMAT=JSON SELECT * FROM t1 ORDER BY a LIMIT 5;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "read_sorted_file": {
+ "r_rows": 5,
+ "filesort": {
+ "sort_key": "t1.a",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_limit": 5,
+ "r_used_priority_queue": false,
+ "r_output_rows": 100,
+ "r_buffer_size": "REPLACED",
+ "r_sort_mode": "sort_key,packed_addon_fields",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 100,
+ "r_rows": 100,
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+}
+SELECT * FROM t1 ORDER BY a LIMIT 5;
+a b
+1 1
+10 10
+100 100
+11 11
+12 12
+SET max_sort_length= @save_max_sort_length;
+SET sort_buffer_size= @save_sort_buffer_size;
+SET max_length_for_sort_data= @save_max_length_for_sort_data;
+DROP TABLE t1;
+#
# MDEV-13994: Bad join results with orderby_uses_equalities=on
#
CREATE TABLE books (
@@ -4024,6 +4080,25 @@ COUNT(DISTINCT a)
SET @@tmp_memory_table_size= @save_tmp_memory_table_size;
DROP TABLE t1;
#
+# MDEV-23216: LONGTEXT column with collation doesn't sort
+#
+CREATE TABLE t1 (a LONGTEXT COLLATE utf8mb4_swedish_ci);
+INSERT INTO t1 VALUES ('A'),('Z'),('B'),('Y');
+SELECT * FROM t1 ORDER BY a;
+a
+A
+B
+Y
+Z
+SELECT * FROM t1 ORDER BY a DESC;
+a
+Z
+Y
+B
+A
+DROP TABLE t1;
+# End of 10.5 tests
+#
# MDEV-13694: Wrong result upon GROUP BY with orderby_uses_equalities=on
#
CREATE TABLE t1 (a INT, b int, primary key(a));
@@ -4159,4 +4234,4 @@ a group_concat(t1.b)
96 2
58 1
DROP TABLE t1, t2;
-# End of 10.5 tests
+# End of 10.6 tests
diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test
index ff73d0db157..2e913d3b5cd 100644
--- a/mysql-test/main/order_by.test
+++ b/mysql-test/main/order_by.test
@@ -2181,6 +2181,28 @@ SET @@max_sort_length= @save_max_sort_length;
DROP TABLE t1;
--echo #
+--echo # MDEV-22390: Assertion `m_next_rec_ptr >= m_rawmem' failed in Filesort_buffer::spaceleft |
+--echo # SIGSEGV in __memmove_avx_unaligned_erms from my_b_write (on optimized)
+--echo #
+
+SET @save_max_sort_length= @@max_sort_length;
+SET @save_sort_buffer_size= @@sort_buffer_size;
+SET @save_max_length_for_sort_data= @@max_length_for_sort_data;
+SET max_sort_length=8;
+SET sort_buffer_size=1024;
+# needed to make sure we use addon fields
+SET max_length_for_sort_data=7000;
+CREATE TABLE t1(a VARCHAR(64), b VARCHAR(2048))DEFAULT CHARSET=utf8;
+INSERT INTO t1 SELECT seq,seq from seq_1_to_100;
+--source include/analyze-format.inc
+ANALYZE FORMAT=JSON SELECT * FROM t1 ORDER BY a LIMIT 5;
+SELECT * FROM t1 ORDER BY a LIMIT 5;
+SET max_sort_length= @save_max_sort_length;
+SET sort_buffer_size= @save_sort_buffer_size;
+SET max_length_for_sort_data= @save_max_length_for_sort_data;
+DROP TABLE t1;
+
+--echo #
--echo # MDEV-13994: Bad join results with orderby_uses_equalities=on
--echo #
@@ -2501,6 +2523,19 @@ SET @@tmp_memory_table_size= @save_tmp_memory_table_size;
DROP TABLE t1;
--echo #
+--echo # MDEV-23216: LONGTEXT column with collation doesn't sort
+--echo #
+
+CREATE TABLE t1 (a LONGTEXT COLLATE utf8mb4_swedish_ci);
+INSERT INTO t1 VALUES ('A'),('Z'),('B'),('Y');
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t1 ORDER BY a DESC;
+
+DROP TABLE t1;
+
+--echo # End of 10.5 tests
+
+--echo #
--echo # MDEV-13694: Wrong result upon GROUP BY with orderby_uses_equalities=on
--echo #
@@ -2533,4 +2568,4 @@ eval EXPLAIN FORMAT=JSON $query;
eval $query;
DROP TABLE t1, t2;
---echo # End of 10.5 tests
+--echo # End of 10.6 tests
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index ec6c3f5d895..9483dfee9fb 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -932,11 +932,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (10),(20),(30);
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a ORDER BY GROUP_CONCAT(a);
-a
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a ORDER BY GROUP_CONCAT(a ORDER BY a);
-a
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
DROP TABLE t1;
# UNION with a parenthesed term
CREATE TABLE t1 (a INT);
@@ -999,14 +997,11 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (10),(20),(30);
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a WITH ROLLUP ORDER BY GROUP_CONCAT(a);
-a
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a WITH ROLLUP ORDER BY GROUP_CONCAT(a ORDER BY a);
-a
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a WITH ROLLUP ORDER BY GROUP_CONCAT(a ORDER BY a) LIMIT 1;
-a
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
DROP TABLE t1;
# Derived table with ROLLUP
CREATE TABLE t1 (a INT);
@@ -1880,6 +1875,69 @@ ERROR 42S02: Table 'test.t1' doesn't exist
SET STATEMENT max_statement_time=180 FOR BACKUP LOCK test.t1;
SET STATEMENT max_statement_time=180 FOR BACKUP UNLOCK;
set SQL_MODE=@save_sql_mode;
+#
+# MDEV-21997: Server crashes in LEX::create_item_ident_sp
+# upon use of unknown identifier
+#
+/*! IF 1 IN ( SELECT 2 ) OR foo = 3 THEN */ SELECT 4;
+ERROR 42000: Undeclared variable: foo
+BEGIN NOT ATOMIC
+IF (SELECT 2) OR foo = 3 THEN
+SELECT 4;
+END IF ;
+END;
+$$
+ERROR 42000: Undeclared variable: foo
+# ... but if declare it then it still work
+BEGIN NOT ATOMIC
+DECLARE foo int;
+IF (SELECT 2) OR foo = 3 THEN
+SELECT 4;
+END IF ;
+END;
+$$
+4
+4
+CASE (SELECT 2) OR foo
+WHEN 1 THEN
+SET @x=10;
+$$
+ERROR 42000: Undeclared variable: foo
+/*! WHILE (SELECT 2) OR foo */
+SET @x=10;
+END WHILE;
+$$
+ERROR 42000: Undeclared variable: foo
+REPEAT
+SET @x=10;
+UNTIL (SELECT 2) OR foo
+END REPEAT;
+$$
+ERROR 42000: Undeclared variable: foo
+FOR i IN 1..(SELECT 2) OR foo
+DO
+SET @x=10;
+END FOR;
+$$
+ERROR 42000: Undeclared variable: foo
+# ... but automatic FOR variable still work
+FOR i IN 1..2
+DO
+SELECT i;
+END FOR;
+$$
+i
+1
+i
+2
+#
+# MDEV-21998: Server crashes in st_select_lex::add_table_to_list
+# upon mix of KILL and sequences
+#
+KILL ( SELECT 1 ) + LASTVAL(s);
+ERROR 42000: KILL does not support subqueries or stored functions
+KILL LASTVAL(s);
+ERROR 42000: KILL does not support subqueries or stored functions
# End of 10.4 tests
#
# Start of 10.5 tests
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index c3b4baaf95a..07f2d409d94 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1084,7 +1084,9 @@ CREATE TABLE t1 AS SELECT 1 LIMIT 1 UNION SELECT 2;
--echo # For now, we're testing the parser.
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (10),(20),(30);
+--error ER_AGGREGATE_ORDER_FOR_UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a ORDER BY GROUP_CONCAT(a);
+--error ER_AGGREGATE_ORDER_FOR_UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a ORDER BY GROUP_CONCAT(a ORDER BY a);
DROP TABLE t1;
@@ -1125,8 +1127,11 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (10),(20),(30);
+--error ER_AGGREGATE_ORDER_FOR_UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a WITH ROLLUP ORDER BY GROUP_CONCAT(a);
+--error ER_AGGREGATE_ORDER_FOR_UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a WITH ROLLUP ORDER BY GROUP_CONCAT(a ORDER BY a);
+--error ER_AGGREGATE_ORDER_FOR_UNION
SELECT 1 AS a UNION SELECT a FROM t1 GROUP BY a WITH ROLLUP ORDER BY GROUP_CONCAT(a ORDER BY a) LIMIT 1;
DROP TABLE t1;
@@ -1610,6 +1615,80 @@ SET STATEMENT max_statement_time=180 FOR BACKUP LOCK test.t1;
SET STATEMENT max_statement_time=180 FOR BACKUP UNLOCK;
set SQL_MODE=@save_sql_mode;
+
+--echo #
+--echo # MDEV-21997: Server crashes in LEX::create_item_ident_sp
+--echo # upon use of unknown identifier
+--echo #
+
+--error ER_SP_UNDECLARED_VAR
+/*! IF 1 IN ( SELECT 2 ) OR foo = 3 THEN */ SELECT 4;
+
+
+DELIMITER $$;
+
+--error ER_SP_UNDECLARED_VAR
+BEGIN NOT ATOMIC
+ IF (SELECT 2) OR foo = 3 THEN
+ SELECT 4;
+ END IF ;
+END;
+$$
+
+--echo # ... but if declare it then it still work
+BEGIN NOT ATOMIC
+ DECLARE foo int;
+ IF (SELECT 2) OR foo = 3 THEN
+ SELECT 4;
+ END IF ;
+END;
+$$
+
+--error ER_SP_UNDECLARED_VAR
+CASE (SELECT 2) OR foo
+WHEN 1 THEN
+ SET @x=10;
+$$
+
+--error ER_SP_UNDECLARED_VAR
+/*! WHILE (SELECT 2) OR foo */
+ SET @x=10;
+END WHILE;
+$$
+
+--error ER_SP_UNDECLARED_VAR
+REPEAT
+ SET @x=10;
+UNTIL (SELECT 2) OR foo
+END REPEAT;
+$$
+
+--error ER_SP_UNDECLARED_VAR
+FOR i IN 1..(SELECT 2) OR foo
+DO
+ SET @x=10;
+END FOR;
+$$
+
+--echo # ... but automatic FOR variable still work
+FOR i IN 1..2
+DO
+ SELECT i;
+END FOR;
+$$
+
+DELIMITER ;$$
+
+--echo #
+--echo # MDEV-21998: Server crashes in st_select_lex::add_table_to_list
+--echo # upon mix of KILL and sequences
+--echo #
+
+--error ER_SUBQUERIES_NOT_SUPPORTED
+KILL ( SELECT 1 ) + LASTVAL(s);
+--error ER_SUBQUERIES_NOT_SUPPORTED
+KILL LASTVAL(s);
+
--echo # End of 10.4 tests
diff --git a/mysql-test/main/partition_explicit_prune.result b/mysql-test/main/partition_explicit_prune.result
index 21741bdff73..5b3049c146f 100644
--- a/mysql-test/main/partition_explicit_prune.result
+++ b/mysql-test/main/partition_explicit_prune.result
@@ -1897,6 +1897,24 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
SELECT * FROM t1 PARTITION (p0);
i
UNLOCK TABLES;
+DROP TABLE t1;
+#
+# MDEV-18371 Server crashes in ha_innobase::cmp_ref upon UPDATE with PARTITION clause.
+#
+CREATE TABLE t1 (a INT, b INT, KEY (a)) ENGINE=InnoDB PARTITION BY KEY(b) PARTITIONS 4;
+INSERT INTO t1 VALUES (3,0),(8,2),(7,8),(3,4),(2,4),(0,7),(4,3),(3,6);
+FLUSH TABLES;
+UPDATE t1 PARTITION (p3,p1) SET a = 2 WHERE a = 3;
+SELECT * FROM t1;
+a b
+2 0
+7 8
+2 4
+2 4
+0 7
+4 3
+8 2
+2 6
DROP TABLE t1, t2;
#
# MDEV-18982: INSERT using explicit patition pruning with column list
diff --git a/mysql-test/main/partition_explicit_prune.test b/mysql-test/main/partition_explicit_prune.test
index a516527c055..fdbbcadd8cb 100644
--- a/mysql-test/main/partition_explicit_prune.test
+++ b/mysql-test/main/partition_explicit_prune.test
@@ -874,6 +874,18 @@ SELECT * FROM t1 PARTITION (p0);
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
SELECT * FROM t1 PARTITION (p0);
UNLOCK TABLES;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-18371 Server crashes in ha_innobase::cmp_ref upon UPDATE with PARTITION clause.
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, KEY (a)) ENGINE=InnoDB PARTITION BY KEY(b) PARTITIONS 4;
+INSERT INTO t1 VALUES (3,0),(8,2),(7,8),(3,4),(2,4),(0,7),(4,3),(3,6);
+FLUSH TABLES;
+UPDATE t1 PARTITION (p3,p1) SET a = 2 WHERE a = 3;
+SELECT * FROM t1;
+
# Cleanup
DROP TABLE t1, t2;
diff --git a/mysql-test/main/plugin.result b/mysql-test/main/plugin.result
index 6fbbc0a880a..50986b95ccc 100644
--- a/mysql-test/main/plugin.result
+++ b/mysql-test/main/plugin.result
@@ -342,6 +342,19 @@ ERROR 42S02: Table 'test.t1' doesn't exist
DROP TABLE t1;
# End of 10.1 test
#
+# MDEV-21258: Can't uninstall plugin if the library file doesn't exist
+#
+insert into mysql.plugin values ("unexisting_plugin", "soname");
+select * from mysql.plugin WHERE name='unexisting_plugin';
+name dl
+unexisting_plugin soname
+UNINSTALL PLUGIN unexisting_plugin;
+select * from mysql.plugin WHERE name='unexisting_plugin';
+name dl
+UNINSTALL PLUGIN unexisting_plugin;
+ERROR 42000: PLUGIN unexisting_plugin does not exist
+# End of 10.2 tests
+#
# MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS
#
# INSTALL IF NOT EXISTS PLUGIN name SONAME library /
@@ -403,3 +416,4 @@ INSTALL PLUGIN example SONAME 'ha_example';
CREATE TEMPORARY TABLE t1(a INT) ENGINE=example;
DROP TABLE t1;
UNINSTALL PLUGIN example;
+# End of 10.4 tests
diff --git a/mysql-test/main/plugin.test b/mysql-test/main/plugin.test
index 5a855a1276e..19199f767f5 100644
--- a/mysql-test/main/plugin.test
+++ b/mysql-test/main/plugin.test
@@ -277,8 +277,27 @@ DROP TABLE t1;
--echo # End of 10.1 test
---source include/install_plugin_if_exists.inc
+--echo #
+--echo # MDEV-21258: Can't uninstall plugin if the library file doesn't exist
+--echo #
+
+insert into mysql.plugin values ("unexisting_plugin", "soname");
+
+# check that we have the plugin installed
+select * from mysql.plugin WHERE name='unexisting_plugin';
+
+# make attempt to uninstall the plugin
+UNINSTALL PLUGIN unexisting_plugin;
+# check that we have the plugin uninstalled
+select * from mysql.plugin WHERE name='unexisting_plugin';
+
+--error ER_SP_DOES_NOT_EXIST
+UNINSTALL PLUGIN unexisting_plugin;
+
+--echo # End of 10.2 tests
+
+--source include/install_plugin_if_exists.inc
--echo #
--echo # Make sure temporary tables maintain plugin references properly
@@ -294,3 +313,5 @@ INSTALL PLUGIN example SONAME 'ha_example';
CREATE TEMPORARY TABLE t1(a INT) ENGINE=example;
DROP TABLE t1;
UNINSTALL PLUGIN example;
+
+--echo # End of 10.4 tests
diff --git a/mysql-test/main/rowid_filter_myisam.result b/mysql-test/main/rowid_filter_myisam.result
new file mode 100644
index 00000000000..927257d2cc7
--- /dev/null
+++ b/mysql-test/main/rowid_filter_myisam.result
@@ -0,0 +1,21 @@
+#
+# MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey with rowid_filer=on
+#
+CREATE TABLE t1 (
+a smallint(6) DEFAULT NULL,
+b bigint(20) DEFAULT NULL,
+c varchar(64) DEFAULT NULL,
+d varchar(64) DEFAULT NULL,
+e smallint(6) DEFAULT NULL,
+f bigint(20) DEFAULT NULL,
+KEY a (a),
+KEY d (d),
+KEY f (f)
+) ENGINE=MyISAM;
+ALTER TABLE t1 DISABLE KEYS;
+# Insert a lot of rows
+ALTER TABLE t1 ENABLE KEYS;
+# Must not crash:
+SELECT * FROM t1 WHERE ( a BETWEEN 255 AND 270 OR f = 200 ) AND f IN ( 1, 4, 112, 143 ) AND d IN ('Montana', 'South Dakota');
+a b c d e f
+DROP TABLE t1;
diff --git a/mysql-test/main/rowid_filter_myisam.test b/mysql-test/main/rowid_filter_myisam.test
new file mode 100644
index 00000000000..3ea4dc26ea0
--- /dev/null
+++ b/mysql-test/main/rowid_filter_myisam.test
@@ -0,0 +1,1625 @@
+--echo #
+--echo # MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey with rowid_filer=on
+--echo #
+
+CREATE TABLE t1 (
+ a smallint(6) DEFAULT NULL,
+ b bigint(20) DEFAULT NULL,
+ c varchar(64) DEFAULT NULL,
+ d varchar(64) DEFAULT NULL,
+ e smallint(6) DEFAULT NULL,
+ f bigint(20) DEFAULT NULL,
+ KEY a (a),
+ KEY d (d),
+ KEY f (f)
+) ENGINE=MyISAM;
+
+ALTER TABLE t1 DISABLE KEYS;
+--echo # Insert a lot of rows
+--disable_query_log
+INSERT INTO t1 VALUES (13954,0,NULL,'c',NULL,0);
+INSERT INTO t1 VALUES (124,0,NULL,'j',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'h',NULL,9);
+INSERT INTO t1 VALUES (4,0,NULL,'New Hampshire',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'q',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'f',NULL,NULL);
+INSERT INTO t1 VALUES (2,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'y',NULL,0);
+INSERT INTO t1 VALUES (106,0,NULL,'Hawaii',NULL,-480);
+INSERT INTO t1 VALUES (10534,0,NULL,'South Carolina',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'Iowa',NULL,0);
+INSERT INTO t1 VALUES (6,0,NULL,'g',NULL,9);
+INSERT INTO t1 VALUES (0,0,NULL,'Arkansas',NULL,116);
+INSERT INTO t1 VALUES (0,0,NULL,'b',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'release',NULL,-624);
+INSERT INTO t1 VALUES (169,0,NULL,'s',NULL,664);
+INSERT INTO t1 VALUES (20060,0,NULL,'l',NULL,672);
+INSERT INTO t1 VALUES (NULL,0,NULL,'q',NULL,235);
+INSERT INTO t1 VALUES (1,0,NULL,'Tennessee',NULL,8);
+INSERT INTO t1 VALUES (687,0,NULL,'j',NULL,21);
+INSERT INTO t1 VALUES (-19736,0,NULL,'s',NULL,NULL);
+INSERT INTO t1 VALUES (81,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'festival',NULL,97);
+INSERT INTO t1 VALUES (NULL,0,NULL,'c',NULL,264);
+INSERT INTO t1 VALUES (0,0,NULL,'o',NULL,NULL);
+INSERT INTO t1 VALUES (-30578,0,NULL,'exam',NULL,NULL);
+INSERT INTO t1 VALUES (30751,0,NULL,'Nebraska',NULL,0);
+INSERT INTO t1 VALUES (8,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (29585,0,NULL,'California',NULL,585);
+INSERT INTO t1 VALUES (15376,0,NULL,'Indiana',NULL,768);
+INSERT INTO t1 VALUES (7162,0,NULL,'gifted',NULL,NULL);
+INSERT INTO t1 VALUES (28102,0,NULL,'w',NULL,616);
+INSERT INTO t1 VALUES (NULL,0,NULL,'b',NULL,NULL);
+INSERT INTO t1 VALUES (80,0,NULL,'p',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'o',NULL,282);
+INSERT INTO t1 VALUES (32767,0,NULL,'p',NULL,2);
+INSERT INTO t1 VALUES (255,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (202,0,NULL,'Mississippi',NULL,0);
+INSERT INTO t1 VALUES (16253,0,NULL,'Alaska',NULL,872);
+INSERT INTO t1 VALUES (5,0,NULL,'q',NULL,-656);
+INSERT INTO t1 VALUES (32767,0,NULL,'q',NULL,3);
+INSERT INTO t1 VALUES (7,0,NULL,'Rhode Island',NULL,250);
+INSERT INTO t1 VALUES (0,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,885);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,-56);
+INSERT INTO t1 VALUES (201,0,NULL,'ridiculous',NULL,-704);
+INSERT INTO t1 VALUES (5,0,NULL,'teenage',NULL,82);
+INSERT INTO t1 VALUES (0,0,NULL,'Alabama',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'i',NULL,1);
+INSERT INTO t1 VALUES (-9774,0,NULL,'v',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'y',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Alabama',NULL,NULL);
+INSERT INTO t1 VALUES (7,0,NULL,'e',NULL,8);
+INSERT INTO t1 VALUES (3,0,NULL,'l',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'drift',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'v',NULL,230);
+INSERT INTO t1 VALUES (5926,0,NULL,'Colorado',NULL,254);
+INSERT INTO t1 VALUES (NULL,0,NULL,'South Carolina',NULL,512);
+INSERT INTO t1 VALUES (9,0,NULL,'othapwsr',NULL,NULL);
+INSERT INTO t1 VALUES (23437,0,NULL,'h',NULL,0);
+INSERT INTO t1 VALUES (18863,0,NULL,'guideline',NULL,-80);
+INSERT INTO t1 VALUES (NULL,0,NULL,'s',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New Mexico',NULL,272);
+INSERT INTO t1 VALUES (79,0,NULL,'partnership',NULL,5);
+INSERT INTO t1 VALUES (0,0,NULL,'e',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'r',NULL,128);
+INSERT INTO t1 VALUES (42,0,NULL,'tz',NULL,NULL);
+INSERT INTO t1 VALUES (228,0,NULL,'Utah',NULL,3);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'Alaska',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'wo',NULL,177);
+INSERT INTO t1 VALUES (0,0,NULL,'Maryland',NULL,487);
+INSERT INTO t1 VALUES (-8186,0,NULL,'Colorado',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'uj',NULL,328);
+INSERT INTO t1 VALUES (4,0,NULL,'fork',NULL,0);
+INSERT INTO t1 VALUES (3,0,NULL,'w',NULL,NULL);
+INSERT INTO t1 VALUES (248,0,NULL,'i',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'dmkbqswrmtyabvlfylaxhnqij',NULL,24);
+INSERT INTO t1 VALUES (32767,0,NULL,'achieve',NULL,1);
+INSERT INTO t1 VALUES (32767,0,NULL,'existing',NULL,5);
+INSERT INTO t1 VALUES (6,0,NULL,'master',NULL,-312);
+INSERT INTO t1 VALUES (214,0,NULL,'b',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Michigan',NULL,42);
+INSERT INTO t1 VALUES (NULL,0,NULL,'simply',NULL,109);
+INSERT INTO t1 VALUES (NULL,0,NULL,'sw',NULL,86);
+INSERT INTO t1 VALUES (20697,0,NULL,'m',NULL,5);
+INSERT INTO t1 VALUES (-11693,0,NULL,'mt',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'South Dakota',NULL,NULL);
+INSERT INTO t1 VALUES (14825,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (-9378,0,NULL,'Washington',NULL,593);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New Jersey',NULL,246);
+INSERT INTO t1 VALUES (32767,0,NULL,'q',NULL,-816);
+INSERT INTO t1 VALUES (0,0,NULL,'vl',NULL,232);
+INSERT INTO t1 VALUES (25257,0,NULL,'Nevada',NULL,-24);
+INSERT INTO t1 VALUES (0,0,NULL,'Wisconsin',NULL,9);
+INSERT INTO t1 VALUES (1536,0,NULL,'x',NULL,NULL);
+INSERT INTO t1 VALUES (5895,0,NULL,'Washington',NULL,170);
+INSERT INTO t1 VALUES (28123,0,NULL,'h',NULL,176);
+INSERT INTO t1 VALUES (9,0,NULL,'Tennessee',NULL,948);
+INSERT INTO t1 VALUES (0,0,NULL,'qi',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Tennessee',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Oklahoma',NULL,132);
+INSERT INTO t1 VALUES (-21476,0,NULL,'Montana',NULL,947);
+INSERT INTO t1 VALUES (6,0,NULL,'aevevozlwbltcvzjptgbxw',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'v',NULL,4);
+INSERT INTO t1 VALUES (1,0,NULL,'vo',NULL,73);
+INSERT INTO t1 VALUES (3,0,NULL,'oz',NULL,328);
+INSERT INTO t1 VALUES (17939,0,NULL,'exclude',NULL,175);
+INSERT INTO t1 VALUES (-26579,0,NULL,'bl',NULL,32);
+INSERT INTO t1 VALUES (9,0,NULL,'c',NULL,130);
+INSERT INTO t1 VALUES (-26118,0,NULL,'asian',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'r',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'personal',NULL,8);
+INSERT INTO t1 VALUES (26919,0,NULL,'i',NULL,550);
+INSERT INTO t1 VALUES (NULL,0,NULL,'n',NULL,456);
+INSERT INTO t1 VALUES (NULL,0,NULL,'tg',NULL,-40);
+INSERT INTO t1 VALUES (0,0,NULL,'g',NULL,-720);
+INSERT INTO t1 VALUES (5,0,NULL,'bxwggltplrozn',NULL,92);
+INSERT INTO t1 VALUES (5,0,NULL,'w',NULL,-904);
+INSERT INTO t1 VALUES (-5704,0,NULL,'Idaho',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'t',NULL,2);
+INSERT INTO t1 VALUES (3,0,NULL,'lroznxbayvsjotzfqwye',NULL,-544);
+INSERT INTO t1 VALUES (-32545,0,NULL,'oz',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'x',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'virtually',NULL,38);
+INSERT INTO t1 VALUES (1,0,NULL,'beautiful',NULL,7);
+INSERT INTO t1 VALUES (223,0,NULL,'vs',NULL,9);
+INSERT INTO t1 VALUES (13865,0,NULL,'Arkansas',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'h',NULL,0);
+INSERT INTO t1 VALUES (-24982,0,NULL,'e',NULL,206);
+INSERT INTO t1 VALUES (27039,0,NULL,'rape',NULL,-184);
+INSERT INTO t1 VALUES (NULL,0,NULL,'v',NULL,74);
+INSERT INTO t1 VALUES (NULL,0,NULL,'wyec',NULL,2);
+INSERT INTO t1 VALUES (0,0,NULL,'cook',NULL,59);
+INSERT INTO t1 VALUES (0,0,NULL,'Iowa',NULL,NULL);
+INSERT INTO t1 VALUES (231,0,NULL,'ecfsb',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'p',NULL,370);
+INSERT INTO t1 VALUES (-24801,0,NULL,'New Mexico',NULL,NULL);
+INSERT INTO t1 VALUES (50,0,NULL,'kelhcq',NULL,104);
+INSERT INTO t1 VALUES (NULL,0,NULL,'el',NULL,402);
+INSERT INTO t1 VALUES (15730,0,NULL,'h',NULL,376);
+INSERT INTO t1 VALUES (8,0,NULL,'p',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'h',NULL,4);
+INSERT INTO t1 VALUES (32767,0,NULL,'South Carolina',NULL,382);
+INSERT INTO t1 VALUES (NULL,0,NULL,'invite',NULL,816);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ft',NULL,538);
+INSERT INTO t1 VALUES (8159,0,NULL,'q',NULL,11);
+INSERT INTO t1 VALUES (0,0,NULL,'a',NULL,103);
+INSERT INTO t1 VALUES (7,0,NULL,'n',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New Jersey',NULL,146);
+INSERT INTO t1 VALUES (32767,0,NULL,'odlwznvezd',NULL,295);
+INSERT INTO t1 VALUES (9,0,NULL,'any',NULL,480);
+INSERT INTO t1 VALUES (7,0,NULL,'znvezdlrwfvhpghujmnvqun',NULL,720);
+INSERT INTO t1 VALUES (12792,0,NULL,'Iowa',NULL,NULL);
+INSERT INTO t1 VALUES (148,0,NULL,'Ohio',NULL,89);
+INSERT INTO t1 VALUES (NULL,0,NULL,'lr',NULL,-680);
+INSERT INTO t1 VALUES (-14898,0,NULL,'fv',NULL,736);
+INSERT INTO t1 VALUES (32767,0,NULL,'v',NULL,9);
+INSERT INTO t1 VALUES (5808,0,NULL,'Florida',NULL,112);
+INSERT INTO t1 VALUES (0,0,NULL,'gh',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'mnvqunepbp',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'enemy',NULL,272);
+INSERT INTO t1 VALUES (32767,0,NULL,'unhappy',NULL,8);
+INSERT INTO t1 VALUES (1460,0,NULL,'Connecticut',NULL,780);
+INSERT INTO t1 VALUES (0,0,NULL,'epbpabcgxxmaozb',NULL,230);
+INSERT INTO t1 VALUES (NULL,0,NULL,'banana',NULL,620);
+INSERT INTO t1 VALUES (0,0,NULL,'pabcgxxmaozbofwby',NULL,212);
+INSERT INTO t1 VALUES (32767,0,NULL,'afterward',NULL,0);
+INSERT INTO t1 VALUES (-15421,0,NULL,'important',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Washington',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'m',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'zb',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'position',NULL,-632);
+INSERT INTO t1 VALUES (17,0,NULL,'bofwbypkykzkbnayqfeuzxlyt',NULL,63);
+INSERT INTO t1 VALUES (NULL,0,NULL,'of',NULL,488);
+INSERT INTO t1 VALUES (0,0,NULL,'wbypkykzkbnayqfeuzxlyts',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'insight',NULL,632);
+INSERT INTO t1 VALUES (0,0,NULL,'Arizona',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'pk',NULL,0);
+INSERT INTO t1 VALUES (174,0,NULL,'yk',NULL,194);
+INSERT INTO t1 VALUES (4,0,NULL,'h',NULL,NULL);
+INSERT INTO t1 VALUES (19871,0,NULL,'zkbna',NULL,7);
+INSERT INTO t1 VALUES (NULL,0,NULL,'l',NULL,0);
+INSERT INTO t1 VALUES (-18596,0,NULL,'New York',NULL,488);
+INSERT INTO t1 VALUES (18464,0,NULL,'qfeuzxlyts',NULL,3);
+INSERT INTO t1 VALUES (-21912,0,NULL,'doctor',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'eu',NULL,4);
+INSERT INTO t1 VALUES (0,0,NULL,'xl',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New York',NULL,394);
+INSERT INTO t1 VALUES (NULL,0,NULL,'closest',NULL,928);
+INSERT INTO t1 VALUES (7,0,NULL,'jx',NULL,0);
+INSERT INTO t1 VALUES (8,0,NULL,'Mississippi',NULL,236);
+INSERT INTO t1 VALUES (8238,0,NULL,'n',NULL,2);
+INSERT INTO t1 VALUES (137,0,NULL,'nf',NULL,3);
+INSERT INTO t1 VALUES (7,0,NULL,'mm',NULL,824);
+INSERT INTO t1 VALUES (-13059,0,NULL,'nfojpim',NULL,-40);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,224);
+INSERT INTO t1 VALUES (NULL,0,NULL,'blind',NULL,-296);
+INSERT INTO t1 VALUES (0,0,NULL,'Maryland',NULL,8);
+INSERT INTO t1 VALUES (0,0,NULL,'im',NULL,0);
+INSERT INTO t1 VALUES (88,0,NULL,'Colorado',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'glove',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'qg',NULL,952);
+INSERT INTO t1 VALUES (14297,0,NULL,'level',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'v',NULL,0);
+INSERT INTO t1 VALUES (46,0,NULL,'suspicion',NULL,0);
+INSERT INTO t1 VALUES (7,0,NULL,'Connecticut',NULL,NULL);
+INSERT INTO t1 VALUES (32672,0,NULL,'master',NULL,224);
+INSERT INTO t1 VALUES (255,0,NULL,'suffering',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'bweyg',NULL,343);
+INSERT INTO t1 VALUES (32,0,NULL,'Maine',NULL,-224);
+INSERT INTO t1 VALUES (2888,0,NULL,'rear',NULL,74);
+INSERT INTO t1 VALUES (218,0,NULL,'New Hampshire',NULL,-416);
+INSERT INTO t1 VALUES (NULL,0,NULL,'m',NULL,5);
+INSERT INTO t1 VALUES (7,0,NULL,'compel',NULL,592);
+INSERT INTO t1 VALUES (3,0,NULL,'Vermont',NULL,-424);
+INSERT INTO t1 VALUES (0,0,NULL,'natural',NULL,6);
+INSERT INTO t1 VALUES (4,0,NULL,'f',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'Maryland',NULL,0);
+INSERT INTO t1 VALUES (4128,0,NULL,'lm',NULL,-128);
+INSERT INTO t1 VALUES (0,0,NULL,'circuit',NULL,NULL);
+INSERT INTO t1 VALUES (-23553,0,NULL,'appearance',NULL,9);
+INSERT INTO t1 VALUES (32767,0,NULL,'qr',NULL,0);
+INSERT INTO t1 VALUES (9700,0,NULL,'g',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hr',NULL,9);
+INSERT INTO t1 VALUES (229,0,NULL,'West Virginia',NULL,244);
+INSERT INTO t1 VALUES (10379,0,NULL,'i',NULL,211);
+INSERT INTO t1 VALUES (0,0,NULL,'personal',NULL,5);
+INSERT INTO t1 VALUES (4298,0,NULL,'z',NULL,985);
+INSERT INTO t1 VALUES (157,0,NULL,'e',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'p',NULL,5);
+INSERT INTO t1 VALUES (32767,0,NULL,'lg',NULL,527);
+INSERT INTO t1 VALUES (1,0,NULL,'t',NULL,208);
+INSERT INTO t1 VALUES (5,0,NULL,'Kansas',NULL,587);
+INSERT INTO t1 VALUES (-31188,0,NULL,'e',NULL,408);
+INSERT INTO t1 VALUES (NULL,0,NULL,'v',NULL,146);
+INSERT INTO t1 VALUES (15527,0,NULL,'vd',NULL,-200);
+INSERT INTO t1 VALUES (11164,0,NULL,'pthiwwamjdavik',NULL,117);
+INSERT INTO t1 VALUES (46,0,NULL,'iw',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'a',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'gradually',NULL,0);
+INSERT INTO t1 VALUES (-21366,0,NULL,'refer',NULL,146);
+INSERT INTO t1 VALUES (20927,0,NULL,'c',NULL,0);
+INSERT INTO t1 VALUES (43,0,NULL,'Florida',NULL,968);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ko',NULL,NULL);
+INSERT INTO t1 VALUES (242,0,NULL,'jrydpgfyxhfqsu',NULL,-800);
+INSERT INTO t1 VALUES (-12797,0,NULL,'ry',NULL,7);
+INSERT INTO t1 VALUES (6,0,NULL,'x',NULL,228);
+INSERT INTO t1 VALUES (9,0,NULL,'y',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'w',NULL,4);
+INSERT INTO t1 VALUES (127,0,NULL,'Maryland',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'h',NULL,NULL);
+INSERT INTO t1 VALUES (7,0,NULL,'qs',NULL,512);
+INSERT INTO t1 VALUES (30910,0,NULL,'disturb',NULL,960);
+INSERT INTO t1 VALUES (NULL,0,NULL,'lx',NULL,4);
+INSERT INTO t1 VALUES (94,0,NULL,'dhc',NULL,0);
+INSERT INTO t1 VALUES (247,0,NULL,'ca',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'fi',NULL,-488);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,3);
+INSERT INTO t1 VALUES (9,0,NULL,'Connecticut',NULL,552);
+INSERT INTO t1 VALUES (0,0,NULL,'register',NULL,0);
+INSERT INTO t1 VALUES (-8679,0,NULL,'bk',NULL,-760);
+INSERT INTO t1 VALUES (32767,0,NULL,'orbit',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'kvm',NULL,7);
+INSERT INTO t1 VALUES (0,0,NULL,'mdqbjxjh',NULL,680);
+INSERT INTO t1 VALUES (32767,0,NULL,'m',NULL,-272);
+INSERT INTO t1 VALUES (0,0,NULL,'bj',NULL,0);
+INSERT INTO t1 VALUES (22547,0,NULL,'xj',NULL,194);
+INSERT INTO t1 VALUES (-32403,0,NULL,'gj',NULL,240);
+INSERT INTO t1 VALUES (6394,0,NULL,'Arizona',NULL,16);
+INSERT INTO t1 VALUES (4,0,NULL,'z',NULL,488);
+INSERT INTO t1 VALUES (114,0,NULL,'i',NULL,0);
+INSERT INTO t1 VALUES (3710,0,NULL,'p',NULL,291);
+INSERT INTO t1 VALUES (28654,0,NULL,'empty',NULL,245);
+INSERT INTO t1 VALUES (9849,0,NULL,'Pennsylvania',NULL,0);
+INSERT INTO t1 VALUES (185,0,NULL,'j',NULL,320);
+INSERT INTO t1 VALUES (5,0,NULL,'Tennessee',NULL,7);
+INSERT INTO t1 VALUES (154,0,NULL,'hl',NULL,157);
+INSERT INTO t1 VALUES (NULL,0,NULL,'lo',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hc',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'must',NULL,755);
+INSERT INTO t1 VALUES (132,0,NULL,'m',NULL,95);
+INSERT INTO t1 VALUES (193,0,NULL,'poke',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'o',NULL,-656);
+INSERT INTO t1 VALUES (172,0,NULL,'e',NULL,0);
+INSERT INTO t1 VALUES (7642,0,NULL,'feeling',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'cwmtpp',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'e',NULL,115);
+INSERT INTO t1 VALUES (32767,0,NULL,'Florida',NULL,505);
+INSERT INTO t1 VALUES (3,0,NULL,'Maryland',NULL,97);
+INSERT INTO t1 VALUES (NULL,0,NULL,'kill',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'qf',NULL,623);
+INSERT INTO t1 VALUES (0,0,NULL,'fz',NULL,812);
+INSERT INTO t1 VALUES (NULL,0,NULL,'greek',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'kglhiuodplizizzobpcq',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'l',NULL,0);
+INSERT INTO t1 VALUES (159,0,NULL,'s',NULL,7);
+INSERT INTO t1 VALUES (-25560,0,NULL,'z',NULL,656);
+INSERT INTO t1 VALUES (189,0,NULL,'u',NULL,0);
+INSERT INTO t1 VALUES (27110,0,NULL,'leather',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'li',NULL,944);
+INSERT INTO t1 VALUES (0,0,NULL,'attract',NULL,NULL);
+INSERT INTO t1 VALUES (9,0,NULL,'structural',NULL,71);
+INSERT INTO t1 VALUES (NULL,0,NULL,'settlement',NULL,4);
+INSERT INTO t1 VALUES (-15549,0,NULL,'n',NULL,564);
+INSERT INTO t1 VALUES (30391,0,NULL,'k',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'ob',NULL,NULL);
+INSERT INTO t1 VALUES (224,0,NULL,'bpcqqji',NULL,413);
+INSERT INTO t1 VALUES (32767,0,NULL,'nowhere',NULL,8);
+INSERT INTO t1 VALUES (15281,0,NULL,'Arkansas',NULL,-912);
+INSERT INTO t1 VALUES (-9327,0,NULL,'d',NULL,-904);
+INSERT INTO t1 VALUES (14055,0,NULL,'i',NULL,293);
+INSERT INTO t1 VALUES (3,0,NULL,'Louisiana',NULL,224);
+INSERT INTO t1 VALUES (NULL,0,NULL,'pw',NULL,-624);
+INSERT INTO t1 VALUES (32767,0,NULL,'nevertheless',NULL,208);
+INSERT INTO t1 VALUES (NULL,0,NULL,'z',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'spectacular',NULL,104);
+INSERT INTO t1 VALUES (0,0,NULL,'digital',NULL,89);
+INSERT INTO t1 VALUES (5,0,NULL,'aq',NULL,40);
+INSERT INTO t1 VALUES (NULL,0,NULL,'tm',NULL,411);
+INSERT INTO t1 VALUES (11726,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (3188,0,NULL,'knykleafajkq',NULL,0);
+INSERT INTO t1 VALUES (1,0,NULL,'technology',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'y',NULL,58);
+INSERT INTO t1 VALUES (67,0,NULL,'a',NULL,0);
+INSERT INTO t1 VALUES (-6719,0,NULL,'n',NULL,136);
+INSERT INTO t1 VALUES (8000,0,NULL,'j',NULL,-248);
+INSERT INTO t1 VALUES (32767,0,NULL,'snow',NULL,8);
+INSERT INTO t1 VALUES (-3623,0,NULL,'d',NULL,920);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,NULL);
+INSERT INTO t1 VALUES (3239,0,NULL,'Kansas',NULL,102);
+INSERT INTO t1 VALUES (7132,0,NULL,'zt',NULL,88);
+INSERT INTO t1 VALUES (-21941,0,NULL,'Tennessee',NULL,77);
+INSERT INTO t1 VALUES (45,0,NULL,'Virginia',NULL,3);
+INSERT INTO t1 VALUES (166,0,NULL,'m',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'l',NULL,-880);
+INSERT INTO t1 VALUES (205,0,NULL,'Idaho',NULL,NULL);
+INSERT INTO t1 VALUES (10679,0,NULL,'f',NULL,2);
+INSERT INTO t1 VALUES (172,0,NULL,'North Dakota',NULL,NULL);
+INSERT INTO t1 VALUES (30942,0,NULL,'Indiana',NULL,832);
+INSERT INTO t1 VALUES (1824,0,NULL,'m',NULL,NULL);
+INSERT INTO t1 VALUES (34,0,NULL,'stumble',NULL,440);
+INSERT INTO t1 VALUES (12955,0,NULL,'juror',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'South Dakota',NULL,5);
+INSERT INTO t1 VALUES (25891,0,NULL,'j',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'clerk',NULL,39);
+INSERT INTO t1 VALUES (13187,0,NULL,'gw',NULL,811);
+INSERT INTO t1 VALUES (0,0,NULL,'x',NULL,583);
+INSERT INTO t1 VALUES (6,0,NULL,'fb',NULL,140);
+INSERT INTO t1 VALUES (32767,0,NULL,'vp',NULL,781);
+INSERT INTO t1 VALUES (0,0,NULL,'if',NULL,NULL);
+INSERT INTO t1 VALUES (7497,0,NULL,'New Hampshire',NULL,233);
+INSERT INTO t1 VALUES (155,0,NULL,'e',NULL,NULL);
+INSERT INTO t1 VALUES (-18830,0,NULL,'q',NULL,84);
+INSERT INTO t1 VALUES (3815,0,NULL,'yy',NULL,8);
+INSERT INTO t1 VALUES (0,0,NULL,'Kansas',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'yqspnupv',NULL,0);
+INSERT INTO t1 VALUES (1,0,NULL,'hers',NULL,688);
+INSERT INTO t1 VALUES (32767,0,NULL,'pnupvmuqjaojhylsrbqichox',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'x',NULL,8);
+INSERT INTO t1 VALUES (3,0,NULL,'North Carolina',NULL,-88);
+INSERT INTO t1 VALUES (92,0,NULL,'u',NULL,0);
+INSERT INTO t1 VALUES (32126,0,NULL,'sensation',NULL,226);
+INSERT INTO t1 VALUES (4,0,NULL,'muqjao',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'aojhylsrbqichoxl',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'tribe',NULL,0);
+INSERT INTO t1 VALUES (142,0,NULL,'jhy',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'w',NULL,622);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New York',NULL,-56);
+INSERT INTO t1 VALUES (-24954,0,NULL,'bqichoxlxsarzbqouvscstrtpofjbbjrci',NULL,8);
+INSERT INTO t1 VALUES (4105,0,NULL,'New Hampshire',NULL,247);
+INSERT INTO t1 VALUES (0,0,NULL,'k',NULL,0);
+INSERT INTO t1 VALUES (46,0,NULL,'reader',NULL,400);
+INSERT INTO t1 VALUES (-29286,0,NULL,'ho',NULL,NULL);
+INSERT INTO t1 VALUES (169,0,NULL,'mr',NULL,0);
+INSERT INTO t1 VALUES (9,0,NULL,'y',NULL,333);
+INSERT INTO t1 VALUES (25168,0,NULL,'New Jersey',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'queen',NULL,2);
+INSERT INTO t1 VALUES (9,0,NULL,'bow',NULL,NULL);
+INSERT INTO t1 VALUES (7,0,NULL,'satellite',NULL,NULL);
+INSERT INTO t1 VALUES (1,0,NULL,'u',NULL,31);
+INSERT INTO t1 VALUES (NULL,0,NULL,'scstrtpofjbbjrcijlkzoyh',NULL,70);
+INSERT INTO t1 VALUES (26275,0,NULL,'b',NULL,7);
+INSERT INTO t1 VALUES (227,0,NULL,'card',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'p',NULL,140);
+INSERT INTO t1 VALUES (4,0,NULL,'Oregon',NULL,556);
+INSERT INTO t1 VALUES (-12170,0,NULL,'Missouri',NULL,292);
+INSERT INTO t1 VALUES (NULL,0,NULL,'bjrcijlkzoyhy',NULL,251);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ci',NULL,NULL);
+INSERT INTO t1 VALUES (69,0,NULL,'g',NULL,-456);
+INSERT INTO t1 VALUES (NULL,0,NULL,'f',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hynudnmi',NULL,45);
+INSERT INTO t1 VALUES (-30445,0,NULL,'widespread',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Maryland',NULL,407);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Delaware',NULL,-40);
+INSERT INTO t1 VALUES (30059,0,NULL,'n',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'u',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'znwacpbwghlegvykaobxv',NULL,7);
+INSERT INTO t1 VALUES (174,0,NULL,'r',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'West Virginia',NULL,71);
+INSERT INTO t1 VALUES (2593,0,NULL,'z',NULL,2);
+INSERT INTO t1 VALUES (-28371,0,NULL,'v',NULL,89);
+INSERT INTO t1 VALUES (23749,0,NULL,'e',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'w',NULL,183);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ghl',NULL,776);
+INSERT INTO t1 VALUES (4,0,NULL,'Mississippi',NULL,8);
+INSERT INTO t1 VALUES (9210,0,NULL,'z',NULL,246);
+INSERT INTO t1 VALUES (12724,0,NULL,'South Dakota',NULL,222);
+INSERT INTO t1 VALUES (NULL,0,NULL,'outlet',NULL,790);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Indiana',NULL,-8);
+INSERT INTO t1 VALUES (NULL,0,NULL,'aob',NULL,0);
+INSERT INTO t1 VALUES (7,0,NULL,'tell',NULL,-648);
+INSERT INTO t1 VALUES (0,0,NULL,'u',NULL,381);
+INSERT INTO t1 VALUES (7,0,NULL,'vqhhtakqoppfcrb',NULL,747);
+INSERT INTO t1 VALUES (4,0,NULL,'Arkansas',NULL,816);
+INSERT INTO t1 VALUES (0,0,NULL,'slight',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'upset',NULL,4);
+INSERT INTO t1 VALUES (-17416,0,NULL,'Nebraska',NULL,9);
+INSERT INTO t1 VALUES (137,0,NULL,'takqoppfcrbangizjeqc',NULL,672);
+INSERT INTO t1 VALUES (-326,0,NULL,'spill',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'w',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'crb',NULL,166);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Mississippi',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'ba',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'a',NULL,1);
+INSERT INTO t1 VALUES (61,0,NULL,'izj',NULL,-744);
+INSERT INTO t1 VALUES (-26413,0,NULL,'Nevada',NULL,NULL);
+INSERT INTO t1 VALUES (6,0,NULL,'Mississippi',NULL,416);
+INSERT INTO t1 VALUES (0,0,NULL,'Nevada',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'b',NULL,470);
+INSERT INTO t1 VALUES (2864,0,NULL,'x',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Montana',NULL,248);
+INSERT INTO t1 VALUES (32767,0,NULL,'y',NULL,2);
+INSERT INTO t1 VALUES (0,0,NULL,'Arkansas',NULL,107);
+INSERT INTO t1 VALUES (243,0,NULL,'bb',NULL,NULL);
+INSERT INTO t1 VALUES (-7006,0,NULL,'y',NULL,262);
+INSERT INTO t1 VALUES (29170,0,NULL,'data',NULL,257);
+INSERT INTO t1 VALUES (NULL,0,NULL,'procedure',NULL,5);
+INSERT INTO t1 VALUES (NULL,0,NULL,'u',NULL,182);
+INSERT INTO t1 VALUES (0,0,NULL,'lczldnxhwgkrabptlqda',NULL,158);
+INSERT INTO t1 VALUES (10754,0,NULL,'cream',NULL,0);
+INSERT INTO t1 VALUES (31943,0,NULL,'open',NULL,4);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hwg',NULL,NULL);
+INSERT INTO t1 VALUES (5,0,NULL,'Wyoming',NULL,NULL);
+INSERT INTO t1 VALUES (-27782,0,NULL,'r',NULL,187);
+INSERT INTO t1 VALUES (32767,0,NULL,'ab',NULL,0);
+INSERT INTO t1 VALUES (3,0,NULL,'ptlqda',NULL,-288);
+INSERT INTO t1 VALUES (32767,0,NULL,'q',NULL,72);
+INSERT INTO t1 VALUES (-22284,0,NULL,'e',NULL,664);
+INSERT INTO t1 VALUES (7,0,NULL,'Florida',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'movfyh',NULL,-784);
+INSERT INTO t1 VALUES (NULL,0,NULL,'vfy',NULL,784);
+INSERT INTO t1 VALUES (37,0,NULL,'h',NULL,105);
+INSERT INTO t1 VALUES (32767,0,NULL,'r',NULL,0);
+INSERT INTO t1 VALUES (145,0,NULL,'Hawaii',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Minnesota',NULL,0);
+INSERT INTO t1 VALUES (4,0,NULL,'ov',NULL,181);
+INSERT INTO t1 VALUES (0,0,NULL,'coming',NULL,5);
+INSERT INTO t1 VALUES (32767,0,NULL,'mnry',NULL,946);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Arizona',NULL,NULL);
+INSERT INTO t1 VALUES (-2368,0,NULL,'c',NULL,0);
+INSERT INTO t1 VALUES (-21715,0,NULL,'ljfxl',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Wyoming',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'fxlxhdnief',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'MariaDB is a community-developed, commercially',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Mississippi',NULL,624);
+INSERT INTO t1 VALUES (6,0,NULL,'h',NULL,198);
+INSERT INTO t1 VALUES (-11442,0,NULL,'Massachusetts',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'i',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'draw',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'k',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'ztabdvhywbflylhukxqufevtdhnfzpccsuyvzargiogjfsnofsruoqac',NULL,53);
+INSERT INTO t1 VALUES (0,0,NULL,'all',NULL,994);
+INSERT INTO t1 VALUES (-18287,0,NULL,'abdvhywbflylhukxqu',NULL,878);
+INSERT INTO t1 VALUES (0,0,NULL,'Wyoming',NULL,847);
+INSERT INTO t1 VALUES (6,0,NULL,'dv',NULL,204);
+INSERT INTO t1 VALUES (246,0,NULL,'ywbflylhukxqufevtdhnfzpccsuyvzargiogjfsnofsruo',NULL,183);
+INSERT INTO t1 VALUES (20335,0,NULL,'f',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'l',NULL,223);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hukxqufevtdhnfzpccsuyvzargiogjfsnofsruoqacwwy',NULL,577);
+INSERT INTO t1 VALUES (180,0,NULL,'qu',NULL,6);
+INSERT INTO t1 VALUES (9,0,NULL,'f',NULL,8);
+INSERT INTO t1 VALUES (27881,0,NULL,'vt',NULL,2);
+INSERT INTO t1 VALUES (3,0,NULL,'tdhnfzpccsuyvzargiogjfsnofsr',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Alabama',NULL,200);
+INSERT INTO t1 VALUES (32767,0,NULL,'fzpccsuyv',NULL,20);
+INSERT INTO t1 VALUES (7,0,NULL,'p',NULL,180);
+INSERT INTO t1 VALUES (32767,0,NULL,'South Dakota',NULL,496);
+INSERT INTO t1 VALUES (23704,0,NULL,'uyvzargiogjfsnofsruoqacwwygpgvfsciovxyvstsktvbpcoliqfqjmavyv',NULL,744);
+INSERT INTO t1 VALUES (7,0,NULL,'za',NULL,4);
+INSERT INTO t1 VALUES (0,0,NULL,'straighten',NULL,198);
+INSERT INTO t1 VALUES (1200,0,NULL,'iogjfsnofsruoqacwwygpgv',NULL,NULL);
+INSERT INTO t1 VALUES (8559,0,NULL,'j',NULL,NULL);
+INSERT INTO t1 VALUES (-11567,0,NULL,'n',NULL,39);
+INSERT INTO t1 VALUES (0,0,NULL,'New Jersey',NULL,723);
+INSERT INTO t1 VALUES (NULL,0,NULL,'sruoqacwwygpgvfsciovxyv',NULL,150);
+INSERT INTO t1 VALUES (0,0,NULL,'Massachusetts',NULL,157);
+INSERT INTO t1 VALUES (10891,0,NULL,'scared',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'q',NULL,952);
+INSERT INTO t1 VALUES (10180,0,NULL,'a',NULL,322);
+INSERT INTO t1 VALUES (-32693,0,NULL,'hunt',NULL,-728);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'yg',NULL,83);
+INSERT INTO t1 VALUES (13866,0,NULL,'gp',NULL,277);
+INSERT INTO t1 VALUES (32767,0,NULL,'Maine',NULL,822);
+INSERT INTO t1 VALUES (19051,0,NULL,'quickly',NULL,2);
+INSERT INTO t1 VALUES (14284,0,NULL,'fsciovxyvstsktvbpcoliqfqjmavyvpmtdrynjkbhcxfvua',NULL,NULL);
+INSERT INTO t1 VALUES (10873,0,NULL,'Utah',NULL,0);
+INSERT INTO t1 VALUES (125,0,NULL,'q',NULL,NULL);
+INSERT INTO t1 VALUES (29916,0,NULL,'xyvstsktvbpcoliqfqjmavyvpmtdrynjkbhcxfv',NULL,547);
+INSERT INTO t1 VALUES (0,0,NULL,'Arizona',NULL,NULL);
+INSERT INTO t1 VALUES (212,0,NULL,'Kansas',NULL,650);
+INSERT INTO t1 VALUES (NULL,0,NULL,'trick',NULL,87);
+INSERT INTO t1 VALUES (1,0,NULL,'assign',NULL,135);
+INSERT INTO t1 VALUES (0,0,NULL,'tsktvbpcoliqfqjmavyvpmtdrynjkbhcxfvuaaupgnpusgz',NULL,237);
+INSERT INTO t1 VALUES (8,0,NULL,'o',NULL,NULL);
+INSERT INTO t1 VALUES (-31777,0,NULL,'t',NULL,1);
+INSERT INTO t1 VALUES (-10171,0,NULL,'pcoliqfqjmavyvpmtdrynjkbhcxfvuaaupgnpusgzncwf',NULL,0);
+INSERT INTO t1 VALUES (7826,0,NULL,'council',NULL,273);
+INSERT INTO t1 VALUES (20426,0,NULL,'r',NULL,9);
+INSERT INTO t1 VALUES (32767,0,NULL,'qf',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'qjmavyvpmtdrynjkbhcxfvuaaupg',NULL,440);
+INSERT INTO t1 VALUES (NULL,0,NULL,'s',NULL,-608);
+INSERT INTO t1 VALUES (0,0,NULL,'vyv',NULL,111);
+INSERT INTO t1 VALUES (225,0,NULL,'Michigan',NULL,NULL);
+INSERT INTO t1 VALUES (10391,0,NULL,'p',NULL,2);
+INSERT INTO t1 VALUES (3,0,NULL,'td',NULL,-480);
+INSERT INTO t1 VALUES (0,0,NULL,'z',NULL,587);
+INSERT INTO t1 VALUES (2180,0,NULL,'r',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'njkbhcxfvuaaupgnpusgzncwf',NULL,-984);
+INSERT INTO t1 VALUES (81,0,NULL,'bhcxfvuaaupgnpusgzncw',NULL,146);
+INSERT INTO t1 VALUES (165,0,NULL,'u',NULL,201);
+INSERT INTO t1 VALUES (11251,0,NULL,'c',NULL,NULL);
+INSERT INTO t1 VALUES (11703,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (236,0,NULL,'opinion',NULL,207);
+INSERT INTO t1 VALUES (32767,0,NULL,'Louisiana',NULL,-744);
+INSERT INTO t1 VALUES (-29220,0,NULL,'Massachusetts',NULL,409);
+INSERT INTO t1 VALUES (NULL,0,NULL,'up',NULL,169);
+INSERT INTO t1 VALUES (18778,0,NULL,'Alabama',NULL,241);
+INSERT INTO t1 VALUES (11959,0,NULL,'npusgzncwfwwbhfynsnzhmkxgjtfjjc',NULL,66);
+INSERT INTO t1 VALUES (30179,0,NULL,'Hawaii',NULL,7);
+INSERT INTO t1 VALUES (NULL,0,NULL,'s',NULL,100);
+INSERT INTO t1 VALUES (214,0,NULL,'New Hampshire',NULL,984);
+INSERT INTO t1 VALUES (5,0,NULL,'remove',NULL,NULL);
+INSERT INTO t1 VALUES (143,0,NULL,'w',NULL,0);
+INSERT INTO t1 VALUES (3,0,NULL,'Pennsylvania',NULL,696);
+INSERT INTO t1 VALUES (191,0,NULL,'b',NULL,816);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hfynsnzhmkxgjtfjjcwggesvfockyauicjqw',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'m',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'Arkansas',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'s',NULL,6);
+INSERT INTO t1 VALUES (1,0,NULL,'mk',NULL,36);
+INSERT INTO t1 VALUES (8215,0,NULL,'xg',NULL,320);
+INSERT INTO t1 VALUES (32767,0,NULL,'g',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'South Dakota',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'object',NULL,NULL);
+INSERT INTO t1 VALUES (26142,0,NULL,'magnetic',NULL,-936);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Idaho',NULL,376);
+INSERT INTO t1 VALUES (NULL,0,NULL,'g',NULL,0);
+INSERT INTO t1 VALUES (-14759,0,NULL,'n',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'svfockyauic',NULL,197);
+INSERT INTO t1 VALUES (25,0,NULL,'v',NULL,440);
+INSERT INTO t1 VALUES (239,0,NULL,'c',NULL,642);
+INSERT INTO t1 VALUES (189,0,NULL,'yauicjqwkwedvcvhsbvsgtjvqul',NULL,38);
+INSERT INTO t1 VALUES (-5515,0,NULL,'auicjqwkwedvcvhsbvsgtjvqulz',NULL,NULL);
+INSERT INTO t1 VALUES (25879,0,NULL,'i',NULL,416);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,-760);
+INSERT INTO t1 VALUES (1,0,NULL,'Delaware',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'w',NULL,250);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,232);
+INSERT INTO t1 VALUES (99,0,NULL,'j',NULL,-552);
+INSERT INTO t1 VALUES (0,0,NULL,'full-time',NULL,10);
+INSERT INTO t1 VALUES (NULL,0,NULL,'suffer',NULL,185);
+INSERT INTO t1 VALUES (19461,0,NULL,'recognize',NULL,8);
+INSERT INTO t1 VALUES (130,0,NULL,'learning',NULL,559);
+INSERT INTO t1 VALUES (4,0,NULL,'grain',NULL,336);
+INSERT INTO t1 VALUES (6,0,NULL,'correspondent',NULL,71);
+INSERT INTO t1 VALUES (9,0,NULL,'b',NULL,5);
+INSERT INTO t1 VALUES (18778,0,NULL,'practitioner',NULL,6);
+INSERT INTO t1 VALUES (2291,0,NULL,'California',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'vq',NULL,0);
+INSERT INTO t1 VALUES (34,0,NULL,'ul',NULL,81);
+INSERT INTO t1 VALUES (-21757,0,NULL,'k',NULL,587);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New Hampshire',NULL,739);
+INSERT INTO t1 VALUES (24,0,NULL,'o',NULL,NULL);
+INSERT INTO t1 VALUES (26917,0,NULL,'m',NULL,102);
+INSERT INTO t1 VALUES (55,0,NULL,'djvzvjevgpptiurzrjvnxsfvylicylrpwhdxky',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'k',NULL,537);
+INSERT INTO t1 VALUES (-10683,0,NULL,'Nevada',NULL,6);
+INSERT INTO t1 VALUES (-30580,0,NULL,'fall',NULL,432);
+INSERT INTO t1 VALUES (0,0,NULL,'Pennsylvania',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'e',NULL,0);
+INSERT INTO t1 VALUES (8,0,NULL,'Massachusetts',NULL,959);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Hawaii',NULL,NULL);
+INSERT INTO t1 VALUES (11119,0,NULL,'weaken',NULL,560);
+INSERT INTO t1 VALUES (-7660,0,NULL,'Massachusetts',NULL,752);
+INSERT INTO t1 VALUES (38,0,NULL,'c',NULL,0);
+INSERT INTO t1 VALUES (23593,0,NULL,'rzrjvnx',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'zr',NULL,7);
+INSERT INTO t1 VALUES (32767,0,NULL,'vn',NULL,0);
+INSERT INTO t1 VALUES (5,0,NULL,'sfv',NULL,0);
+INSERT INTO t1 VALUES (2,0,NULL,'v',NULL,242);
+INSERT INTO t1 VALUES (0,0,NULL,'o',NULL,2);
+INSERT INTO t1 VALUES (24986,0,NULL,'Delaware',NULL,9);
+INSERT INTO t1 VALUES (32767,0,NULL,'r',NULL,968);
+INSERT INTO t1 VALUES (-17056,0,NULL,'human',NULL,245);
+INSERT INTO t1 VALUES (0,0,NULL,'New Hampshire',NULL,4);
+INSERT INTO t1 VALUES (2,0,NULL,'rpwhdxkyahrnbjkssbbgjdtkk',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'g',NULL,NULL);
+INSERT INTO t1 VALUES (2,0,NULL,'hdxkyahrnbjkssbbgjdt',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'xk',NULL,840);
+INSERT INTO t1 VALUES (145,0,NULL,'picture',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'h',NULL,713);
+INSERT INTO t1 VALUES (-22009,0,NULL,'New Hampshire',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'x',NULL,225);
+INSERT INTO t1 VALUES (0,0,NULL,'accomplish',NULL,0);
+INSERT INTO t1 VALUES (166,0,NULL,'j',NULL,4);
+INSERT INTO t1 VALUES (24484,0,NULL,'South Dakota',NULL,117);
+INSERT INTO t1 VALUES (0,0,NULL,'Ohio',NULL,1);
+INSERT INTO t1 VALUES (149,0,NULL,'prepare',NULL,958);
+INSERT INTO t1 VALUES (9,0,NULL,'i',NULL,496);
+INSERT INTO t1 VALUES (0,0,NULL,'she',NULL,328);
+INSERT INTO t1 VALUES (0,0,NULL,'bbgjdtkkkntfogehrocicikzsxdkdefzskjbcdqkaawqmtxnpefrdshgm',NULL,NULL);
+INSERT INTO t1 VALUES (206,0,NULL,'gjdtkkkntfogehrocicikzsxdkdefzskjbcdqkaawqmtxnpefrdshgmyujlf',NULL,678);
+INSERT INTO t1 VALUES (83,0,NULL,'teenager',NULL,290);
+INSERT INTO t1 VALUES (32767,0,NULL,'tkkkntfogehrocicikzsxdkdefzskjbcdqkaawqmtxnpefrdshgmyujlfbpksd',NULL,12);
+INSERT INTO t1 VALUES (0,0,NULL,'kntfogehrocicikzsxdkdefzskjbcdqkaawqmtxnpefrdshgmyujlfbpksd',NULL,79);
+INSERT INTO t1 VALUES (-1536,0,NULL,'n',NULL,192);
+INSERT INTO t1 VALUES (0,0,NULL,'ignore',NULL,0);
+INSERT INTO t1 VALUES (28936,0,NULL,'gehrocicikzsxdkdefzskjbcd',NULL,191);
+INSERT INTO t1 VALUES (2,0,NULL,'rocicikzsxdkdefzskjbcdqkaawqmtxnpefrdshgmyujlfbpksdqbcozg',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'southwest',NULL,0);
+INSERT INTO t1 VALUES (-14649,0,NULL,'icikzsxdkdefzskjbcdqkaawqmtxnp',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'i',NULL,144);
+INSERT INTO t1 VALUES (54,0,NULL,'investigation',NULL,NULL);
+INSERT INTO t1 VALUES (1,0,NULL,'Missouri',NULL,-880);
+INSERT INTO t1 VALUES (0,0,NULL,'Minnesota',NULL,-144);
+INSERT INTO t1 VALUES (NULL,0,NULL,'seek',NULL,NULL);
+INSERT INTO t1 VALUES (92,0,NULL,'critical',NULL,NULL);
+INSERT INTO t1 VALUES (-19917,0,NULL,'dancing',NULL,11);
+INSERT INTO t1 VALUES (32767,0,NULL,'k',NULL,9);
+INSERT INTO t1 VALUES (5,0,NULL,'efzskjbcd',NULL,520);
+INSERT INTO t1 VALUES (NULL,0,NULL,'l',NULL,9);
+INSERT INTO t1 VALUES (-18309,0,NULL,'x',NULL,0);
+INSERT INTO t1 VALUES (30791,0,NULL,'v',NULL,883);
+INSERT INTO t1 VALUES (17054,0,NULL,'quite',NULL,199);
+INSERT INTO t1 VALUES (0,0,NULL,'Illinois',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'thought',NULL,6);
+INSERT INTO t1 VALUES (32767,0,NULL,'aa',NULL,240);
+INSERT INTO t1 VALUES (1,0,NULL,'builder',NULL,0);
+INSERT INTO t1 VALUES (2,0,NULL,'bread',NULL,478);
+INSERT INTO t1 VALUES (9,0,NULL,'mt',NULL,464);
+INSERT INTO t1 VALUES (0,0,NULL,'t',NULL,471);
+INSERT INTO t1 VALUES (249,0,NULL,'npefrdshgmyujlfbpksdqbcozgqnzxeuyjrdnutvbnf',NULL,272);
+INSERT INTO t1 VALUES (-5659,0,NULL,'ef',NULL,845);
+INSERT INTO t1 VALUES (32767,0,NULL,'Maine',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'project',NULL,-880);
+INSERT INTO t1 VALUES (203,0,NULL,'f',NULL,569);
+INSERT INTO t1 VALUES (6615,0,NULL,'z',NULL,820);
+INSERT INTO t1 VALUES (0,0,NULL,'highlight',NULL,0);
+INSERT INTO t1 VALUES (28099,0,NULL,'Louisiana',NULL,-528);
+INSERT INTO t1 VALUES (NULL,0,NULL,'j',NULL,NULL);
+INSERT INTO t1 VALUES (244,0,NULL,'f',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'mutter',NULL,3);
+INSERT INTO t1 VALUES (32767,0,NULL,'i',NULL,4);
+INSERT INTO t1 VALUES (-11010,0,NULL,'e',NULL,294);
+INSERT INTO t1 VALUES (214,0,NULL,'c',NULL,-32);
+INSERT INTO t1 VALUES (8,0,NULL,'ozgqnzxeuyjrdnutvbnfsjye',NULL,275);
+INSERT INTO t1 VALUES (0,0,NULL,'m',NULL,808);
+INSERT INTO t1 VALUES (-17980,0,NULL,'dip',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'Virginia',NULL,222);
+INSERT INTO t1 VALUES (218,0,NULL,'opponent',NULL,8);
+INSERT INTO t1 VALUES (32767,0,NULL,'xeuyjrdnutvbnfsjyeke',NULL,3);
+INSERT INTO t1 VALUES (1,0,NULL,'jrdnutvbnfsjyekezjixrjdkyqgpokqquixax',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'s',NULL,NULL);
+INSERT INTO t1 VALUES (234,0,NULL,'g',NULL,99);
+INSERT INTO t1 VALUES (172,0,NULL,'appointment',NULL,821);
+INSERT INTO t1 VALUES (NULL,0,NULL,'k',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'vbnfsjyekezjixrjdkyqgpokqquixaxjoyffwcfggsaoysceuzohfq',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'nfsjyekezjixrjdkyqgpokqquixaxjoy',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'n',NULL,66);
+INSERT INTO t1 VALUES (32767,0,NULL,'South Carolina',NULL,32);
+INSERT INTO t1 VALUES (0,0,NULL,'ek',NULL,22);
+INSERT INTO t1 VALUES (4,0,NULL,'Mississippi',NULL,132);
+INSERT INTO t1 VALUES (26606,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (26043,0,NULL,'center',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'b',NULL,1);
+INSERT INTO t1 VALUES (8,0,NULL,'dk',NULL,NULL);
+INSERT INTO t1 VALUES (24031,0,NULL,'l',NULL,4);
+INSERT INTO t1 VALUES (79,0,NULL,'po',NULL,7);
+INSERT INTO t1 VALUES (5,0,NULL,'Massachusetts',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'k',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'quixaxjoyf',NULL,213);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Arkansas',NULL,-160);
+INSERT INTO t1 VALUES (-30994,0,NULL,'Kansas',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'wheat',NULL,-808);
+INSERT INTO t1 VALUES (231,0,NULL,'less',NULL,912);
+INSERT INTO t1 VALUES (NULL,0,NULL,'a',NULL,107);
+INSERT INTO t1 VALUES (4,0,NULL,'ix',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'within',NULL,2);
+INSERT INTO t1 VALUES (17,0,NULL,'style',NULL,19);
+INSERT INTO t1 VALUES (32767,0,NULL,'o',NULL,840);
+INSERT INTO t1 VALUES (-12239,0,NULL,'marker',NULL,152);
+INSERT INTO t1 VALUES (9,0,NULL,'wcfggsaoysceuzohfq',NULL,160);
+INSERT INTO t1 VALUES (212,0,NULL,'fggsaoysceuzohfqhhrnnxkuwsbefbdefxucxqiowgsrsq',NULL,521);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Pennsylvania',NULL,0);
+INSERT INTO t1 VALUES (4,0,NULL,'North Dakota',NULL,67);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Minnesota',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'l',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'known',NULL,0);
+INSERT INTO t1 VALUES (-3384,0,NULL,'uzohfqhhrnnxkuwsbefbdef',NULL,401);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,5);
+INSERT INTO t1 VALUES (210,0,NULL,'conclusion',NULL,110);
+INSERT INTO t1 VALUES (17237,0,NULL,'h',NULL,NULL);
+INSERT INTO t1 VALUES (21561,0,NULL,'examine',NULL,699);
+INSERT INTO t1 VALUES (32767,0,NULL,'xkuwsbefbdefxucx',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'Virginia',NULL,47);
+INSERT INTO t1 VALUES (3,0,NULL,'g',NULL,NULL);
+INSERT INTO t1 VALUES (111,0,NULL,'correctly',NULL,0);
+INSERT INTO t1 VALUES (-588,0,NULL,'j',NULL,180);
+INSERT INTO t1 VALUES (10747,0,NULL,'be',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'e',NULL,8);
+INSERT INTO t1 VALUES (NULL,0,NULL,'defxucxqiowgsrsqg',NULL,NULL);
+INSERT INTO t1 VALUES (214,0,NULL,'v',NULL,183);
+INSERT INTO t1 VALUES (0,0,NULL,'xqiowgsrsqghqvetkcthoaigpdmsltmfepvjynircsyhydh',NULL,442);
+INSERT INTO t1 VALUES (21,0,NULL,'q',NULL,212);
+INSERT INTO t1 VALUES (6,0,NULL,'w',NULL,474);
+INSERT INTO t1 VALUES (0,0,NULL,'portfolio',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,NULL);
+INSERT INTO t1 VALUES (-2945,0,NULL,'g',NULL,536);
+INSERT INTO t1 VALUES (NULL,0,NULL,'slam',NULL,3);
+INSERT INTO t1 VALUES (172,0,NULL,'South Carolina',NULL,0);
+INSERT INTO t1 VALUES (-15771,0,NULL,'u',NULL,105);
+INSERT INTO t1 VALUES (0,0,NULL,'New Mexico',NULL,3);
+INSERT INTO t1 VALUES (-27986,0,NULL,'ho',NULL,NULL);
+INSERT INTO t1 VALUES (21055,0,NULL,'igpdmsltmfepvjynircsyhydhsmudplhhmhanqhwqrvpvcwltaxycuccy',NULL,360);
+INSERT INTO t1 VALUES (8,0,NULL,'q',NULL,12);
+INSERT INTO t1 VALUES (235,0,NULL,'msltmfepvjynircsyhydhsmudplh',NULL,764);
+INSERT INTO t1 VALUES (32767,0,NULL,'Florida',NULL,932);
+INSERT INTO t1 VALUES (184,0,NULL,'vision',NULL,183);
+INSERT INTO t1 VALUES (4,0,NULL,'c',NULL,776);
+INSERT INTO t1 VALUES (6,0,NULL,'pv',NULL,0);
+INSERT INTO t1 VALUES (-27554,0,NULL,'conference',NULL,79);
+INSERT INTO t1 VALUES (32767,0,NULL,'jy',NULL,0);
+INSERT INTO t1 VALUES (5,0,NULL,'ircsyhydhsmudplhhmhanqhwq',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Washington',NULL,8);
+INSERT INTO t1 VALUES (7,0,NULL,'syhydhs',NULL,387);
+INSERT INTO t1 VALUES (32767,0,NULL,'z',NULL,0);
+INSERT INTO t1 VALUES (3,0,NULL,'ydhsmudplhhmhanqhwqrvpvcwltaxycuccywdujpabzv',NULL,707);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hsmudplhhmhanqhwqrvpvcwltaxycuccywdujpabzvtngapa',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'udplhhmhanqhwqrvpvcwltaxy',NULL,769);
+INSERT INTO t1 VALUES (2,0,NULL,'plhhmh',NULL,7);
+INSERT INTO t1 VALUES (39,0,NULL,'h',NULL,0);
+INSERT INTO t1 VALUES (-10547,0,NULL,'devote',NULL,0);
+INSERT INTO t1 VALUES (5,0,NULL,'Louisiana',NULL,49);
+INSERT INTO t1 VALUES (122,0,NULL,'nqhwqrvpvcwltaxycuccywdujpabzvtngapaidsrppccpnychu',NULL,8);
+INSERT INTO t1 VALUES (6778,0,NULL,'required',NULL,595);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,800);
+INSERT INTO t1 VALUES (NULL,0,NULL,'election',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'n',NULL,-360);
+INSERT INTO t1 VALUES (9,0,NULL,'doorway',NULL,146);
+INSERT INTO t1 VALUES (4025,0,NULL,'vpvcwltaxycuccywdujpabzvtngapaidsrppccpnychuzvzaxa',NULL,440);
+INSERT INTO t1 VALUES (25553,0,NULL,'classroom',NULL,116);
+INSERT INTO t1 VALUES (0,0,NULL,'duck',NULL,0);
+INSERT INTO t1 VALUES (7,0,NULL,'belly',NULL,176);
+INSERT INTO t1 VALUES (11217,0,NULL,'o',NULL,928);
+INSERT INTO t1 VALUES (30374,0,NULL,'j',NULL,32);
+INSERT INTO t1 VALUES (32767,0,NULL,'cu',NULL,-280);
+INSERT INTO t1 VALUES (3292,0,NULL,'ywdujpabzvtngapaidsrppccpnychuzvzaxajyizsnovyzqqimibnvz',NULL,NULL);
+INSERT INTO t1 VALUES (5,0,NULL,'uj',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'v',NULL,NULL);
+INSERT INTO t1 VALUES (31072,0,NULL,'adjustment',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'vt',NULL,NULL);
+INSERT INTO t1 VALUES (11282,0,NULL,'e',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'a',NULL,0);
+INSERT INTO t1 VALUES (30,0,NULL,'i',NULL,5);
+INSERT INTO t1 VALUES (1,0,NULL,'Maryland',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'rppccpnychuzvzaxajyizsnovyzqq',NULL,688);
+INSERT INTO t1 VALUES (4426,0,NULL,'ppccpnychuzvzaxajyizsnovyzqqimibnvzudcicgutp',NULL,3);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Iowa',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'x',NULL,928);
+INSERT INTO t1 VALUES (1,0,NULL,'k',NULL,-88);
+INSERT INTO t1 VALUES (30550,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'huzvzaxajyizsnovyzqqimibnvzudcicgutpkrnsuqdzqjvnnesqq',NULL,577);
+INSERT INTO t1 VALUES (22824,0,NULL,'uzvzaxajyizsnovyzqqimibnvzudcicgutpkrnsuqdz',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'z',NULL,0);
+INSERT INTO t1 VALUES (9,0,NULL,'Rhode Island',NULL,120);
+INSERT INTO t1 VALUES (5,0,NULL,'zaxajyizsnovyzqqimibnvzudcicgutpkrnsuqdzqjvnnesqqprogbfwnjvym',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'xajyizsnovyzqqimibnvzudcicg',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'certainly',NULL,0);
+INSERT INTO t1 VALUES (-32548,0,NULL,'zs',NULL,-232);
+INSERT INTO t1 VALUES (32767,0,NULL,'vy',NULL,5);
+INSERT INTO t1 VALUES (151,0,NULL,'Vermont',NULL,171);
+INSERT INTO t1 VALUES (32767,0,NULL,'Virginia',NULL,0);
+INSERT INTO t1 VALUES (9,0,NULL,'h',NULL,719);
+INSERT INTO t1 VALUES (19723,0,NULL,'Oregon',NULL,96);
+INSERT INTO t1 VALUES (0,0,NULL,'Utah',NULL,2);
+INSERT INTO t1 VALUES (73,0,NULL,'qimibnvz',NULL,-160);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,NULL);
+INSERT INTO t1 VALUES (29652,0,NULL,'vzudcicgutpkrnsuq',NULL,117);
+INSERT INTO t1 VALUES (-8160,0,NULL,'Alabama',NULL,380);
+INSERT INTO t1 VALUES (28910,0,NULL,'slow',NULL,-720);
+INSERT INTO t1 VALUES (23824,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (12,0,NULL,'wake',NULL,-328);
+INSERT INTO t1 VALUES (9,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'tpkrnsuqdzqjvnnesqqprogbfwnjvymzpewbtuefqwbjzvynkwcko',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'krnsuqdzqjvnnesqq',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'r',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'nsuqdzqjvnnesqqprogbfwnjvymzpewb',NULL,264);
+INSERT INTO t1 VALUES (30,0,NULL,'qdzqjvnnesqqprogbfw',NULL,749);
+INSERT INTO t1 VALUES (NULL,0,NULL,'t',NULL,NULL);
+INSERT INTO t1 VALUES (250,0,NULL,'qj',NULL,736);
+INSERT INTO t1 VALUES (0,0,NULL,'South Carolina',NULL,113);
+INSERT INTO t1 VALUES (NULL,0,NULL,'l',NULL,532);
+INSERT INTO t1 VALUES (29641,0,NULL,'sqqprogbfwnjvymzpewbtuefqwbjzvynkwckorhjvecyethcprwnxptf',NULL,9);
+INSERT INTO t1 VALUES (0,0,NULL,'qprogbfwnjvymzpewbtuefqwbjzvynkwckor',NULL,491);
+INSERT INTO t1 VALUES (4,0,NULL,'ogbfwnjvymzpewbtuefqwbjzvynkwckorhjvecyethcprwnxpt',NULL,987);
+INSERT INTO t1 VALUES (-164,0,NULL,'i',NULL,2);
+INSERT INTO t1 VALUES (18056,0,NULL,'pair',NULL,3);
+INSERT INTO t1 VALUES (7,0,NULL,'appointment',NULL,5);
+INSERT INTO t1 VALUES (6,0,NULL,'n',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Massachusetts',NULL,-832);
+INSERT INTO t1 VALUES (32767,0,NULL,'m',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'zpewbtuefqwbjzvynkwckorh',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'announcement',NULL,3);
+INSERT INTO t1 VALUES (9,0,NULL,'e',NULL,864);
+INSERT INTO t1 VALUES (54,0,NULL,'f',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'beard',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'jungle',NULL,5);
+INSERT INTO t1 VALUES (32767,0,NULL,'South Dakota',NULL,8);
+INSERT INTO t1 VALUES (23375,0,NULL,'s',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Idaho',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (28335,0,NULL,'qw',NULL,NULL);
+INSERT INTO t1 VALUES (147,0,NULL,'jzvynkwckorhjvecyethcprwnxptfrrcftpelmjjhwzgdgqxaeqgknlz',NULL,16);
+INSERT INTO t1 VALUES (32767,0,NULL,'Texas',NULL,184);
+INSERT INTO t1 VALUES (NULL,0,NULL,'amazing',NULL,0);
+INSERT INTO t1 VALUES (176,0,NULL,'ckorhjvecyethcprwnxptfrrcftpelmjjhwzgdgqxaeqgknlzzhcl',NULL,219);
+INSERT INTO t1 VALUES (5824,0,NULL,'rhjvecyethcprwnxptfrrcftpelmjjhwzgdgqxaeqgknlzz',NULL,8);
+INSERT INTO t1 VALUES (7,0,NULL,'jvecyethcprwnxp',NULL,NULL);
+INSERT INTO t1 VALUES (31315,0,NULL,'k',NULL,0);
+INSERT INTO t1 VALUES (6,0,NULL,'y',NULL,-472);
+INSERT INTO t1 VALUES (1,0,NULL,'Wisconsin',NULL,-208);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Louisiana',NULL,928);
+INSERT INTO t1 VALUES (9,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'giant',NULL,505);
+INSERT INTO t1 VALUES (NULL,0,NULL,'xptfrrcftpelmjjhwzgdgqxaeqgknlzzhclsosqpyoeakxhqnjaa',NULL,941);
+INSERT INTO t1 VALUES (NULL,0,NULL,'w',NULL,0);
+INSERT INTO t1 VALUES (6693,0,NULL,'Ohio',NULL,3);
+INSERT INTO t1 VALUES (182,0,NULL,'Delaware',NULL,119);
+INSERT INTO t1 VALUES (26419,0,NULL,'tp',NULL,0);
+INSERT INTO t1 VALUES (77,0,NULL,'elmjjhwzgdgqxaeqgknlzzhc',NULL,227);
+INSERT INTO t1 VALUES (NULL,0,NULL,'m',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,653);
+INSERT INTO t1 VALUES (5,0,NULL,'how',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'pick',NULL,-128);
+INSERT INTO t1 VALUES (21683,0,NULL,'Missouri',NULL,135);
+INSERT INTO t1 VALUES (27244,0,NULL,'q',NULL,155);
+INSERT INTO t1 VALUES (0,0,NULL,'Delaware',NULL,309);
+INSERT INTO t1 VALUES (0,0,NULL,'eqgknlzzhclsosqpyoeakxhqnjaagzutblkgqduiopczwkjkkzjqg',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'failure',NULL,800);
+INSERT INTO t1 VALUES (0,0,NULL,'Rhode Island',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'h',NULL,NULL);
+INSERT INTO t1 VALUES (10453,0,NULL,'Oregon',NULL,0);
+INSERT INTO t1 VALUES (4,0,NULL,'b',NULL,-648);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,104);
+INSERT INTO t1 VALUES (8,0,NULL,'qp',NULL,344);
+INSERT INTO t1 VALUES (4200,0,NULL,'pyoeakxhqnjaagzutblkgqduiopczwkjkkzjqgcnzxrfvzsgcobwhzif',NULL,86);
+INSERT INTO t1 VALUES (NULL,0,NULL,'property',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'akxhqnjaag',NULL,213);
+INSERT INTO t1 VALUES (131,0,NULL,'New Mexico',NULL,207);
+INSERT INTO t1 VALUES (NULL,0,NULL,'contest',NULL,184);
+INSERT INTO t1 VALUES (-13903,0,NULL,'decade',NULL,-96);
+INSERT INTO t1 VALUES (32767,0,NULL,'aagzutbl',NULL,395);
+INSERT INTO t1 VALUES (7,0,NULL,'like',NULL,324);
+INSERT INTO t1 VALUES (137,0,NULL,'u',NULL,0);
+INSERT INTO t1 VALUES (1,0,NULL,'b',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'g',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'duiopczwkjkkzjqgcnzxrfvzsgcobwhzifhnulqzxdrmpoeyfsifyi',NULL,-960);
+INSERT INTO t1 VALUES (86,0,NULL,'s',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'op',NULL,889);
+INSERT INTO t1 VALUES (5,0,NULL,'g',NULL,NULL);
+INSERT INTO t1 VALUES (6,0,NULL,'czwkjkkzjq',NULL,48);
+INSERT INTO t1 VALUES (195,0,NULL,'w',NULL,86);
+INSERT INTO t1 VALUES (15,0,NULL,'kkzjqgcnzxrfvzsgcobwhzifhnulqzxdrmpoeyfsifyiiycarluqadgl',NULL,0);
+INSERT INTO t1 VALUES (7366,0,NULL,'e',NULL,8);
+INSERT INTO t1 VALUES (29558,0,NULL,'j',NULL,NULL);
+INSERT INTO t1 VALUES (2268,0,NULL,'cn',NULL,9);
+INSERT INTO t1 VALUES (32767,0,NULL,'nzxrfvzsgcobwhzifhnulqzxdrmpoeyfsifyiiycarluqadgldl',NULL,866);
+INSERT INTO t1 VALUES (0,0,NULL,'zx',NULL,172);
+INSERT INTO t1 VALUES (3,0,NULL,'xrfvzsgcobwhzifhnulqzxdrmpoeyfsify',NULL,8);
+INSERT INTO t1 VALUES (NULL,0,NULL,'South Dakota',NULL,584);
+INSERT INTO t1 VALUES (32767,0,NULL,'z',NULL,0);
+INSERT INTO t1 VALUES (-7091,0,NULL,'g',NULL,5);
+INSERT INTO t1 VALUES (32767,0,NULL,'o',NULL,311);
+INSERT INTO t1 VALUES (4,0,NULL,'f',NULL,432);
+INSERT INTO t1 VALUES (116,0,NULL,'Indiana',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'boundary',NULL,2);
+INSERT INTO t1 VALUES (219,0,NULL,'n',NULL,626);
+INSERT INTO t1 VALUES (70,0,NULL,'u',NULL,7);
+INSERT INTO t1 VALUES (NULL,0,NULL,'lqz',NULL,935);
+INSERT INTO t1 VALUES (9,0,NULL,'coat',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'y',NULL,0);
+INSERT INTO t1 VALUES (6631,0,NULL,'master',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'rmpoeyfsifyii',NULL,654);
+INSERT INTO t1 VALUES (6,0,NULL,'p',NULL,24);
+INSERT INTO t1 VALUES (-30502,0,NULL,'eyfsifyiiycarluqadgldleafqwtnqxbjccqnslyksq',NULL,6);
+INSERT INTO t1 VALUES (32767,0,NULL,'r',NULL,0);
+INSERT INTO t1 VALUES (22650,0,NULL,'Ohio',NULL,152);
+INSERT INTO t1 VALUES (21205,0,NULL,'burning',NULL,14);
+INSERT INTO t1 VALUES (65,0,NULL,'condemn',NULL,200);
+INSERT INTO t1 VALUES (7,0,NULL,'fyiiycarluqadgldleafqwtnq',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'iy',NULL,242);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ca',NULL,796);
+INSERT INTO t1 VALUES (8,0,NULL,'r',NULL,8);
+INSERT INTO t1 VALUES (184,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'Georgia',NULL,752);
+INSERT INTO t1 VALUES (81,0,NULL,'North Carolina',NULL,0);
+INSERT INTO t1 VALUES (-15767,0,NULL,'u',NULL,656);
+INSERT INTO t1 VALUES (3,0,NULL,'Texas',NULL,784);
+INSERT INTO t1 VALUES (12921,0,NULL,'girlfriend',NULL,49);
+INSERT INTO t1 VALUES (69,0,NULL,'n',NULL,7);
+INSERT INTO t1 VALUES (5823,0,NULL,'a',NULL,929);
+INSERT INTO t1 VALUES (245,0,NULL,'fqwtnq',NULL,100);
+INSERT INTO t1 VALUES (0,0,NULL,'w',NULL,-328);
+INSERT INTO t1 VALUES (32767,0,NULL,'tn',NULL,256);
+INSERT INTO t1 VALUES (0,0,NULL,'q',NULL,-192);
+INSERT INTO t1 VALUES (19430,0,NULL,'o',NULL,NULL);
+INSERT INTO t1 VALUES (21086,0,NULL,'producer',NULL,0);
+INSERT INTO t1 VALUES (6,0,NULL,'cq',NULL,568);
+INSERT INTO t1 VALUES (0,0,NULL,'South Dakota',NULL,253);
+INSERT INTO t1 VALUES (32767,0,NULL,'kill',NULL,129);
+INSERT INTO t1 VALUES (NULL,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (18210,0,NULL,'seal',NULL,29);
+INSERT INTO t1 VALUES (102,0,NULL,'jmxngcvwlwuvtuwmyxzulbiys',NULL,0);
+INSERT INTO t1 VALUES (29116,0,NULL,'ngcvwlwuvtuwmyxzulbiysrlgjzzendrgndm',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'vw',NULL,9);
+INSERT INTO t1 VALUES (0,0,NULL,'West Virginia',NULL,258);
+INSERT INTO t1 VALUES (32767,0,NULL,'wuvtuwmyxz',NULL,67);
+INSERT INTO t1 VALUES (32767,0,NULL,'New Hampshire',NULL,113);
+INSERT INTO t1 VALUES (0,0,NULL,'a',NULL,NULL);
+INSERT INTO t1 VALUES (7,0,NULL,'p',NULL,24);
+INSERT INTO t1 VALUES (251,0,NULL,'m',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'y',NULL,0);
+INSERT INTO t1 VALUES (31980,0,NULL,'s',NULL,989);
+INSERT INTO t1 VALUES (32767,0,NULL,'encounter',NULL,NULL);
+INSERT INTO t1 VALUES (10072,0,NULL,'laboratory',NULL,110);
+INSERT INTO t1 VALUES (64,0,NULL,'ysrlgjzzendrgndmbuqakniwwuvhdkzkpviuzhjcaeovskckoeqzaydcn',NULL,711);
+INSERT INTO t1 VALUES (33,0,NULL,'a',NULL,0);
+INSERT INTO t1 VALUES (9768,0,NULL,'rl',NULL,4);
+INSERT INTO t1 VALUES (32767,0,NULL,'Massachusetts',NULL,0);
+INSERT INTO t1 VALUES (-27608,0,NULL,'zzendrg',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'narrative',NULL,0);
+INSERT INTO t1 VALUES (32652,0,NULL,'nd',NULL,758);
+INSERT INTO t1 VALUES (-27421,0,NULL,'gndmbuqakniwwuvhdkzkp',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Michigan',NULL,672);
+INSERT INTO t1 VALUES (63,0,NULL,'Washington',NULL,177);
+INSERT INTO t1 VALUES (32767,0,NULL,'South Dakota',NULL,NULL);
+INSERT INTO t1 VALUES (89,0,NULL,'road',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'a',NULL,161);
+INSERT INTO t1 VALUES (NULL,0,NULL,'breathing',NULL,4);
+INSERT INTO t1 VALUES (-3678,0,NULL,'Georgia',NULL,0);
+INSERT INTO t1 VALUES (20068,0,NULL,'Minnesota',NULL,199);
+INSERT INTO t1 VALUES (2,0,NULL,'v',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'Pennsylvania',NULL,177);
+INSERT INTO t1 VALUES (5,0,NULL,'commonly',NULL,0);
+INSERT INTO t1 VALUES (1,0,NULL,'iuzhjcaeovskckoeqzaydc',NULL,NULL);
+INSERT INTO t1 VALUES (-28253,0,NULL,'c',NULL,362);
+INSERT INTO t1 VALUES (NULL,0,NULL,'cook',NULL,NULL);
+INSERT INTO t1 VALUES (68,0,NULL,'standard',NULL,212);
+INSERT INTO t1 VALUES (71,0,NULL,'Illinois',NULL,0);
+INSERT INTO t1 VALUES (25059,0,NULL,'d',NULL,952);
+INSERT INTO t1 VALUES (-17615,0,NULL,'d',NULL,19);
+INSERT INTO t1 VALUES (0,0,NULL,'butt',NULL,-112);
+INSERT INTO t1 VALUES (32767,0,NULL,'v',NULL,-264);
+INSERT INTO t1 VALUES (NULL,0,NULL,'missing',NULL,250);
+INSERT INTO t1 VALUES (-17641,0,NULL,'kc',NULL,105);
+INSERT INTO t1 VALUES (30903,0,NULL,'once',NULL,595);
+INSERT INTO t1 VALUES (113,0,NULL,'m',NULL,-616);
+INSERT INTO t1 VALUES (NULL,0,NULL,'za',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Alaska',NULL,318);
+INSERT INTO t1 VALUES (32767,0,NULL,'Oregon',NULL,NULL);
+INSERT INTO t1 VALUES (21013,0,NULL,'dear',NULL,0);
+INSERT INTO t1 VALUES (23803,0,NULL,'a',NULL,936);
+INSERT INTO t1 VALUES (6861,0,NULL,'c',NULL,244);
+INSERT INTO t1 VALUES (1,0,NULL,'ri',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New Mexico',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'xupthytmhktihnxeysankgnfqmmf',NULL,84);
+INSERT INTO t1 VALUES (59,0,NULL,'d',NULL,4);
+INSERT INTO t1 VALUES (NULL,0,NULL,'suddenly',NULL,162);
+INSERT INTO t1 VALUES (0,0,NULL,'share',NULL,202);
+INSERT INTO t1 VALUES (NULL,0,NULL,'h',NULL,0);
+INSERT INTO t1 VALUES (12334,0,NULL,'kt',NULL,0);
+INSERT INTO t1 VALUES (18729,0,NULL,'hn',NULL,311);
+INSERT INTO t1 VALUES (0,0,NULL,'ey',NULL,1);
+INSERT INTO t1 VALUES (10,0,NULL,'Virginia',NULL,0);
+INSERT INTO t1 VALUES (1167,0,NULL,'Nevada',NULL,1);
+INSERT INTO t1 VALUES (11065,0,NULL,'v',NULL,30);
+INSERT INTO t1 VALUES (32767,0,NULL,'Mississippi',NULL,96);
+INSERT INTO t1 VALUES (5376,0,NULL,'g',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'q',NULL,161);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hozhvbkimrkwyfogyxqgovowrlzdlkn',NULL,145);
+INSERT INTO t1 VALUES (53,0,NULL,'z',NULL,NULL);
+INSERT INTO t1 VALUES (3,0,NULL,'Connecticut',NULL,0);
+INSERT INTO t1 VALUES (-1242,0,NULL,'v',NULL,711);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Kansas',NULL,NULL);
+INSERT INTO t1 VALUES (3,0,NULL,'q',NULL,0);
+INSERT INTO t1 VALUES (-7994,0,NULL,'rkwyfogyxqgovowrlzdlkngplowqyzdunpamanuewqasgpjuajeyvbeqhywn',NULL,426);
+INSERT INTO t1 VALUES (NULL,0,NULL,'yfogyxqgovowrlzdlkngplowqyzdunpamanuewqasgpjuajeyv',NULL,6);
+INSERT INTO t1 VALUES (55,0,NULL,'o',NULL,73);
+INSERT INTO t1 VALUES (NULL,0,NULL,'qgovowrlzdlk',NULL,89);
+INSERT INTO t1 VALUES (32767,0,NULL,'ovowrlzdlkngp',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'poll',NULL,73);
+INSERT INTO t1 VALUES (15368,0,NULL,'Kansas',NULL,0);
+INSERT INTO t1 VALUES (-11422,0,NULL,'zdlkngplow',NULL,9);
+INSERT INTO t1 VALUES (-8890,0,NULL,'kngplowqyzdunpamanuewqasgpjuajeyvbeqhywnkzbtgviyukxz',NULL,685);
+INSERT INTO t1 VALUES (2184,0,NULL,'ng',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'rider',NULL,-448);
+INSERT INTO t1 VALUES (3,0,NULL,'s',NULL,227);
+INSERT INTO t1 VALUES (NULL,0,NULL,'true',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'d',NULL,274);
+INSERT INTO t1 VALUES (9689,0,NULL,'suite',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Michigan',NULL,2);
+INSERT INTO t1 VALUES (-30937,0,NULL,'n',NULL,202);
+INSERT INTO t1 VALUES (NULL,0,NULL,'g',NULL,22);
+INSERT INTO t1 VALUES (32767,0,NULL,'w',NULL,147);
+INSERT INTO t1 VALUES (217,0,NULL,'d',NULL,461);
+INSERT INTO t1 VALUES (6058,0,NULL,'a',NULL,432);
+INSERT INTO t1 VALUES (-2853,0,NULL,'sg',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'n',NULL,196);
+INSERT INTO t1 VALUES (8,0,NULL,'j',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'j',NULL,974);
+INSERT INTO t1 VALUES (0,0,NULL,'industry',NULL,0);
+INSERT INTO t1 VALUES (-8236,0,NULL,'d',NULL,24);
+INSERT INTO t1 VALUES (NULL,0,NULL,'qh',NULL,NULL);
+INSERT INTO t1 VALUES (26313,0,NULL,'California',NULL,836);
+INSERT INTO t1 VALUES (0,0,NULL,'ywnkzbtgviyukxzdxkwj',NULL,NULL);
+INSERT INTO t1 VALUES (22547,0,NULL,'zbtgviyukxzdxkwjxmyiszwsexxwhejgdbsainxfsu',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Wyoming',NULL,-696);
+INSERT INTO t1 VALUES (411,0,NULL,'credit',NULL,798);
+INSERT INTO t1 VALUES (1,0,NULL,'v',NULL,231);
+INSERT INTO t1 VALUES (4,0,NULL,'there',NULL,156);
+INSERT INTO t1 VALUES (-2887,0,NULL,'Illinois',NULL,889);
+INSERT INTO t1 VALUES (4,0,NULL,'yukxzdxkwjxmyiszwsexxwhejgdbsainxfsuurwwueiuzlljraimezc',NULL,-128);
+INSERT INTO t1 VALUES (0,0,NULL,'q',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'xz',NULL,296);
+INSERT INTO t1 VALUES (8,0,NULL,'d',NULL,2);
+INSERT INTO t1 VALUES (19143,0,NULL,'ysuamdortdfpeqhchat',NULL,1);
+INSERT INTO t1 VALUES (128,0,NULL,'unknown',NULL,-864);
+INSERT INTO t1 VALUES (49,0,NULL,'ortdfpeqhchatthkorvzlyvcemotaanbknuuoisfyggsebeowudp',NULL,1);
+INSERT INTO t1 VALUES (NULL,0,NULL,'North Carolina',NULL,8);
+INSERT INTO t1 VALUES (-17574,0,NULL,'tdfpeqhchatthkorvzlyvcemotaanbknuuoisfyggsebeowudpihwiusfzabegk',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,137);
+INSERT INTO t1 VALUES (-13055,0,NULL,'qh',NULL,209);
+INSERT INTO t1 VALUES (NULL,0,NULL,'a',NULL,165);
+INSERT INTO t1 VALUES (127,0,NULL,'hatthkorvzlyvcemotaanbkn',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'casualty',NULL,-824);
+INSERT INTO t1 VALUES (189,0,NULL,'w',NULL,850);
+INSERT INTO t1 VALUES (0,0,NULL,'th',NULL,872);
+INSERT INTO t1 VALUES (7,0,NULL,'b',NULL,103);
+INSERT INTO t1 VALUES (11552,0,NULL,'r',NULL,584);
+INSERT INTO t1 VALUES (7,0,NULL,'halfway',NULL,-544);
+INSERT INTO t1 VALUES (246,0,NULL,'peak',NULL,0);
+INSERT INTO t1 VALUES (2218,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (26017,0,NULL,'emotaanbknuuoisfyggsebeowudpihwiusfzabegktdhkddnhpuliqiao',NULL,3);
+INSERT INTO t1 VALUES (32767,0,NULL,'killing',NULL,NULL);
+INSERT INTO t1 VALUES (-18822,0,NULL,'Hawaii',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'New Jersey',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Oklahoma',NULL,344);
+INSERT INTO t1 VALUES (NULL,0,NULL,'nuuoisfyggsebeowudpihwiusfzabegktdhkddnhpul',NULL,896);
+INSERT INTO t1 VALUES (2,0,NULL,'approval',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'v',NULL,117);
+INSERT INTO t1 VALUES (0,0,NULL,'w',NULL,525);
+INSERT INTO t1 VALUES (8,0,NULL,'uoisfyggseb',NULL,231);
+INSERT INTO t1 VALUES (0,0,NULL,'Oklahoma',NULL,36);
+INSERT INTO t1 VALUES (NULL,0,NULL,'p',NULL,-312);
+INSERT INTO t1 VALUES (0,0,NULL,'South Carolina',NULL,5);
+INSERT INTO t1 VALUES (127,0,NULL,'n',NULL,198);
+INSERT INTO t1 VALUES (175,0,NULL,'ebeowudpihwiusfzabegktdhkddnhpuliq',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'beowudpihwiusfzabegktdhkddnhp',NULL,0);
+INSERT INTO t1 VALUES (145,0,NULL,'e',NULL,888);
+INSERT INTO t1 VALUES (-26393,0,NULL,'recall',NULL,172);
+INSERT INTO t1 VALUES (32767,0,NULL,'Massachusetts',NULL,210);
+INSERT INTO t1 VALUES (125,0,NULL,'hwiusfzabegktdhkddnhpuliqiaocxuasqfm',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'wi',NULL,132);
+INSERT INTO t1 VALUES (208,0,NULL,'b',NULL,174);
+INSERT INTO t1 VALUES (-2811,0,NULL,'Michigan',NULL,35);
+INSERT INTO t1 VALUES (31649,0,NULL,'fz',NULL,817);
+INSERT INTO t1 VALUES (NULL,0,NULL,'b',NULL,100);
+INSERT INTO t1 VALUES (32767,0,NULL,'k',NULL,224);
+INSERT INTO t1 VALUES (119,0,NULL,'t',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'be',NULL,NULL);
+INSERT INTO t1 VALUES (9,0,NULL,'communication',NULL,960);
+INSERT INTO t1 VALUES (3,0,NULL,'concrete',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'z',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'uliqiaocxuasqfmrtqzapk',NULL,115);
+INSERT INTO t1 VALUES (10801,0,NULL,'Utah',NULL,473);
+INSERT INTO t1 VALUES (0,0,NULL,'i',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Delaware',NULL,0);
+INSERT INTO t1 VALUES (20394,0,NULL,'input',NULL,0);
+INSERT INTO t1 VALUES (-7220,0,NULL,'Minnesota',NULL,214);
+INSERT INTO t1 VALUES (11769,0,NULL,'o',NULL,176);
+INSERT INTO t1 VALUES (0,0,NULL,'a',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'q',NULL,330);
+INSERT INTO t1 VALUES (NULL,0,NULL,'loyal',NULL,4);
+INSERT INTO t1 VALUES (28380,0,NULL,'p',NULL,721);
+INSERT INTO t1 VALUES (0,0,NULL,'zapkkyoihc',NULL,NULL);
+INSERT INTO t1 VALUES (141,0,NULL,'kkyoihcjkajdhiiuoamcqdozgdlrctoxousgtwbkorqhjxntnwvkmnpma',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'ky',NULL,-784);
+INSERT INTO t1 VALUES (25414,0,NULL,'yoihcjkajdhiiuoamcqdozgdl',NULL,NULL);
+INSERT INTO t1 VALUES (-23163,0,NULL,'h',NULL,720);
+INSERT INTO t1 VALUES (7,0,NULL,'n',NULL,928);
+INSERT INTO t1 VALUES (3,0,NULL,'kaj',NULL,NULL);
+INSERT INTO t1 VALUES (145,0,NULL,'draft',NULL,88);
+INSERT INTO t1 VALUES (5,0,NULL,'b',NULL,49);
+INSERT INTO t1 VALUES (4,0,NULL,'dhiiuoamcqdozgdlrctoxou',NULL,0);
+INSERT INTO t1 VALUES (171,0,NULL,'iu',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'mc',NULL,384);
+INSERT INTO t1 VALUES (4,0,NULL,'Illinois',NULL,0);
+INSERT INTO t1 VALUES (6,0,NULL,'etc',NULL,104);
+INSERT INTO t1 VALUES (NULL,0,NULL,'v',NULL,968);
+INSERT INTO t1 VALUES (7,0,NULL,'rctoxousgtwbkorqhjxntnwvkmnpmazmeyarrywowwntwuedjsu',NULL,NULL);
+INSERT INTO t1 VALUES (57,0,NULL,'voting',NULL,9);
+INSERT INTO t1 VALUES (26320,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'x',NULL,5);
+INSERT INTO t1 VALUES (7,0,NULL,'us',NULL,251);
+INSERT INTO t1 VALUES (3,0,NULL,'twbkorqhjxn',NULL,334);
+INSERT INTO t1 VALUES (9,0,NULL,'copy',NULL,563);
+INSERT INTO t1 VALUES (0,0,NULL,'North Carolina',NULL,0);
+INSERT INTO t1 VALUES (249,0,NULL,'Arkansas',NULL,114);
+INSERT INTO t1 VALUES (152,0,NULL,'hjxntnwvkmnpmazmeyarrywowwntwuedjs',NULL,7);
+INSERT INTO t1 VALUES (0,0,NULL,'xntnwvkmnpmazmeyarrywowwntwue',NULL,23);
+INSERT INTO t1 VALUES (28399,0,NULL,'tnwvkmnpmazmeyarr',NULL,914);
+INSERT INTO t1 VALUES (32767,0,NULL,'Iowa',NULL,0);
+INSERT INTO t1 VALUES (43,0,NULL,'n',NULL,8);
+INSERT INTO t1 VALUES (-18416,0,NULL,'maximum',NULL,190);
+INSERT INTO t1 VALUES (169,0,NULL,'Louisiana',NULL,0);
+INSERT INTO t1 VALUES (14,0,NULL,'q',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'n',NULL,86);
+INSERT INTO t1 VALUES (0,0,NULL,'k',NULL,-912);
+INSERT INTO t1 VALUES (NULL,0,NULL,'rr',NULL,368);
+INSERT INTO t1 VALUES (32767,0,NULL,'g',NULL,768);
+INSERT INTO t1 VALUES (3,0,NULL,'pickup',NULL,8);
+INSERT INTO t1 VALUES (0,0,NULL,'honest',NULL,34);
+INSERT INTO t1 VALUES (16895,0,NULL,'so',NULL,888);
+INSERT INTO t1 VALUES (32767,0,NULL,'e',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'play',NULL,82);
+INSERT INTO t1 VALUES (12622,0,NULL,'m',NULL,42);
+INSERT INTO t1 VALUES (0,0,NULL,'ue',NULL,0);
+INSERT INTO t1 VALUES (2,0,NULL,'djsuvvuntfauimqchxjgbzfiambcxhvmtltykjwu',NULL,NULL);
+INSERT INTO t1 VALUES (210,0,NULL,'su',NULL,77);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Florida',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'Arkansas',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'untfauimqchxjgbzfia',NULL,3);
+INSERT INTO t1 VALUES (29576,0,NULL,'Arkansas',NULL,980);
+INSERT INTO t1 VALUES (227,0,NULL,'u',NULL,520);
+INSERT INTO t1 VALUES (3,0,NULL,'imqchxjgbzfiambcxhvmtltykjwulfefqfiykyhqozcnbtzpxonitsw',NULL,-136);
+INSERT INTO t1 VALUES (NULL,0,NULL,'chx',NULL,1);
+INSERT INTO t1 VALUES (5537,0,NULL,'Mississippi',NULL,872);
+INSERT INTO t1 VALUES (0,0,NULL,'jgbzfiambcxhvmtl',NULL,-728);
+INSERT INTO t1 VALUES (229,0,NULL,'bzfiambcxhvmtltykjwulfefqfiykyhqozcnbtzpxonits',NULL,211);
+INSERT INTO t1 VALUES (-16943,0,NULL,'f',NULL,641);
+INSERT INTO t1 VALUES (6,0,NULL,'q',NULL,7);
+INSERT INTO t1 VALUES (1066,0,NULL,'buy',NULL,NULL);
+INSERT INTO t1 VALUES (9,0,NULL,'k',NULL,952);
+INSERT INTO t1 VALUES (11079,0,NULL,'g',NULL,0);
+INSERT INTO t1 VALUES (2,0,NULL,'xh',NULL,NULL);
+INSERT INTO t1 VALUES (5,0,NULL,'mtltykjwulfefqfiykyhqozcn',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'w',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'a',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'influential',NULL,8);
+INSERT INTO t1 VALUES (-26136,0,NULL,'u',NULL,460);
+INSERT INTO t1 VALUES (10308,0,NULL,'lfefqfiykyhqozcnbtzpxonitswxmkoaagmmpxhyefkvhynit',NULL,383);
+INSERT INTO t1 VALUES (6,0,NULL,'fq',NULL,800);
+INSERT INTO t1 VALUES (9,0,NULL,'x',NULL,19);
+INSERT INTO t1 VALUES (0,0,NULL,'y',NULL,0);
+INSERT INTO t1 VALUES (197,0,NULL,'yhqozcnbtzpxonitswxmkoaagmmpxhyefkvhynitxebnkuj',NULL,28);
+INSERT INTO t1 VALUES (0,0,NULL,'Nevada',NULL,746);
+INSERT INTO t1 VALUES (233,0,NULL,'Vermont',NULL,0);
+INSERT INTO t1 VALUES (34,0,NULL,'s',NULL,2);
+INSERT INTO t1 VALUES (32767,0,NULL,'cnbtzpxonitswxmkoaagmmpxhyefkvhynitxebnkujdffizkgzsobnkapdhsgi',NULL,NULL);
+INSERT INTO t1 VALUES (27288,0,NULL,'btzpxonitswxmkoaagmmpxhyefkvhynitxebnkujdffizkgzsobnkapd',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'m',NULL,4);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Nebraska',NULL,NULL);
+INSERT INTO t1 VALUES (-27150,0,NULL,'o',NULL,242);
+INSERT INTO t1 VALUES (0,0,NULL,'explain',NULL,15);
+INSERT INTO t1 VALUES (26756,0,NULL,'x',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'than',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'session',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'tswxmkoaagmmpxhyefkvhynitxebnkujdffizkgzsobnkapdhsgiyimagniglns',NULL,587);
+INSERT INTO t1 VALUES (45,0,NULL,'pursue',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'m',NULL,132);
+INSERT INTO t1 VALUES (9,0,NULL,'Idaho',NULL,4);
+INSERT INTO t1 VALUES (1,0,NULL,'flavor',NULL,139);
+INSERT INTO t1 VALUES (0,0,NULL,'offender',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'gmmpxhyefkvhynitxebnkujdffizkgzsobnkapdhsgiyimagnigl',NULL,-544);
+INSERT INTO t1 VALUES (87,0,NULL,'mmpxhyefkvhyn',NULL,4);
+INSERT INTO t1 VALUES (159,0,NULL,'pxhyefkvhynitxebnkujdffizkgzsobnkapdhsgi',NULL,0);
+INSERT INTO t1 VALUES (242,0,NULL,'hy',NULL,113);
+INSERT INTO t1 VALUES (30,0,NULL,'e',NULL,325);
+INSERT INTO t1 VALUES (NULL,0,NULL,'kv',NULL,-624);
+INSERT INTO t1 VALUES (0,0,NULL,'ynitxebnkujdffizkgzsobnkapdhsgiyimagniglnsaocuagnv',NULL,708);
+INSERT INTO t1 VALUES (227,0,NULL,'Utah',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Kentucky',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hard',NULL,3);
+INSERT INTO t1 VALUES (8,0,NULL,'c',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'i',NULL,0);
+INSERT INTO t1 VALUES (174,0,NULL,'nk',NULL,188);
+INSERT INTO t1 VALUES (106,0,NULL,'spectacular',NULL,2);
+INSERT INTO t1 VALUES (0,0,NULL,'quiet',NULL,586);
+INSERT INTO t1 VALUES (155,0,NULL,'chop',NULL,237);
+INSERT INTO t1 VALUES (1,0,NULL,'undergraduate',NULL,464);
+INSERT INTO t1 VALUES (NULL,0,NULL,'iz',NULL,-224);
+INSERT INTO t1 VALUES (32767,0,NULL,'Maryland',NULL,619);
+INSERT INTO t1 VALUES (NULL,0,NULL,'kgzsobnkapdhsgiyimagniglnsaocuagnvqciwxiiquuzmfzfffty',NULL,-200);
+INSERT INTO t1 VALUES (8,0,NULL,'so',NULL,581);
+INSERT INTO t1 VALUES (1,0,NULL,'nkapdhsgiyimagniglnsaocuagnvqciwxiiquuzmfzffft',NULL,NULL);
+INSERT INTO t1 VALUES (2,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (-22001,0,NULL,'corridor',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'sgiyimagniglnsaocuagnvqciwxiiquuzmfzffftyxvxxv',NULL,-24);
+INSERT INTO t1 VALUES (122,0,NULL,'g',NULL,624);
+INSERT INTO t1 VALUES (0,0,NULL,'makeup',NULL,NULL);
+INSERT INTO t1 VALUES (32,0,NULL,'chest',NULL,-680);
+INSERT INTO t1 VALUES (3,0,NULL,'w',NULL,63);
+INSERT INTO t1 VALUES (224,0,NULL,'Utah',NULL,800);
+INSERT INTO t1 VALUES (194,0,NULL,'ni',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'i',NULL,3);
+INSERT INTO t1 VALUES (28,0,NULL,'ln',NULL,NULL);
+INSERT INTO t1 VALUES (-27045,0,NULL,'protection',NULL,349);
+INSERT INTO t1 VALUES (4,0,NULL,'ns',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'Tennessee',NULL,0);
+INSERT INTO t1 VALUES (-21629,0,NULL,'c',NULL,4);
+INSERT INTO t1 VALUES (28847,0,NULL,'g',NULL,46);
+INSERT INTO t1 VALUES (44,0,NULL,'nvqciwxiiquuzmfzffftyxvxxvnsfpxpqdny',NULL,220);
+INSERT INTO t1 VALUES (4,0,NULL,'s',NULL,26);
+INSERT INTO t1 VALUES (77,0,NULL,'abandon',NULL,-848);
+INSERT INTO t1 VALUES (-27160,0,NULL,'m',NULL,2);
+INSERT INTO t1 VALUES (0,0,NULL,'qciwxiiquuzmfzffftyxvxxvnsfpxpqdnyzusaefncvuyxnqbwedgpprpgf',NULL,55);
+INSERT INTO t1 VALUES (32767,0,NULL,'w',NULL,192);
+INSERT INTO t1 VALUES (0,0,NULL,'could',NULL,0);
+INSERT INTO t1 VALUES (6,0,NULL,'charge',NULL,-408);
+INSERT INTO t1 VALUES (-22785,0,NULL,'North Dakota',NULL,-320);
+INSERT INTO t1 VALUES (11582,0,NULL,'d',NULL,945);
+INSERT INTO t1 VALUES (NULL,0,NULL,'mf',NULL,0);
+INSERT INTO t1 VALUES (126,0,NULL,'routine',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'zffftyxvxxvnsfpxpqdnyzu',NULL,928);
+INSERT INTO t1 VALUES (16638,0,NULL,'necessity',NULL,3);
+INSERT INTO t1 VALUES (32431,0,NULL,'fty',NULL,9);
+INSERT INTO t1 VALUES (0,0,NULL,'Maryland',NULL,136);
+INSERT INTO t1 VALUES (NULL,0,NULL,'yxvxxvnsfpxpqdnyzusaefncvuyxnqbwedgpp',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'vxxvnsfpxpqdnyzusaefncvuyxnqbwedgpprpgfqyh',NULL,3);
+INSERT INTO t1 VALUES (32767,0,NULL,'anxiety',NULL,580);
+INSERT INTO t1 VALUES (32767,0,NULL,'defensive',NULL,27);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Pennsylvania',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'l',NULL,2);
+INSERT INTO t1 VALUES (143,0,NULL,'b',NULL,31);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,NULL);
+INSERT INTO t1 VALUES (9,0,NULL,'x',NULL,-528);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Oklahoma',NULL,0);
+INSERT INTO t1 VALUES (42,0,NULL,'p',NULL,67);
+INSERT INTO t1 VALUES (3,0,NULL,'Vermont',NULL,9);
+INSERT INTO t1 VALUES (58,0,NULL,'ny',NULL,0);
+INSERT INTO t1 VALUES (135,0,NULL,'saefncvuyxnqbwedgpprpgfqyhmoqdmwmiwrgehdnteyvlymyccrdlobsqnvuhm',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'West Virginia',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'efncvuyxnqbwedgpprpgfqyhmoqdmwmiwrgehdnteyvlymyccrdlobs',NULL,568);
+INSERT INTO t1 VALUES (1,0,NULL,'l',NULL,6);
+INSERT INTO t1 VALUES (46,0,NULL,'cvuyxnqbwedgpprpgfqyhmoq',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'uyxnqbwed',NULL,928);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Minnesota',NULL,0);
+INSERT INTO t1 VALUES (31825,0,NULL,'Illinois',NULL,NULL);
+INSERT INTO t1 VALUES (9,0,NULL,'South Dakota',NULL,0);
+INSERT INTO t1 VALUES (162,0,NULL,'t',NULL,74);
+INSERT INTO t1 VALUES (99,0,NULL,'dg',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'pr',NULL,0);
+INSERT INTO t1 VALUES (7,0,NULL,'officially',NULL,-712);
+INSERT INTO t1 VALUES (12140,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (1291,0,NULL,'yh',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'h',NULL,115);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Colorado',NULL,2);
+INSERT INTO t1 VALUES (32767,0,NULL,'k',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'miwrgehdnteyvlymyccrdlobsqnvuhmgyvukmp',NULL,386);
+INSERT INTO t1 VALUES (NULL,0,NULL,'North Dakota',NULL,0);
+INSERT INTO t1 VALUES (-20852,0,NULL,'g',NULL,912);
+INSERT INTO t1 VALUES (0,0,NULL,'dnteyvl',NULL,54);
+INSERT INTO t1 VALUES (7,0,NULL,'tey',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'yvlymyccrdlobsqnvuhmg',NULL,88);
+INSERT INTO t1 VALUES (0,0,NULL,'y',NULL,NULL);
+INSERT INTO t1 VALUES (156,0,NULL,'my',NULL,361);
+INSERT INTO t1 VALUES (32767,0,NULL,'f',NULL,227);
+INSERT INTO t1 VALUES (NULL,0,NULL,'California',NULL,915);
+INSERT INTO t1 VALUES (179,0,NULL,'Ohio',NULL,-968);
+INSERT INTO t1 VALUES (117,0,NULL,'lobsqnvuhmgyvukmprhonjoiawllmhf',NULL,201);
+INSERT INTO t1 VALUES (-27545,0,NULL,'m',NULL,109);
+INSERT INTO t1 VALUES (251,0,NULL,'q',NULL,762);
+INSERT INTO t1 VALUES (NULL,0,NULL,'royal',NULL,0);
+INSERT INTO t1 VALUES (31557,0,NULL,'Montana',NULL,398);
+INSERT INTO t1 VALUES (6,0,NULL,'gyvukmprhonjoiawllmhfdjzwfflnops',NULL,100);
+INSERT INTO t1 VALUES (27311,0,NULL,'vu',NULL,990);
+INSERT INTO t1 VALUES (0,0,NULL,'North Carolina',NULL,992);
+INSERT INTO t1 VALUES (790,0,NULL,'mprhonjoiawllmhfdjzwfflnopswkconfvcfgxnaubjgqaouxnruacblp',NULL,911);
+INSERT INTO t1 VALUES (99,0,NULL,'glass',NULL,874);
+INSERT INTO t1 VALUES (3,0,NULL,'roman',NULL,821);
+INSERT INTO t1 VALUES (6,0,NULL,'rhonjoiawllmhfdjzwfflnopswkconfvcfgxnaubjgqaouxn',NULL,-8);
+INSERT INTO t1 VALUES (94,0,NULL,'Wisconsin',NULL,207);
+INSERT INTO t1 VALUES (0,0,NULL,'Alabama',NULL,2);
+INSERT INTO t1 VALUES (6,0,NULL,'suspect',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'aw',NULL,-520);
+INSERT INTO t1 VALUES (9,0,NULL,'lmhfdjzwfflnopswkconfvcfgxnaubjgqaouxnruacblpwurbz',NULL,3);
+INSERT INTO t1 VALUES (9568,0,NULL,'g',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'djzwfflnopswkconfvcfgxnaubjgqaouxnruacblpwurbzdlpncouones',NULL,880);
+INSERT INTO t1 VALUES (7001,0,NULL,'m',NULL,306);
+INSERT INTO t1 VALUES (23109,0,NULL,'s',NULL,448);
+INSERT INTO t1 VALUES (32767,0,NULL,'introduce',NULL,8);
+INSERT INTO t1 VALUES (1,0,NULL,'fflnopswkconfvcfgxnaubjgqaouxnru',NULL,-544);
+INSERT INTO t1 VALUES (214,0,NULL,'l',NULL,56);
+INSERT INTO t1 VALUES (5,0,NULL,'Kentucky',NULL,259);
+INSERT INTO t1 VALUES (-757,0,NULL,'p',NULL,192);
+INSERT INTO t1 VALUES (NULL,0,NULL,'wkconfvcfgxnaubjgqaouxnruacblpwurbzdlpncouonesd',NULL,8);
+INSERT INTO t1 VALUES (0,0,NULL,'confvcfgxnaubjgqaouxnruacblpwurb',NULL,0);
+INSERT INTO t1 VALUES (-31049,0,NULL,'longtime',NULL,65);
+INSERT INTO t1 VALUES (25,0,NULL,'walking',NULL,NULL);
+INSERT INTO t1 VALUES (2393,0,NULL,'f',NULL,20);
+INSERT INTO t1 VALUES (1,0,NULL,'Oregon',NULL,438);
+INSERT INTO t1 VALUES (14610,0,NULL,'Maryland',NULL,NULL);
+INSERT INTO t1 VALUES (13039,0,NULL,'New Mexico',NULL,0);
+INSERT INTO t1 VALUES (24175,0,NULL,'naubjgqaouxnruacblpwurbzdlpncouonesdoepwzafzqjbxvwo',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'u',NULL,7);
+INSERT INTO t1 VALUES (9,0,NULL,'gqaouxnruacblpwurbzdlpncouonesdoepwza',NULL,498);
+INSERT INTO t1 VALUES (8,0,NULL,'observation',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ouxn',NULL,132);
+INSERT INTO t1 VALUES (13366,0,NULL,'nruacblpwurbzdlpncouonesdoepwzafzqjbxvwo',NULL,287);
+INSERT INTO t1 VALUES (145,0,NULL,'uacblpwurbzdlpncouonesdoepwzafzqjbxvwoe',NULL,0);
+INSERT INTO t1 VALUES (14293,0,NULL,'c',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'institution',NULL,8);
+INSERT INTO t1 VALUES (147,0,NULL,'Maryland',NULL,0);
+INSERT INTO t1 VALUES (-31412,0,NULL,'c',NULL,-440);
+INSERT INTO t1 VALUES (0,0,NULL,'rbz',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'achieve',NULL,472);
+INSERT INTO t1 VALUES (31,0,NULL,'s',NULL,8);
+INSERT INTO t1 VALUES (5,0,NULL,'g',NULL,7);
+INSERT INTO t1 VALUES (NULL,0,NULL,'North Carolina',NULL,380);
+INSERT INTO t1 VALUES (32767,0,NULL,'t',NULL,-336);
+INSERT INTO t1 VALUES (0,0,NULL,'lpncouonesdoepwzafzqjbxvwoekkivtce',NULL,33);
+INSERT INTO t1 VALUES (0,0,NULL,'Montana',NULL,NULL);
+INSERT INTO t1 VALUES (3,0,NULL,'pncouonesdoepwzafzqjbxvwoekkivtcesl',NULL,723);
+INSERT INTO t1 VALUES (NULL,0,NULL,'u',NULL,0);
+INSERT INTO t1 VALUES (63,0,NULL,'on',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'frustrate',NULL,83);
+INSERT INTO t1 VALUES (NULL,0,NULL,'klcvzuvzzhvxqjupfbbocyvbgiwysnfjiojwzzfvdgaregnglbhd',NULL,128);
+INSERT INTO t1 VALUES (25809,0,NULL,'z',NULL,NULL);
+INSERT INTO t1 VALUES (34,0,NULL,'bonus',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'discover',NULL,NULL);
+INSERT INTO t1 VALUES (191,0,NULL,'shorts',NULL,245);
+INSERT INTO t1 VALUES (32767,0,NULL,'hungry',NULL,-944);
+INSERT INTO t1 VALUES (2,0,NULL,'o',NULL,958);
+INSERT INTO t1 VALUES (209,0,NULL,'ju',NULL,4);
+INSERT INTO t1 VALUES (-14598,0,NULL,'spot',NULL,190);
+INSERT INTO t1 VALUES (2077,0,NULL,'West Virginia',NULL,NULL);
+INSERT INTO t1 VALUES (4,0,NULL,'e',NULL,350);
+INSERT INTO t1 VALUES (-19212,0,NULL,'Louisiana',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'North Carolina',NULL,0);
+INSERT INTO t1 VALUES (60,0,NULL,'w',NULL,6);
+INSERT INTO t1 VALUES (2496,0,NULL,'Alabama',NULL,NULL);
+INSERT INTO t1 VALUES (30994,0,NULL,'s',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'h',NULL,2);
+INSERT INTO t1 VALUES (148,0,NULL,'w',NULL,87);
+INSERT INTO t1 VALUES (-28993,0,NULL,'Nebraska',NULL,5);
+INSERT INTO t1 VALUES (NULL,0,NULL,'solar',NULL,NULL);
+INSERT INTO t1 VALUES (6,0,NULL,'Delaware',NULL,440);
+INSERT INTO t1 VALUES (0,0,NULL,'io',NULL,-456);
+INSERT INTO t1 VALUES (0,0,NULL,'nonprofit',NULL,3);
+INSERT INTO t1 VALUES (94,0,NULL,'p',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'New Jersey',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'badly',NULL,-976);
+INSERT INTO t1 VALUES (0,0,NULL,'vdgaregnglbhdyuz',NULL,-512);
+INSERT INTO t1 VALUES (53,0,NULL,'y',NULL,3);
+INSERT INTO t1 VALUES (1334,0,NULL,'re',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'gnglbhdyuzefxyqyvzgqengmivoxdyeps',NULL,91);
+INSERT INTO t1 VALUES (32767,0,NULL,'r',NULL,170);
+INSERT INTO t1 VALUES (0,0,NULL,'Delaware',NULL,255);
+INSERT INTO t1 VALUES (83,0,NULL,'hd',NULL,811);
+INSERT INTO t1 VALUES (-3048,0,NULL,'Maryland',NULL,-704);
+INSERT INTO t1 VALUES (32767,0,NULL,'resist',NULL,80);
+INSERT INTO t1 VALUES (32767,0,NULL,'u',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'uzefxyqyvzgqengmivoxdyepsuxvtphayypszsnjuol',NULL,496);
+INSERT INTO t1 VALUES (32767,0,NULL,'Hawaii',NULL,812);
+INSERT INTO t1 VALUES (32767,0,NULL,'Missouri',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'yvzgqengmivoxdyepsuxv',NULL,0);
+INSERT INTO t1 VALUES (-14971,0,NULL,'Iowa',NULL,158);
+INSERT INTO t1 VALUES (5,0,NULL,'zgqengmivoxdyepsuxvtphayypszsnjuoldxekhknxplp',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'gqengmivoxdyepsuxvtphayypszsnjuoldx',NULL,652);
+INSERT INTO t1 VALUES (0,0,NULL,'t',NULL,649);
+INSERT INTO t1 VALUES (0,0,NULL,'m',NULL,40);
+INSERT INTO t1 VALUES (6,0,NULL,'oxdyepsuxvtphayypszsnjuold',NULL,NULL);
+INSERT INTO t1 VALUES (4374,0,NULL,'e',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'t',NULL,168);
+INSERT INTO t1 VALUES (250,0,NULL,'yepsuxvtphayypszsnjuo',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New York',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'complete',NULL,871);
+INSERT INTO t1 VALUES (9,0,NULL,'uxvtphayy',NULL,-144);
+INSERT INTO t1 VALUES (56,0,NULL,'nod',NULL,-504);
+INSERT INTO t1 VALUES (0,0,NULL,'v',NULL,680);
+INSERT INTO t1 VALUES (181,0,NULL,'Massachusetts',NULL,322);
+INSERT INTO t1 VALUES (32767,0,NULL,'nuclear',NULL,664);
+INSERT INTO t1 VALUES (163,0,NULL,'u',NULL,117);
+INSERT INTO t1 VALUES (32767,0,NULL,'ay',NULL,-280);
+INSERT INTO t1 VALUES (11214,0,NULL,'z',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'y',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'m',NULL,822);
+INSERT INTO t1 VALUES (0,0,NULL,'California',NULL,91);
+INSERT INTO t1 VALUES (-26918,0,NULL,'date',NULL,343);
+INSERT INTO t1 VALUES (-25243,0,NULL,'reception',NULL,NULL);
+INSERT INTO t1 VALUES (210,0,NULL,'comment',NULL,4);
+INSERT INTO t1 VALUES (73,0,NULL,'w',NULL,734);
+INSERT INTO t1 VALUES (-7394,0,NULL,'j',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'j',NULL,5);
+INSERT INTO t1 VALUES (-4137,0,NULL,'Georgia',NULL,0);
+INSERT INTO t1 VALUES (140,0,NULL,'l',NULL,-880);
+INSERT INTO t1 VALUES (-12829,0,NULL,'Nebraska',NULL,0);
+INSERT INTO t1 VALUES (16211,0,NULL,'hknxplpjbfdlgldb',NULL,NULL);
+INSERT INTO t1 VALUES (14906,0,NULL,'d',NULL,218);
+INSERT INTO t1 VALUES (148,0,NULL,'x',NULL,-736);
+INSERT INTO t1 VALUES (0,0,NULL,'pl',NULL,59);
+INSERT INTO t1 VALUES (NULL,0,NULL,'x',NULL,183);
+INSERT INTO t1 VALUES (0,0,NULL,'fd',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'possibility',NULL,3);
+INSERT INTO t1 VALUES (-7506,0,NULL,'Washington',NULL,512);
+INSERT INTO t1 VALUES (32767,0,NULL,'Illinois',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'bhmxtau',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Colorado',NULL,0);
+INSERT INTO t1 VALUES (1,0,NULL,'mxta',NULL,NULL);
+INSERT INTO t1 VALUES (6,0,NULL,'m',NULL,994);
+INSERT INTO t1 VALUES (0,0,NULL,'Massachusetts',NULL,16);
+INSERT INTO t1 VALUES (-17799,0,NULL,'Massachusetts',NULL,91);
+INSERT INTO t1 VALUES (32767,0,NULL,'motion',NULL,139);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Utah',NULL,-160);
+INSERT INTO t1 VALUES (6,0,NULL,'tolerate',NULL,144);
+INSERT INTO t1 VALUES (0,0,NULL,'Florida',NULL,0);
+INSERT INTO t1 VALUES (9,0,NULL,'Vermont',NULL,178);
+INSERT INTO t1 VALUES (13228,0,NULL,'g',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'s',NULL,0);
+INSERT INTO t1 VALUES (18675,0,NULL,'dcuzmmvrllxwkmcyemoriwjoyrkbhssjesnylouaiygiodldcgwktzumjpot',NULL,130);
+INSERT INTO t1 VALUES (7,0,NULL,'Indiana',NULL,0);
+INSERT INTO t1 VALUES (1,0,NULL,'entertainment',NULL,-736);
+INSERT INTO t1 VALUES (-15594,0,NULL,'zmmvrllxwkmcyemoriwjoyrkbhssj',NULL,728);
+INSERT INTO t1 VALUES (0,0,NULL,'mvrllxwkmcyemoriwjoyrk',NULL,295);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Virginia',NULL,23);
+INSERT INTO t1 VALUES (NULL,0,NULL,'llxwkmcyemoriwjoyrkbhssjesnylouaiygiodldcgwktzumjpotwry',NULL,NULL);
+INSERT INTO t1 VALUES (840,0,NULL,'tiny',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'b',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'v',NULL,0);
+INSERT INTO t1 VALUES (4,0,NULL,'Pennsylvania',NULL,133);
+INSERT INTO t1 VALUES (0,0,NULL,'i',NULL,34);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Tennessee',NULL,157);
+INSERT INTO t1 VALUES (7375,0,NULL,'New York',NULL,124);
+INSERT INTO t1 VALUES (8,0,NULL,'e',NULL,0);
+INSERT INTO t1 VALUES (201,0,NULL,'Maine',NULL,597);
+INSERT INTO t1 VALUES (22036,0,NULL,'forty',NULL,168);
+INSERT INTO t1 VALUES (3,0,NULL,'jo',NULL,0);
+INSERT INTO t1 VALUES (16007,0,NULL,'yr',NULL,906);
+INSERT INTO t1 VALUES (NULL,0,NULL,'universe',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'jesnylouaiygiodldcgwktzumjpotwrysvhzzsophhfh',NULL,120);
+INSERT INTO t1 VALUES (0,0,NULL,'Ohio',NULL,4);
+INSERT INTO t1 VALUES (NULL,0,NULL,'sn',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'nylouaiygiodldcgwktzumjpotwrysvhzzsophhfhw',NULL,48);
+INSERT INTO t1 VALUES (233,0,NULL,'dissolve',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'z',NULL,45);
+INSERT INTO t1 VALUES (0,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'mentally',NULL,5);
+INSERT INTO t1 VALUES (32767,0,NULL,'b',NULL,185);
+INSERT INTO t1 VALUES (32767,0,NULL,'poor',NULL,104);
+INSERT INTO t1 VALUES (0,0,NULL,'l',NULL,2);
+INSERT INTO t1 VALUES (20709,0,NULL,'West Virginia',NULL,31);
+INSERT INTO t1 VALUES (196,0,NULL,'ie',NULL,237);
+INSERT INTO t1 VALUES (1,0,NULL,'tz',NULL,NULL);
+INSERT INTO t1 VALUES (214,0,NULL,'mj',NULL,224);
+INSERT INTO t1 VALUES (5,0,NULL,'interpretation',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'q',NULL,1);
+INSERT INTO t1 VALUES (2,0,NULL,'Colorado',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'ry',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'s',NULL,8);
+INSERT INTO t1 VALUES (1,0,NULL,'vhzzsophhfhwxrajsnelqegm',NULL,730);
+INSERT INTO t1 VALUES (-12909,0,NULL,'web',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'zz',NULL,138);
+INSERT INTO t1 VALUES (NULL,0,NULL,'New Hampshire',NULL,NULL);
+INSERT INTO t1 VALUES (56,0,NULL,'u',NULL,297);
+INSERT INTO t1 VALUES (0,0,NULL,'o',NULL,5);
+INSERT INTO t1 VALUES (32767,0,NULL,'consume',NULL,7);
+INSERT INTO t1 VALUES (21901,0,NULL,'g',NULL,0);
+INSERT INTO t1 VALUES (4,0,NULL,'f',NULL,230);
+INSERT INTO t1 VALUES (240,0,NULL,'tension',NULL,1);
+INSERT INTO t1 VALUES (0,0,NULL,'xr',NULL,3);
+INSERT INTO t1 VALUES (0,0,NULL,'h',NULL,679);
+INSERT INTO t1 VALUES (5996,0,NULL,'js',NULL,197);
+INSERT INTO t1 VALUES (-22204,0,NULL,'snelqegmghyhblwpwxfwdt',NULL,0);
+INSERT INTO t1 VALUES (29005,0,NULL,'lqegmghyhblwpwx',NULL,329);
+INSERT INTO t1 VALUES (NULL,0,NULL,'c',NULL,0);
+INSERT INTO t1 VALUES (92,0,NULL,'gm',NULL,NULL);
+INSERT INTO t1 VALUES (5022,0,NULL,'u',NULL,7);
+INSERT INTO t1 VALUES (1,0,NULL,'gh',NULL,-336);
+INSERT INTO t1 VALUES (58,0,NULL,'hyhblwpwxfwdtkjqznxsfkdilpdqhjnyyvkqbqlbighvqntgezzqyfncjcdc',NULL,NULL);
+INSERT INTO t1 VALUES (18629,0,NULL,'bl',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'availability',NULL,-968);
+INSERT INTO t1 VALUES (-17586,0,NULL,'f',NULL,347);
+INSERT INTO t1 VALUES (0,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (6,0,NULL,'consumer',NULL,7);
+INSERT INTO t1 VALUES (2,0,NULL,'jqznxsfkd',NULL,0);
+INSERT INTO t1 VALUES (2,0,NULL,'amazing',NULL,2);
+INSERT INTO t1 VALUES (0,0,NULL,'accompany',NULL,-720);
+INSERT INTO t1 VALUES (NULL,0,NULL,'nxsfkdilpd',NULL,92);
+INSERT INTO t1 VALUES (96,0,NULL,'f',NULL,9);
+INSERT INTO t1 VALUES (NULL,0,NULL,'dilpdqhjnyyvkqbqlbi',NULL,208);
+INSERT INTO t1 VALUES (19,0,NULL,'ribbon',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'Oklahoma',NULL,9);
+INSERT INTO t1 VALUES (22507,0,NULL,'j',NULL,NULL);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Rhode Island',NULL,473);
+INSERT INTO t1 VALUES (167,0,NULL,'Oklahoma',NULL,0);
+INSERT INTO t1 VALUES (65,0,NULL,'y',NULL,42);
+INSERT INTO t1 VALUES (NULL,0,NULL,'container',NULL,0);
+INSERT INTO t1 VALUES (NULL,0,NULL,'ql',NULL,5);
+INSERT INTO t1 VALUES (3,0,NULL,'lbighvqntgezzqyfncjcdcedujseoodxdgibhgrvxgviemzgn',NULL,NULL);
+INSERT INTO t1 VALUES (-18007,0,NULL,'suggest',NULL,0);
+INSERT INTO t1 VALUES (32767,0,NULL,'g',NULL,-88);
+INSERT INTO t1 VALUES (32767,0,NULL,'hvqntgezzqyfncjcdcedujseoodxdgibhgrvxgviemz',NULL,85);
+INSERT INTO t1 VALUES (0,0,NULL,'Oregon',NULL,584);
+INSERT INTO t1 VALUES (32767,0,NULL,'tg',NULL,128);
+INSERT INTO t1 VALUES (57,0,NULL,'ez',NULL,0);
+INSERT INTO t1 VALUES (25235,0,NULL,'Florida',NULL,0);
+INSERT INTO t1 VALUES (245,0,NULL,'Kentucky',NULL,4);
+INSERT INTO t1 VALUES (202,0,NULL,'u',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'fn',NULL,9);
+INSERT INTO t1 VALUES (30016,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (21837,0,NULL,'cd',NULL,6);
+INSERT INTO t1 VALUES (NULL,0,NULL,'cedujseoodxdgibhgrvxgviemzgngjtolxd',NULL,-648);
+INSERT INTO t1 VALUES (NULL,0,NULL,'jseoodxdgibhgrvxgviemzgngjtolxdrc',NULL,154);
+INSERT INTO t1 VALUES (0,0,NULL,'v',NULL,-160);
+INSERT INTO t1 VALUES (32767,0,NULL,'Oklahoma',NULL,27);
+INSERT INTO t1 VALUES (189,0,NULL,'v',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'solar',NULL,5);
+INSERT INTO t1 VALUES (3423,0,NULL,'dg',NULL,880);
+INSERT INTO t1 VALUES (10026,0,NULL,'g',NULL,68);
+INSERT INTO t1 VALUES (2786,0,NULL,'argue',NULL,NULL);
+INSERT INTO t1 VALUES (32767,0,NULL,'i',NULL,NULL);
+INSERT INTO t1 VALUES (18620,0,NULL,'Florida',NULL,197);
+INSERT INTO t1 VALUES (169,0,NULL,'Michigan',NULL,584);
+INSERT INTO t1 VALUES (NULL,0,NULL,'x',NULL,9);
+INSERT INTO t1 VALUES (-21070,0,NULL,'cemetery',NULL,NULL);
+INSERT INTO t1 VALUES (-26771,0,NULL,'Ohio',NULL,2);
+INSERT INTO t1 VALUES (9937,0,NULL,'m',NULL,321);
+INSERT INTO t1 VALUES (4659,0,NULL,'z',NULL,116);
+INSERT INTO t1 VALUES (15502,0,NULL,'n',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'y',NULL,57);
+INSERT INTO t1 VALUES (1,0,NULL,'l',NULL,70);
+INSERT INTO t1 VALUES (52,0,NULL,'y',NULL,-552);
+INSERT INTO t1 VALUES (0,0,NULL,'deem',NULL,544);
+INSERT INTO t1 VALUES (0,0,NULL,'f',NULL,9);
+INSERT INTO t1 VALUES (32767,0,NULL,'r',NULL,52);
+INSERT INTO t1 VALUES (NULL,0,NULL,'o',NULL,154);
+INSERT INTO t1 VALUES (11,0,NULL,'Rhode Island',NULL,176);
+INSERT INTO t1 VALUES (32767,0,NULL,'South Carolina',NULL,1);
+INSERT INTO t1 VALUES (32767,0,NULL,'p',NULL,672);
+INSERT INTO t1 VALUES (0,0,NULL,'u',NULL,4);
+INSERT INTO t1 VALUES (NULL,0,NULL,'positive',NULL,218);
+INSERT INTO t1 VALUES (NULL,0,NULL,'tomorrow',NULL,-48);
+INSERT INTO t1 VALUES (-30122,0,NULL,'rh',NULL,261);
+INSERT INTO t1 VALUES (4,0,NULL,'tap',NULL,NULL);
+INSERT INTO t1 VALUES (0,0,NULL,'overall',NULL,5);
+INSERT INTO t1 VALUES (0,0,NULL,'n',NULL,146);
+INSERT INTO t1 VALUES (32767,0,NULL,'sometimes',NULL,6);
+INSERT INTO t1 VALUES (0,0,NULL,'n',NULL,488);
+INSERT INTO t1 VALUES (NULL,0,NULL,'hw',NULL,NULL);
+INSERT INTO t1 VALUES (2179,0,NULL,'o',NULL,-176);
+INSERT INTO t1 VALUES (NULL,0,NULL,'Pennsylvania',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'dd',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'d',NULL,0);
+INSERT INTO t1 VALUES (160,0,NULL,'h',NULL,633);
+INSERT INTO t1 VALUES (228,0,NULL,'r',NULL,54);
+INSERT INTO t1 VALUES (0,0,NULL,'p',NULL,7);
+INSERT INTO t1 VALUES (0,0,NULL,'jr',NULL,NULL);
+INSERT INTO t1 VALUES (2,0,NULL,'q',NULL,0);
+INSERT INTO t1 VALUES (29,0,NULL,'w',NULL,184);
+INSERT INTO t1 VALUES (14801,0,NULL,'q',NULL,0);
+INSERT INTO t1 VALUES (-24663,0,NULL,'progress',NULL,270);
+INSERT INTO t1 VALUES (0,0,NULL,'w',NULL,-912);
+INSERT INTO t1 VALUES (27423,0,NULL,'ok',NULL,8);
+INSERT INTO t1 VALUES (NULL,0,NULL,'re',NULL,NULL);
+INSERT INTO t1 VALUES (29082,0,NULL,'d',NULL,2);
+INSERT INTO t1 VALUES (32767,0,NULL,'name',NULL,162);
+INSERT INTO t1 VALUES (NULL,0,NULL,'p',NULL,219);
+INSERT INTO t1 VALUES (4801,0,NULL,'wixljp',NULL,266);
+INSERT INTO t1 VALUES (36,0,NULL,'xl',NULL,NULL);
+INSERT INTO t1 VALUES (1,0,NULL,'l',NULL,0);
+INSERT INTO t1 VALUES (0,0,NULL,'i',NULL,584);
+INSERT INTO t1 VALUES (160,0,NULL,'w',NULL,0);
+INSERT INTO t1 VALUES (4,0,NULL,'s',NULL,0);
+INSERT INTO t1 VALUES (20,0,NULL,'d',NULL,NULL);
+INSERT INTO t1 VALUES (31136,0,NULL,'god',NULL,4);
+--enable_query_log
+ALTER TABLE t1 ENABLE KEYS;
+
+--echo # Must not crash:
+SELECT * FROM t1 WHERE ( a BETWEEN 255 AND 270 OR f = 200 ) AND f IN ( 1, 4, 112, 143 ) AND d IN ('Montana', 'South Dakota');
+DROP TABLE t1;
diff --git a/mysql-test/main/signal.result b/mysql-test/main/signal.result
index 40b1609fc26..b5b479db017 100644
--- a/mysql-test/main/signal.result
+++ b/mysql-test/main/signal.result
@@ -2285,13 +2285,13 @@ begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo SET MYSQL_ERRNO = `65`; /* illegal */
end $$
-ERROR 42S22: Unknown column '65' in 'field list'
+ERROR 42000: Undeclared variable: 65
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo SET MYSQL_ERRNO = `A`; /* illegal */
end $$
-ERROR 42S22: Unknown column 'A' in 'field list'
+ERROR 42000: Undeclared variable: A
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -2342,7 +2342,7 @@ DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo SET MYSQL_ERRNO = 1000,
MESSAGE_TEXT = `Hello`;
end $$
-ERROR 42S22: Unknown column 'Hello' in 'field list'
+ERROR 42000: Undeclared variable: Hello
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
diff --git a/mysql-test/main/signal.test b/mysql-test/main/signal.test
index 5b40863b0e6..22cfc080895 100644
--- a/mysql-test/main/signal.test
+++ b/mysql-test/main/signal.test
@@ -2546,7 +2546,7 @@ end $$
call test_signal $$
drop procedure test_signal $$
--- error ER_BAD_FIELD_ERROR
+-- error ER_SP_UNDECLARED_VAR
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -2554,7 +2554,7 @@ begin
end $$
--- error ER_BAD_FIELD_ERROR
+-- error ER_SP_UNDECLARED_VAR
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -2616,7 +2616,7 @@ end $$
call test_signal $$
drop procedure test_signal $$
--- error ER_BAD_FIELD_ERROR
+-- error ER_SP_UNDECLARED_VAR
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
diff --git a/mysql-test/main/sp-error.result b/mysql-test/main/sp-error.result
index 703af07569b..55777da3ee8 100644
--- a/mysql-test/main/sp-error.result
+++ b/mysql-test/main/sp-error.result
@@ -452,7 +452,7 @@ else
set b = a;
end if;
end|
-ERROR 42S22: Unknown column 'aa' in 'field list'
+ERROR 42000: Undeclared variable: aa
create procedure bug4344() drop procedure bug4344|
ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
create procedure bug4344() drop function bug4344|
@@ -1067,7 +1067,7 @@ IF bug13037_foo THEN
SELECT 1;
END IF;
END|
-ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+ERROR 42000: Undeclared variable: bug13037_foo
CREATE PROCEDURE bug13037_p2()
BEGIN
SET @bug13037_foo = bug13037_bar;
@@ -2870,3 +2870,16 @@ SELECT @msg;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
+#
+# 10.2 Test
+#
+# MDEV-MDEV-22058: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+# is_bulk_op())' failed in Diagnostics_area::set_ok_status
+#
+SET @old_optimizer_switch = @@SESSION.OPTIMIZER_SWITCH;
+SET @cmd:="SET @@SESSION.SQL_MODE=(SELECT 'a')";
+SET @@SESSION.OPTIMIZER_SWITCH="in_to_exists=OFF,materialization=OFF";
+ERROR HY000: At least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'
+PREPARE stmt FROM @cmd;
+set @@SESSION.OPTIMIZER_SWITCH=@old_optimizer_switch;
+# End of 10.2 Test
diff --git a/mysql-test/main/sp-error.test b/mysql-test/main/sp-error.test
index 0a545b99f42..4eb1a00caa4 100644
--- a/mysql-test/main/sp-error.test
+++ b/mysql-test/main/sp-error.test
@@ -612,7 +612,7 @@ create procedure bug2653_1(a int, out b int)
set b = aa|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug2653_2(a int, out b int)
begin
if aa < 0 then
@@ -1505,7 +1505,7 @@ DROP PROCEDURE IF EXISTS bug13037_p3;
delimiter |;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE bug13037_p1()
BEGIN
IF bug13037_foo THEN
@@ -3835,3 +3835,22 @@ SELECT @msg;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
+
+--echo #
+--echo # 10.2 Test
+--echo #
+--echo # MDEV-MDEV-22058: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+--echo # is_bulk_op())' failed in Diagnostics_area::set_ok_status
+--echo #
+
+SET @old_optimizer_switch = @@SESSION.OPTIMIZER_SWITCH;
+
+SET @cmd:="SET @@SESSION.SQL_MODE=(SELECT 'a')";
+
+--error ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES
+SET @@SESSION.OPTIMIZER_SWITCH="in_to_exists=OFF,materialization=OFF";
+PREPARE stmt FROM @cmd;
+
+set @@SESSION.OPTIMIZER_SWITCH=@old_optimizer_switch;
+
+--echo # End of 10.2 Test
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index dd7e12949f4..ed20689ed11 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -4184,7 +4184,7 @@ select v, isnull(v);
end if;
end;
end|
-ERROR 42S22: Unknown column 'undefined_var' in 'field list'
+ERROR 42000: Undeclared variable: undefined_var
create procedure bug14643_2()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
@@ -4196,7 +4196,7 @@ select 2;
end case;
select undefined_var;
end|
-ERROR 42S22: Unknown column 'undefined_var' in 'field list'
+ERROR 42000: Undeclared variable: undefined_var
drop procedure if exists bug14304|
drop table if exists t3, t4|
create table t3(a int primary key auto_increment)|
@@ -4226,7 +4226,7 @@ create procedure bug14376()
begin
declare x int default x;
end|
-ERROR 42S22: Unknown column 'x' in 'field list'
+ERROR 42000: Undeclared variable: x
create procedure bug14376()
begin
declare x int default 42;
@@ -4481,7 +4481,7 @@ select 'no' as 'v';
end if;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_2()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4490,7 +4490,7 @@ select 'yes' as 'v';
end while;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_3()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4499,7 +4499,7 @@ select 'maybe' as 'v';
until v end repeat;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_4()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4513,7 +4513,7 @@ select '?' as 'v';
end case;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_5()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4527,7 +4527,7 @@ select '?' as 'v';
end case;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
drop table if exists t3|
drop procedure if exists bug15231_1|
drop procedure if exists bug15231_2|
@@ -8401,7 +8401,7 @@ DECLARE name VARCHAR(10);
SET name="hello";
call p1(name2);
END|
-ERROR 42S22: Unknown column 'name2' in 'field list'
+ERROR 42000: Undeclared variable: name2
call p2();
a
hello
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 7d1e8e2a8f9..bddd07bdb6c 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -5046,7 +5046,7 @@ drop procedure if exists bug14643_1|
drop procedure if exists bug14643_2|
--enable_warnings
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14643_1()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
@@ -5062,7 +5062,7 @@ begin
end;
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14643_2()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
@@ -5117,7 +5117,7 @@ drop table t3, t4|
drop procedure if exists bug14376|
--enable_warnings
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14376()
begin
declare x int default x;
@@ -5344,7 +5344,7 @@ drop procedure if exists bug14498_4|
drop procedure if exists bug14498_5|
--enable_warnings
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_1()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5357,7 +5357,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_2()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5368,7 +5368,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_3()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5379,7 +5379,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_4()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5395,7 +5395,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_5()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -9931,7 +9931,7 @@ BEGIN
call p1(name);
END|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE OR REPLACE PROCEDURE p3 ()
BEGIN
DECLARE name VARCHAR(10);
diff --git a/mysql-test/main/stat_tables_innodb.result b/mysql-test/main/stat_tables_innodb.result
index a5c702213c3..e937d1ffe0f 100644
--- a/mysql-test/main/stat_tables_innodb.result
+++ b/mysql-test/main/stat_tables_innodb.result
@@ -926,4 +926,28 @@ set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
+#
+# MDEV-22851: Engine independent index statistics are incorrect for large tables on Windows.
+#
+CREATE TABLE t1(a INT) ENGINE=INNODB;
+INSERT INTO t1 SELECT 1 FROM seq_1_to_60000;
+SET @save_use_stat_tables= @@use_stat_tables;
+SET use_stat_tables= preferably;
+SELECT count(*) FROM t1;
+count(*)
+60000
+CREATE INDEX idx ON t1(a);
+ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (idx);
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+SELECT * FROM mysql.index_stats where table_name='t1';
+db_name table_name index_name prefix_arity avg_frequency
+test t1 idx 1 60000.0000
+SELECT * FROM mysql.column_stats where table_name='t1';
+db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
+test t1 a 1 1 0.0000 4.0000 60000.0000 0 NULL NULL
+SET use_stat_tables= @save_use_stat_tables;
+DROP TABLE t1;
+# end of 10.1 tests
SET SESSION DEFAULT_STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/main/stat_tables_innodb.test b/mysql-test/main/stat_tables_innodb.test
index 533f56387a2..f439ec52315 100644
--- a/mysql-test/main/stat_tables_innodb.test
+++ b/mysql-test/main/stat_tables_innodb.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
@@ -18,4 +19,23 @@ set global innodb_stats_persistent_sample_pages=
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
+--echo #
+--echo # MDEV-22851: Engine independent index statistics are incorrect for large tables on Windows.
+--echo #
+
+CREATE TABLE t1(a INT) ENGINE=INNODB;
+INSERT INTO t1 SELECT 1 FROM seq_1_to_60000;
+
+SET @save_use_stat_tables= @@use_stat_tables;
+SET use_stat_tables= preferably;
+SELECT count(*) FROM t1;
+CREATE INDEX idx ON t1(a);
+ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (idx);
+SELECT * FROM mysql.index_stats where table_name='t1';
+SELECT * FROM mysql.column_stats where table_name='t1';
+SET use_stat_tables= @save_use_stat_tables;
+DROP TABLE t1;
+
+--echo # end of 10.1 tests
+
SET SESSION DEFAULT_STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/main/subselect_exists2in.result b/mysql-test/main/subselect_exists2in.result
index 950538ad114..576559c2e86 100644
--- a/mysql-test/main/subselect_exists2in.result
+++ b/mysql-test/main/subselect_exists2in.result
@@ -440,8 +440,8 @@ drop table t1,t3;
# MDEV-159 Assertion about not marked for read failed in
# String* Field_varstring::val_str(String*, String*)
#
-SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' );
-SET optimizer_switch='in_to_exists=on,exists_to_in=on';
+SET optimizer_switch = REPLACE(REPLACE(@@optimizer_switch, '=on', '=off'), 'in_to_exists=off', 'in_to_exists=on');
+SET optimizer_switch='exists_to_in=on';
CREATE TABLE t1 ( a VARCHAR(1) );
INSERT INTO t1 VALUES ('k'),('m');
CREATE TABLE t2 ( b INT,
@@ -596,8 +596,8 @@ Warnings:
Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`alias`.`b` and `test`.`alias`.`b` > `test`.`alias`.`a`
-SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' );
-SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=off';
+SET optimizer_switch = REPLACE(REPLACE(@@optimizer_switch, '=on', '=off'), 'materialization=off', 'materialization=on');
+SET optimizer_switch = 'exists_to_in=on,semijoin=off';
SELECT * FROM t1 AS alias
WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b );
a b
diff --git a/mysql-test/main/subselect_exists2in.test b/mysql-test/main/subselect_exists2in.test
index 1354953e972..2a9947123d4 100644
--- a/mysql-test/main/subselect_exists2in.test
+++ b/mysql-test/main/subselect_exists2in.test
@@ -330,8 +330,8 @@ drop table t1,t3;
--echo # String* Field_varstring::val_str(String*, String*)
--echo #
-SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' );
-SET optimizer_switch='in_to_exists=on,exists_to_in=on';
+SET optimizer_switch = REPLACE(REPLACE(@@optimizer_switch, '=on', '=off'), 'in_to_exists=off', 'in_to_exists=on');
+SET optimizer_switch='exists_to_in=on';
CREATE TABLE t1 ( a VARCHAR(1) );
INSERT INTO t1 VALUES ('k'),('m');
@@ -466,8 +466,8 @@ explain extended
SELECT * FROM t1 AS alias
WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b );
-SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' );
-SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=off';
+SET optimizer_switch = REPLACE(REPLACE(@@optimizer_switch, '=on', '=off'), 'materialization=off', 'materialization=on');
+SET optimizer_switch = 'exists_to_in=on,semijoin=off';
SELECT * FROM t1 AS alias
WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b );
explain extended
diff --git a/mysql-test/main/type_bit.result b/mysql-test/main/type_bit.result
index 35a05388754..f44bdf70c4a 100644
--- a/mysql-test/main/type_bit.result
+++ b/mysql-test/main/type_bit.result
@@ -876,6 +876,989 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
#
+# MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+#
+BEGIN NOT ATOMIC
+FOR i IN 1..64
+DO
+SELECT '-----', CONCAT('BIT(',i,')') AS Type;
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a BIT(64))','64', i);
+INSERT IGNORE INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
+CREATE TABLE t2 AS SELECT
+a,
+FLOOR(a) AS cf,
+CEILING(a) AS cc,
+ROUND(a) AS cr,
+TRUNCATE(a,0) AS ct
+FROM t1;
+SHOW CREATE TABLE t2;
+SELECT CAST(a AS UNSIGNED) AS a, cf, cc, cr, ct FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
+END FOR;
+END;
+$$
+----- -----
+Type BIT(1)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(1) DEFAULT NULL,
+ `cf` int(1) unsigned DEFAULT NULL,
+ `cc` int(1) unsigned DEFAULT NULL,
+ `cr` int(1) unsigned DEFAULT NULL,
+ `ct` int(1) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1
+cf 1
+cc 1
+cr 1
+ct 1
+----- -----
+Type BIT(2)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(2) DEFAULT NULL,
+ `cf` int(1) unsigned DEFAULT NULL,
+ `cc` int(1) unsigned DEFAULT NULL,
+ `cr` int(1) unsigned DEFAULT NULL,
+ `ct` int(1) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 3
+cf 3
+cc 3
+cr 3
+ct 3
+----- -----
+Type BIT(3)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(3) DEFAULT NULL,
+ `cf` int(1) unsigned DEFAULT NULL,
+ `cc` int(1) unsigned DEFAULT NULL,
+ `cr` int(1) unsigned DEFAULT NULL,
+ `ct` int(1) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 7
+cf 7
+cc 7
+cr 7
+ct 7
+----- -----
+Type BIT(4)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(4) DEFAULT NULL,
+ `cf` int(2) unsigned DEFAULT NULL,
+ `cc` int(2) unsigned DEFAULT NULL,
+ `cr` int(2) unsigned DEFAULT NULL,
+ `ct` int(2) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 15
+cf 15
+cc 15
+cr 15
+ct 15
+----- -----
+Type BIT(5)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(5) DEFAULT NULL,
+ `cf` int(2) unsigned DEFAULT NULL,
+ `cc` int(2) unsigned DEFAULT NULL,
+ `cr` int(2) unsigned DEFAULT NULL,
+ `ct` int(2) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 31
+cf 31
+cc 31
+cr 31
+ct 31
+----- -----
+Type BIT(6)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(6) DEFAULT NULL,
+ `cf` int(2) unsigned DEFAULT NULL,
+ `cc` int(2) unsigned DEFAULT NULL,
+ `cr` int(2) unsigned DEFAULT NULL,
+ `ct` int(2) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 63
+cf 63
+cc 63
+cr 63
+ct 63
+----- -----
+Type BIT(7)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(7) DEFAULT NULL,
+ `cf` int(3) unsigned DEFAULT NULL,
+ `cc` int(3) unsigned DEFAULT NULL,
+ `cr` int(3) unsigned DEFAULT NULL,
+ `ct` int(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 127
+cf 127
+cc 127
+cr 127
+ct 127
+----- -----
+Type BIT(8)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(8) DEFAULT NULL,
+ `cf` int(3) unsigned DEFAULT NULL,
+ `cc` int(3) unsigned DEFAULT NULL,
+ `cr` int(3) unsigned DEFAULT NULL,
+ `ct` int(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 255
+cf 255
+cc 255
+cr 255
+ct 255
+----- -----
+Type BIT(9)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(9) DEFAULT NULL,
+ `cf` int(3) unsigned DEFAULT NULL,
+ `cc` int(3) unsigned DEFAULT NULL,
+ `cr` int(3) unsigned DEFAULT NULL,
+ `ct` int(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 511
+cf 511
+cc 511
+cr 511
+ct 511
+----- -----
+Type BIT(10)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(10) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1023
+cf 1023
+cc 1023
+cr 1023
+ct 1023
+----- -----
+Type BIT(11)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(11) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2047
+cf 2047
+cc 2047
+cr 2047
+ct 2047
+----- -----
+Type BIT(12)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(12) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4095
+cf 4095
+cc 4095
+cr 4095
+ct 4095
+----- -----
+Type BIT(13)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(13) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8191
+cf 8191
+cc 8191
+cr 8191
+ct 8191
+----- -----
+Type BIT(14)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(14) DEFAULT NULL,
+ `cf` int(5) unsigned DEFAULT NULL,
+ `cc` int(5) unsigned DEFAULT NULL,
+ `cr` int(5) unsigned DEFAULT NULL,
+ `ct` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 16383
+cf 16383
+cc 16383
+cr 16383
+ct 16383
+----- -----
+Type BIT(15)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(15) DEFAULT NULL,
+ `cf` int(5) unsigned DEFAULT NULL,
+ `cc` int(5) unsigned DEFAULT NULL,
+ `cr` int(5) unsigned DEFAULT NULL,
+ `ct` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 32767
+cf 32767
+cc 32767
+cr 32767
+ct 32767
+----- -----
+Type BIT(16)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(16) DEFAULT NULL,
+ `cf` int(5) unsigned DEFAULT NULL,
+ `cc` int(5) unsigned DEFAULT NULL,
+ `cr` int(5) unsigned DEFAULT NULL,
+ `ct` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 65535
+cf 65535
+cc 65535
+cr 65535
+ct 65535
+----- -----
+Type BIT(17)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(17) DEFAULT NULL,
+ `cf` int(6) unsigned DEFAULT NULL,
+ `cc` int(6) unsigned DEFAULT NULL,
+ `cr` int(6) unsigned DEFAULT NULL,
+ `ct` int(6) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 131071
+cf 131071
+cc 131071
+cr 131071
+ct 131071
+----- -----
+Type BIT(18)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(18) DEFAULT NULL,
+ `cf` int(6) unsigned DEFAULT NULL,
+ `cc` int(6) unsigned DEFAULT NULL,
+ `cr` int(6) unsigned DEFAULT NULL,
+ `ct` int(6) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 262143
+cf 262143
+cc 262143
+cr 262143
+ct 262143
+----- -----
+Type BIT(19)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(19) DEFAULT NULL,
+ `cf` int(6) unsigned DEFAULT NULL,
+ `cc` int(6) unsigned DEFAULT NULL,
+ `cr` int(6) unsigned DEFAULT NULL,
+ `ct` int(6) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 524287
+cf 524287
+cc 524287
+cr 524287
+ct 524287
+----- -----
+Type BIT(20)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(20) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1048575
+cf 1048575
+cc 1048575
+cr 1048575
+ct 1048575
+----- -----
+Type BIT(21)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(21) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2097151
+cf 2097151
+cc 2097151
+cr 2097151
+ct 2097151
+----- -----
+Type BIT(22)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(22) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4194303
+cf 4194303
+cc 4194303
+cr 4194303
+ct 4194303
+----- -----
+Type BIT(23)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(23) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8388607
+cf 8388607
+cc 8388607
+cr 8388607
+ct 8388607
+----- -----
+Type BIT(24)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(24) DEFAULT NULL,
+ `cf` int(8) unsigned DEFAULT NULL,
+ `cc` int(8) unsigned DEFAULT NULL,
+ `cr` int(8) unsigned DEFAULT NULL,
+ `ct` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 16777215
+cf 16777215
+cc 16777215
+cr 16777215
+ct 16777215
+----- -----
+Type BIT(25)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(25) DEFAULT NULL,
+ `cf` int(8) unsigned DEFAULT NULL,
+ `cc` int(8) unsigned DEFAULT NULL,
+ `cr` int(8) unsigned DEFAULT NULL,
+ `ct` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 33554431
+cf 33554431
+cc 33554431
+cr 33554431
+ct 33554431
+----- -----
+Type BIT(26)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(26) DEFAULT NULL,
+ `cf` int(8) unsigned DEFAULT NULL,
+ `cc` int(8) unsigned DEFAULT NULL,
+ `cr` int(8) unsigned DEFAULT NULL,
+ `ct` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 67108863
+cf 67108863
+cc 67108863
+cr 67108863
+ct 67108863
+----- -----
+Type BIT(27)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(27) DEFAULT NULL,
+ `cf` int(9) unsigned DEFAULT NULL,
+ `cc` int(9) unsigned DEFAULT NULL,
+ `cr` int(9) unsigned DEFAULT NULL,
+ `ct` int(9) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 134217727
+cf 134217727
+cc 134217727
+cr 134217727
+ct 134217727
+----- -----
+Type BIT(28)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(28) DEFAULT NULL,
+ `cf` int(9) unsigned DEFAULT NULL,
+ `cc` int(9) unsigned DEFAULT NULL,
+ `cr` int(9) unsigned DEFAULT NULL,
+ `ct` int(9) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 268435455
+cf 268435455
+cc 268435455
+cr 268435455
+ct 268435455
+----- -----
+Type BIT(29)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(29) DEFAULT NULL,
+ `cf` int(9) unsigned DEFAULT NULL,
+ `cc` int(9) unsigned DEFAULT NULL,
+ `cr` int(9) unsigned DEFAULT NULL,
+ `ct` int(9) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 536870911
+cf 536870911
+cc 536870911
+cr 536870911
+ct 536870911
+----- -----
+Type BIT(30)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(30) DEFAULT NULL,
+ `cf` int(10) unsigned DEFAULT NULL,
+ `cc` int(10) unsigned DEFAULT NULL,
+ `cr` int(10) unsigned DEFAULT NULL,
+ `ct` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1073741823
+cf 1073741823
+cc 1073741823
+cr 1073741823
+ct 1073741823
+----- -----
+Type BIT(31)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(31) DEFAULT NULL,
+ `cf` int(10) unsigned DEFAULT NULL,
+ `cc` int(10) unsigned DEFAULT NULL,
+ `cr` int(10) unsigned DEFAULT NULL,
+ `ct` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2147483647
+cf 2147483647
+cc 2147483647
+cr 2147483647
+ct 2147483647
+----- -----
+Type BIT(32)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(32) DEFAULT NULL,
+ `cf` int(10) unsigned DEFAULT NULL,
+ `cc` int(10) unsigned DEFAULT NULL,
+ `cr` int(10) unsigned DEFAULT NULL,
+ `ct` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4294967295
+cf 4294967295
+cc 4294967295
+cr 4294967295
+ct 4294967295
+----- -----
+Type BIT(33)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(33) DEFAULT NULL,
+ `cf` bigint(10) unsigned DEFAULT NULL,
+ `cc` bigint(10) unsigned DEFAULT NULL,
+ `cr` bigint(10) unsigned DEFAULT NULL,
+ `ct` bigint(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8589934591
+cf 8589934591
+cc 8589934591
+cr 8589934591
+ct 8589934591
+----- -----
+Type BIT(34)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(34) DEFAULT NULL,
+ `cf` bigint(11) unsigned DEFAULT NULL,
+ `cc` bigint(11) unsigned DEFAULT NULL,
+ `cr` bigint(11) unsigned DEFAULT NULL,
+ `ct` bigint(11) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 17179869183
+cf 17179869183
+cc 17179869183
+cr 17179869183
+ct 17179869183
+----- -----
+Type BIT(35)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(35) DEFAULT NULL,
+ `cf` bigint(11) unsigned DEFAULT NULL,
+ `cc` bigint(11) unsigned DEFAULT NULL,
+ `cr` bigint(11) unsigned DEFAULT NULL,
+ `ct` bigint(11) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 34359738367
+cf 34359738367
+cc 34359738367
+cr 34359738367
+ct 34359738367
+----- -----
+Type BIT(36)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(36) DEFAULT NULL,
+ `cf` bigint(11) unsigned DEFAULT NULL,
+ `cc` bigint(11) unsigned DEFAULT NULL,
+ `cr` bigint(11) unsigned DEFAULT NULL,
+ `ct` bigint(11) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 68719476735
+cf 68719476735
+cc 68719476735
+cr 68719476735
+ct 68719476735
+----- -----
+Type BIT(37)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(37) DEFAULT NULL,
+ `cf` bigint(12) unsigned DEFAULT NULL,
+ `cc` bigint(12) unsigned DEFAULT NULL,
+ `cr` bigint(12) unsigned DEFAULT NULL,
+ `ct` bigint(12) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 137438953471
+cf 137438953471
+cc 137438953471
+cr 137438953471
+ct 137438953471
+----- -----
+Type BIT(38)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(38) DEFAULT NULL,
+ `cf` bigint(12) unsigned DEFAULT NULL,
+ `cc` bigint(12) unsigned DEFAULT NULL,
+ `cr` bigint(12) unsigned DEFAULT NULL,
+ `ct` bigint(12) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 274877906943
+cf 274877906943
+cc 274877906943
+cr 274877906943
+ct 274877906943
+----- -----
+Type BIT(39)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(39) DEFAULT NULL,
+ `cf` bigint(12) unsigned DEFAULT NULL,
+ `cc` bigint(12) unsigned DEFAULT NULL,
+ `cr` bigint(12) unsigned DEFAULT NULL,
+ `ct` bigint(12) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 549755813887
+cf 549755813887
+cc 549755813887
+cr 549755813887
+ct 549755813887
+----- -----
+Type BIT(40)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(40) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1099511627775
+cf 1099511627775
+cc 1099511627775
+cr 1099511627775
+ct 1099511627775
+----- -----
+Type BIT(41)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(41) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2199023255551
+cf 2199023255551
+cc 2199023255551
+cr 2199023255551
+ct 2199023255551
+----- -----
+Type BIT(42)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(42) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4398046511103
+cf 4398046511103
+cc 4398046511103
+cr 4398046511103
+ct 4398046511103
+----- -----
+Type BIT(43)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(43) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8796093022207
+cf 8796093022207
+cc 8796093022207
+cr 8796093022207
+ct 8796093022207
+----- -----
+Type BIT(44)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(44) DEFAULT NULL,
+ `cf` bigint(14) unsigned DEFAULT NULL,
+ `cc` bigint(14) unsigned DEFAULT NULL,
+ `cr` bigint(14) unsigned DEFAULT NULL,
+ `ct` bigint(14) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 17592186044415
+cf 17592186044415
+cc 17592186044415
+cr 17592186044415
+ct 17592186044415
+----- -----
+Type BIT(45)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(45) DEFAULT NULL,
+ `cf` bigint(14) unsigned DEFAULT NULL,
+ `cc` bigint(14) unsigned DEFAULT NULL,
+ `cr` bigint(14) unsigned DEFAULT NULL,
+ `ct` bigint(14) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 35184372088831
+cf 35184372088831
+cc 35184372088831
+cr 35184372088831
+ct 35184372088831
+----- -----
+Type BIT(46)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(46) DEFAULT NULL,
+ `cf` bigint(14) unsigned DEFAULT NULL,
+ `cc` bigint(14) unsigned DEFAULT NULL,
+ `cr` bigint(14) unsigned DEFAULT NULL,
+ `ct` bigint(14) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 70368744177663
+cf 70368744177663
+cc 70368744177663
+cr 70368744177663
+ct 70368744177663
+----- -----
+Type BIT(47)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(47) DEFAULT NULL,
+ `cf` bigint(15) unsigned DEFAULT NULL,
+ `cc` bigint(15) unsigned DEFAULT NULL,
+ `cr` bigint(15) unsigned DEFAULT NULL,
+ `ct` bigint(15) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 140737488355327
+cf 140737488355327
+cc 140737488355327
+cr 140737488355327
+ct 140737488355327
+----- -----
+Type BIT(48)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(48) DEFAULT NULL,
+ `cf` bigint(15) unsigned DEFAULT NULL,
+ `cc` bigint(15) unsigned DEFAULT NULL,
+ `cr` bigint(15) unsigned DEFAULT NULL,
+ `ct` bigint(15) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 281474976710655
+cf 281474976710655
+cc 281474976710655
+cr 281474976710655
+ct 281474976710655
+----- -----
+Type BIT(49)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(49) DEFAULT NULL,
+ `cf` bigint(15) unsigned DEFAULT NULL,
+ `cc` bigint(15) unsigned DEFAULT NULL,
+ `cr` bigint(15) unsigned DEFAULT NULL,
+ `ct` bigint(15) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 562949953421311
+cf 562949953421311
+cc 562949953421311
+cr 562949953421311
+ct 562949953421311
+----- -----
+Type BIT(50)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(50) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1125899906842623
+cf 1125899906842623
+cc 1125899906842623
+cr 1125899906842623
+ct 1125899906842623
+----- -----
+Type BIT(51)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(51) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2251799813685247
+cf 2251799813685247
+cc 2251799813685247
+cr 2251799813685247
+ct 2251799813685247
+----- -----
+Type BIT(52)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(52) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4503599627370495
+cf 4503599627370495
+cc 4503599627370495
+cr 4503599627370495
+ct 4503599627370495
+----- -----
+Type BIT(53)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(53) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 9007199254740991
+cf 9007199254740991
+cc 9007199254740991
+cr 9007199254740991
+ct 9007199254740991
+----- -----
+Type BIT(54)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(54) DEFAULT NULL,
+ `cf` bigint(17) unsigned DEFAULT NULL,
+ `cc` bigint(17) unsigned DEFAULT NULL,
+ `cr` bigint(17) unsigned DEFAULT NULL,
+ `ct` bigint(17) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 18014398509481983
+cf 18014398509481983
+cc 18014398509481983
+cr 18014398509481983
+ct 18014398509481983
+----- -----
+Type BIT(55)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(55) DEFAULT NULL,
+ `cf` bigint(17) unsigned DEFAULT NULL,
+ `cc` bigint(17) unsigned DEFAULT NULL,
+ `cr` bigint(17) unsigned DEFAULT NULL,
+ `ct` bigint(17) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 36028797018963967
+cf 36028797018963967
+cc 36028797018963967
+cr 36028797018963967
+ct 36028797018963967
+----- -----
+Type BIT(56)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(56) DEFAULT NULL,
+ `cf` bigint(17) unsigned DEFAULT NULL,
+ `cc` bigint(17) unsigned DEFAULT NULL,
+ `cr` bigint(17) unsigned DEFAULT NULL,
+ `ct` bigint(17) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 72057594037927935
+cf 72057594037927935
+cc 72057594037927935
+cr 72057594037927935
+ct 72057594037927935
+----- -----
+Type BIT(57)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(57) DEFAULT NULL,
+ `cf` bigint(18) unsigned DEFAULT NULL,
+ `cc` bigint(18) unsigned DEFAULT NULL,
+ `cr` bigint(18) unsigned DEFAULT NULL,
+ `ct` bigint(18) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 144115188075855871
+cf 144115188075855871
+cc 144115188075855871
+cr 144115188075855871
+ct 144115188075855871
+----- -----
+Type BIT(58)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(58) DEFAULT NULL,
+ `cf` bigint(18) unsigned DEFAULT NULL,
+ `cc` bigint(18) unsigned DEFAULT NULL,
+ `cr` bigint(18) unsigned DEFAULT NULL,
+ `ct` bigint(18) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 288230376151711743
+cf 288230376151711743
+cc 288230376151711743
+cr 288230376151711743
+ct 288230376151711743
+----- -----
+Type BIT(59)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(59) DEFAULT NULL,
+ `cf` bigint(18) unsigned DEFAULT NULL,
+ `cc` bigint(18) unsigned DEFAULT NULL,
+ `cr` bigint(18) unsigned DEFAULT NULL,
+ `ct` bigint(18) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 576460752303423487
+cf 576460752303423487
+cc 576460752303423487
+cr 576460752303423487
+ct 576460752303423487
+----- -----
+Type BIT(60)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(60) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1152921504606846975
+cf 1152921504606846975
+cc 1152921504606846975
+cr 1152921504606846975
+ct 1152921504606846975
+----- -----
+Type BIT(61)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(61) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2305843009213693951
+cf 2305843009213693951
+cc 2305843009213693951
+cr 2305843009213693951
+ct 2305843009213693951
+----- -----
+Type BIT(62)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(62) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4611686018427387903
+cf 4611686018427387903
+cc 4611686018427387903
+cr 4611686018427387903
+ct 4611686018427387903
+----- -----
+Type BIT(63)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(63) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 9223372036854775807
+cf 9223372036854775807
+cc 9223372036854775807
+cr 9223372036854775807
+ct 9223372036854775807
+----- -----
+Type BIT(64)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(64) DEFAULT NULL,
+ `cf` bigint(20) unsigned DEFAULT NULL,
+ `cc` bigint(20) unsigned DEFAULT NULL,
+ `cr` bigint(20) unsigned DEFAULT NULL,
+ `ct` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 18446744073709551615
+cf 18446744073709551615
+cc 18446744073709551615
+cr 18446744073709551615
+ct 18446744073709551615
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/type_bit.test b/mysql-test/main/type_bit.test
index 3085d46bab6..2e66c7fb7cd 100644
--- a/mysql-test/main/type_bit.test
+++ b/mysql-test/main/type_bit.test
@@ -507,6 +507,35 @@ EXPLAIN SELECT * FROM t1 WHERE a=200;
EXPLAIN SELECT * FROM t1 WHERE a<=>200;
DROP TABLE t1;
+--echo #
+--echo # MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+--echo #
+
+--vertical_results
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ FOR i IN 1..64
+ DO
+ SELECT '-----', CONCAT('BIT(',i,')') AS Type;
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a BIT(64))','64', i);
+ INSERT IGNORE INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
+ CREATE TABLE t2 AS SELECT
+ a,
+ FLOOR(a) AS cf,
+ CEILING(a) AS cc,
+ ROUND(a) AS cr,
+ TRUNCATE(a,0) AS ct
+ FROM t1;
+ SHOW CREATE TABLE t2;
+ SELECT CAST(a AS UNSIGNED) AS a, cf, cc, cr, ct FROM t2;
+ DROP TABLE t2;
+ DROP TABLE t1;
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+--horizontal_results
+
--echo #
--echo # End of 10.4 tests
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result
index aa5d6ccadc1..84301a4b191 100644
--- a/mysql-test/main/type_date.result
+++ b/mysql-test/main/type_date.result
@@ -1089,5 +1089,19 @@ CAST(1012.5 AS DATE) * 1.0
Warnings:
Note 1292 Truncated incorrect date value: '1012.5'
#
+# MDEV-23351 Rounding functions return wrong data types for DATE input
+#
+CREATE TABLE t1 (a date);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `FLOOR(a)` int(8) unsigned DEFAULT NULL,
+ `CEIL(a)` int(8) unsigned DEFAULT NULL,
+ `ROUND(a)` int(8) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2,t1;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_date.test b/mysql-test/main/type_date.test
index c041295f845..33598846504 100644
--- a/mysql-test/main/type_date.test
+++ b/mysql-test/main/type_date.test
@@ -740,6 +740,14 @@ SET sql_mode=DEFAULT;
SELECT NULLIF(CAST(1012.5 AS DATE), 1);
SELECT CAST(1012.5 AS DATE) * 1.0;
+--echo #
+--echo # MDEV-23351 Rounding functions return wrong data types for DATE input
+--echo #
+
+CREATE TABLE t1 (a date);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2,t1;
--echo #
--echo # End of 10.4 tests
diff --git a/mysql-test/main/type_datetime_hires.result b/mysql-test/main/type_datetime_hires.result
index 5211515ea77..02adadd16c5 100644
--- a/mysql-test/main/type_datetime_hires.result
+++ b/mysql-test/main/type_datetime_hires.result
@@ -900,5 +900,170 @@ f
NULL
DROP TABLE t1;
#
+# MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+#
+CREATE TABLE t1 AS SELECT
+FLOOR(TIMESTAMP'2001-01-01 00:00:00.999999'),
+CEILING(TIMESTAMP'2001-01-01 00:00:00.999999');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `FLOOR(TIMESTAMP'2001-01-01 00:00:00.999999')` datetime DEFAULT NULL,
+ `CEILING(TIMESTAMP'2001-01-01 00:00:00.999999')` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.0');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.0');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.0');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.0');
+CREATE FUNCTION FLOOR_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+RETURN
+CASE
+WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ELSE TRUNCATE(a,0)
+END;
+END;
+$$
+CREATE FUNCTION CEILING_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+RETURN
+CASE
+WHEN TRUNCATE(a,0)=TIMESTAMP'9999-12-31 23:59:59' THEN a
+WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ELSE TRUNCATE(a,0)+INTERVAL 1 SECOND
+END;
+END;
+$$
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+a FLOOR(a) FLOOR_SP(a) FLOOR(a)=FLOOR_SP(a)
+0001-12-31 23:59:59.000000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.100000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.900000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.990000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999900 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999990 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999999 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0999-12-31 23:59:59.000000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.100000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.900000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.990000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999900 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999990 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999999 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+9999-12-30 23:59:59.000000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.100000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.900000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.990000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999900 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999990 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999999 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-31 23:59:59.000000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.100000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.900000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.990000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999900 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999990 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999999 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+a CEILING(a) CEILING_SP(a) CEILING(a)=CEILING_SP(a)
+0001-12-31 23:59:59.000000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.100000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.900000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.990000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999900 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999990 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999999 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0999-12-31 23:59:59.000000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.100000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.900000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.990000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999900 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999990 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999999 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+9999-12-30 23:59:59.000000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.100000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.900000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.990000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999900 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999990 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999999 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-31 23:59:59.000000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.100000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.900000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.990000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999900 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999990 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999999 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('0000-00-00 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-00-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-01-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-00-00 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+a FLOOR(a) CEILING(a)
+0000-00-00 23:59:59.999999 0000-00-00 23:59:59 NULL
+0000-00-01 23:59:59.999999 0000-00-01 23:59:59 NULL
+0000-01-01 23:59:59.999999 0000-01-01 23:59:59 NULL
+0001-00-00 23:59:59.999999 0001-00-00 23:59:59 NULL
+Warnings:
+Warning 1411 Incorrect date value: '0000-00-00' for function round(datetime)
+Warning 1411 Incorrect date value: '0000-00-01' for function round(datetime)
+Warning 1411 Incorrect date value: '0000-01-01' for function round(datetime)
+Warning 1411 Incorrect date value: '0001-00-00' for function round(datetime)
+DROP TABLE t1;
+SET sql_mode=ALLOW_INVALID_DATES;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('2001-02-28 23:59:59.999999');
+INSERT INTO t1 VALUES ('2001-02-29 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+a FLOOR(a) CEILING(a)
+2001-02-28 23:59:59.999999 2001-02-28 23:59:59 2001-03-01 00:00:00
+2001-02-29 23:59:59.999999 2001-02-29 23:59:59 NULL
+Warnings:
+Warning 1411 Incorrect date value: '2001-02-29' for function round(datetime)
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_datetime_hires.test b/mysql-test/main/type_datetime_hires.test
index 7b3b37560a3..6476d7fb182 100644
--- a/mysql-test/main/type_datetime_hires.test
+++ b/mysql-test/main/type_datetime_hires.test
@@ -157,5 +157,103 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+--echo #
+
+CREATE TABLE t1 AS SELECT
+ FLOOR(TIMESTAMP'2001-01-01 00:00:00.999999'),
+ CEILING(TIMESTAMP'2001-01-01 00:00:00.999999');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME(6));
+
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.0');
+
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.0');
+
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.0');
+
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.0');
+
+
+DELIMITER $$;
+CREATE FUNCTION FLOOR_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+ RETURN
+ CASE
+ WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ ELSE TRUNCATE(a,0)
+ END;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE FUNCTION CEILING_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+ RETURN
+ CASE
+ WHEN TRUNCATE(a,0)=TIMESTAMP'9999-12-31 23:59:59' THEN a
+ WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ ELSE TRUNCATE(a,0)+INTERVAL 1 SECOND
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('0000-00-00 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-00-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-01-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-00-00 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+DROP TABLE t1;
+
+SET sql_mode=ALLOW_INVALID_DATES;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('2001-02-28 23:59:59.999999');
+INSERT INTO t1 VALUES ('2001-02-29 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_enum.result b/mysql-test/main/type_enum.result
index ca909e1a2f2..d8b558c7ce0 100644
--- a/mysql-test/main/type_enum.result
+++ b/mysql-test/main/type_enum.result
@@ -2305,3 +2305,24 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP PROCEDURE p1;
DROP TABLE t1;
+#
+# MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+#
+CREATE TABLE t1 (a ENUM('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` enum('999999999999999999999999999999999999999999999999999999999999') DEFAULT NULL,
+ `FLOOR(a)` int(5) unsigned DEFAULT NULL,
+ `CEILING(a)` int(5) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(5) unsigned DEFAULT NULL,
+ `ROUND(a)` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a FLOOR(a) CEILING(a) TRUNCATE(a,0) ROUND(a)
+999999999999999999999999999999999999999999999999999999999999 1 1 1 1
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_enum.test b/mysql-test/main/type_enum.test
index a79335960bc..a36d63f8725 100644
--- a/mysql-test/main/type_enum.test
+++ b/mysql-test/main/type_enum.test
@@ -518,3 +518,16 @@ DELIMITER ;$$
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+--echo #
+
+CREATE TABLE t1 (a ENUM('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+ SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_hex_hybrid.result b/mysql-test/main/type_hex_hybrid.result
index eec24f6e89e..92a7432ae56 100644
--- a/mysql-test/main/type_hex_hybrid.result
+++ b/mysql-test/main/type_hex_hybrid.result
@@ -20,5 +20,163 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <cache>(octet_length(charset('a'))) + `test`.`t1`.`a` <=> <cache>(octet_length(charset(0x61))) + `test`.`t1`.`a`
DROP TABLE t1;
#
+# MDEV-23320 Hex hybrid constants 0xHHHH work badly in rounding functions
+#
+BEGIN NOT ATOMIC
+DECLARE arg TEXT DEFAULT '';
+DECLARE query TEXT DEFAULT
+'CREATE TABLE t1 AS SELECT '
+ '0xFFFFFFFFFFFFFFFF+0 AS c1,'
+ 'FLOOR(0xFFFFFFFFFFFFFFFF) AS c2,'
+ 'CEILING(0xFFFFFFFFFFFFFFFF) AS c3,'
+ 'ROUND(0xFFFFFFFFFFFFFFFF) AS c4,'
+ 'TRUNCATE(0xFFFFFFFFFFFFFFFF,0) AS c5';
+FOR i IN 1..9
+DO
+SET arg= CONCAT('0x',REPEAT('FF',i));
+SELECT i, arg;
+EXECUTE IMMEDIATE REPLACE(query,'0xFFFFFFFFFFFFFFFF', arg);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+END FOR;
+END;
+$$
+i 1
+arg 0xFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` int(4) unsigned NOT NULL,
+ `c2` int(3) unsigned NOT NULL,
+ `c3` int(3) unsigned NOT NULL,
+ `c4` int(3) unsigned NOT NULL,
+ `c5` int(3) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 255
+c2 255
+c3 255
+c4 255
+c5 255
+i 2
+arg 0xFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` int(6) unsigned NOT NULL,
+ `c2` int(5) unsigned NOT NULL,
+ `c3` int(5) unsigned NOT NULL,
+ `c4` int(5) unsigned NOT NULL,
+ `c5` int(5) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 65535
+c2 65535
+c3 65535
+c4 65535
+c5 65535
+i 3
+arg 0xFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` int(9) unsigned NOT NULL,
+ `c2` int(8) unsigned NOT NULL,
+ `c3` int(8) unsigned NOT NULL,
+ `c4` int(8) unsigned NOT NULL,
+ `c5` int(8) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 16777215
+c2 16777215
+c3 16777215
+c4 16777215
+c5 16777215
+i 4
+arg 0xFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(11) unsigned NOT NULL,
+ `c2` bigint(10) unsigned NOT NULL,
+ `c3` bigint(10) unsigned NOT NULL,
+ `c4` bigint(10) unsigned NOT NULL,
+ `c5` bigint(10) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 4294967295
+c2 4294967295
+c3 4294967295
+c4 4294967295
+c5 4294967295
+i 5
+arg 0xFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(14) unsigned NOT NULL,
+ `c2` bigint(13) unsigned NOT NULL,
+ `c3` bigint(13) unsigned NOT NULL,
+ `c4` bigint(13) unsigned NOT NULL,
+ `c5` bigint(13) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 1099511627775
+c2 1099511627775
+c3 1099511627775
+c4 1099511627775
+c5 1099511627775
+i 6
+arg 0xFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(16) unsigned NOT NULL,
+ `c2` bigint(15) unsigned NOT NULL,
+ `c3` bigint(15) unsigned NOT NULL,
+ `c4` bigint(15) unsigned NOT NULL,
+ `c5` bigint(15) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 281474976710655
+c2 281474976710655
+c3 281474976710655
+c4 281474976710655
+c5 281474976710655
+i 7
+arg 0xFFFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(18) unsigned NOT NULL,
+ `c2` bigint(17) unsigned NOT NULL,
+ `c3` bigint(17) unsigned NOT NULL,
+ `c4` bigint(17) unsigned NOT NULL,
+ `c5` bigint(17) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 72057594037927935
+c2 72057594037927935
+c3 72057594037927935
+c4 72057594037927935
+c5 72057594037927935
+i 8
+arg 0xFFFFFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(21) unsigned NOT NULL,
+ `c2` bigint(20) unsigned NOT NULL,
+ `c3` bigint(20) unsigned NOT NULL,
+ `c4` bigint(20) unsigned NOT NULL,
+ `c5` bigint(20) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 18446744073709551615
+c2 18446744073709551615
+c3 18446744073709551615
+c4 18446744073709551615
+c5 18446744073709551615
+i 9
+arg 0xFFFFFFFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(21) unsigned NOT NULL,
+ `c2` bigint(20) unsigned NOT NULL,
+ `c3` bigint(20) unsigned NOT NULL,
+ `c4` bigint(20) unsigned NOT NULL,
+ `c5` bigint(20) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 18446744073709551615
+c2 18446744073709551615
+c3 18446744073709551615
+c4 18446744073709551615
+c5 18446744073709551615
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_hex_hybrid.test b/mysql-test/main/type_hex_hybrid.test
index a39750e2635..77afb45cfbf 100644
--- a/mysql-test/main/type_hex_hybrid.test
+++ b/mysql-test/main/type_hex_hybrid.test
@@ -17,5 +17,35 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(CHARSET('a'))+a<=>LENGTH(CHARSET(
DROP TABLE t1;
--echo #
+--echo # MDEV-23320 Hex hybrid constants 0xHHHH work badly in rounding functions
+--echo #
+
+--vertical_results
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE arg TEXT DEFAULT '';
+ DECLARE query TEXT DEFAULT
+ 'CREATE TABLE t1 AS SELECT '
+ '0xFFFFFFFFFFFFFFFF+0 AS c1,'
+ 'FLOOR(0xFFFFFFFFFFFFFFFF) AS c2,'
+ 'CEILING(0xFFFFFFFFFFFFFFFF) AS c3,'
+ 'ROUND(0xFFFFFFFFFFFFFFFF) AS c4,'
+ 'TRUNCATE(0xFFFFFFFFFFFFFFFF,0) AS c5';
+ FOR i IN 1..9
+ DO
+ SET arg= CONCAT('0x',REPEAT('FF',i));
+ SELECT i, arg;
+ EXECUTE IMMEDIATE REPLACE(query,'0xFFFFFFFFFFFFFFFF', arg);
+ SHOW CREATE TABLE t1;
+ SELECT * FROM t1;
+ DROP TABLE t1;
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+--horizontal_results
+
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_int.result b/mysql-test/main/type_int.result
index 855341a2b59..b75a07251a9 100644
--- a/mysql-test/main/type_int.result
+++ b/mysql-test/main/type_int.result
@@ -412,6 +412,222 @@ COUNT(*)
0
DROP TABLE t1;
#
+# MDEV-23337 Rounding functions create a wrong data type for numeric input
+#
+CREATE PROCEDURE p1(t VARCHAR(64))
+BEGIN
+SELECT t AS ``;
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a TYPE)', 'TYPE', t);
+INSERT IGNORE INTO t1 VALUES (-100000000000000000000000000000);
+INSERT IGNORE INTO t1 VALUES (100000000000000000000000000000);
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+END;
+$$
+CALL p1('tinyint');
+ tinyint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` tinyint(4) DEFAULT NULL,
+ `ROUND(a)` tinyint(4) DEFAULT NULL,
+ `TRUNCATE(a,0)` tinyint(4) DEFAULT NULL,
+ `FLOOR(a)` tinyint(4) DEFAULT NULL,
+ `CEILING(a)` tinyint(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -128
+ROUND(a) -128
+TRUNCATE(a,0) -128
+FLOOR(a) -128
+CEILING(a) -128
+a 127
+ROUND(a) 127
+TRUNCATE(a,0) 127
+FLOOR(a) 127
+CEILING(a) 127
+CALL p1('smallint');
+ smallint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` smallint(6) DEFAULT NULL,
+ `ROUND(a)` smallint(6) DEFAULT NULL,
+ `TRUNCATE(a,0)` smallint(6) DEFAULT NULL,
+ `FLOOR(a)` smallint(6) DEFAULT NULL,
+ `CEILING(a)` smallint(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -32768
+ROUND(a) -32768
+TRUNCATE(a,0) -32768
+FLOOR(a) -32768
+CEILING(a) -32768
+a 32767
+ROUND(a) 32767
+TRUNCATE(a,0) 32767
+FLOOR(a) 32767
+CEILING(a) 32767
+CALL p1('mediumint');
+ mediumint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` mediumint(9) DEFAULT NULL,
+ `ROUND(a)` mediumint(9) DEFAULT NULL,
+ `TRUNCATE(a,0)` mediumint(9) DEFAULT NULL,
+ `FLOOR(a)` mediumint(9) DEFAULT NULL,
+ `CEILING(a)` mediumint(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -8388608
+ROUND(a) -8388608
+TRUNCATE(a,0) -8388608
+FLOOR(a) -8388608
+CEILING(a) -8388608
+a 8388607
+ROUND(a) 8388607
+TRUNCATE(a,0) 8388607
+FLOOR(a) 8388607
+CEILING(a) 8388607
+CALL p1('int');
+ int
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `ROUND(a)` int(11) DEFAULT NULL,
+ `TRUNCATE(a,0)` int(11) DEFAULT NULL,
+ `FLOOR(a)` int(11) DEFAULT NULL,
+ `CEILING(a)` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -2147483648
+ROUND(a) -2147483648
+TRUNCATE(a,0) -2147483648
+FLOOR(a) -2147483648
+CEILING(a) -2147483648
+a 2147483647
+ROUND(a) 2147483647
+TRUNCATE(a,0) 2147483647
+FLOOR(a) 2147483647
+CEILING(a) 2147483647
+CALL p1('bigint');
+ bigint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bigint(20) DEFAULT NULL,
+ `ROUND(a)` bigint(20) DEFAULT NULL,
+ `TRUNCATE(a,0)` bigint(20) DEFAULT NULL,
+ `FLOOR(a)` bigint(20) DEFAULT NULL,
+ `CEILING(a)` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -9223372036854775808
+ROUND(a) -9223372036854775808
+TRUNCATE(a,0) -9223372036854775808
+FLOOR(a) -9223372036854775808
+CEILING(a) -9223372036854775808
+a 9223372036854775807
+ROUND(a) 9223372036854775807
+TRUNCATE(a,0) 9223372036854775807
+FLOOR(a) 9223372036854775807
+CEILING(a) 9223372036854775807
+CALL p1('tinyint unsigned');
+ tinyint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` tinyint(3) unsigned DEFAULT NULL,
+ `ROUND(a)` tinyint(3) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` tinyint(3) unsigned DEFAULT NULL,
+ `FLOOR(a)` tinyint(3) unsigned DEFAULT NULL,
+ `CEILING(a)` tinyint(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 255
+ROUND(a) 255
+TRUNCATE(a,0) 255
+FLOOR(a) 255
+CEILING(a) 255
+CALL p1('smallint unsigned');
+ smallint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` smallint(5) unsigned DEFAULT NULL,
+ `ROUND(a)` smallint(5) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` smallint(5) unsigned DEFAULT NULL,
+ `FLOOR(a)` smallint(5) unsigned DEFAULT NULL,
+ `CEILING(a)` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 65535
+ROUND(a) 65535
+TRUNCATE(a,0) 65535
+FLOOR(a) 65535
+CEILING(a) 65535
+CALL p1('mediumint unsigned');
+ mediumint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` mediumint(8) unsigned DEFAULT NULL,
+ `ROUND(a)` mediumint(8) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` mediumint(8) unsigned DEFAULT NULL,
+ `FLOOR(a)` mediumint(8) unsigned DEFAULT NULL,
+ `CEILING(a)` mediumint(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 16777215
+ROUND(a) 16777215
+TRUNCATE(a,0) 16777215
+FLOOR(a) 16777215
+CEILING(a) 16777215
+CALL p1('int unsigned');
+ int unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(10) unsigned DEFAULT NULL,
+ `ROUND(a)` int(10) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(10) unsigned DEFAULT NULL,
+ `FLOOR(a)` int(10) unsigned DEFAULT NULL,
+ `CEILING(a)` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 4294967295
+ROUND(a) 4294967295
+TRUNCATE(a,0) 4294967295
+FLOOR(a) 4294967295
+CEILING(a) 4294967295
+CALL p1('bigint unsigned');
+ bigint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bigint(20) unsigned DEFAULT NULL,
+ `ROUND(a)` bigint(20) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` bigint(20) unsigned DEFAULT NULL,
+ `FLOOR(a)` bigint(20) unsigned DEFAULT NULL,
+ `CEILING(a)` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 18446744073709551615
+ROUND(a) 18446744073709551615
+TRUNCATE(a,0) 18446744073709551615
+FLOOR(a) 18446744073709551615
+CEILING(a) 18446744073709551615
+DROP PROCEDURE p1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/type_int.test b/mysql-test/main/type_int.test
index 5d961724e59..04cb9edf606 100644
--- a/mysql-test/main/type_int.test
+++ b/mysql-test/main/type_int.test
@@ -294,6 +294,41 @@ SELECT COUNT(*) FROM t1 WHERE a XOR a;
DROP TABLE t1;
--echo #
+--echo # MDEV-23337 Rounding functions create a wrong data type for numeric input
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(t VARCHAR(64))
+BEGIN
+ SELECT t AS ``;
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a TYPE)', 'TYPE', t);
+ INSERT IGNORE INTO t1 VALUES (-100000000000000000000000000000);
+ INSERT IGNORE INTO t1 VALUES (100000000000000000000000000000);
+ CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+ SHOW CREATE TABLE t2;
+ SELECT * FROM t2;
+ DROP TABLE t1, t2;
+END;
+$$
+DELIMITER ;$$
+
+--vertical_results
+CALL p1('tinyint');
+CALL p1('smallint');
+CALL p1('mediumint');
+CALL p1('int');
+CALL p1('bigint');
+
+CALL p1('tinyint unsigned');
+CALL p1('smallint unsigned');
+CALL p1('mediumint unsigned');
+CALL p1('int unsigned');
+CALL p1('bigint unsigned');
+--horizontal_results
+
+DROP PROCEDURE p1;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_set.result b/mysql-test/main/type_set.result
index 76a0c343973..5f54521c9dc 100644
--- a/mysql-test/main/type_set.result
+++ b/mysql-test/main/type_set.result
@@ -358,3 +358,24 @@ DROP TABLE t1;
SET NAMES utf8;
CREATE TABLE t1 (a SET('a,bü'));
ERROR 22007: Illegal set 'a,bü' value found during parsing
+#
+# MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+#
+CREATE TABLE t1 (a SET('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` set('999999999999999999999999999999999999999999999999999999999999') DEFAULT NULL,
+ `FLOOR(a)` int(5) unsigned DEFAULT NULL,
+ `CEILING(a)` int(5) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(5) unsigned DEFAULT NULL,
+ `ROUND(a)` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a FLOOR(a) CEILING(a) TRUNCATE(a,0) ROUND(a)
+999999999999999999999999999999999999999999999999999999999999 1 1 1 1
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_set.test b/mysql-test/main/type_set.test
index 8a81c406c63..2d0c81340ae 100644
--- a/mysql-test/main/type_set.test
+++ b/mysql-test/main/type_set.test
@@ -248,3 +248,16 @@ DROP TABLE t1;
SET NAMES utf8;
--error ER_ILLEGAL_VALUE_FOR_TYPE
CREATE TABLE t1 (a SET('a,bü'));
+
+--echo #
+--echo # MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+--echo #
+
+CREATE TABLE t1 (a SET('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+ SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_time_hires.result b/mysql-test/main/type_time_hires.result
index 6122afcfc47..c7fecbef76b 100644
--- a/mysql-test/main/type_time_hires.result
+++ b/mysql-test/main/type_time_hires.result
@@ -670,3 +670,240 @@ a ROUND(a,-6)
838:59:59.999999 838:59:59
DROP TABLE t1;
SET time_zone=DEFAULT;
+#
+# MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+#
+CREATE TABLE t1 AS SELECT
+FLOOR(TIME'00:00:00.999999'),
+CEILING(TIME'00:00:00.999999');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `FLOOR(TIME'00:00:00.999999')` time NOT NULL,
+ `CEILING(TIME'00:00:00.999999')` time NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('838:59:59.999999');
+INSERT INTO t1 VALUES ('838:59:59.99999');
+INSERT INTO t1 VALUES ('838:59:59.9999');
+INSERT INTO t1 VALUES ('838:59:59.999');
+INSERT INTO t1 VALUES ('838:59:59.99');
+INSERT INTO t1 VALUES ('838:59:59.9');
+INSERT INTO t1 VALUES ('838:59:59.1');
+INSERT INTO t1 VALUES ('838:59:59.0');
+INSERT INTO t1 VALUES ('837:59:59.999999');
+INSERT INTO t1 VALUES ('837:59:59.99999');
+INSERT INTO t1 VALUES ('837:59:59.9999');
+INSERT INTO t1 VALUES ('837:59:59.999');
+INSERT INTO t1 VALUES ('837:59:59.99');
+INSERT INTO t1 VALUES ('837:59:59.9');
+INSERT INTO t1 VALUES ('837:59:59.1');
+INSERT INTO t1 VALUES ('837:59:59.0');
+INSERT INTO t1 VALUES ('23:59:59.999999');
+INSERT INTO t1 VALUES ('23:59:59.99999');
+INSERT INTO t1 VALUES ('23:59:59.9999');
+INSERT INTO t1 VALUES ('23:59:59.999');
+INSERT INTO t1 VALUES ('23:59:59.99');
+INSERT INTO t1 VALUES ('23:59:59.9');
+INSERT INTO t1 VALUES ('23:59:59.1');
+INSERT INTO t1 VALUES ('23:59:59.0');
+INSERT INTO t1 VALUES ('00:00:00.999999');
+INSERT INTO t1 VALUES ('00:00:00.99999');
+INSERT INTO t1 VALUES ('00:00:00.9999');
+INSERT INTO t1 VALUES ('00:00:00.999');
+INSERT INTO t1 VALUES ('00:00:00.99');
+INSERT INTO t1 VALUES ('00:00:00.9');
+INSERT INTO t1 VALUES ('00:00:00.1');
+INSERT INTO t1 VALUES ('00:00:00.0');
+INSERT INTO t1 VALUES ('-00:00:00.999999');
+INSERT INTO t1 VALUES ('-00:00:00.99999');
+INSERT INTO t1 VALUES ('-00:00:00.9999');
+INSERT INTO t1 VALUES ('-00:00:00.999');
+INSERT INTO t1 VALUES ('-00:00:00.99');
+INSERT INTO t1 VALUES ('-00:00:00.9');
+INSERT INTO t1 VALUES ('-00:00:00.1');
+INSERT INTO t1 VALUES ('-00:00:00.0');
+INSERT INTO t1 VALUES ('-23:59:59.999999');
+INSERT INTO t1 VALUES ('-23:59:59.99999');
+INSERT INTO t1 VALUES ('-23:59:59.9999');
+INSERT INTO t1 VALUES ('-23:59:59.999');
+INSERT INTO t1 VALUES ('-23:59:59.99');
+INSERT INTO t1 VALUES ('-23:59:59.9');
+INSERT INTO t1 VALUES ('-23:59:59.1');
+INSERT INTO t1 VALUES ('-23:59:59.0');
+INSERT INTO t1 VALUES ('-837:59:59.999999');
+INSERT INTO t1 VALUES ('-837:59:59.99999');
+INSERT INTO t1 VALUES ('-837:59:59.9999');
+INSERT INTO t1 VALUES ('-837:59:59.999');
+INSERT INTO t1 VALUES ('-837:59:59.99');
+INSERT INTO t1 VALUES ('-837:59:59.9');
+INSERT INTO t1 VALUES ('-837:59:59.1');
+INSERT INTO t1 VALUES ('-837:59:59.0');
+INSERT INTO t1 VALUES ('-838:59:59.999999');
+INSERT INTO t1 VALUES ('-838:59:59.99999');
+INSERT INTO t1 VALUES ('-838:59:59.9999');
+INSERT INTO t1 VALUES ('-838:59:59.999');
+INSERT INTO t1 VALUES ('-838:59:59.99');
+INSERT INTO t1 VALUES ('-838:59:59.9');
+INSERT INTO t1 VALUES ('-838:59:59.1');
+INSERT INTO t1 VALUES ('-838:59:59.0');
+CREATE FUNCTION FLOOR_SP(a TIME(6)) RETURNS TIME
+BEGIN
+RETURN
+CASE
+WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+WHEN a<0 THEN TRUNCATE(a,0)-INTERVAL 1 SECOND -- negative values
+WHEN a>0 THEN TRUNCATE(a,0) -- positive values
+END;
+END;
+$$
+CREATE FUNCTION CEILING_SP(a TIME(6)) RETURNS TIME
+BEGIN
+RETURN
+CASE
+WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+WHEN a<0 THEN TRUNCATE(a,0) -- negative values
+WHEN a>0 THEN TRUNCATE(a,0)+INTERVAL 1 SECOND -- positive values
+END;
+END;
+$$
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+a FLOOR(a) FLOOR_SP(a) FLOOR(a)=FLOOR_SP(a)
+-838:59:59.999999 -838:59:59 -838:59:59 1
+-838:59:59.999990 -838:59:59 -838:59:59 1
+-838:59:59.999900 -838:59:59 -838:59:59 1
+-838:59:59.999000 -838:59:59 -838:59:59 1
+-838:59:59.990000 -838:59:59 -838:59:59 1
+-838:59:59.900000 -838:59:59 -838:59:59 1
+-838:59:59.100000 -838:59:59 -838:59:59 1
+-838:59:59.000000 -838:59:59 -838:59:59 1
+-837:59:59.999999 -838:00:00 -838:00:00 1
+-837:59:59.999990 -838:00:00 -838:00:00 1
+-837:59:59.999900 -838:00:00 -838:00:00 1
+-837:59:59.999000 -838:00:00 -838:00:00 1
+-837:59:59.990000 -838:00:00 -838:00:00 1
+-837:59:59.900000 -838:00:00 -838:00:00 1
+-837:59:59.100000 -838:00:00 -838:00:00 1
+-837:59:59.000000 -837:59:59 -837:59:59 1
+-23:59:59.999999 -24:00:00 -24:00:00 1
+-23:59:59.999990 -24:00:00 -24:00:00 1
+-23:59:59.999900 -24:00:00 -24:00:00 1
+-23:59:59.999000 -24:00:00 -24:00:00 1
+-23:59:59.990000 -24:00:00 -24:00:00 1
+-23:59:59.900000 -24:00:00 -24:00:00 1
+-23:59:59.100000 -24:00:00 -24:00:00 1
+-23:59:59.000000 -23:59:59 -23:59:59 1
+-00:00:00.999999 -00:00:01 -00:00:01 1
+-00:00:00.999990 -00:00:01 -00:00:01 1
+-00:00:00.999900 -00:00:01 -00:00:01 1
+-00:00:00.999000 -00:00:01 -00:00:01 1
+-00:00:00.990000 -00:00:01 -00:00:01 1
+-00:00:00.900000 -00:00:01 -00:00:01 1
+-00:00:00.100000 -00:00:01 -00:00:01 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.100000 00:00:00 00:00:00 1
+00:00:00.900000 00:00:00 00:00:00 1
+00:00:00.990000 00:00:00 00:00:00 1
+00:00:00.999000 00:00:00 00:00:00 1
+00:00:00.999900 00:00:00 00:00:00 1
+00:00:00.999990 00:00:00 00:00:00 1
+00:00:00.999999 00:00:00 00:00:00 1
+23:59:59.000000 23:59:59 23:59:59 1
+23:59:59.100000 23:59:59 23:59:59 1
+23:59:59.900000 23:59:59 23:59:59 1
+23:59:59.990000 23:59:59 23:59:59 1
+23:59:59.999000 23:59:59 23:59:59 1
+23:59:59.999900 23:59:59 23:59:59 1
+23:59:59.999990 23:59:59 23:59:59 1
+23:59:59.999999 23:59:59 23:59:59 1
+837:59:59.000000 837:59:59 837:59:59 1
+837:59:59.100000 837:59:59 837:59:59 1
+837:59:59.900000 837:59:59 837:59:59 1
+837:59:59.990000 837:59:59 837:59:59 1
+837:59:59.999000 837:59:59 837:59:59 1
+837:59:59.999900 837:59:59 837:59:59 1
+837:59:59.999990 837:59:59 837:59:59 1
+837:59:59.999999 837:59:59 837:59:59 1
+838:59:59.000000 838:59:59 838:59:59 1
+838:59:59.100000 838:59:59 838:59:59 1
+838:59:59.900000 838:59:59 838:59:59 1
+838:59:59.990000 838:59:59 838:59:59 1
+838:59:59.999000 838:59:59 838:59:59 1
+838:59:59.999900 838:59:59 838:59:59 1
+838:59:59.999990 838:59:59 838:59:59 1
+838:59:59.999999 838:59:59 838:59:59 1
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+a CEILING(a) CEILING_SP(a) CEILING(a)=CEILING_SP(a)
+-838:59:59.999999 -838:59:59 -838:59:59 1
+-838:59:59.999990 -838:59:59 -838:59:59 1
+-838:59:59.999900 -838:59:59 -838:59:59 1
+-838:59:59.999000 -838:59:59 -838:59:59 1
+-838:59:59.990000 -838:59:59 -838:59:59 1
+-838:59:59.900000 -838:59:59 -838:59:59 1
+-838:59:59.100000 -838:59:59 -838:59:59 1
+-838:59:59.000000 -838:59:59 -838:59:59 1
+-837:59:59.999999 -837:59:59 -837:59:59 1
+-837:59:59.999990 -837:59:59 -837:59:59 1
+-837:59:59.999900 -837:59:59 -837:59:59 1
+-837:59:59.999000 -837:59:59 -837:59:59 1
+-837:59:59.990000 -837:59:59 -837:59:59 1
+-837:59:59.900000 -837:59:59 -837:59:59 1
+-837:59:59.100000 -837:59:59 -837:59:59 1
+-837:59:59.000000 -837:59:59 -837:59:59 1
+-23:59:59.999999 -23:59:59 -23:59:59 1
+-23:59:59.999990 -23:59:59 -23:59:59 1
+-23:59:59.999900 -23:59:59 -23:59:59 1
+-23:59:59.999000 -23:59:59 -23:59:59 1
+-23:59:59.990000 -23:59:59 -23:59:59 1
+-23:59:59.900000 -23:59:59 -23:59:59 1
+-23:59:59.100000 -23:59:59 -23:59:59 1
+-23:59:59.000000 -23:59:59 -23:59:59 1
+-00:00:00.999999 00:00:00 00:00:00 1
+-00:00:00.999990 00:00:00 00:00:00 1
+-00:00:00.999900 00:00:00 00:00:00 1
+-00:00:00.999000 00:00:00 00:00:00 1
+-00:00:00.990000 00:00:00 00:00:00 1
+-00:00:00.900000 00:00:00 00:00:00 1
+-00:00:00.100000 00:00:00 00:00:00 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.100000 00:00:01 00:00:01 1
+00:00:00.900000 00:00:01 00:00:01 1
+00:00:00.990000 00:00:01 00:00:01 1
+00:00:00.999000 00:00:01 00:00:01 1
+00:00:00.999900 00:00:01 00:00:01 1
+00:00:00.999990 00:00:01 00:00:01 1
+00:00:00.999999 00:00:01 00:00:01 1
+23:59:59.000000 23:59:59 23:59:59 1
+23:59:59.100000 24:00:00 24:00:00 1
+23:59:59.900000 24:00:00 24:00:00 1
+23:59:59.990000 24:00:00 24:00:00 1
+23:59:59.999000 24:00:00 24:00:00 1
+23:59:59.999900 24:00:00 24:00:00 1
+23:59:59.999990 24:00:00 24:00:00 1
+23:59:59.999999 24:00:00 24:00:00 1
+837:59:59.000000 837:59:59 837:59:59 1
+837:59:59.100000 838:00:00 838:00:00 1
+837:59:59.900000 838:00:00 838:00:00 1
+837:59:59.990000 838:00:00 838:00:00 1
+837:59:59.999000 838:00:00 838:00:00 1
+837:59:59.999900 838:00:00 838:00:00 1
+837:59:59.999990 838:00:00 838:00:00 1
+837:59:59.999999 838:00:00 838:00:00 1
+838:59:59.000000 838:59:59 838:59:59 1
+838:59:59.100000 838:59:59 838:59:59 1
+838:59:59.900000 838:59:59 838:59:59 1
+838:59:59.990000 838:59:59 838:59:59 1
+838:59:59.999000 838:59:59 838:59:59 1
+838:59:59.999900 838:59:59 838:59:59 1
+838:59:59.999990 838:59:59 838:59:59 1
+838:59:59.999999 838:59:59 838:59:59 1
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_time_hires.test b/mysql-test/main/type_time_hires.test
index 0949738e949..f9b4a5a9f27 100644
--- a/mysql-test/main/type_time_hires.test
+++ b/mysql-test/main/type_time_hires.test
@@ -73,3 +73,126 @@ SELECT a, ROUND(a,-6) FROM t1;
DROP TABLE t1;
SET time_zone=DEFAULT;
+
+
+--echo #
+--echo # MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+--echo #
+
+CREATE TABLE t1 AS SELECT
+ FLOOR(TIME'00:00:00.999999'),
+ CEILING(TIME'00:00:00.999999');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TIME(6));
+
+INSERT INTO t1 VALUES ('838:59:59.999999');
+INSERT INTO t1 VALUES ('838:59:59.99999');
+INSERT INTO t1 VALUES ('838:59:59.9999');
+INSERT INTO t1 VALUES ('838:59:59.999');
+INSERT INTO t1 VALUES ('838:59:59.99');
+INSERT INTO t1 VALUES ('838:59:59.9');
+INSERT INTO t1 VALUES ('838:59:59.1');
+INSERT INTO t1 VALUES ('838:59:59.0');
+
+INSERT INTO t1 VALUES ('837:59:59.999999');
+INSERT INTO t1 VALUES ('837:59:59.99999');
+INSERT INTO t1 VALUES ('837:59:59.9999');
+INSERT INTO t1 VALUES ('837:59:59.999');
+INSERT INTO t1 VALUES ('837:59:59.99');
+INSERT INTO t1 VALUES ('837:59:59.9');
+INSERT INTO t1 VALUES ('837:59:59.1');
+INSERT INTO t1 VALUES ('837:59:59.0');
+
+INSERT INTO t1 VALUES ('23:59:59.999999');
+INSERT INTO t1 VALUES ('23:59:59.99999');
+INSERT INTO t1 VALUES ('23:59:59.9999');
+INSERT INTO t1 VALUES ('23:59:59.999');
+INSERT INTO t1 VALUES ('23:59:59.99');
+INSERT INTO t1 VALUES ('23:59:59.9');
+INSERT INTO t1 VALUES ('23:59:59.1');
+INSERT INTO t1 VALUES ('23:59:59.0');
+
+INSERT INTO t1 VALUES ('00:00:00.999999');
+INSERT INTO t1 VALUES ('00:00:00.99999');
+INSERT INTO t1 VALUES ('00:00:00.9999');
+INSERT INTO t1 VALUES ('00:00:00.999');
+INSERT INTO t1 VALUES ('00:00:00.99');
+INSERT INTO t1 VALUES ('00:00:00.9');
+INSERT INTO t1 VALUES ('00:00:00.1');
+INSERT INTO t1 VALUES ('00:00:00.0');
+
+INSERT INTO t1 VALUES ('-00:00:00.999999');
+INSERT INTO t1 VALUES ('-00:00:00.99999');
+INSERT INTO t1 VALUES ('-00:00:00.9999');
+INSERT INTO t1 VALUES ('-00:00:00.999');
+INSERT INTO t1 VALUES ('-00:00:00.99');
+INSERT INTO t1 VALUES ('-00:00:00.9');
+INSERT INTO t1 VALUES ('-00:00:00.1');
+INSERT INTO t1 VALUES ('-00:00:00.0');
+
+INSERT INTO t1 VALUES ('-23:59:59.999999');
+INSERT INTO t1 VALUES ('-23:59:59.99999');
+INSERT INTO t1 VALUES ('-23:59:59.9999');
+INSERT INTO t1 VALUES ('-23:59:59.999');
+INSERT INTO t1 VALUES ('-23:59:59.99');
+INSERT INTO t1 VALUES ('-23:59:59.9');
+INSERT INTO t1 VALUES ('-23:59:59.1');
+INSERT INTO t1 VALUES ('-23:59:59.0');
+
+INSERT INTO t1 VALUES ('-837:59:59.999999');
+INSERT INTO t1 VALUES ('-837:59:59.99999');
+INSERT INTO t1 VALUES ('-837:59:59.9999');
+INSERT INTO t1 VALUES ('-837:59:59.999');
+INSERT INTO t1 VALUES ('-837:59:59.99');
+INSERT INTO t1 VALUES ('-837:59:59.9');
+INSERT INTO t1 VALUES ('-837:59:59.1');
+INSERT INTO t1 VALUES ('-837:59:59.0');
+
+INSERT INTO t1 VALUES ('-838:59:59.999999');
+INSERT INTO t1 VALUES ('-838:59:59.99999');
+INSERT INTO t1 VALUES ('-838:59:59.9999');
+INSERT INTO t1 VALUES ('-838:59:59.999');
+INSERT INTO t1 VALUES ('-838:59:59.99');
+INSERT INTO t1 VALUES ('-838:59:59.9');
+INSERT INTO t1 VALUES ('-838:59:59.1');
+INSERT INTO t1 VALUES ('-838:59:59.0');
+
+DELIMITER $$;
+CREATE FUNCTION FLOOR_SP(a TIME(6)) RETURNS TIME
+BEGIN
+ RETURN
+ CASE
+ WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+ WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+ WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+ WHEN a<0 THEN TRUNCATE(a,0)-INTERVAL 1 SECOND -- negative values
+ WHEN a>0 THEN TRUNCATE(a,0) -- positive values
+ END;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE FUNCTION CEILING_SP(a TIME(6)) RETURNS TIME
+BEGIN
+ RETURN
+ CASE
+ WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+ WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+ WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+ WHEN a<0 THEN TRUNCATE(a,0) -- negative values
+ WHEN a>0 THEN TRUNCATE(a,0)+INTERVAL 1 SECOND -- positive values
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+
+DROP TABLE t1;
diff --git a/mysql-test/main/type_timestamp_hires.result b/mysql-test/main/type_timestamp_hires.result
index dc69aa36b0f..64675ff9973 100644
--- a/mysql-test/main/type_timestamp_hires.result
+++ b/mysql-test/main/type_timestamp_hires.result
@@ -626,5 +626,17 @@ a ROUND(a,-6)
DROP TABLE t1;
SET time_zone=DEFAULT;
#
+# MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+#
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEILING(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `FLOOR(a)` datetime DEFAULT NULL,
+ `CEILING(a)` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_timestamp_hires.test b/mysql-test/main/type_timestamp_hires.test
index f2e765d09fe..27aed16d6be 100644
--- a/mysql-test/main/type_timestamp_hires.test
+++ b/mysql-test/main/type_timestamp_hires.test
@@ -107,6 +107,16 @@ DROP TABLE t1;
SET time_zone=DEFAULT;
+
+--echo #
+--echo # MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+--echo #
+
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEILING(a) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result
index 1792cd5b7d4..4fb38bdf798 100644
--- a/mysql-test/main/type_year.result
+++ b/mysql-test/main/type_year.result
@@ -585,6 +585,33 @@ COALESCE(a) DATE(COALESCE(a))
NULL NULL
DROP TABLE t1;
#
+# MDEV-23337 Rounding functions create a wrong data type for numeric input
+#
+CREATE TABLE t1 (a YEAR(2));
+Warnings:
+Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+Warnings:
+Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+DESC t2;
+Field Type Null Key Default Extra
+a year(2) YES NULL
+ROUND(a) int(2) unsigned YES NULL
+TRUNCATE(a,0) int(2) unsigned YES NULL
+FLOOR(a) int(2) unsigned YES NULL
+CEILING(a) int(2) unsigned YES NULL
+DROP TABLE t2,t1;
+CREATE TABLE t1 (a YEAR(4));
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+DESC t2;
+Field Type Null Key Default Extra
+a year(4) YES NULL
+ROUND(a) int(4) unsigned YES NULL
+TRUNCATE(a,0) int(4) unsigned YES NULL
+FLOOR(a) int(4) unsigned YES NULL
+CEILING(a) int(4) unsigned YES NULL
+DROP TABLE t2,t1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/type_year.test b/mysql-test/main/type_year.test
index 6f16610c06f..1eb528d7af3 100644
--- a/mysql-test/main/type_year.test
+++ b/mysql-test/main/type_year.test
@@ -327,6 +327,21 @@ SELECT COALESCE(a), DATE(COALESCE(a)) FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-23337 Rounding functions create a wrong data type for numeric input
+--echo #
+
+CREATE TABLE t1 (a YEAR(2));
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+DESC t2;
+DROP TABLE t2,t1;
+
+CREATE TABLE t1 (a YEAR(4));
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+DESC t2;
+DROP TABLE t2,t1;
+
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/union.result b/mysql-test/main/union.result
index e3a69f54949..ef3aed397ba 100644
--- a/mysql-test/main/union.result
+++ b/mysql-test/main/union.result
@@ -1794,8 +1794,7 @@ union
select 4
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
-foo
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
prepare stmt1 from 'select 1 as foo
union
select 2
@@ -1805,12 +1804,7 @@ union
select 4
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
';
-execute stmt1;
-foo
-1
-execute stmt1;
-foo
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
select 1 as foo
union
select 2
@@ -1820,8 +1814,7 @@ union
(select 4)
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
-foo
-1
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
prepare stmt1 from 'select 1 as foo
union
select 2
@@ -1831,13 +1824,7 @@ union
(select 4)
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
';
-execute stmt1;
-foo
-1
-execute stmt1;
-foo
-1
-deallocate prepare stmt1;
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
End of 5.1 tests
#
# mdev-5091: Asseirtion failure for UNION with ORDER BY
@@ -2336,6 +2323,14 @@ Warnings:
Note 1003 /* select#1 */ select 1 AS `1`,2 AS `2` union all /* select#2 */ select 1 AS `i`,count(0) AS `COUNT(*)` from `test`.`t2` where 0 group by 1 having 1
DROP TABLE t1,t2;
#
+# MDEV-10120: Wrong result of UNION .. ORDER BY GROUP_CONCAT()
+#
+CREATE TABLE t1 (a INT);
+INSERT t1 VALUES (1),(2),(3);
+(SELECT 1 AS a) UNION (SELECT a FROM t1 GROUP BY a) ORDER BY GROUP_CONCAT(a);
+ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
+DROP TABLE t1;
+#
# Start of 10.3 tests
#
#
diff --git a/mysql-test/main/union.test b/mysql-test/main/union.test
index a90d27e161d..33adbb4603d 100644
--- a/mysql-test/main/union.test
+++ b/mysql-test/main/union.test
@@ -1210,11 +1210,11 @@ select 4
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval $my_stmt;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval prepare stmt1 from '$my_stmt';
-execute stmt1;
-execute stmt1;
let $my_stmt=
select 1 as foo
@@ -1227,13 +1227,11 @@ union
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval $my_stmt;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval prepare stmt1 from '$my_stmt';
-execute stmt1;
-execute stmt1;
-
-deallocate prepare stmt1;
--echo End of 5.1 tests
@@ -1663,6 +1661,17 @@ eval EXPLAIN EXTENDED $q;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-10120: Wrong result of UNION .. ORDER BY GROUP_CONCAT()
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT t1 VALUES (1),(2),(3);
+
+--error ER_AGGREGATE_ORDER_FOR_UNION
+(SELECT 1 AS a) UNION (SELECT a FROM t1 GROUP BY a) ORDER BY GROUP_CONCAT(a);
+DROP TABLE t1;
+
--echo #
--echo # Start of 10.3 tests
diff --git a/mysql-test/main/upgrade_MDEV-19650.result b/mysql-test/main/upgrade_MDEV-19650.result
index 386c15ae83e..7e8610683e2 100644
--- a/mysql-test/main/upgrade_MDEV-19650.result
+++ b/mysql-test/main/upgrade_MDEV-19650.result
@@ -165,7 +165,6 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
# check non root
CREATE USER 'not_root'@'localhost';
diff --git a/mysql-test/main/upgrade_MDEV-19650.test b/mysql-test/main/upgrade_MDEV-19650.test
index 89cbfc8c7aa..a2f9fee705f 100644
--- a/mysql-test/main/upgrade_MDEV-19650.test
+++ b/mysql-test/main/upgrade_MDEV-19650.test
@@ -70,11 +70,11 @@ CREATE DEFINER='root'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user A
SET sql_mode='';
-delimiter |;
-
DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn;
DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn;
+delimiter |;
+
CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
begin
diff --git a/mysql-test/main/upgrade_MDEV-23102-1.result b/mysql-test/main/upgrade_MDEV-23102-1.result
new file mode 100644
index 00000000000..8caa49180ee
--- /dev/null
+++ b/mysql-test/main/upgrade_MDEV-23102-1.result
@@ -0,0 +1,286 @@
+#
+# MDEV-23102: 10.4 create mariadb.sys user on each update even
+# is the user is not needed
+#
+# part 1: reassigning mysql.user and gis procedures to other user
+call mtr.add_suppression("Cannot load from mysql.proc. The table is probably corrupted");
+create database mysqltest1;
+use mysqltest1;
+create table save_global_priv as select * from mysql.global_priv;
+create table save_tables_priv as select * from mysql.tables_priv;
+create table save_proxies_priv as select * from mysql.proxies_priv;
+create table mysql.save_proc like mysql.proc;
+insert into mysql.save_proc select * from mysql.proc;
+set @save_sql_mode= @@sql_mode;
+use mysql;
+# make changed definition of gis procedures and user view
+create user superuser@localhost;
+grant all privileges on mysql.* to superuser@localhost;
+drop view user;
+CREATE DEFINER='superuser'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT
+Host,
+User,
+IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password,
+IF(JSON_VALUE(Priv, '$.access') & 1, 'Y', 'N') AS Select_priv,
+IF(JSON_VALUE(Priv, '$.access') & 2, 'Y', 'N') AS Insert_priv,
+IF(JSON_VALUE(Priv, '$.access') & 4, 'Y', 'N') AS Update_priv,
+IF(JSON_VALUE(Priv, '$.access') & 8, 'Y', 'N') AS Delete_priv,
+IF(JSON_VALUE(Priv, '$.access') & 16, 'Y', 'N') AS Create_priv,
+IF(JSON_VALUE(Priv, '$.access') & 32, 'Y', 'N') AS Drop_priv,
+IF(JSON_VALUE(Priv, '$.access') & 64, 'Y', 'N') AS Reload_priv,
+IF(JSON_VALUE(Priv, '$.access') & 128, 'Y', 'N') AS Shutdown_priv,
+IF(JSON_VALUE(Priv, '$.access') & 256, 'Y', 'N') AS Process_priv,
+IF(JSON_VALUE(Priv, '$.access') & 512, 'Y', 'N') AS File_priv,
+IF(JSON_VALUE(Priv, '$.access') & 1024, 'Y', 'N') AS Grant_priv,
+IF(JSON_VALUE(Priv, '$.access') & 2048, 'Y', 'N') AS References_priv,
+IF(JSON_VALUE(Priv, '$.access') & 4096, 'Y', 'N') AS Index_priv,
+IF(JSON_VALUE(Priv, '$.access') & 8192, 'Y', 'N') AS Alter_priv,
+IF(JSON_VALUE(Priv, '$.access') & 16384, 'Y', 'N') AS Show_db_priv,
+IF(JSON_VALUE(Priv, '$.access') & 32768, 'Y', 'N') AS Super_priv,
+IF(JSON_VALUE(Priv, '$.access') & 65536, 'Y', 'N') AS Create_tmp_table_priv,
+IF(JSON_VALUE(Priv, '$.access') & 131072, 'Y', 'N') AS Lock_tables_priv,
+IF(JSON_VALUE(Priv, '$.access') & 262144, 'Y', 'N') AS Execute_priv,
+IF(JSON_VALUE(Priv, '$.access') & 524288, 'Y', 'N') AS Repl_slave_priv,
+IF(JSON_VALUE(Priv, '$.access') & 1048576, 'Y', 'N') AS Repl_client_priv,
+IF(JSON_VALUE(Priv, '$.access') & 2097152, 'Y', 'N') AS Create_view_priv,
+IF(JSON_VALUE(Priv, '$.access') & 4194304, 'Y', 'N') AS Show_view_priv,
+IF(JSON_VALUE(Priv, '$.access') & 8388608, 'Y', 'N') AS Create_routine_priv,
+IF(JSON_VALUE(Priv, '$.access') & 16777216, 'Y', 'N') AS Alter_routine_priv,
+IF(JSON_VALUE(Priv, '$.access') & 33554432, 'Y', 'N') AS Create_user_priv,
+IF(JSON_VALUE(Priv, '$.access') & 67108864, 'Y', 'N') AS Event_priv,
+IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv,
+IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv,
+IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv,
+ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type,
+IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher,
+IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer,
+IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections,
+IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin,
+IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string,
+'N' AS password_expired,
+ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role,
+IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time
+FROM global_priv;
+SET sql_mode='';
+DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn;
+DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn;
+CREATE DEFINER=`superuser`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
+t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
+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 |
+CREATE DEFINER=`superuser`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64),
+t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
+begin
+set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |
+set @@sql_mode= @save_sql_mode;
+drop user 'mariadb.sys'@'localhost';
+# check changed definitions mysql_upgrade
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
+SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
+# Run mysql_upgrade
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.global_priv OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.index_stats OK
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.save_proc OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+
+Repairing tables
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+mysql.user OK
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysqltest1
+mysqltest1.save_global_priv OK
+mysqltest1.save_proxies_priv OK
+mysqltest1.save_tables_priv OK
+performance_schema
+test
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+# check new definitions mysql_upgrade
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+select count(*) from global_priv where user='mariadb.sys' and host='localhost';
+count(*)
+0
+# above should be 0 (no mariadb.sys@localhost user)
+# restore environment
+DROP USER 'superuser'@'localhost';
+DROP VIEW mysql.user;
+DROP PROCEDURE AddGeometryColumn;
+DROP PROCEDURE DropGeometryColumn;
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.global_priv OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.index_stats OK
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.save_proc OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+
+Repairing tables
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysqltest1
+mysqltest1.save_global_priv OK
+mysqltest1.save_proxies_priv OK
+mysqltest1.save_tables_priv OK
+performance_schema
+test
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+delete from global_priv;
+delete from tables_priv;
+delete from proxies_priv;
+delete from proc;
+insert into mysql.global_priv select * from mysqltest1.save_global_priv;
+insert into mysql.tables_priv select * from mysqltest1.save_tables_priv;
+insert into mysql.proxies_priv select * from mysqltest1.save_proxies_priv;
+rename table proc to bad_proc;
+rename table save_proc to proc;
+drop table bad_proc;
+flush privileges;
+disconnect default;
+connect default,localhost,root,,;
+connection default;
+drop database mysqltest1;
+# End of 10.4 tests (but better do not add other tests here)
diff --git a/mysql-test/main/upgrade_MDEV-23102-1.test b/mysql-test/main/upgrade_MDEV-23102-1.test
new file mode 100644
index 00000000000..8491ddfffe4
--- /dev/null
+++ b/mysql-test/main/upgrade_MDEV-23102-1.test
@@ -0,0 +1,163 @@
+--echo #
+--echo # MDEV-23102: 10.4 create mariadb.sys user on each update even
+--echo # is the user is not needed
+--echo #
+--echo # part 1: reassigning mysql.user and gis procedures to other user
+
+--source include/mysql_upgrade_preparation.inc
+
+call mtr.add_suppression("Cannot load from mysql.proc. The table is probably corrupted");
+create database mysqltest1;
+use mysqltest1;
+create table save_global_priv as select * from mysql.global_priv;
+create table save_tables_priv as select * from mysql.tables_priv;
+create table save_proxies_priv as select * from mysql.proxies_priv;
+create table mysql.save_proc like mysql.proc;
+insert into mysql.save_proc select * from mysql.proc;
+set @save_sql_mode= @@sql_mode;
+
+use mysql;
+
+--echo # make changed definition of gis procedures and user view
+
+create user superuser@localhost;
+grant all privileges on mysql.* to superuser@localhost;
+
+drop view user;
+
+CREATE DEFINER='superuser'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT
+ Host,
+ User,
+ IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password,
+ IF(JSON_VALUE(Priv, '$.access') & 1, 'Y', 'N') AS Select_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 2, 'Y', 'N') AS Insert_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 4, 'Y', 'N') AS Update_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 8, 'Y', 'N') AS Delete_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 16, 'Y', 'N') AS Create_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 32, 'Y', 'N') AS Drop_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 64, 'Y', 'N') AS Reload_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 128, 'Y', 'N') AS Shutdown_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 256, 'Y', 'N') AS Process_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 512, 'Y', 'N') AS File_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 1024, 'Y', 'N') AS Grant_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 2048, 'Y', 'N') AS References_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 4096, 'Y', 'N') AS Index_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 8192, 'Y', 'N') AS Alter_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 16384, 'Y', 'N') AS Show_db_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 32768, 'Y', 'N') AS Super_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 65536, 'Y', 'N') AS Create_tmp_table_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 131072, 'Y', 'N') AS Lock_tables_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 262144, 'Y', 'N') AS Execute_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 524288, 'Y', 'N') AS Repl_slave_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 1048576, 'Y', 'N') AS Repl_client_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 2097152, 'Y', 'N') AS Create_view_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 4194304, 'Y', 'N') AS Show_view_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 8388608, 'Y', 'N') AS Create_routine_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 16777216, 'Y', 'N') AS Alter_routine_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 33554432, 'Y', 'N') AS Create_user_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 67108864, 'Y', 'N') AS Event_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv,
+ ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type,
+ IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher,
+ IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer,
+ IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections,
+ IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin,
+ IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string,
+ 'N' AS password_expired,
+ ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role,
+ IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time
+ FROM global_priv;
+
+
+SET sql_mode='';
+
+DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn;
+DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn;
+
+delimiter |;
+
+CREATE DEFINER=`superuser`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
+ t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
+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 |
+
+CREATE DEFINER=`superuser`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64),
+ t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
+begin
+ set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |
+
+delimiter ;|
+
+set @@sql_mode= @save_sql_mode;
+
+drop user 'mariadb.sys'@'localhost';
+
+--echo # check changed definitions mysql_upgrade
+
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+
+SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--echo # Run mysql_upgrade
+--exec $MYSQL_UPGRADE 2>&1
+--file_exists $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+--echo # check new definitions mysql_upgrade
+
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+
+select count(*) from global_priv where user='mariadb.sys' and host='localhost';
+--echo # above should be 0 (no mariadb.sys@localhost user)
+
+--echo # restore environment
+
+DROP USER 'superuser'@'localhost';
+DROP VIEW mysql.user;
+DROP PROCEDURE AddGeometryColumn;
+DROP PROCEDURE DropGeometryColumn;
+--exec $MYSQL_UPGRADE 2>&1
+--file_exists $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+delete from global_priv;
+delete from tables_priv;
+delete from proxies_priv;
+delete from proc;
+insert into mysql.global_priv select * from mysqltest1.save_global_priv;
+insert into mysql.tables_priv select * from mysqltest1.save_tables_priv;
+insert into mysql.proxies_priv select * from mysqltest1.save_proxies_priv;
+rename table proc to bad_proc;
+rename table save_proc to proc;
+drop table bad_proc;
+flush privileges;
+
+disconnect default;
+connect default,localhost,root,,;
+connection default;
+
+drop database mysqltest1;
+
+--echo # End of 10.4 tests (but better do not add other tests here)
diff --git a/mysql-test/main/upgrade_MDEV-23102-2.result b/mysql-test/main/upgrade_MDEV-23102-2.result
new file mode 100644
index 00000000000..4702fae812f
--- /dev/null
+++ b/mysql-test/main/upgrade_MDEV-23102-2.result
@@ -0,0 +1,262 @@
+#
+# MDEV-23102: 10.4 create mariadb.sys user on each update even
+# is the user is not needed
+#
+# part 2: reassigning mysql.user and deleting gis procedures
+call mtr.add_suppression("Cannot load from mysql.proc. The table is probably corrupted");
+create database mysqltest1;
+use mysqltest1;
+create table save_global_priv as select * from mysql.global_priv;
+create table save_tables_priv as select * from mysql.tables_priv;
+create table save_proxies_priv as select * from mysql.proxies_priv;
+create table mysql.save_proc like mysql.proc;
+insert into mysql.save_proc select * from mysql.proc;
+set @save_sql_mode= @@sql_mode;
+use mysql;
+# make changed definition of gis procedures and user view
+create user superuser@localhost;
+grant all privileges on mysql.* to superuser@localhost;
+drop view user;
+CREATE DEFINER='superuser'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT
+Host,
+User,
+IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password,
+IF(JSON_VALUE(Priv, '$.access') & 1, 'Y', 'N') AS Select_priv,
+IF(JSON_VALUE(Priv, '$.access') & 2, 'Y', 'N') AS Insert_priv,
+IF(JSON_VALUE(Priv, '$.access') & 4, 'Y', 'N') AS Update_priv,
+IF(JSON_VALUE(Priv, '$.access') & 8, 'Y', 'N') AS Delete_priv,
+IF(JSON_VALUE(Priv, '$.access') & 16, 'Y', 'N') AS Create_priv,
+IF(JSON_VALUE(Priv, '$.access') & 32, 'Y', 'N') AS Drop_priv,
+IF(JSON_VALUE(Priv, '$.access') & 64, 'Y', 'N') AS Reload_priv,
+IF(JSON_VALUE(Priv, '$.access') & 128, 'Y', 'N') AS Shutdown_priv,
+IF(JSON_VALUE(Priv, '$.access') & 256, 'Y', 'N') AS Process_priv,
+IF(JSON_VALUE(Priv, '$.access') & 512, 'Y', 'N') AS File_priv,
+IF(JSON_VALUE(Priv, '$.access') & 1024, 'Y', 'N') AS Grant_priv,
+IF(JSON_VALUE(Priv, '$.access') & 2048, 'Y', 'N') AS References_priv,
+IF(JSON_VALUE(Priv, '$.access') & 4096, 'Y', 'N') AS Index_priv,
+IF(JSON_VALUE(Priv, '$.access') & 8192, 'Y', 'N') AS Alter_priv,
+IF(JSON_VALUE(Priv, '$.access') & 16384, 'Y', 'N') AS Show_db_priv,
+IF(JSON_VALUE(Priv, '$.access') & 32768, 'Y', 'N') AS Super_priv,
+IF(JSON_VALUE(Priv, '$.access') & 65536, 'Y', 'N') AS Create_tmp_table_priv,
+IF(JSON_VALUE(Priv, '$.access') & 131072, 'Y', 'N') AS Lock_tables_priv,
+IF(JSON_VALUE(Priv, '$.access') & 262144, 'Y', 'N') AS Execute_priv,
+IF(JSON_VALUE(Priv, '$.access') & 524288, 'Y', 'N') AS Repl_slave_priv,
+IF(JSON_VALUE(Priv, '$.access') & 1048576, 'Y', 'N') AS Repl_client_priv,
+IF(JSON_VALUE(Priv, '$.access') & 2097152, 'Y', 'N') AS Create_view_priv,
+IF(JSON_VALUE(Priv, '$.access') & 4194304, 'Y', 'N') AS Show_view_priv,
+IF(JSON_VALUE(Priv, '$.access') & 8388608, 'Y', 'N') AS Create_routine_priv,
+IF(JSON_VALUE(Priv, '$.access') & 16777216, 'Y', 'N') AS Alter_routine_priv,
+IF(JSON_VALUE(Priv, '$.access') & 33554432, 'Y', 'N') AS Create_user_priv,
+IF(JSON_VALUE(Priv, '$.access') & 67108864, 'Y', 'N') AS Event_priv,
+IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv,
+IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv,
+IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv,
+ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type,
+IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher,
+IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer,
+IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections,
+IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin,
+IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string,
+'N' AS password_expired,
+ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role,
+IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role,
+CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time
+FROM global_priv;
+DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn;
+DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn;
+drop user 'mariadb.sys'@'localhost';
+# check changed definitions mysql_upgrade
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn';
+count(*)
+0
+SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
+SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
+# Run mysql_upgrade
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.global_priv OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.index_stats OK
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.save_proc OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+
+Repairing tables
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+mysql.user OK
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysqltest1
+mysqltest1.save_global_priv OK
+mysqltest1.save_proxies_priv OK
+mysqltest1.save_tables_priv OK
+performance_schema
+test
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+# check new definitions mysql_upgrade
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn';
+count(*)
+0
+select count(*) from global_priv where user='mariadb.sys' and host='localhost';
+count(*)
+0
+# above should be 0 (no mariadb.sys@localhost user)
+# restore environment
+DROP USER 'superuser'@'localhost';
+DROP VIEW mysql.user;
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.global_priv OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.index_stats OK
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.save_proc OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+
+Repairing tables
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysqltest1
+mysqltest1.save_global_priv OK
+mysqltest1.save_proxies_priv OK
+mysqltest1.save_tables_priv OK
+performance_schema
+test
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+delete from global_priv;
+delete from tables_priv;
+delete from proxies_priv;
+delete from proc;
+insert into mysql.global_priv select * from mysqltest1.save_global_priv;
+insert into mysql.tables_priv select * from mysqltest1.save_tables_priv;
+insert into mysql.proxies_priv select * from mysqltest1.save_proxies_priv;
+rename table proc to bad_proc;
+rename table save_proc to proc;
+drop table bad_proc;
+flush privileges;
+disconnect default;
+connect default,localhost,root,,;
+connection default;
+drop database mysqltest1;
+# End of 10.4 tests (but better do not add other tests here)
diff --git a/mysql-test/main/upgrade_MDEV-23102-2.test b/mysql-test/main/upgrade_MDEV-23102-2.test
new file mode 100644
index 00000000000..5ce7682fea6
--- /dev/null
+++ b/mysql-test/main/upgrade_MDEV-23102-2.test
@@ -0,0 +1,141 @@
+--echo #
+--echo # MDEV-23102: 10.4 create mariadb.sys user on each update even
+--echo # is the user is not needed
+--echo #
+--echo # part 2: reassigning mysql.user and deleting gis procedures
+
+--source include/mysql_upgrade_preparation.inc
+
+call mtr.add_suppression("Cannot load from mysql.proc. The table is probably corrupted");
+create database mysqltest1;
+use mysqltest1;
+create table save_global_priv as select * from mysql.global_priv;
+create table save_tables_priv as select * from mysql.tables_priv;
+create table save_proxies_priv as select * from mysql.proxies_priv;
+create table mysql.save_proc like mysql.proc;
+insert into mysql.save_proc select * from mysql.proc;
+set @save_sql_mode= @@sql_mode;
+
+use mysql;
+
+--echo # make changed definition of gis procedures and user view
+
+create user superuser@localhost;
+grant all privileges on mysql.* to superuser@localhost;
+
+drop view user;
+
+CREATE DEFINER='superuser'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT
+ Host,
+ User,
+ IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password,
+ IF(JSON_VALUE(Priv, '$.access') & 1, 'Y', 'N') AS Select_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 2, 'Y', 'N') AS Insert_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 4, 'Y', 'N') AS Update_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 8, 'Y', 'N') AS Delete_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 16, 'Y', 'N') AS Create_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 32, 'Y', 'N') AS Drop_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 64, 'Y', 'N') AS Reload_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 128, 'Y', 'N') AS Shutdown_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 256, 'Y', 'N') AS Process_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 512, 'Y', 'N') AS File_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 1024, 'Y', 'N') AS Grant_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 2048, 'Y', 'N') AS References_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 4096, 'Y', 'N') AS Index_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 8192, 'Y', 'N') AS Alter_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 16384, 'Y', 'N') AS Show_db_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 32768, 'Y', 'N') AS Super_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 65536, 'Y', 'N') AS Create_tmp_table_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 131072, 'Y', 'N') AS Lock_tables_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 262144, 'Y', 'N') AS Execute_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 524288, 'Y', 'N') AS Repl_slave_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 1048576, 'Y', 'N') AS Repl_client_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 2097152, 'Y', 'N') AS Create_view_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 4194304, 'Y', 'N') AS Show_view_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 8388608, 'Y', 'N') AS Create_routine_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 16777216, 'Y', 'N') AS Alter_routine_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 33554432, 'Y', 'N') AS Create_user_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 67108864, 'Y', 'N') AS Event_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv,
+ IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv,
+ ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type,
+ IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher,
+ IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer,
+ IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections,
+ IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin,
+ IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string,
+ 'N' AS password_expired,
+ ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role,
+ IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role,
+ CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time
+ FROM global_priv;
+
+
+DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn;
+DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn;
+
+
+drop user 'mariadb.sys'@'localhost';
+
+--echo # check changed definitions mysql_upgrade
+
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn';
+
+SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--echo # Run mysql_upgrade
+--exec $MYSQL_UPGRADE 2>&1
+--file_exists $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+--echo # check new definitions mysql_upgrade
+
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def'
+and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'superuser@localhost';
+SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn';
+
+
+select count(*) from global_priv where user='mariadb.sys' and host='localhost';
+--echo # above should be 0 (no mariadb.sys@localhost user)
+
+--echo # restore environment
+
+DROP USER 'superuser'@'localhost';
+DROP VIEW mysql.user;
+--exec $MYSQL_UPGRADE 2>&1
+--file_exists $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+delete from global_priv;
+delete from tables_priv;
+delete from proxies_priv;
+delete from proc;
+insert into mysql.global_priv select * from mysqltest1.save_global_priv;
+insert into mysql.tables_priv select * from mysqltest1.save_tables_priv;
+insert into mysql.proxies_priv select * from mysqltest1.save_proxies_priv;
+rename table proc to bad_proc;
+rename table save_proc to proc;
+drop table bad_proc;
+flush privileges;
+
+disconnect default;
+connect default,localhost,root,,;
+connection default;
+
+drop database mysqltest1;
+
+--echo # End of 10.4 tests (but better do not add other tests here)
diff --git a/mysql-test/main/user_var-binlog.result b/mysql-test/main/user_var-binlog.result
index 9021fcc9628..20d1d8e7da8 100644
--- a/mysql-test/main/user_var-binlog.result
+++ b/mysql-test/main/user_var-binlog.result
@@ -23,7 +23,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`a b`:=_latin1 X'68656C6C6F' COLLATE `latin1_swedish_ci`/*!*/;
use `test`/*!*/;
@@ -41,7 +41,7 @@ INSERT INTO t1 VALUES(@`a b`)
SET TIMESTAMP=10000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`var1`:=_latin1 X'273B616161' COLLATE `latin1_swedish_ci`/*!*/;
SET @`var2`:=_binary X'61' COLLATE `binary`/*!*/;
diff --git a/mysql-test/main/view_grant.result b/mysql-test/main/view_grant.result
index 0f76aa974cd..f091d4de2d1 100644
--- a/mysql-test/main/view_grant.result
+++ b/mysql-test/main/view_grant.result
@@ -1361,7 +1361,6 @@ connection default;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
End of 5.0 tests.
connection default;
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index 82e9399e653..441852fb362 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3799,6 +3799,58 @@ SELECT FIRST_VALUE(MAX(a) OVER (PARTITION BY a)) OVER (ORDER BY a) AS x FROM t1
ERROR HY000: Window functions can not be used as arguments to group functions.
DROP TABLE t1;
#
+# MDEV-12059: Assertion `precision > 0' failed with a window function or window aggregate function
+#
+CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED);
+INSERT INTO t1 VALUES (1),(2);
+SELECT MIN(d) OVER () FROM t1;
+MIN(d) OVER ()
+1
+1
+DROP TABLE t1;
+#
+# MDEV-22463: Element_type &Bounds_checked_array<Item *>::operator[](size_t) [Element_type = Item *]:
+# Assertion `n < m_size' failed
+#
+CREATE TABLE t1 (a INT, b INT, c INT, d INT, e INT, f INT, g int, h INT, i INT);
+INSERT INTO t1 SELECT seq,seq,seq,seq, seq,seq,seq,seq,seq FROM seq_1_to_5;
+SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6);
+ROW_NUMBER() OVER w2
+1
+2
+3
+4
+5
+SELECT a FROM t1 ORDER BY ROW_NUMBER() OVER (PARTITION BY -1,1,0,2,3,4,5,6,7,8);
+a
+1
+2
+3
+4
+5
+SELECT a,b FROM t1 WINDOW w2 AS (PARTITION BY -1,1,0,2,3,4);
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6);
+ROW_NUMBER() OVER w2
+1
+2
+3
+4
+5
+DROP TABLE t1;
+#
+# MDEV-18916: crash in Window_spec::print_partition() with decimals
+#
+SELECT cast((rank() over w1) as decimal (53,56));
+ERROR 42000: Too big scale 56 specified for 'rank() over w1'. Maximum is 38
+SELECT cast((rank() over w1) as decimal (53,30));
+ERROR HY000: Window specification with name 'w1' is not defined
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 6e628d3c0ba..4b442c03ad6 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -1,6 +1,7 @@
#
# Window Functions Tests
#
+--source include/have_sequence.inc
--disable_warnings
drop table if exists t1,t2;
@@ -2472,6 +2473,39 @@ SELECT FIRST_VALUE(MAX(a) OVER (PARTITION BY a)) OVER (ORDER BY a) AS x FROM t1
DROP TABLE t1;
--echo #
+--echo # MDEV-12059: Assertion `precision > 0' failed with a window function or window aggregate function
+--echo #
+
+CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED);
+INSERT INTO t1 VALUES (1),(2);
+SELECT MIN(d) OVER () FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-22463: Element_type &Bounds_checked_array<Item *>::operator[](size_t) [Element_type = Item *]:
+--echo # Assertion `n < m_size' failed
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, c INT, d INT, e INT, f INT, g int, h INT, i INT);
+INSERT INTO t1 SELECT seq,seq,seq,seq, seq,seq,seq,seq,seq FROM seq_1_to_5;
+
+SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6);
+--sorted_result
+SELECT a FROM t1 ORDER BY ROW_NUMBER() OVER (PARTITION BY -1,1,0,2,3,4,5,6,7,8);
+SELECT a,b FROM t1 WINDOW w2 AS (PARTITION BY -1,1,0,2,3,4);
+SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-18916: crash in Window_spec::print_partition() with decimals
+--echo #
+
+--error ER_TOO_BIG_SCALE
+SELECT cast((rank() over w1) as decimal (53,56));
+--error ER_WRONG_WINDOW_SPEC_NAME
+SELECT cast((rank() over w1) as decimal (53,30));
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/win_ntile.result b/mysql-test/main/win_ntile.result
index 41cb1a594bf..4d02a230e13 100644
--- a/mysql-test/main/win_ntile.result
+++ b/mysql-test/main/win_ntile.result
@@ -433,3 +433,81 @@ ntile((select a from t1)) over (partition by b order by pk)
from t1;
ERROR 21000: Subquery returns more than 1 row
drop table t1;
+#
+# MDEV-9911 NTILE must return an error when parameter is not stable
+#
+create table t1 (
+pk int primary key,
+c1 nvarchar(10),
+c2 nvarchar(10),
+c3 int
+);
+insert into t1 values
+(1, 'Mark', 'Male', 5),
+(2, 'John', 'Male', 5),
+(3, 'Pam', 'Female', 6),
+(4, 'Sara', 'Female', 6),
+(5, 'Todd', 'Male', 5),
+(6, 'Mary', 'Female', 6),
+(7, 'Ben', 'Male', 5),
+(8, 'Jodi', 'Female', 6),
+(9, 'Tom', 'Male', 5),
+(10, 'Lucky', 'Male', 5),
+(11, 'Mark', 'Male', 5),
+(12, 'John', 'Male', 5),
+(13, 'Pam', 'Female', 6),
+(14, 'Sara', 'Female', 6),
+(15, 'Todd', 'Male', 5),
+(16, 'Mary', 'Female', 6),
+(17, 'Ben', 'Male', 5),
+(18, 'Jodi', 'Female', 6),
+(19, 'Tom', 'Male', 5),
+(20, 'Lucky', 'Male', 5);
+select c1, c2, c3, ntile(6) over (partition by c2 order by pk) from t1;
+c1 c2 c3 ntile(6) over (partition by c2 order by pk)
+Pam Female 6 1
+Sara Female 6 1
+Mary Female 6 2
+Jodi Female 6 2
+Pam Female 6 3
+Sara Female 6 4
+Mary Female 6 5
+Jodi Female 6 6
+Mark Male 5 1
+John Male 5 1
+Todd Male 5 2
+Ben Male 5 2
+Tom Male 5 3
+Lucky Male 5 3
+Mark Male 5 4
+John Male 5 4
+Todd Male 5 5
+Ben Male 5 5
+Tom Male 5 6
+Lucky Male 5 6
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+c1 c2 c3 ntile(c3) over (partition by c2 order by pk)
+Pam Female 6 1
+Sara Female 6 1
+Mary Female 6 2
+Jodi Female 6 2
+Pam Female 6 3
+Sara Female 6 4
+Mary Female 6 5
+Jodi Female 6 6
+Mark Male 5 1
+John Male 5 1
+Todd Male 5 1
+Ben Male 5 2
+Tom Male 5 2
+Lucky Male 5 2
+Mark Male 5 3
+John Male 5 3
+Todd Male 5 4
+Ben Male 5 4
+Tom Male 5 5
+Lucky Male 5 5
+update t1 set c3= 1 where pk = 1;
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+ERROR HY000: Argument of NTILE must be greater than 0
+drop table t1;
diff --git a/mysql-test/main/win_ntile.test b/mysql-test/main/win_ntile.test
index 6f12e1f4005..c65ba7e1521 100644
--- a/mysql-test/main/win_ntile.test
+++ b/mysql-test/main/win_ntile.test
@@ -169,3 +169,46 @@ from t1;
drop table t1;
+
+--echo #
+--echo # MDEV-9911 NTILE must return an error when parameter is not stable
+--echo #
+
+create table t1 (
+ pk int primary key,
+ c1 nvarchar(10),
+ c2 nvarchar(10),
+ c3 int
+);
+
+insert into t1 values
+ (1, 'Mark', 'Male', 5),
+ (2, 'John', 'Male', 5),
+ (3, 'Pam', 'Female', 6),
+ (4, 'Sara', 'Female', 6),
+ (5, 'Todd', 'Male', 5),
+ (6, 'Mary', 'Female', 6),
+ (7, 'Ben', 'Male', 5),
+ (8, 'Jodi', 'Female', 6),
+ (9, 'Tom', 'Male', 5),
+ (10, 'Lucky', 'Male', 5),
+ (11, 'Mark', 'Male', 5),
+ (12, 'John', 'Male', 5),
+ (13, 'Pam', 'Female', 6),
+ (14, 'Sara', 'Female', 6),
+ (15, 'Todd', 'Male', 5),
+ (16, 'Mary', 'Female', 6),
+ (17, 'Ben', 'Male', 5),
+ (18, 'Jodi', 'Female', 6),
+ (19, 'Tom', 'Male', 5),
+ (20, 'Lucky', 'Male', 5);
+# Correct usage of NTILE with a fix argument NTILE(6).
+select c1, c2, c3, ntile(6) over (partition by c2 order by pk) from t1;
+# Correct usage - constant NTILE (argument) in each partition.
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+
+update t1 set c3= 1 where pk = 1;
+--error ER_INVALID_NTILE_ARGUMENT
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+
+drop table t1;
diff --git a/mysql-test/std_data/ldml/Index.xml b/mysql-test/std_data/ldml/Index.xml
index 0435b2ab689..c4b91535af6 100644
--- a/mysql-test/std_data/ldml/Index.xml
+++ b/mysql-test/std_data/ldml/Index.xml
@@ -362,7 +362,14 @@
<alias>iso_8859-1:1987</alias>
<alias>l1</alias>
<alias>latin1</alias>
- <collation name="latin1_test" id="99" order="test"/>
+ <!--
+ The server rejects binding an existing built-in collation
+ to a different character set through Index.xml.
+ This example tries to override cp1250_polish_ci with id 99
+ and bind it to latin1:
+ -->
+ <collation name="latin1_test_replace" id="99"/>
+ <collation name="latin1_test" id="331" order="test"/>
<collation name="latin1_test2" id="332" order="test"/>
<collation name="latin1_test2_cs" id="333"/>
<collation name="latin1_swedish_nopad2_ci" id="334" flag="nopad">
diff --git a/mysql-test/std_data/wsrep_notify.sh b/mysql-test/std_data/wsrep_notify.sh
index 7036f603c84..48edad4306f 100755
--- a/mysql-test/std_data/wsrep_notify.sh
+++ b/mysql-test/std_data/wsrep_notify.sh
@@ -56,7 +56,7 @@ configuration_change()
status_update()
{
- echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;"
+ echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
}
COM=status_update # not a configuration change by default
@@ -89,11 +89,11 @@ do
shift
done
-# Undefined means node is shutting down
-if [ "$STATUS" != "Undefined" ]
-then
- $COM | mysql -B -u$USER -h$HOST -P$PORT
-fi
-
-exit 0
-#
+case $STATUS in
+ "joined" | "donor" | "synced")
+ $COM | mysql -B -u$USER -h$HOST -P$PORT
+ ;;
+ *)
+ exit 0
+ ;;
+esac
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
index a6378f4e094..1d6e94249dc 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 20c62920566..1229ef885b4 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -383,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 #
@@ -404,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 #
@@ -441,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 #
@@ -462,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 #
@@ -483,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 #
@@ -504,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 #
@@ -525,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 #
@@ -546,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 #
@@ -567,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 #
@@ -588,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 #
@@ -609,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 #
@@ -630,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 #
@@ -669,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 #
@@ -707,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 #
@@ -728,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 #
@@ -749,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 #
@@ -770,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 #
@@ -807,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 #
@@ -834,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 #
@@ -855,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 #
@@ -878,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 #
@@ -915,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 #
@@ -939,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 #
@@ -976,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 #
@@ -997,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 #
@@ -1034,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 #
@@ -1055,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 #
@@ -1092,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 #
@@ -1116,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 #
@@ -1139,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 #
@@ -1176,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 #
@@ -1197,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 #
@@ -1234,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 #
@@ -1258,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 #
@@ -1281,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 #
@@ -1318,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 #
@@ -1339,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 #
@@ -1376,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 #
@@ -1400,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 #
@@ -1423,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 #
@@ -1460,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 #
@@ -1481,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 #
@@ -1518,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 #
@@ -1542,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 #
@@ -1565,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 #
@@ -1602,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 #
@@ -1623,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 #
@@ -1660,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 #
@@ -1681,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 #
@@ -1718,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 #
@@ -1739,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 #
@@ -1760,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 #
@@ -1797,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 #
@@ -1818,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 #
@@ -1855,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 #
@@ -1876,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 #
@@ -1913,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 #
@@ -1935,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 #
@@ -1972,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 #
@@ -1993,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 #
@@ -2030,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 #
@@ -2051,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 #
@@ -2088,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 #
@@ -2109,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 #
@@ -2146,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 #
@@ -2167,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 #
@@ -2204,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 #
@@ -2225,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 #
@@ -2262,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 #
@@ -2283,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 #
@@ -2320,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 #
@@ -2341,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 #
@@ -2378,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 #
@@ -2399,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 #
@@ -2436,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 #
@@ -2457,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 #
@@ -2494,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 #
@@ -2515,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 #
@@ -2536,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 #
@@ -2576,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 #
@@ -2597,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 #
@@ -2634,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 #
@@ -2655,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 #
@@ -2692,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 #
@@ -2713,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 #
@@ -2750,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 #
@@ -2771,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 #
@@ -2792,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 #
@@ -2832,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 #
@@ -2853,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 #
@@ -2890,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 #
@@ -2911,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 #
@@ -2948,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 #
@@ -2969,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 #
@@ -3006,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 #
@@ -3027,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 #
@@ -3064,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 #
@@ -3085,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 #
@@ -3122,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 #
@@ -3143,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 #
@@ -3180,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 #
@@ -3201,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 #
@@ -3222,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 #
@@ -3262,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 #
@@ -3283,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 #
@@ -3304,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 #
@@ -3344,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 #
@@ -3365,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 #
@@ -3402,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 #
@@ -3423,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 #
@@ -3460,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 #
@@ -3481,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 #
@@ -3518,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 #
@@ -3539,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 #
@@ -3576,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 #
@@ -3597,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 #
@@ -3618,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 #
@@ -3639,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 #
@@ -3676,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 #
@@ -3697,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 #
@@ -3734,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 #
@@ -3755,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 #
@@ -3776,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 #
@@ -3797,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 #
@@ -3834,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 #
@@ -3855,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 #
@@ -3876,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 #
@@ -3897,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 #
@@ -3934,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 #
@@ -3955,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 #
@@ -3992,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 #
@@ -4013,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 #
@@ -4034,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 #
@@ -4055,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 #
@@ -4092,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 #
@@ -4113,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 #
@@ -4134,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 #
@@ -4155,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 #
@@ -4192,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 #
@@ -4213,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 #
@@ -4250,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 #
@@ -4271,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 #
@@ -4308,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 #
@@ -4329,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 #
@@ -4366,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 #
@@ -4387,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 #
@@ -4424,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 #
@@ -4445,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 #
@@ -4482,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 #
@@ -4503,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 #
@@ -4540,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 #
@@ -4561,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 #
@@ -4598,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 #
@@ -4619,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 #
@@ -4656,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 #
@@ -4677,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 #
@@ -4714,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 #
@@ -4735,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 #
@@ -4772,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 #
@@ -4793,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 #
@@ -4830,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 #
@@ -4851,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 #
@@ -4888,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 #
@@ -4909,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 #
@@ -4946,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 #
@@ -4967,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 #
@@ -4988,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 #
@@ -5009,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 #
@@ -5030,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 #
@@ -5051,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 #
@@ -5072,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 #
@@ -5093,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 #
@@ -5138,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 #
@@ -5160,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 #
@@ -5182,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 #
@@ -5204,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 #
@@ -5226,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 #
@@ -5294,7 +5294,7 @@ 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 #
@@ -5347,7 +5347,7 @@ DELIMITER /*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=320*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
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 89757605a95..5fce079ef24 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 #
@@ -2550,7 +2550,7 @@ 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 #
@@ -2732,7 +2732,7 @@ 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 #
@@ -3080,7 +3080,7 @@ 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 #
@@ -3420,7 +3420,7 @@ 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 #
@@ -3765,7 +3765,7 @@ 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 #
@@ -4108,7 +4108,7 @@ 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 #
@@ -4454,7 +4454,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 #
@@ -4634,7 +4634,7 @@ 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 #
@@ -4811,7 +4811,7 @@ 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 #
@@ -4991,7 +4991,7 @@ 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 #
@@ -5293,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 #
@@ -5363,7 +5363,7 @@ 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 #
@@ -5442,7 +5442,7 @@ 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 #
@@ -5717,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 #
@@ -5787,7 +5787,7 @@ 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 #
@@ -5857,7 +5857,7 @@ 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 #
@@ -5927,7 +5927,7 @@ 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 #
@@ -6117,7 +6117,7 @@ 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 #
@@ -6331,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 #
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 a7b5989ed9d..47b366fc61b 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 #
@@ -2553,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 #
@@ -2737,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 #
@@ -3087,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 #
@@ -3429,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 #
@@ -3776,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 #
@@ -4121,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 #
@@ -4469,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 #
@@ -4651,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 #
@@ -4830,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 #
@@ -5012,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 #
@@ -5316,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 #
@@ -5388,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 #
@@ -5469,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 #
@@ -5746,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 #
@@ -5818,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 #
@@ -5890,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 #
@@ -5962,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 #
@@ -6154,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 #
@@ -6370,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 #
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 1d025cf38bc..349dc8b7610 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 #
@@ -257,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 #
@@ -287,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 #
@@ -326,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 #
@@ -348,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 #
@@ -433,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 #
@@ -463,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 #
@@ -502,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 #
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 ecd55142241..5d70f7871ab 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 #
@@ -171,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 #
@@ -198,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 #
@@ -225,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 #
@@ -267,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 #
@@ -294,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 #
@@ -374,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 #
@@ -401,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 #
@@ -414,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 #
@@ -427,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 #
@@ -458,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 #
@@ -471,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 #
@@ -542,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 #
@@ -567,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 #
@@ -592,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 #
@@ -617,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 #
@@ -655,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 #
@@ -680,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 #
@@ -768,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 #
@@ -795,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 #
@@ -822,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 #
@@ -849,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 #
@@ -891,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 #
@@ -918,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 #
@@ -998,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 #
@@ -1025,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 #
@@ -1038,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 #
@@ -1051,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 #
@@ -1082,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 #
@@ -1095,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 #
@@ -1166,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 #
@@ -1190,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 #
@@ -1214,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 #
@@ -1238,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 #
@@ -1275,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 #
@@ -1299,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 #
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 194dc28cf3e..fc07aed7123 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -16,7 +16,7 @@ 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)
@@ -104,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 #
@@ -125,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 #
@@ -146,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 #
@@ -167,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 #
@@ -188,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 #
@@ -209,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 #
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 a30d7efab95..8fc90fd968c 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 #
@@ -97,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 #
@@ -121,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 #
@@ -152,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 #
@@ -176,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 #
@@ -198,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 #
@@ -237,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 #
@@ -303,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 #
@@ -338,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 #
@@ -362,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 #
@@ -393,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 #
@@ -417,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 #
@@ -439,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 #
@@ -478,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 #
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 f15159c68b3..f7bc552c4e5 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/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index 5ac6e31c080..da1ef1f40dd 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 #
@@ -107,7 +107,7 @@ 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 #
@@ -133,7 +133,7 @@ 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 #
@@ -159,7 +159,7 @@ 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 #
@@ -213,7 +213,7 @@ 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 #
@@ -296,7 +296,7 @@ ROLLBACK/*!*/;
# 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
@@ -331,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
@@ -374,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
@@ -389,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
@@ -404,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_encryption/binlog_row_annotate.result b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
index 0cb4305d78b..b5e6721ace1 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 #
@@ -175,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 #
@@ -202,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 #
@@ -229,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 #
@@ -271,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 #
@@ -298,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 #
@@ -381,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 #
@@ -408,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 #
@@ -421,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 #
@@ -434,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 #
@@ -465,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 #
@@ -478,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 #
@@ -552,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 #
@@ -576,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 #
@@ -600,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 #
@@ -624,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 #
@@ -661,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 #
@@ -685,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 #
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/sp-cursor-rowtype.result b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
index a60bbc38883..31d794c9f61 100644
--- a/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
@@ -1045,7 +1045,7 @@ NULL;
END LOOP;
END;
$$
-ERROR 42000: Undefined CURSOR: c2
+ERROR 42000: Undeclared variable: c2
# Make sure "rec" shadows other declarations outside the loop
CREATE TABLE t1 (a INT, b VARCHAR(10));
INSERT INTO t1 VALUES (10, 'b0');
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result
index e62ce1df9e5..5e2ea82fbc3 100644
--- a/mysql-test/suite/compat/oracle/r/sp.result
+++ b/mysql-test/suite/compat/oracle/r/sp.result
@@ -1019,7 +1019,7 @@ LOOP
EXIT WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
CREATE PROCEDURE p1
AS
BEGIN
@@ -1028,7 +1028,7 @@ LOOP
EXIT label WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
CREATE PROCEDURE p1
AS
BEGIN
@@ -1036,7 +1036,7 @@ LOOP
CONTINUE WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
CREATE PROCEDURE p1
AS
BEGIN
@@ -1045,7 +1045,7 @@ LOOP
CONTINUE label WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
#
# MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
#
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/sp-cursor-rowtype.test b/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
index ba0ca9b6a60..78a38c5f4c6 100644
--- a/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
@@ -1128,7 +1128,7 @@ DELIMITER ;$$
--echo # IN followed by an unknown cursor name
DELIMITER $$;
---error ER_SP_CURSOR_MISMATCH
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1 AS
CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
BEGIN
diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test
index 1c977e40f34..99bdc7166e0 100644
--- a/mysql-test/suite/compat/oracle/t/sp.test
+++ b/mysql-test/suite/compat/oracle/t/sp.test
@@ -1094,7 +1094,7 @@ DROP FUNCTION f1;
--echo #
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
@@ -1106,7 +1106,7 @@ DELIMITER ;$$
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
@@ -1119,7 +1119,7 @@ DELIMITER ;$$
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
@@ -1131,7 +1131,7 @@ DELIMITER ;$$
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result b/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
index 9a291ae1354..541680ae862 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
@@ -9,6 +9,9 @@ INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192;
SELECT COUNT(*) FROM t1;
COUNT(*)
8192
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+8192
SELECT variable_value > @old_encrypted FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
variable_value > @old_encrypted
diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test b/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
index 779e77a4540..d99a55b9b44 100644
--- a/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
+++ b/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
@@ -15,6 +15,8 @@ CREATE TEMPORARY TABLE t2(f1 CHAR(100), f2 CHAR(200), f3 CHAR(200))ENGINE=InnoDB
INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192;
SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
SELECT variable_value > @old_encrypted FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
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 d4f0de131d1..d7065b54788 100644
--- a/mysql-test/suite/funcs_1/r/is_table_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result
@@ -56,7 +56,6 @@ SELECT table_catalog, table_schema, table_name, privilege_type
FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL;
table_catalog table_schema table_name privilege_type
def mysql global_priv SELECT
-def mysql global_priv UPDATE
def mysql global_priv DELETE
######################################################################
# Testcase 3.2.11.2+3.2.11.3+3.2.11.4:
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index e4244c63297..cfab7ce3472 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -18,13 +18,11 @@ MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently
MW-329 : MDEV-19962 Galera test failure on MW-329
galera.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
-galera_autoinc_sst_mariabackup : Known issue, may require porting MDEV-17458 from later versions
galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_bf_abort_group_commit
galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files
galera_ftwrl : MDEV-21525 galera.galera_ftwrl
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
-galera_ist_progress : MDEV-15236 fails when trying to read transfer status
galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges
galera_kill_nochanges : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges
galera_load_data : MDEV-19968 galera.galera_load_data
@@ -43,7 +41,6 @@ galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_reject_queries : assertion in inline_mysql_socket_send
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
galera_wan : MDEV-17259 Test failure on galera.galera_wan
-mysql-wsrep#198 : MDEV-18935 Galera test mysql-wsrep#198 sporaric assertion transaction.cpp:362: int wsrep::transaction::before_commit(): Assertion `state() == s_executing || state() == s_committing || state() == s_must_abort || state() == s_replaying' failed.
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
diff --git a/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-test/suite/galera/include/galera_st_clean_slave.inc
index 3a49f4f6ad2..44cbf67fd12 100644
--- a/mysql-test/suite/galera/include/galera_st_clean_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_clean_slave.inc
@@ -102,12 +102,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
index d6d7552f7b6..3ac52deb284 100644
--- a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
@@ -100,12 +100,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc
index 0b96de55a32..a4d9e91e8be 100644
--- a/mysql-test/suite/galera/include/galera_st_kill_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc
@@ -96,12 +96,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
index 44a1513fa6e..bb8c68bd181 100644
--- a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
+++ b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
@@ -110,6 +110,9 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
@@ -117,6 +120,8 @@ COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
diff --git a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
index 207282c8237..eeb6a15e0a3 100644
--- a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
@@ -97,12 +97,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MDEV-22458.result b/mysql-test/suite/galera/r/MDEV-22458.result
new file mode 100644
index 00000000000..d1f9d94bd1c
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-22458.result
@@ -0,0 +1,10 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t1 (a INT);
+connect con1,localhost,root,,test;
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+SHOW EXPLAIN FOR $con1;
+ERROR HY000: Target is not running an EXPLAINable command
+connection con1;
+INSERT INTO t1 VALUES (5),(6),(7),(8);
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result
index 448e927f09d..f256558644e 100644
--- a/mysql-test/suite/galera/r/MW-328A.result
+++ b/mysql-test/suite/galera/r/MW-328A.result
@@ -14,7 +14,10 @@ END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
+connection node_1;
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
connection node_2;
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
SET SESSION wsrep_retry_autocommit = 0;
connection node_1;
connection node_1X;
diff --git a/mysql-test/suite/galera/r/galera_bf_kill.result b/mysql-test/suite/galera/r/galera_bf_kill.result
index 2a7bc9eac29..3738e8c9684 100644
--- a/mysql-test/suite/galera/r/galera_bf_kill.result
+++ b/mysql-test/suite/galera/r/galera_bf_kill.result
@@ -69,21 +69,5 @@ select * from t1;
a b
2 1
disconnect node_2a;
-drop table t1;
-connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
-connection node_2a;
-CREATE TABLE t1 (i int primary key);
-SET DEBUG_SYNC = "before_wsrep_ordered_commit SIGNAL bwoc_reached WAIT_FOR bwoc_continue";
-INSERT INTO t1 VALUES (1);
-connection node_2;
-SET DEBUG_SYNC = "now WAIT_FOR bwoc_reached";
-SET DEBUG_SYNC = "now SIGNAL bwoc_continue";
-SET DEBUG_SYNC='RESET';
-connection node_2a;
-connection node_2;
-select * from t1;
-i
-1
-disconnect node_2a;
-connection node_2;
+connection node_1;
drop table t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_kill_debug.result b/mysql-test/suite/galera/r/galera_bf_kill_debug.result
new file mode 100644
index 00000000000..c3eae243f47
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_kill_debug.result
@@ -0,0 +1,54 @@
+connection node_2;
+connection node_1;
+connection node_2;
+CREATE TABLE t1(a int not null primary key auto_increment,b int) engine=InnoDB;
+insert into t1 values (NULL,1);
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2a;
+truncate t1;
+insert into t1 values (1,0);
+begin;
+update t1 set b=2 where a=1;
+connection node_2;
+set session wsrep_sync_wait=0;
+connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2b;
+SET GLOBAL debug_dbug = "d,sync.before_wsrep_thd_abort";
+connection node_1;
+select * from t1;
+a b
+1 0
+update t1 set b= 1 where a=1;
+connection node_2b;
+SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.before_wsrep_thd_abort_reached";
+connection node_2;
+SET DEBUG_SYNC= 'before_awake_no_mutex SIGNAL awake_reached WAIT_FOR continue_kill';
+connection node_2b;
+SET DEBUG_SYNC='now WAIT_FOR awake_reached';
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = "now SIGNAL signal.before_wsrep_thd_abort";
+SET DEBUG_SYNC = "now SIGNAL continue_kill";
+connection node_2;
+connection node_2a;
+select * from t1;
+connection node_2;
+SET DEBUG_SYNC = "RESET";
+drop table t1;
+disconnect node_2a;
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2a;
+CREATE TABLE t1 (i int primary key);
+SET DEBUG_SYNC = "before_wsrep_ordered_commit SIGNAL bwoc_reached WAIT_FOR bwoc_continue";
+INSERT INTO t1 VALUES (1);
+connection node_2;
+SET DEBUG_SYNC = "now WAIT_FOR bwoc_reached";
+SET DEBUG_SYNC = "now SIGNAL bwoc_continue";
+SET DEBUG_SYNC='RESET';
+connection node_2a;
+connection node_2;
+select * from t1;
+i
+1
+disconnect node_2a;
+connection node_1;
+drop table t1;
diff --git a/mysql-test/suite/galera/r/galera_bf_lock_wait.result b/mysql-test/suite/galera/r/galera_bf_lock_wait.result
index 71627d11a4e..723f3e37282 100644
--- a/mysql-test/suite/galera/r/galera_bf_lock_wait.result
+++ b/mysql-test/suite/galera/r/galera_bf_lock_wait.result
@@ -1,5 +1,7 @@
connection node_2;
connection node_1;
+connection node_2;
+call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
connection node_1;
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2;
diff --git a/mysql-test/suite/galera/r/galera_toi_truncate.result b/mysql-test/suite/galera/r/galera_toi_truncate.result
index 7db0f8abdb8..a02487ac347 100644
--- a/mysql-test/suite/galera/r/galera_toi_truncate.result
+++ b/mysql-test/suite/galera/r/galera_toi_truncate.result
@@ -7,12 +7,12 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
connection node_2;
SET SESSION wsrep_retry_autocommit = 0;
INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6, ten AS a7, ten AS a8;
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2a;
connection node_1;
-TRUNCATE TABLE t1;;
+TRUNCATE TABLE t1;
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-connection node_1;
-connection node_2;
SELECT COUNT(*) AS EXPECT_0 FROM t1;
EXPECT_0
0
diff --git a/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
index 3eb56d1a48d..758c34ee62e 100644
--- a/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
+++ b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
@@ -1,27 +1,30 @@
connection node_2;
connection node_1;
-connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
connection node_1;
-CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SET GLOBAL innodb_disallow_writes=ON;
-INSERT INTO t1 VALUES (1);;
+INSERT INTO t1 (f2) SELECT 'abcde ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+connection node_2;
+INSERT INTO t1 (f2) SELECT 'fghij ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SELECT COUNT(*) AS EXPECT_10000 FROM t1;
+EXPECT_10000
+10000
connection node_1a;
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
-EXPECT_0
-0
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
-EXPECT_0
-0
SET GLOBAL innodb_disallow_writes=OFF;
connection node_1;
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
-EXPECT_1
-1
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
+EXPECT_20000
+20000
+connection node_2;
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
+EXPECT_20000
+20000
+connection node_1;
connection node_2;
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
-EXPECT_1
-1
DROP TABLE t1;
+DROP TABLE ten;
disconnect node_1a;
diff --git a/mysql-test/suite/galera/r/galera_var_notify_cmd.result b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
index 823407fbba7..432d6c0adbd 100644
--- a/mysql-test/suite/galera/r/galera_var_notify_cmd.result
+++ b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
@@ -1,3 +1,5 @@
+connection node_2;
+connection node_1;
connection node_1;
SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
EXPECT_2
diff --git a/mysql-test/suite/galera/r/mdev_21718.result b/mysql-test/suite/galera/r/mdev_21718.result
new file mode 100644
index 00000000000..ce938614854
--- /dev/null
+++ b/mysql-test/suite/galera/r/mdev_21718.result
@@ -0,0 +1,16 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+connection node_1;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL reached WAIT_FOR continue";
+COMMIT;
+connection node_1_ctrl;
+SET DEBUG_SYNC = "now WAIT_FOR reached";
+connection node_2;
+INSERT INTO t1 VALUES (1);
+connection node_1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
index 671fd1688c9..c0b2da5f349 100644
--- a/mysql-test/suite/galera/suite.pm
+++ b/mysql-test/suite/galera/suite.pm
@@ -64,6 +64,7 @@ push @::global_suppressions,
qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
qr|WSREP: Trying to continue unpaused monitor|,
+ qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|,
);
sub skip_combinations {
diff --git a/mysql-test/suite/galera/t/MDEV-22458.test b/mysql-test/suite/galera/t/MDEV-22458.test
new file mode 100644
index 00000000000..8f9ba1bb107
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-22458.test
@@ -0,0 +1,21 @@
+# MDEV-22458
+#
+# When running SHOW command, thread lock `LOCK_thd_data` should not be taken.
+# Lock will be taken only when we are killing thread
+#
+
+--source include/galera_cluster.inc
+CREATE TABLE t1 (a INT);
+
+--connect (con1,localhost,root,,test)
+--let $con1 = `SELECT CONNECTION_ID()`
+
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+
+--error ER_TARGET_NOT_EXPLAINABLE
+EVALP SHOW EXPLAIN FOR $con1;
+
+--connection con1
+INSERT INTO t1 VALUES (5),(6),(7),(8);
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test
index a547823ced0..2435a9e2c2e 100644
--- a/mysql-test/suite/galera/t/MW-328A.test
+++ b/mysql-test/suite/galera/t/MW-328A.test
@@ -16,7 +16,11 @@
--source include/force_restart.inc
--source suite/galera/t/MW-328-header.inc
+--connection node_1
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
+
--connection node_2
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
--let $count = 100
--let $successes = 0
--let $deadlocks = 0
diff --git a/mysql-test/suite/galera/t/galera_bf_kill.test b/mysql-test/suite/galera/t/galera_bf_kill.test
index 3eb3ddc32b5..c8564bc9219 100644
--- a/mysql-test/suite/galera/t/galera_bf_kill.test
+++ b/mysql-test/suite/galera/t/galera_bf_kill.test
@@ -1,7 +1,5 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
#
# Test case 1: Start a transaction on node_2a and kill it
@@ -135,56 +133,9 @@ update t1 set a =5, b=2;
--eval KILL $k_thread
--enable_query_log
-
select * from t1;
--disconnect node_2a
+--connection node_1
drop table t1;
-
-
-#
-# Test case 7:
-# run a transaction in node 2, and set a sync point to pause the transaction
-# in commit phase.
-# Through another connection to node 2, kill the committing transaction by
-# KILL QUERY command
-#
-
---connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
---connection node_2a
---let $connection_id = `SELECT CONNECTION_ID()`
-
-CREATE TABLE t1 (i int primary key);
-
-# Set up sync point
-SET DEBUG_SYNC = "before_wsrep_ordered_commit SIGNAL bwoc_reached WAIT_FOR bwoc_continue";
-
-# Send insert which will block in the sync point above
---send INSERT INTO t1 VALUES (1)
-
---connection node_2
-SET DEBUG_SYNC = "now WAIT_FOR bwoc_reached";
-
---disable_query_log
---disable_result_log
-# victim has passed the point of no return, kill is not possible anymore
---eval KILL QUERY $connection_id
---enable_result_log
---enable_query_log
-
-SET DEBUG_SYNC = "now SIGNAL bwoc_continue";
-SET DEBUG_SYNC='RESET';
---connection node_2a
---error 0,1213
---reap
-
---connection node_2
-# victim was able to complete the INSERT
-select * from t1;
-
---disconnect node_2a
-
---connection node_2
-drop table t1;
-
diff --git a/mysql-test/suite/galera/t/galera_bf_kill_debug.cnf b/mysql-test/suite/galera/t/galera_bf_kill_debug.cnf
new file mode 100644
index 00000000000..e68f891792c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_kill_debug.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep-debug=SERVER
+
+[mysqld.2]
+wsrep-debug=SERVER
diff --git a/mysql-test/suite/galera/t/galera_bf_kill_debug.test b/mysql-test/suite/galera/t/galera_bf_kill_debug.test
new file mode 100644
index 00000000000..b687a5a6a67
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_kill_debug.test
@@ -0,0 +1,140 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+#
+# Test case 7:
+# 1. Start a transaction on node_2,
+# and leave it pending while holding a row locked
+# 2. set sync point pause applier
+# 3. send a conflicting write on node_1, it will pause
+# at the sync point
+# 4. though another connection to node_2, kill the local
+# transaction
+#
+
+--connection node_2
+CREATE TABLE t1(a int not null primary key auto_increment,b int) engine=InnoDB;
+insert into t1 values (NULL,1);
+
+#
+# connection node_2a runs a local transaction, that is victim of BF abort
+# and victim of KILL command by connection node_2
+#
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+truncate t1;
+insert into t1 values (1,0);
+
+# start a transaction that will conflict with later applier
+begin;
+update t1 set b=2 where a=1;
+
+--connection node_2
+set session wsrep_sync_wait=0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'root' AND COMMAND = 'Sleep' LIMIT 1
+--source include/wait_condition.inc
+
+--let $k_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'root' AND COMMAND = 'Sleep' LIMIT 1`
+
+# connection node_2b is for controlling debug syn points
+# first set a sync point for applier, to pause during BF aborting
+# and before THD::awake would be called
+#
+--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2b
+SET GLOBAL debug_dbug = "d,sync.before_wsrep_thd_abort";
+
+#
+# replicate an update, which will BF abort the victim node_2a
+# however, while applier in node 2 is handling the abort,
+# it will pause in sync point set by node_2b
+#
+--connection node_1
+select * from t1;
+update t1 set b= 1 where a=1;
+
+#
+# wait until the applying of above update has reached the sync point
+# in node 2
+#
+--connection node_2b
+SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.before_wsrep_thd_abort_reached";
+
+--connection node_2
+#
+# pause KILL execution before awake
+#
+SET DEBUG_SYNC= 'before_awake_no_mutex SIGNAL awake_reached WAIT_FOR continue_kill';
+--disable_query_log
+--send_eval KILL $k_thread
+--enable_query_log
+
+
+--connection node_2b
+SET DEBUG_SYNC='now WAIT_FOR awake_reached';
+
+# release applier and KILL operator
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = "now SIGNAL signal.before_wsrep_thd_abort";
+SET DEBUG_SYNC = "now SIGNAL continue_kill";
+
+--connection node_2
+--reap
+
+--connection node_2a
+--error 0,1213
+select * from t1;
+
+--connection node_2
+SET DEBUG_SYNC = "RESET";
+
+drop table t1;
+
+--disconnect node_2a
+#
+# Test case 7:
+# run a transaction in node 2, and set a sync point to pause the transaction
+# in commit phase.
+# Through another connection to node 2, kill the committing transaction by
+# KILL QUERY command
+#
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--let $connection_id = `SELECT CONNECTION_ID()`
+
+CREATE TABLE t1 (i int primary key);
+
+# Set up sync point
+SET DEBUG_SYNC = "before_wsrep_ordered_commit SIGNAL bwoc_reached WAIT_FOR bwoc_continue";
+
+# Send insert which will block in the sync point above
+--send INSERT INTO t1 VALUES (1)
+
+--connection node_2
+SET DEBUG_SYNC = "now WAIT_FOR bwoc_reached";
+
+--disable_query_log
+--disable_result_log
+# victim has passed the point of no return, kill is not possible anymore
+--eval KILL QUERY $connection_id
+--enable_result_log
+--enable_query_log
+
+SET DEBUG_SYNC = "now SIGNAL bwoc_continue";
+SET DEBUG_SYNC='RESET';
+--connection node_2a
+--error 0,1213
+--reap
+
+--connection node_2
+# victim was able to complete the INSERT
+select * from t1;
+
+--disconnect node_2a
+
+--connection node_1
+drop table t1;
+
diff --git a/mysql-test/suite/galera/t/galera_bf_lock_wait.test b/mysql-test/suite/galera/t/galera_bf_lock_wait.test
index 97d3b8e0710..a78a94eb1db 100644
--- a/mysql-test/suite/galera/t/galera_bf_lock_wait.test
+++ b/mysql-test/suite/galera/t/galera_bf_lock_wait.test
@@ -2,8 +2,10 @@
--source include/have_innodb.inc
--source include/big_test.inc
---connection node_1
+--connection node_2
+call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
+--connection node_1
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2;
diff --git a/mysql-test/suite/galera/t/galera_toi_truncate.test b/mysql-test/suite/galera/t/galera_toi_truncate.test
index 30e0e802816..5b23a8c3f3e 100644
--- a/mysql-test/suite/galera/t/galera_toi_truncate.test
+++ b/mysql-test/suite/galera/t/galera_toi_truncate.test
@@ -25,17 +25,18 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 0;
--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6, ten AS a7, ten AS a8
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Sending data%' AND INFO LIKE 'INSERT INTO t1 (f1)%';
+--source include/wait_condition.inc
+
--connection node_1
---send TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
--connection node_2
--error ER_LOCK_DEADLOCK
--reap
---connection node_1
---reap
-
---connection node_2
SELECT COUNT(*) AS EXPECT_0 FROM t1;
--connection node_1
diff --git a/mysql-test/suite/galera/t/galera_var_cluster_conf_id.test b/mysql-test/suite/galera/t/galera_var_cluster_conf_id.test
index dd4a630035d..668ace297a8 100644
--- a/mysql-test/suite/galera/t/galera_var_cluster_conf_id.test
+++ b/mysql-test/suite/galera/t/galera_var_cluster_conf_id.test
@@ -1,9 +1,9 @@
--source include/galera_cluster.inc
--connection node_1
---replace_regex /18446744073709551/ERROR/ /[0-9+]/#/
+--replace_regex /18446744073709551/ERROR/ /[0-9]+/#/
show status like 'wsrep_cluster_conf_id';
--connection node_2
---replace_regex /18446744073709551/ERROR/ /[0-9+]/#/
+--replace_regex /18446744073709551/ERROR/ /[0-9]+/#/
show status like 'wsrep_cluster_conf_id';
diff --git a/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
index 37469d8a5fb..10f3815e135 100644
--- a/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
+++ b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
@@ -11,40 +11,62 @@
#
--source include/galera_cluster.inc
+--source include/have_innodb.inc
--source include/have_log_bin.inc
+--let $datadir= `SELECT @@datadir`
+
+
# Open a separate connection to be used to run SHOW PROCESSLIST
---connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
--connection node_1a
SET SESSION wsrep_sync_wait = 0;
--connection node_1
-CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
SET GLOBAL innodb_disallow_writes=ON;
---send INSERT INTO t1 VALUES (1);
+--exec find $datadir -type f-exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_before
+
+#
+# This insert has no effect before innodb_disallow_writes is OFF
+#
+--send INSERT INTO t1 (f2) SELECT 'abcde ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_2
+INSERT INTO t1 (f2) SELECT 'fghij ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SELECT COUNT(*) AS EXPECT_10000 FROM t1;
--connection node_1a
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
---source include/wait_condition.inc
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
-let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'INSERT INTO t1 VALUES (1)';
---source include/wait_condition.inc
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
+--sleep 5
+
+--exec find $datadir -type f-exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_after
SET GLOBAL innodb_disallow_writes=OFF;
--connection node_1
--reap
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
--connection node_2
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
---source include/wait_condition.inc
---let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
--source include/wait_condition.inc
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
+
+--connection node_1
+--diff_files $MYSQLTEST_VARDIR/tmp/innodb_before $MYSQLTEST_VARDIR/tmp/innodb_after
+
+--connection node_2
DROP TABLE t1;
+DROP TABLE ten;
--disconnect node_1a
diff --git a/mysql-test/suite/galera/t/mdev_21718.cnf b/mysql-test/suite/galera/t/mdev_21718.cnf
new file mode 100644
index 00000000000..9e066597a13
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_21718.cnf
@@ -0,0 +1,4 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+thread-handling=pool-of-threads
diff --git a/mysql-test/suite/galera/t/mdev_21718.test b/mysql-test/suite/galera/t/mdev_21718.test
new file mode 100644
index 00000000000..3fbc4e773d5
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_21718.test
@@ -0,0 +1,35 @@
+#
+# MDEV-21718 Reproduce a case where BF abort after
+# client session acquires the ownership but before calls
+# before_command() causes an assertion in wsrep-lib.
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+--let $galera_connection_name = node_1_ctrl
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL reached WAIT_FOR continue";
+--send COMMIT
+
+--connection node_1_ctrl
+SET DEBUG_SYNC = "now WAIT_FOR reached";
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+# BF abort wakes up node_1 from sync wait.
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+DROP TABLE t1;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
index b808db6a50a..da02d4a9020 100644
--- a/mysql-test/suite/galera_3nodes/suite.pm
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -39,6 +39,13 @@ push @::global_suppressions,
qr(WSREP: Action message in non-primary configuration from member [0-9]*),
qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.),
+ qr|Query apply failed:*|,
+ qr(WSREP: Ignoring error*),
+ qr(WSREP: Failed to remove page file .*),
+ qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
+ qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
+ qr|WSREP: Trying to continue unpaused monitor|,
+ qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|,
);
bless { };
diff --git a/mysql-test/suite/galera_3nodes/t/GCF-354.test b/mysql-test/suite/galera_3nodes/t/GCF-354.test
index f48d9fbc72a..c428aee7732 100644
--- a/mysql-test/suite/galera_3nodes/t/GCF-354.test
+++ b/mysql-test/suite/galera_3nodes/t/GCF-354.test
@@ -9,6 +9,13 @@ DROP SCHEMA test;
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--source ../galera/include/auto_increment_offset_save.inc
+
SET wsrep_on=OFF;
CREATE TABLE test.t1 (f1 INTEGER);
#
@@ -90,3 +97,5 @@ CALL mtr.add_suppression("Query apply failed");
CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on .*");
CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown");
+--source ../galera/include/auto_increment_offset_restore.inc
+
diff --git a/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.test b/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.test
index 4ce485308a3..7add9f48cfc 100644
--- a/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.test
+++ b/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.test
@@ -5,6 +5,9 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source ../galera/include/galera_have_debug_sync.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm
index cc13421d66d..a9665b5252c 100644
--- a/mysql-test/suite/galera_sr/suite.pm
+++ b/mysql-test/suite/galera_sr/suite.pm
@@ -62,6 +62,9 @@ push @::global_suppressions,
qr(WSREP: Ignoring error*),
qr(WSREP: Failed to remove page file .*),
qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
+ qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
+ qr|WSREP: Trying to continue unpaused monitor|,
+ qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|,
);
bless { };
diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result
index c750187e512..71c8ab4b190 100644
--- a/mysql-test/suite/gcol/r/gcol_bugfixes.result
+++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result
@@ -604,3 +604,69 @@ test gcol_t1 sidea NEVER NULL
test gcol_t1 sideb NEVER NULL
test gcol_t1 sidec VIRTUAL GENERATED ALWAYS sqrt(`sidea` * `sidea` + `sideb` * `sideb`)
DROP TABLE gcol_t1;
+#
+# MDEV-16039 Crash when selecting virtual columns
+# generated using functions with DAYNAME()
+#
+CREATE TABLE t1 (
+suppliersenttoday INT NOT NULL,
+suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+SELECT * FROM t1;
+suppliersenttoday suppliercaptoday
+0 Wednesday
+0 Wednesday
+PREPARE STMT FROM 'INSERT INTO t1 (suppliersenttoday) VALUES (1)';
+CREATE OR REPLACE TABLE t1 (
+suppliersenttoday INT NOT NULL,
+suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+EXECUTE STMT;
+EXECUTE STMT;
+SELECT * FROM t1;
+suppliersenttoday suppliercaptoday
+1 Wednesday
+1 Wednesday
+DROP TABLE t1;
+# (duplicate) MDEV-20380 Server crash during update
+CREATE TABLE gafld (
+nuigafld INTEGER NOT NULL,
+ucrgafld VARCHAR(30) COLLATE UTF8_BIN NOT NULL
+DEFAULT SUBSTRING_INDEX(USER(),'@',1)
+);
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gafld ALL NULL NULL NULL NULL 1 Using where
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gafld ALL NULL NULL NULL NULL 1 Using where
+DROP TABLE gafld;
+# (duplicate) MDEV-17653 replace into generated columns is unstable
+# Some columns are snipped from the MDEV test
+CREATE TABLE t (
+c0 TIMESTAMP NOT NULL DEFAULT current_timestamp()
+ON UPDATE current_timestamp(),
+c1 DECIMAL(27,25) GENERATED ALWAYS AS (DAYOFMONTH('2020-02-05')),
+c4 TIME NOT NULL,
+c8 SMALLINT(6) GENERATED ALWAYS AS
+(CONCAT_WS(CONVERT(C1 USING CP932),
+'900') <> (c4 = 1)),
+PRIMARY KEY (c4)
+) DEFAULT CHARSET=latin1;
+REPLACE INTO t SET c0 = '2018-06-03 10:31:43', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:44', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:45', c4 = '02:58:55';
+DROP TABLE t;
+# (duplicate) MDEV-17986 crash when I insert on a table
+CREATE OR REPLACE TABLE t2 (
+number BIGINT(20) NOT NULL,
+lrn BIGINT(20) NOT NULL DEFAULT 0,
+source VARCHAR(15) NOT NULL
+DEFAULT (REVERSE(SUBSTRING_INDEX(REVERSE(user()), '@', 1))),
+PRIMARY KEY (number)
+);
+REPLACE t2(number) VALUES('1');
+REPLACE t2(number) VALUES('1');
+DROP TABLE t2;
diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test
index 5563347a02a..033c430853d 100644
--- a/mysql-test/suite/gcol/t/gcol_bugfixes.test
+++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test
@@ -564,3 +564,73 @@ SELECT table_schema,table_name,column_name,extra,is_generated,generation_express
FROM information_schema.columns WHERE table_name='gcol_t1';
DROP TABLE gcol_t1;
+
+--echo #
+--echo # MDEV-16039 Crash when selecting virtual columns
+--echo # generated using functions with DAYNAME()
+--echo #
+
+CREATE TABLE t1 (
+ suppliersenttoday INT NOT NULL,
+ suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+SELECT * FROM t1;
+
+PREPARE STMT FROM 'INSERT INTO t1 (suppliersenttoday) VALUES (1)';
+
+CREATE OR REPLACE TABLE t1 (
+ suppliersenttoday INT NOT NULL,
+ suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+
+EXECUTE STMT;
+EXECUTE STMT;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+--echo # (duplicate) MDEV-20380 Server crash during update
+CREATE TABLE gafld (
+ nuigafld INTEGER NOT NULL,
+ ucrgafld VARCHAR(30) COLLATE UTF8_BIN NOT NULL
+ DEFAULT SUBSTRING_INDEX(USER(),'@',1)
+);
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+DROP TABLE gafld;
+
+--echo # (duplicate) MDEV-17653 replace into generated columns is unstable
+--echo # Some columns are snipped from the MDEV test
+CREATE TABLE t (
+ c0 TIMESTAMP NOT NULL DEFAULT current_timestamp()
+ ON UPDATE current_timestamp(),
+ c1 DECIMAL(27,25) GENERATED ALWAYS AS (DAYOFMONTH('2020-02-05')),
+ c4 TIME NOT NULL,
+ c8 SMALLINT(6) GENERATED ALWAYS AS
+ (CONCAT_WS(CONVERT(C1 USING CP932),
+ '900') <> (c4 = 1)),
+ PRIMARY KEY (c4)
+) DEFAULT CHARSET=latin1;
+
+REPLACE INTO t SET c0 = '2018-06-03 10:31:43', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:44', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:45', c4 = '02:58:55';
+
+DROP TABLE t;
+
+--echo # (duplicate) MDEV-17986 crash when I insert on a table
+CREATE OR REPLACE TABLE t2 (
+ number BIGINT(20) NOT NULL,
+ lrn BIGINT(20) NOT NULL DEFAULT 0,
+ source VARCHAR(15) NOT NULL
+ DEFAULT (REVERSE(SUBSTRING_INDEX(REVERSE(user()), '@', 1))),
+ PRIMARY KEY (number)
+);
+
+REPLACE t2(number) VALUES('1');
+REPLACE t2(number) VALUES('1');
+
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def
index fd5a8ab6d39..35c941f8af7 100644
--- a/mysql-test/suite/innodb/disabled.def
+++ b/mysql-test/suite/innodb/disabled.def
@@ -11,5 +11,3 @@
##############################################################################
create-index-debug : MDEV-13680 InnoDB may crash when btr_page_alloc() fails
-innodb_force_recovery_rollback : MDEV-22889 InnoDB occasionally breaks ACID
-innodb_scrub : MDEV-8139/MDEV-22970 Fix scrubbing
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/default_row_format_alter,compact.rdiff b/mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff
new file mode 100644
index 00000000000..09095c90e29
--- /dev/null
+++ b/mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff
@@ -0,0 +1,10 @@
+--- default_row_format_alter.result
++++ default_row_format_alter,compact.reject
+@@ -91,6 +91,6 @@
+ ALTER TABLE t1 ADD b INT;
+ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+ ROW_FORMAT
+-Dynamic
++Compact
+ DROP TABLE t1;
+ SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff b/mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff
new file mode 100644
index 00000000000..972ee9bdac8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff
@@ -0,0 +1,10 @@
+--- default_row_format_alter.result
++++ default_row_format_alter,compact.reject
+@@ -91,6 +91,6 @@
+ ALTER TABLE t1 ADD b INT;
+ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+ ROW_FORMAT
+-Dynamic
++Redundant
+ DROP TABLE t1;
+ SET GLOBAL innodb_default_row_format = @row_format;
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 1f349e6e2f6..42d006a2dd3 100644
--- a/mysql-test/suite/innodb/r/default_row_format_alter.result
+++ b/mysql-test/suite/innodb/r/default_row_format_alter.result
@@ -82,4 +82,15 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_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;
+#
+# MDEV-23295 Assertion fields[i].same(instant.fields[i]) failed
+#
+SET GLOBAL innodb_default_row_format = @row_format;
+CREATE TABLE t1 (a char(8)) ENGINE=InnoDB DEFAULT CHARSET utf8;
+SET GLOBAL innodb_default_row_format= COMPACT;
+ALTER TABLE t1 ADD b INT;
+SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+ROW_FORMAT
+Dynamic
+DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 24cf44c90e0..4bd1a09dd73 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -1069,3 +1069,20 @@ SELECT * FROM t1;
a b
10 10:20:30
DROP TABLE t1;
+#
+# MDEV-18042 Server crashes in mysql_alter_table upon adding a non-null
+# date column under NO_ZERO_DATE with ALGORITHM=INPLACE
+#
+SET @OLD_SQL_MODE= @@SQL_MODE;
+SET @@SQL_MODE= 'NO_ZERO_DATE';
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=MyISAM;
+ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB;
+ALTER TABLE t1 ADD d DATETIME NOT NULL CHECK (f <= 0), ALGORITHM=COPY;
+ERROR 42S22: Unknown column 'f' in 'CHECK'
+CREATE OR REPLACE TABLE t1 (a int) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b DATETIME NOT NULL, LOCK=NONE;
+# Cleanup
+SET @@SQL_MODE= @OLD_SQL_MODE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_debug.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_debug.result
index f1faeb1d554..0dea25f6bf1 100644
--- a/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_debug.result
+++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_debug.result
@@ -1,5 +1,4 @@
set global innodb_file_per_table=ON;
-set global innodb_thread_concurrency=20;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connect con3,localhost,root,,;
diff --git a/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result b/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result
deleted file mode 100644
index f43cb9da239..00000000000
--- a/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result
+++ /dev/null
@@ -1,26 +0,0 @@
-set global innodb_commit_concurrency=0;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0'
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-1
-set global innodb_commit_concurrency=1;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-1
-set global innodb_commit_concurrency=42;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-42
-set global innodb_commit_concurrency=DEFAULT;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-1
-set global innodb_commit_concurrency=0;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0'
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-1
-set global innodb_commit_concurrency=1;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-1
diff --git a/mysql-test/suite/innodb/r/innodb_bug42101.result b/mysql-test/suite/innodb/r/innodb_bug42101.result
deleted file mode 100644
index 4e3367d5a54..00000000000
--- a/mysql-test/suite/innodb/r/innodb_bug42101.result
+++ /dev/null
@@ -1,22 +0,0 @@
-set global innodb_commit_concurrency=0;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-0
-set global innodb_commit_concurrency=1;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1'
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-0
-set global innodb_commit_concurrency=42;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '42'
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-0
-set global innodb_commit_concurrency=0;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-0
-set global innodb_commit_concurrency=DEFAULT;
-select @@innodb_commit_concurrency;
-@@innodb_commit_concurrency
-0
diff --git a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result
index 1f3b271941d..502f57156c3 100644
--- a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result
+++ b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result
@@ -383,7 +383,7 @@ Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
set names latin1;
show collation like 'latin1_test';
Collation Charset Id Default Compiled Sortlen
-latin1_test latin1 99 Yes 1
+latin1_test latin1 331 1
select "foo" = "foo " collate latin1_test;
"foo" = "foo " collate latin1_test
1
@@ -402,6 +402,7 @@ utf8mb4_test_ci utf8mb4 326 8
utf16_test_ci utf16 327 8
utf8mb4_test_400_ci utf8mb4 328 8
utf8mb4_test_520_nopad_ci utf8mb4 329 8
+latin1_test latin1 331 1
latin1_test2 latin1 332 1
latin1_test2_cs latin1 333 1
latin1_swedish_nopad2_ci latin1 334 1
@@ -426,7 +427,7 @@ utf32_test_ci utf32 391 8
utf8_maxuserid_ci utf8 2047 8
show collation like '%test%';
Collation Charset Id Default Compiled Sortlen
-latin1_test latin1 99 Yes 1
+latin1_test latin1 331 1
latin1_test2 latin1 332 1
latin1_test2_cs latin1 333 1
utf8_test_ci utf8 353 8
diff --git a/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result b/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result
index 81fa2448e3d..c2db4bed2f9 100644
--- a/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result
+++ b/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result
@@ -13,6 +13,6 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
# restart: --innodb-force-recovery=2
disconnect con0;
connection default;
-SELECT * FROM t0 LOCK IN SHARE MODE;
+SELECT * FROM t0 LIMIT 0 LOCK IN SHARE MODE;
a
DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 31db0622fe1..595a56a8bef 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -1797,9 +1797,6 @@ DROP TABLE t1;
set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
set global innodb_autoextend_increment=8;
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
-set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
-set global innodb_commit_concurrency=0;
-set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
ENGINE=InnoDB;
INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result
index 84c9ba2d630..d5acc872b49 100644
--- a/mysql-test/suite/innodb/r/instant_alter_bugs.result
+++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result
@@ -402,4 +402,12 @@ INSERT INTO t1 SET a=1, b=NULL;
ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
+#
+# MDEV-22651 Assertion dict_col_get_fixed_size...
+# in dict_table_t::init_instant()
+#
+CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t SET i=1;
+ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
+DROP TABLE t;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result
index cbb49819bfe..6b60c79b558 100644
--- a/mysql-test/suite/innodb/r/instant_alter_charset.result
+++ b/mysql-test/suite/innodb/r/instant_alter_charset.result
@@ -1929,3 +1929,106 @@ KEY a_idx(a(1))
INSERT INTO t VALUES (1, 'something in the air');
ALTER TABLE t MODIFY a text CHARSET utf8mb4;
DROP TABLE t;
+#
+# MDEV-22899: Assertion `field->col->is_binary() || field->prefix_len % field->col->mbmaxlen == 0' failed in dict_index_add_to_cache
+#
+CREATE TABLE t1 (
+a text CHARACTER SET utf8 DEFAULT NULL,
+KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a text CHARACTER SET utf8 DEFAULT NULL,
+b int,
+KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a char(200) CHARACTER SET utf8 DEFAULT NULL,
+KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a char(200) CHARACTER SET utf8 DEFAULT NULL,
+b int,
+KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
+KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
+b int,
+KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
+KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+CREATE TABLE t1 (
+a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
+b int,
+KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+#
+# MDEV-23245 Still getting assertion failure in file data0type.cc line 67
+#
+CREATE TABLE Foo
+(
+Bar char(2) CHARACTER SET utf8,
+KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar char(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+CREATE TABLE Foo
+(
+Bar varchar(2) CHARACTER SET utf8,
+KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar varchar(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+CREATE TABLE Foo
+(
+Bar text CHARACTER SET utf8,
+KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar text CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
+PRIMARY KEY (a(1)))
+ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`a`(1))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 MODIFY a VARCHAR(2)
+CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ('a');
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index 50b69801043..9053cbacec6 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -401,5 +401,10 @@ SET DEBUG_SYNC='now SIGNAL emptied';
connection con2;
disconnect con2;
connection default;
+ALTER TABLE t1 DROP c;
+INSERT INTO t1 VALUES (2),(3),(4);
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
DROP TABLE t1;
SET DEBUG_SYNC=RESET;
diff --git a/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff b/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff
index 596dfe43ab8..08f9afa696a 100644
--- a/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff
@@ -1,29 +1,38 @@
--- instant_alter_convert.result
+++ instant_alter_convert,utf8.result
-@@ -37,7 +37,7 @@
- test.t check status OK
+@@ -38,7 +38,7 @@
+ best.t check status OK
call check_table('t');
name mtype prtype len
-a 2 800FE 200
+a 13 2100FE 600
# CHAR enlargement
- alter table t modify a char(220), algorithm=instant;
- select count(a) from t where a = @bigval;
-@@ -51,7 +51,7 @@
- test.t check status OK
+ alter table t modify a char(220);
+ affected rows: 2
+@@ -54,7 +54,7 @@
+ best.t check status OK
call check_table('t');
name mtype prtype len
-a 2 800FE 220
+a 13 2100FE 660
+ ALTER TABLE t CHANGE COLUMN a a CHAR(230) BINARY;
+ affected rows: 2
+ info: Records: 2 Duplicates: 0 Warnings: 0
+@@ -69,7 +69,7 @@
+ best.t check status OK
+ call check_table('t');
+ name mtype prtype len
+-a 13 2F00FE 230
++a 13 5300FE 690
# Convert from VARCHAR to a bigger CHAR
- alter table t modify a varchar(200), algorithm=instant;
- ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
-@@ -72,7 +72,7 @@
- test.t check status OK
+ alter table t modify a varchar(200);
+ affected rows: 2
+@@ -92,7 +92,7 @@
+ best.t check status OK
call check_table('t');
name mtype prtype len
-a 2 800FE 255
+a 13 2100FE 765
# BINARY/VARBINARY test
create or replace table t (a varbinary(300));
- alter table t modify a binary(255), algorithm=instant;
+ insert into t values(NULL);
diff --git a/mysql-test/suite/innodb/r/instant_alter_extend.result b/mysql-test/suite/innodb/r/instant_alter_extend.result
index fb03ef9a182..33a5f57c7b6 100644
--- a/mysql-test/suite/innodb/r/instant_alter_extend.result
+++ b/mysql-test/suite/innodb/r/instant_alter_extend.result
Binary files differ
diff --git a/mysql-test/suite/innodb/r/mvcc.result b/mysql-test/suite/innodb/r/mvcc.result
index fc2d403fa63..215b2165b8c 100644
--- a/mysql-test/suite/innodb/r/mvcc.result
+++ b/mysql-test/suite/innodb/r/mvcc.result
@@ -29,4 +29,18 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+#
+# MDEV-23198 Crash in REPLACE
+#
+BEGIN NOT ATOMIC
+DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(id INT PRIMARY KEY, c',
+GROUP_CONCAT(seq SEPARATOR ' INT, c'),
+' INT NOT NULL UNIQUE) ENGINE=InnoDB')
+FROM seq_1_to_294);
+EXECUTE IMMEDIATE c;
+END;
+$$
+INSERT INTO t1 SET id=1,c294=1;
+REPLACE t1 SET id=1,c294=1;
+DROP TABLE t1;
SET GLOBAL innodb_file_per_table= @save_per_table;
diff --git a/mysql-test/suite/innodb/r/truncate_foreign.result b/mysql-test/suite/innodb/r/truncate_foreign.result
index bcf5b16aa83..fc09b74d62f 100644
--- a/mysql-test/suite/innodb/r/truncate_foreign.result
+++ b/mysql-test/suite/innodb/r/truncate_foreign.result
@@ -29,6 +29,7 @@ SET DEBUG_SYNC='foreign_constraint_check_for_update SIGNAL fk WAIT_FOR go';
DELETE FROM parent;
connection default;
SET DEBUG_SYNC='now WAIT_FOR fk';
+SET lock_wait_timeout=1;
TRUNCATE TABLE child;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC='now SIGNAL go';
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/default_row_format_alter.test b/mysql-test/suite/innodb/t/default_row_format_alter.test
index 8f7217bcf0c..6690bc5bddf 100644
--- a/mysql-test/suite/innodb/t/default_row_format_alter.test
+++ b/mysql-test/suite/innodb/t/default_row_format_alter.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/innodb_row_format.inc
SET @row_format = @@GLOBAL.innodb_default_row_format;
@@ -95,4 +96,14 @@ ALTER TABLE t1 DROP INDEX k1;
SHOW TABLE STATUS LIKE 't1';
DROP TABLE t1;
+--echo #
+--echo # MDEV-23295 Assertion fields[i].same(instant.fields[i]) failed
+--echo #
+SET GLOBAL innodb_default_row_format = @row_format;
+CREATE TABLE t1 (a char(8)) ENGINE=InnoDB DEFAULT CHARSET utf8;
+SET GLOBAL innodb_default_row_format= COMPACT;
+ALTER TABLE t1 ADD b INT;
+SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index d383b3bf55e..f72935ebc3c 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -668,6 +668,28 @@ ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-
SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-18042 Server crashes in mysql_alter_table upon adding a non-null
+--echo # date column under NO_ZERO_DATE with ALGORITHM=INPLACE
+--echo #
+
+SET @OLD_SQL_MODE= @@SQL_MODE;
+SET @@SQL_MODE= 'NO_ZERO_DATE';
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=MyISAM;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE;
+
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t1 ADD d DATETIME NOT NULL CHECK (f <= 0), ALGORITHM=COPY;
+
+CREATE OR REPLACE TABLE t1 (a int) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b DATETIME NOT NULL, LOCK=NONE;
+
+--echo # Cleanup
+SET @@SQL_MODE= @OLD_SQL_MODE;
+DROP TABLE t1;
+
#
# End of 10.2 tests
#
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 6fd2cdc74d2..dfb4da3a63d 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -24,10 +24,6 @@ call mtr.add_suppression("Cannot add field .* in table .* because after adding i
call mtr.add_suppression("\\[ERROR\\] InnoDB: in ALTER TABLE `test`.`t1`");
call mtr.add_suppression("\\[ERROR\\] InnoDB: in RENAME TABLE table `test`.`t1`");
-SET @innodb_thread_sleep_delay_orig = @@innodb_thread_sleep_delay;
-
-SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
-
--disable_warnings
SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
@@ -2503,9 +2499,6 @@ DROP TABLE bug35537;
DISCONNECT c1;
CONNECTION default;
-SET GLOBAL innodb_thread_sleep_delay = @innodb_thread_sleep_delay_orig;
-SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
-
-- enable_query_log
# Clean up after the Bug#55284/Bug#58912 test case.
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test
index 4f5ee089852..ddac64c17c9 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test
@@ -9,8 +9,6 @@
--disable_query_log
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set @old_innodb_file_per_table = @@innodb_file_per_table;
-set @old_innodb_thread_concurrency = @@innodb_thread_concurrency;
-set @old_innodb_thread_sleep_delay = @@innodb_thread_sleep_delay;
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
call mtr.add_suppression("\\[ERROR\\] InnoDB: failed to allocate memory for buffer pool chunk");
@@ -22,7 +20,6 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: failed to allocate memory for buff
let $wait_timeout = 180;
set global innodb_file_per_table=ON;
-set global innodb_thread_concurrency=20;
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
@@ -178,8 +175,6 @@ drop table t6;
--disable_query_log
set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
set global innodb_file_per_table = @old_innodb_file_per_table;
-set global innodb_thread_concurrency = @old_innodb_thread_concurrency;
-set global innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt
deleted file mode 100644
index e82f614c897..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-commit-concurrency=1
diff --git a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
deleted file mode 100644
index 3ee3f1e6a8b..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
+++ /dev/null
@@ -1,20 +0,0 @@
---source include/have_innodb.inc
-#
-# Bug#42101 Race condition in innodb_commit_concurrency
-# http://bugs.mysql.com/42101
-#
-
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_commit_concurrency=0;
-select @@innodb_commit_concurrency;
-set global innodb_commit_concurrency=1;
-select @@innodb_commit_concurrency;
-set global innodb_commit_concurrency=42;
-select @@innodb_commit_concurrency;
-set global innodb_commit_concurrency=DEFAULT;
-select @@innodb_commit_concurrency;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_commit_concurrency=0;
-select @@innodb_commit_concurrency;
-set global innodb_commit_concurrency=1;
-select @@innodb_commit_concurrency;
diff --git a/mysql-test/suite/innodb/t/innodb_bug42101.test b/mysql-test/suite/innodb/t/innodb_bug42101.test
deleted file mode 100644
index 374d3e6b5f5..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug42101.test
+++ /dev/null
@@ -1,18 +0,0 @@
---source include/have_innodb.inc
-#
-# Bug#42101 Race condition in innodb_commit_concurrency
-# http://bugs.mysql.com/42101
-#
-
-set global innodb_commit_concurrency=0;
-select @@innodb_commit_concurrency;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_commit_concurrency=1;
-select @@innodb_commit_concurrency;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_commit_concurrency=42;
-select @@innodb_commit_concurrency;
-set global innodb_commit_concurrency=0;
-select @@innodb_commit_concurrency;
-set global innodb_commit_concurrency=DEFAULT;
-select @@innodb_commit_concurrency;
diff --git a/mysql-test/suite/innodb/t/innodb_ctype_ldml.test b/mysql-test/suite/innodb/t/innodb_ctype_ldml.test
index 26af717b15a..f065c51505b 100644
--- a/mysql-test/suite/innodb/t/innodb_ctype_ldml.test
+++ b/mysql-test/suite/innodb/t/innodb_ctype_ldml.test
@@ -13,6 +13,7 @@ drop table if exists t1;
--disable_query_log
call mtr.add_suppression("Syntax error at '\\[strength tertiary\\]'");
call mtr.add_suppression("Can't reset before a primary ignorable character U\\+A48C");
+call mtr.add_suppression("Charset id.*trying to replace");
--enable_query_log
--echo In the following tests we change the order of letter "b"
diff --git a/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test b/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test
index ad234eba72e..f1d14c45aaf 100644
--- a/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test
+++ b/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test
@@ -30,5 +30,6 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
disconnect con0;
connection default;
# If the rollback was aborted, we would end up in a lock wait here.
-SELECT * FROM t0 LOCK IN SHARE MODE;
+# The LIMIT 0 works around MDEV-22889 InnoDB occasionally breaks ACID
+SELECT * FROM t0 LIMIT 0 LOCK IN SHARE MODE;
DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt
index c8a96d2fe93..513791a0a88 100644
--- a/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt
+++ b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.opt
@@ -59,9 +59,7 @@
--loose-innodb_sys_datafiles
--loose-innodb_changed_pages
--loose-innodb_tablespaces_encryption
---loose-innodb_tablespaces_scrubbing
--loose-innodb_mutexes
--loose-innodb_sys_semaphore_waits
---loose-innodb_tablespaces_scrubbing
--loose-innodb_mutexes
--loose-innodb_sys_semaphore_waits
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
index b6b4cadc654..3dd0bedbbb6 100644
--- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -420,4 +420,14 @@ ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
+--echo #
+--echo # MDEV-22651 Assertion dict_col_get_fixed_size...
+--echo # in dict_table_t::init_instant()
+--echo #
+--source include/have_innodb.inc
+CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t SET i=1;
+ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
+DROP TABLE t;
+
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/t/instant_alter_charset.test b/mysql-test/suite/innodb/t/instant_alter_charset.test
index 270db2d6462..a5ddd49830c 100644
--- a/mysql-test/suite/innodb/t/instant_alter_charset.test
+++ b/mysql-test/suite/innodb/t/instant_alter_charset.test
@@ -730,3 +730,116 @@ INSERT INTO t VALUES (1, 'something in the air');
ALTER TABLE t MODIFY a text CHARSET utf8mb4;
DROP TABLE t;
+
+
+--echo #
+--echo # MDEV-22899: Assertion `field->col->is_binary() || field->prefix_len % field->col->mbmaxlen == 0' failed in dict_index_add_to_cache
+--echo #
+
+CREATE TABLE t1 (
+ a text CHARACTER SET utf8 DEFAULT NULL,
+ KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a text CHARACTER SET utf8 DEFAULT NULL,
+ b int,
+ KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a char(200) CHARACTER SET utf8 DEFAULT NULL,
+ KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a char(200) CHARACTER SET utf8 DEFAULT NULL,
+ b int,
+ KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
+ KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
+ b int,
+ KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
+ KEY a_key (a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
+ b int,
+ KEY a_key (b, a(1))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ();
+ALTER TABLE t1 MODIFY a text DEFAULT NULL;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-23245 Still getting assertion failure in file data0type.cc line 67
+--echo #
+
+CREATE TABLE Foo
+(
+ Bar char(2) CHARACTER SET utf8,
+ KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar char(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+
+CREATE TABLE Foo
+(
+ Bar varchar(2) CHARACTER SET utf8,
+ KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar varchar(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+
+CREATE TABLE Foo
+(
+ Bar text CHARACTER SET utf8,
+ KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar text CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+
+CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
+PRIMARY KEY (a(1)))
+ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 MODIFY a VARCHAR(2)
+CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ('a');
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
index b71e52a5f80..86273bcddd5 100644
--- a/mysql-test/suite/innodb/t/instant_alter_debug.test
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -455,5 +455,8 @@ connection con2;
reap;
disconnect con2;
connection default;
+ALTER TABLE t1 DROP c;
+INSERT INTO t1 VALUES (2),(3),(4);
+CHECK TABLE t1;
DROP TABLE t1;
SET DEBUG_SYNC=RESET;
diff --git a/mysql-test/suite/innodb/t/instant_alter_extend.test b/mysql-test/suite/innodb/t/instant_alter_extend.test
index 4320d9bae05..7258ba6d238 100644
--- a/mysql-test/suite/innodb/t/instant_alter_extend.test
+++ b/mysql-test/suite/innodb/t/instant_alter_extend.test
@@ -64,6 +64,15 @@ select a, length(a) from t where a = 'z';
check table t extended;
call check_table('t');
+--enable_info
+ALTER TABLE t CHANGE COLUMN a a CHAR(230) BINARY;
+ALTER TABLE t ADD COLUMN b INT FIRST;
+ALTER TABLE t DROP b;
+--disable_info
+
+check table t extended;
+call check_table('t');
+
--echo # Convert from VARCHAR to a bigger CHAR
--enable_info
alter table t modify a varchar(200);
diff --git a/mysql-test/suite/innodb/t/mvcc.test b/mysql-test/suite/innodb/t/mvcc.test
index bf76a5de798..7c37718c28a 100644
--- a/mysql-test/suite/innodb/t/mvcc.test
+++ b/mysql-test/suite/innodb/t/mvcc.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
SET @save_per_table= @@GLOBAL.innodb_file_per_table;
SET GLOBAL innodb_file_per_table= 1;
@@ -49,4 +50,23 @@ SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-23198 Crash in REPLACE
+--echo #
+
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(id INT PRIMARY KEY, c',
+ GROUP_CONCAT(seq SEPARATOR ' INT, c'),
+ ' INT NOT NULL UNIQUE) ENGINE=InnoDB')
+ FROM seq_1_to_294);
+ EXECUTE IMMEDIATE c;
+END;
+$$
+DELIMITER ;$$
+
+INSERT INTO t1 SET id=1,c294=1;
+REPLACE t1 SET id=1,c294=1;
+DROP TABLE t1;
+
SET GLOBAL innodb_file_per_table= @save_per_table;
diff --git a/mysql-test/suite/innodb/t/truncate_foreign.test b/mysql-test/suite/innodb/t/truncate_foreign.test
index 2c00c0641e9..d9d647e69f0 100644
--- a/mysql-test/suite/innodb/t/truncate_foreign.test
+++ b/mysql-test/suite/innodb/t/truncate_foreign.test
@@ -37,6 +37,7 @@ send DELETE FROM parent;
connection default;
SET DEBUG_SYNC='now WAIT_FOR fk';
+SET lock_wait_timeout=1;
--error ER_LOCK_WAIT_TIMEOUT
TRUNCATE TABLE child;
SET DEBUG_SYNC='now SIGNAL go';
diff --git a/mysql-test/suite/maria/maria-connect.result b/mysql-test/suite/maria/maria-connect.result
index 76e30d7d136..5c8b5524d69 100644
--- a/mysql-test/suite/maria/maria-connect.result
+++ b/mysql-test/suite/maria/maria-connect.result
@@ -11,7 +11,7 @@ ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show warnings;
Level Code Message
Error 1062 Duplicate entry '2' for key 'PRIMARY'
-Note 4173 Engine Aria does not support rollback. Changes where commited during rollback call
+Note 4173 Engine Aria does not support rollback. Changes where committed during rollback call
Warning 1196 Some non-transactional changed tables couldn't be rolled back
select * from t1;
a
diff --git a/mysql-test/suite/maria/max_length.test b/mysql-test/suite/maria/max_length.test
index 4ebe48b4979..a5bfb0b8fd6 100644
--- a/mysql-test/suite/maria/max_length.test
+++ b/mysql-test/suite/maria/max_length.test
@@ -4,6 +4,8 @@
--source include/have_maria.inc
--source include/have_sequence.inc
--source include/big_test.inc
+# This test is too slow for valgrind
+--source include/not_valgrind.inc
drop table if exists t1,t2;
diff --git a/mysql-test/suite/mariabackup/huge_lsn.result b/mysql-test/suite/mariabackup/huge_lsn.result
index e109fba6748..b24c1af964c 100644
--- a/mysql-test/suite/mariabackup/huge_lsn.result
+++ b/mysql-test/suite/mariabackup/huge_lsn.result
@@ -17,3 +17,7 @@ SELECT * FROM t;
i
1
DROP TABLE t;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
diff --git a/mysql-test/suite/mariabackup/huge_lsn.test b/mysql-test/suite/mariabackup/huge_lsn.test
index 27d40f577ad..0af66b761ec 100644
--- a/mysql-test/suite/mariabackup/huge_lsn.test
+++ b/mysql-test/suite/mariabackup/huge_lsn.test
@@ -8,6 +8,10 @@
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let MYSQLD_DATADIR=`select @@datadir`;
+let $targetdir_old=$MYSQLTEST_VARDIR/tmp/backup_1;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir_old;
+--enable_result_log
--source include/shutdown_mysqld.inc
perl;
@@ -56,3 +60,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
SELECT * FROM t;
DROP TABLE t;
rmdir $targetdir;
+let $targetdir= $targetdir_old;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+--source include/restart_and_restore.inc
+rmdir $targetdir_old;
diff --git a/mysql-test/suite/parts/r/alter_table.result b/mysql-test/suite/parts/r/alter_table.result
index fc508663204..94100b83118 100644
--- a/mysql-test/suite/parts/r/alter_table.result
+++ b/mysql-test/suite/parts/r/alter_table.result
@@ -21,3 +21,10 @@ set @@session.alter_algorithm= @save_alter_algorithm;
CREATE TABLE t1 (a INT) PARTITION BY RANGE(a) SUBPARTITION BY HASH(a) (PARTITION p VALUES LESS THAN (5) (SUBPARTITION sp, SUBPARTITION sp1), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION sp2, SUBPARTITION sp3));
ALTER TABLE t1 DROP PARTITION p;
DROP TABLE if exists t1;
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 as SELECT * FROM t1;
+CREATE TABLE t2 (i INT);
+ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
+ERROR 42000: Can't open table
+DROP VIEW v1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/parts/t/alter_table.test b/mysql-test/suite/parts/t/alter_table.test
index 6c4d83f9eed..53b61806acb 100644
--- a/mysql-test/suite/parts/t/alter_table.test
+++ b/mysql-test/suite/parts/t/alter_table.test
@@ -27,3 +27,14 @@ set @@session.alter_algorithm= @save_alter_algorithm;
CREATE TABLE t1 (a INT) PARTITION BY RANGE(a) SUBPARTITION BY HASH(a) (PARTITION p VALUES LESS THAN (5) (SUBPARTITION sp, SUBPARTITION sp1), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION sp2, SUBPARTITION sp3));
ALTER TABLE t1 DROP PARTITION p;
DROP TABLE if exists t1;
+
+#
+# MDEV-23357 Server crashes in Sql_cmd_alter_table_exchange_partition::exchange_partition
+#
+CREATE TABLE t1 (i INT);
+CREATE VIEW v1 as SELECT * FROM t1;
+CREATE TABLE t2 (i INT);
+--error ER_CHECK_NO_SUCH_TABLE
+ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
+DROP VIEW v1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result
index e3137d634a6..ba655d3c329 100644
--- a/mysql-test/suite/perfschema/r/nesting.result
+++ b/mysql-test/suite/perfschema/r/nesting.result
@@ -114,152 +114,161 @@ 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 20 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL
-1 4 stage/sql/starting (stage) STATEMENT 0
+0 21 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL
+1 5 stage/sql/starting (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
-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 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/starting (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/starting (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;
+4 4 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1
+5 5 wait/io/file/sql/query_log write STAGE 1
+6 6 stage/sql/checking permissions (stage) STATEMENT 0
+7 7 stage/sql/Opening tables (stage) STATEMENT 0
+8 8 stage/sql/After opening tables (stage) STATEMENT 0
+9 9 stage/sql/init (stage) STATEMENT 0
+10 10 stage/sql/Optimizing (stage) STATEMENT 0
+11 11 stage/sql/Executing (stage) STATEMENT 0
+12 12 stage/sql/End of update loop (stage) STATEMENT 0
+13 13 stage/sql/Query end (stage) STATEMENT 0
+14 14 stage/sql/Commit (stage) STATEMENT 0
+15 15 stage/sql/closing tables (stage) STATEMENT 0
+16 16 stage/sql/Starting cleanup (stage) STATEMENT 0
+17 17 stage/sql/Freeing items (stage) STATEMENT 0
+18 18 wait/io/socket/sql/client_connection send STATEMENT 0
+19 19 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 0
+20 21 stage/sql/Reset for next command (stage) STATEMENT 0
+21 21 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 20
+22 22 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 0
+23 23 idle idle NULL NULL
+24 45 statement/sql/select select "This is simple statement one" as payload NULL NULL
+25 29 stage/sql/starting (stage) STATEMENT 24
+26 26 wait/io/socket/sql/client_connection recv STAGE 25
+27 27 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 25
+28 28 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 25
+29 29 wait/io/file/sql/query_log write STAGE 25
+30 30 stage/sql/checking permissions (stage) STATEMENT 24
+31 31 stage/sql/Opening tables (stage) STATEMENT 24
+32 32 stage/sql/After opening tables (stage) STATEMENT 24
+33 33 stage/sql/init (stage) STATEMENT 24
+34 34 stage/sql/Optimizing (stage) STATEMENT 24
+35 35 stage/sql/Executing (stage) STATEMENT 24
+36 36 stage/sql/End of update loop (stage) STATEMENT 24
+37 37 stage/sql/Query end (stage) STATEMENT 24
+38 38 stage/sql/Commit (stage) STATEMENT 24
+39 39 stage/sql/closing tables (stage) STATEMENT 24
+40 40 stage/sql/Starting cleanup (stage) STATEMENT 24
+41 41 stage/sql/Freeing items (stage) STATEMENT 24
+42 42 wait/io/socket/sql/client_connection send STATEMENT 24
+43 43 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 24
+44 45 stage/sql/Reset for next command (stage) STATEMENT 24
+45 45 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 44
+46 46 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 24
+47 47 idle idle NULL NULL
+48 69 statement/sql/select select "This is simple statement two" as payload NULL NULL
+49 53 stage/sql/starting (stage) STATEMENT 48
+50 50 wait/io/socket/sql/client_connection recv STAGE 49
+51 51 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 49
+52 52 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 49
+53 53 wait/io/file/sql/query_log write STAGE 49
+54 54 stage/sql/checking permissions (stage) STATEMENT 48
+55 55 stage/sql/Opening tables (stage) STATEMENT 48
+56 56 stage/sql/After opening tables (stage) STATEMENT 48
+57 57 stage/sql/init (stage) STATEMENT 48
+58 58 stage/sql/Optimizing (stage) STATEMENT 48
+59 59 stage/sql/Executing (stage) STATEMENT 48
+60 60 stage/sql/End of update loop (stage) STATEMENT 48
+61 61 stage/sql/Query end (stage) STATEMENT 48
+62 62 stage/sql/Commit (stage) STATEMENT 48
+63 63 stage/sql/closing tables (stage) STATEMENT 48
+64 64 stage/sql/Starting cleanup (stage) STATEMENT 48
+65 65 stage/sql/Freeing items (stage) STATEMENT 48
+66 66 wait/io/socket/sql/client_connection send STATEMENT 48
+67 67 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 48
+68 69 stage/sql/Reset for next command (stage) STATEMENT 48
+69 69 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 68
+70 70 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 48
+71 71 idle idle NULL NULL
+72 92 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
-67 71 stage/sql/starting (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;
+73 78 stage/sql/starting (stage) STATEMENT 72
+74 74 wait/io/socket/sql/client_connection recv STAGE 73
+75 75 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73
+76 76 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73
+77 77 wait/io/file/sql/query_log write STAGE 73
+78 78 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73
+79 79 stage/sql/checking permissions (stage) STATEMENT 72
+80 80 stage/sql/Opening tables (stage) STATEMENT 72
+81 81 stage/sql/After opening tables (stage) STATEMENT 72
+82 82 stage/sql/init (stage) STATEMENT 72
+83 83 stage/sql/Optimizing (stage) STATEMENT 72
+84 84 stage/sql/Executing (stage) STATEMENT 72
+85 85 stage/sql/End of update loop (stage) STATEMENT 72
+86 86 stage/sql/Query end (stage) STATEMENT 72
+87 87 stage/sql/Commit (stage) STATEMENT 72
+88 88 stage/sql/closing tables (stage) STATEMENT 72
+89 89 stage/sql/Starting cleanup (stage) STATEMENT 72
+90 92 stage/sql/Freeing items (stage) STATEMENT 72
+91 91 wait/io/socket/sql/client_connection send STAGE 90
+92 92 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 90
+93 110 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
-87 89 stage/sql/starting (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/starting (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/starting (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
+94 96 stage/sql/starting (stage) STATEMENT 93
+95 95 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 94
+96 96 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 94
+97 97 stage/sql/checking permissions (stage) STATEMENT 93
+98 98 stage/sql/Opening tables (stage) STATEMENT 93
+99 99 stage/sql/After opening tables (stage) STATEMENT 93
+100 100 stage/sql/init (stage) STATEMENT 93
+101 101 stage/sql/Optimizing (stage) STATEMENT 93
+102 102 stage/sql/Executing (stage) STATEMENT 93
+103 103 stage/sql/End of update loop (stage) STATEMENT 93
+104 104 stage/sql/Query end (stage) STATEMENT 93
+105 105 stage/sql/Commit (stage) STATEMENT 93
+106 106 stage/sql/closing tables (stage) STATEMENT 93
+107 107 stage/sql/Starting cleanup (stage) STATEMENT 93
+108 110 stage/sql/Freeing items (stage) STATEMENT 93
+109 109 wait/io/socket/sql/client_connection send STAGE 108
+110 110 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 108
+111 129 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
+112 113 stage/sql/starting (stage) STATEMENT 111
+113 113 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 112
+114 114 stage/sql/checking permissions (stage) STATEMENT 111
+115 115 stage/sql/Opening tables (stage) STATEMENT 111
+116 116 stage/sql/After opening tables (stage) STATEMENT 111
+117 117 stage/sql/init (stage) STATEMENT 111
+118 118 stage/sql/Optimizing (stage) STATEMENT 111
+119 119 stage/sql/Executing (stage) STATEMENT 111
+120 120 stage/sql/End of update loop (stage) STATEMENT 111
+121 121 stage/sql/Query end (stage) STATEMENT 111
+122 122 stage/sql/Commit (stage) STATEMENT 111
+123 123 stage/sql/closing tables (stage) STATEMENT 111
+124 124 stage/sql/Starting cleanup (stage) STATEMENT 111
+125 125 stage/sql/Freeing items (stage) STATEMENT 111
+126 126 wait/io/socket/sql/client_connection send STATEMENT 111
+127 127 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 111
+128 129 stage/sql/Reset for next command (stage) STATEMENT 111
+129 129 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 128
+130 130 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 111
+131 131 idle idle NULL NULL
+132 153 statement/sql/select select "MARKER_END" as marker NULL NULL
+133 137 stage/sql/starting (stage) STATEMENT 132
+134 134 wait/io/socket/sql/client_connection recv STAGE 133
+135 135 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 133
+136 136 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 133
+137 137 wait/io/file/sql/query_log write STAGE 133
+138 138 stage/sql/checking permissions (stage) STATEMENT 132
+139 139 stage/sql/Opening tables (stage) STATEMENT 132
+140 140 stage/sql/After opening tables (stage) STATEMENT 132
+141 141 stage/sql/init (stage) STATEMENT 132
+142 142 stage/sql/Optimizing (stage) STATEMENT 132
+143 143 stage/sql/Executing (stage) STATEMENT 132
+144 144 stage/sql/End of update loop (stage) STATEMENT 132
+145 145 stage/sql/Query end (stage) STATEMENT 132
+146 146 stage/sql/Commit (stage) STATEMENT 132
+147 147 stage/sql/closing tables (stage) STATEMENT 132
+148 148 stage/sql/Starting cleanup (stage) STATEMENT 132
+149 149 stage/sql/Freeing items (stage) STATEMENT 132
+150 150 wait/io/socket/sql/client_connection send STATEMENT 132
+151 151 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STATEMENT 132
+152 153 stage/sql/Reset for next command (stage) STATEMENT 132
+153 153 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 152
disconnect con1;
diff --git a/mysql-test/suite/plugins/r/audit_null_debug.result b/mysql-test/suite/plugins/r/audit_null_debug.result
index 3b18edf1d0b..727bd67aecf 100644
--- a/mysql-test/suite/plugins/r/audit_null_debug.result
+++ b/mysql-test/suite/plugins/r/audit_null_debug.result
@@ -14,6 +14,7 @@ uninstall plugin audit_null;
ERROR HY000: Index for table './mysql/plugin.MYI' is corrupt; try to repair it
SET debug_dbug=@old_dbug;
uninstall plugin audit_null;
+uninstall plugin audit_null;
ERROR 42000: PLUGIN audit_null does not exist
delete from mysql.plugin where name='audit_null';
alter table mysql.plugin engine=aria;
diff --git a/mysql-test/suite/plugins/t/audit_null_debug.test b/mysql-test/suite/plugins/t/audit_null_debug.test
index da949b15f8a..52c50f13b74 100644
--- a/mysql-test/suite/plugins/t/audit_null_debug.test
+++ b/mysql-test/suite/plugins/t/audit_null_debug.test
@@ -28,7 +28,8 @@ SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage';
uninstall plugin audit_null;
SET debug_dbug=@old_dbug;
---error 1305
+uninstall plugin audit_null;
+--error ER_SP_DOES_NOT_EXIST
uninstall plugin audit_null;
delete from mysql.plugin where name='audit_null';
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 9e1d21bab5e..4aaa0388170 100644
--- a/mysql-test/suite/roles/set_role-table-column-priv.result
+++ b/mysql-test/suite/roles/set_role-table-column-priv.result
@@ -63,7 +63,7 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'ro
drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
Host Db User Table_name Grantor Timestamp Table_priv Column_priv
-localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Update,Delete
+localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Delete
mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
diff --git a/mysql-test/suite/roles/set_role-table-simple.result b/mysql-test/suite/roles/set_role-table-simple.result
index 107ca726e22..f33df34d85e 100644
--- a/mysql-test/suite/roles/set_role-table-simple.result
+++ b/mysql-test/suite/roles/set_role-table-simple.result
@@ -61,7 +61,7 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'ro
drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
Host Db User Table_name Grantor Timestamp Table_priv Column_priv
-localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Update,Delete
+localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Delete
mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
diff --git a/mysql-test/suite/rpl/r/parallel_backup.result b/mysql-test/suite/rpl/r/parallel_backup.result
new file mode 100644
index 00000000000..d87c61f2d0f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/parallel_backup.result
@@ -0,0 +1,40 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
+# replication
+#
+connection master;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
+connection slave;
+include/stop_slave.inc
+SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
+SET @@global.slave_parallel_threads= 2;
+SET @@global.slave_parallel_mode = 'optimistic';
+connection master;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+connect aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+connection slave;
+include/start_slave.inc
+connection aux_slave;
+connect backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+BACKUP STAGE START;
+BACKUP STAGE BLOCK_COMMIT;
+connection aux_slave;
+ROLLBACK;
+connection backup_slave;
+BACKUP STAGE END;
+connection slave;
+include/diff_tables.inc [master:t1,slave:t1]
+connection slave;
+include/stop_slave.inc
+SET @@global.slave_parallel_threads= @old_parallel_threads;
+SET @@global.slave_parallel_mode = @old_parallel_mode;
+include/start_slave.inc
+connection server_1;
+DROP TABLE t1;
+include/rpl_end.inc
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 b88c3576462..52da842d855 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
@@ -230,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 #
@@ -248,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 #
@@ -266,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 #
@@ -284,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 #
@@ -302,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 #
@@ -328,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 #
@@ -346,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 #
@@ -364,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 #
@@ -390,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 #
@@ -408,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 #
@@ -426,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 #
diff --git a/mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result b/mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result
new file mode 100644
index 00000000000..3a80d5b5f31
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result
@@ -0,0 +1,22 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES(1);
+connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug= 'd,simulate_error_on_packet_write';
+START SLAVE;
+SET DEBUG_SYNC= 'now WAIT_FOR parked';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SET DEBUG_SYNC= 'RESET';
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_start.inc
+connection master;
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+a
+1
+connection master;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 59c572fd2d2..406b1d145d1 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_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index 22060954fd7..5ec40d81ade 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_row_virt.result b/mysql-test/suite/rpl/r/rpl_row_virt.result
new file mode 100644
index 00000000000..b670c63d9f1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_virt.result
@@ -0,0 +1,20 @@
+include/master-slave.inc
+[connection master]
+connection master;
+create table t1 (
+id int auto_increment,
+data varchar(32),
+virt tinyint as (1),
+primary key (id),
+key virt (virt)
+) engine=innodb default charset=utf8mb4;
+insert into t1 (data) values ('broken');
+update t1 set data='more broken';
+connection slave;
+select * from t1;
+id data virt
+1 more broken 1
+connection master;
+drop table t1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 8fe417d51cc..b6f4e87bfa2 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -810,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))
@@ -818,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())
@@ -826,7 +826,7 @@ insert into t1 values (unix_timestamp())
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -872,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)
@@ -880,7 +880,7 @@ insert into t2 values(3)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (15)
@@ -888,7 +888,7 @@ insert into t1 values (15)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -899,7 +899,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
alter procedure foo4 sql security invoker
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -907,7 +907,7 @@ insert into t2 values(3)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (5)
@@ -915,7 +915,7 @@ insert into t1 values (5)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
@@ -936,7 +936,7 @@ begin
insert into t2 values(20),(20);
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(20),(20)
@@ -964,7 +964,7 @@ insert into t1 values (x);
return x+2;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete t1,t2 from t1,t2
@@ -972,7 +972,7 @@ delete t1,t2 from t1,t2
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
@@ -980,7 +980,7 @@ SELECT `mysqltest1`.`fn1`(20)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(fn1(21))
@@ -998,7 +998,7 @@ begin
return unix_timestamp();
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1006,7 +1006,7 @@ delete from t1
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values(fn1())
@@ -1028,7 +1028,7 @@ begin
return 0;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
@@ -1049,7 +1049,7 @@ insert into t2 values(x),(x);
return 10;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(100)
@@ -1057,7 +1057,7 @@ SELECT `mysqltest1`.`fn1`(100)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
@@ -1065,7 +1065,7 @@ SELECT `mysqltest1`.`fn1`(20)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1076,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)
@@ -1084,7 +1084,7 @@ insert into t1 values (1)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1095,7 +1095,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
drop trigger trg
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
@@ -1142,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())
@@ -1169,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'))
@@ -1223,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 )
@@ -1238,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_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
deleted file mode 100644
index cd9ac1db9b1..00000000000
--- a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+++ /dev/null
@@ -1,18 +0,0 @@
-include/master-slave.inc
-[connection master]
-connection slave;
-SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
-SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
-SET GLOBAL innodb_thread_concurrency = 100;
-connection master;
-CREATE TABLE t(f INT) ENGINE=INNODB;
-INSERT INTO t VALUES (10);
-connection slave;
-include/diff_tables.inc [master:t, slave:t]
-"===== Clean up======="
-connection master;
-DROP TABLE t;
-connection slave;
-SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
-SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/parallel_backup.test b/mysql-test/suite/rpl/t/parallel_backup.test
new file mode 100644
index 00000000000..6ed182c024b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/parallel_backup.test
@@ -0,0 +1,75 @@
+--source include/have_innodb.inc
+# The test is not format specific, MIXED is required to optimize testing time
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
+--echo # replication
+--echo #
+
+--connection master
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
+
+--sync_slave_with_master
+--source include/stop_slave.inc
+SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
+SET @@global.slave_parallel_threads= 2;
+SET @@global.slave_parallel_mode = 'optimistic';
+
+--connection master
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+--save_master_pos
+
+# The plot:
+# Block the 1st of two workers and, at waiting-for-prior-commit by the 2nd,
+# issue BACKUP commands.
+# BLOCK_COMMIT may hang so it is --send.
+# Release the 1st worker to observe a deadlock unless its fixed.
+
+--connect (aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,)
+BEGIN;
+# block the 1st worker and wait for the 2nd ready to commit
+INSERT INTO t1 VALUES (1);
+
+--connection slave
+--source include/start_slave.inc
+
+--connection aux_slave
+--let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
+--source include/wait_condition.inc
+
+# While the 1st worker is locked out run backup
+--connect (backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,)
+BACKUP STAGE START;
+--send BACKUP STAGE BLOCK_COMMIT
+
+# release the 1st work
+--connection aux_slave
+--sleep 1
+ROLLBACK;
+
+--connection backup_slave
+--reap
+BACKUP STAGE END;
+
+--connection slave
+--sync_with_master
+
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+
+# Clean up.
+--connection slave
+--source include/stop_slave.inc
+SET @@global.slave_parallel_threads= @old_parallel_threads;
+SET @@global.slave_parallel_mode = @old_parallel_mode;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test b/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
new file mode 100644
index 00000000000..d750d44ae71
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
@@ -0,0 +1,60 @@
+# ==== Purpose ====
+#
+# Test verifies that, due to a temporary network error, if request dump
+# command specific packet write operation fails then the write error gets
+# handled appropriately. Further retry will be initiated with appropriate
+# slave registration on master. This will ensure that master has all the
+# details of slave and no warnings are reported on the master side.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Skip the slave start.
+# 1 - Enable debug simulation which will simulate packet write error during
+# dump request command execution.
+# 2 - Start the slave. Observe that slave is able to reconnect post
+# temporary network write error.
+#
+# ==== References ====
+#
+# MDEV-14203: rpl.rpl_extra_col_master_myisam,
+# rpl.rpl_slave_load_tmpdir_not_exist failed in buildbot with a
+# warning
+#
+# MDEV-13258: rpl.rpl_skip_replication, rpl.rpl_set_statement_default_master
+# failed in buildbot
+#
+
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--let $rpl_skip_start_slave=1
+--source include/master-slave.inc
+
+# Do an insert on master
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES(1);
+
+# Add a debug point and start the slave so that dump request fails.
+connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug= 'd,simulate_error_on_packet_write';
+
+START SLAVE;
+SET DEBUG_SYNC= 'now WAIT_FOR parked';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SET DEBUG_SYNC= 'RESET';
+
+--source include/wait_for_slave_io_to_start.inc
+--source include/wait_for_slave_sql_to_start.inc
+
+# Sync the slave and verify that slave has caught up with the master.
+connection master;
+--source include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+
+# Cleanup
+connection master;
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_virt.test b/mysql-test/suite/rpl/t/rpl_row_virt.test
new file mode 100644
index 00000000000..e79869cd8e4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_virt.test
@@ -0,0 +1,27 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+connection master;
+
+create table t1 (
+ id int auto_increment,
+ data varchar(32),
+ virt tinyint as (1),
+ primary key (id),
+ key virt (virt)
+) engine=innodb default charset=utf8mb4;
+
+insert into t1 (data) values ('broken');
+
+update t1 set data='more broken';
+
+--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/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
deleted file mode 100644
index b4c2971d2fb..00000000000
--- a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+++ /dev/null
@@ -1,41 +0,0 @@
-# ==== Purpose ====
-#
-# Test verifies that replication shouldn't hang when number of active threads
-# on the slave server are less than the allowed innodb_thread_concurrency value.
-#
-# ==== Implementation ====
-#
-# Steps:
-# 0 - Have master slave replication setup with engine being Innodb.
-# 1 - Configure innodb_thread_concurrency = 100.
-# 2 - Do some DML on master and sync the slave with master.
-# 3 - Ensure replication doesn't hang.
-#
-# ==== References ====
-#
-# MDEV-20247: Replication hangs with "preparing" and never starts
-#
-
---source include/master-slave.inc
---source include/have_innodb.inc
-
---connection slave
-SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
-SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
-SET GLOBAL innodb_thread_concurrency = 100;
-
---connection master
-CREATE TABLE t(f INT) ENGINE=INNODB;
-INSERT INTO t VALUES (10);
---sync_slave_with_master
-
---let $diff_tables=master:t, slave:t
---source include/diff_tables.inc
-
---echo "===== Clean up======="
---connection master
-DROP TABLE t;
---sync_slave_with_master
-SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
-SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
---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/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result
index b3ba28a4411..c5f468a7427 100644
--- a/mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result
@@ -1,37 +1,48 @@
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
-150000
+0
150000 Expected
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;
+Warnings:
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=0;
+Warnings:
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
0
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100000;
+Warnings:
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
-100000
+0
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000000;
+Warnings:
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
-1000000
+0
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001;
Warnings:
Warning 1292 Truncated incorrect innodb_adaptive_max_sleep_delay value: '1000001'
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
-1000000
+0
1000000 Expected
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=4294967295;
Warnings:
Warning 1292 Truncated incorrect innodb_adaptive_max_sleep_delay value: '4294967295'
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
-1000000
+0
1000000 Expected
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1;
Warnings:
Warning 1292 Truncated incorrect innodb_adaptive_max_sleep_delay value: '-1'
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
0
@@ -39,6 +50,7 @@ SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1024;
Warnings:
Warning 1292 Truncated incorrect innodb_adaptive_max_sleep_delay value: '-1024'
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
@@GLOBAL.innodb_adaptive_max_sleep_delay
0
@@ -70,3 +82,5 @@ Expected error 'Variable is a GLOBAL variable'
SELECT innodb_adaptive_max_sleep_delay = @@SESSION.innodb_adaptive_max_sleep_delay;
ERROR 42S22: Unknown column 'innodb_adaptive_max_sleep_delay' in 'field list'
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=150000;
+Warnings:
+Warning 138 The parameter innodb_adaptive_max_sleep_delay is deprecated and has no effect.
diff --git a/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
index 474818829c5..3c1f6a7d2aa 100644
--- a/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
@@ -4,35 +4,49 @@ SELECT @global_start_value;
0
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_commit_concurrency = 0;
+Warnings:
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SET @@global.innodb_commit_concurrency = DEFAULT;
+Warnings:
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
'#---------------------FN_DYNVARS_046_02-------------------------#'
SET innodb_commit_concurrency = 1;
ERROR HY000: Variable 'innodb_commit_concurrency' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL innodb_commit_concurrency = 1;
+Warnings:
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
SELECT local.innodb_commit_concurrency;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_commit_concurrency = 0;
+Warnings:
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
'#--------------------FN_DYNVARS_046_03------------------------#'
SET @@global.innodb_commit_concurrency = 0;
+Warnings:
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_commit_concurrency = 1;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
SET @@global.innodb_commit_concurrency = -1;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '-1'
+Warnings:
+Warning 1292 Truncated incorrect innodb_commit_concurrency value: '-1'
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
@@ -52,7 +66,9 @@ SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
SET @@global.innodb_commit_concurrency = 1001;
-ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1001'
+Warnings:
+Warning 1292 Truncated incorrect innodb_commit_concurrency value: '1001'
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
@@ -82,6 +98,8 @@ SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
SET @@global.innodb_commit_concurrency = @global_start_value;
+Warnings:
+Warning 138 The parameter innodb_commit_concurrency is deprecated and has no effect.
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
index dd4488a97b3..5d35833dd88 100644
--- a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
@@ -1,93 +1,103 @@
SET @global_start_value = @@global.innodb_concurrency_tickets;
SELECT @global_start_value;
@global_start_value
-5000
+0
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_concurrency_tickets = 0;
Warnings:
-Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SET @@global.innodb_concurrency_tickets = DEFAULT;
+Warnings:
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-5000
+0
'#---------------------FN_DYNVARS_046_02-------------------------#'
SET innodb_concurrency_tickets = 1;
ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@innodb_concurrency_tickets;
@@innodb_concurrency_tickets
-5000
+0
SELECT local.innodb_concurrency_tickets;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_concurrency_tickets = 0;
Warnings:
-Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
'#--------------------FN_DYNVARS_046_03------------------------#'
SET @@global.innodb_concurrency_tickets = 1;
+Warnings:
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = 1000;
+Warnings:
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1000
+0
SET @@global.innodb_concurrency_tickets = 4294967295;
+Warnings:
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-4294967295
+0
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_concurrency_tickets = 4294967296;
SELECT @@global.innodb_concurrency_tickets IN (4294967296,4294967295);
@@global.innodb_concurrency_tickets IN (4294967296,4294967295)
-1
+0
SET @@global.innodb_concurrency_tickets = 12345678901;
SELECT @@global.innodb_concurrency_tickets IN (12345678901,4294967295);
@@global.innodb_concurrency_tickets IN (12345678901,4294967295)
-1
+0
SET @@global.innodb_concurrency_tickets = 18446744073709551615;
SELECT @@global.innodb_concurrency_tickets IN (18446744073709551615,4294967295);
@@global.innodb_concurrency_tickets IN (18446744073709551615,4294967295)
-1
+0
'#--------------------FN_DYNVARS_046_05-------------------------#'
SET @@global.innodb_concurrency_tickets = -1;
Warnings:
Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '-1'
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = -1024;
Warnings:
Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '-1024'
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = 1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = " ";
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = ' ';
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
'#----------------------FN_DYNVARS_046_06------------------------#'
SELECT @@global.innodb_concurrency_tickets =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -97,34 +107,38 @@ VARIABLE_VALUE
1
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_concurrency_tickets';
VARIABLE_VALUE
-1
+0
'#---------------------FN_DYNVARS_046_07-------------------------#'
SET @@global.innodb_concurrency_tickets = OFF;
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = ON;
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
'#---------------------FN_DYNVARS_046_08----------------------#'
SET @@global.innodb_concurrency_tickets = TRUE;
+Warnings:
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = FALSE;
Warnings:
-Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-1
+0
SET @@global.innodb_concurrency_tickets = @global_start_value;
+Warnings:
+Warning 138 The parameter innodb_concurrency_tickets is deprecated and has no effect.
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-5000
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result
index 5e0fb425f6b..53a499ff34b 100644
--- a/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result
@@ -24,33 +24,43 @@ select * from information_schema.session_variables where variable_name='innodb_r
VARIABLE_NAME VARIABLE_VALUE
INNODB_REPLICATION_DELAY 0
set global innodb_replication_delay=10;
+Warnings:
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
-10
+0
select * from information_schema.global_variables where variable_name='innodb_replication_delay';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_REPLICATION_DELAY 10
+INNODB_REPLICATION_DELAY 0
select * from information_schema.session_variables where variable_name='innodb_replication_delay';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_REPLICATION_DELAY 10
+INNODB_REPLICATION_DELAY 0
set session innodb_replication_delay=1;
ERROR HY000: Variable 'innodb_replication_delay' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_replication_delay=DEFAULT;
+Warnings:
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
0
set global innodb_replication_delay=0;
+Warnings:
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
0
set global innodb_replication_delay=65535;
+Warnings:
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
-65535
+0
set global innodb_replication_delay=4294967295;
+Warnings:
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
-4294967295
+0
set global innodb_replication_delay=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
set global innodb_replication_delay=1e1;
@@ -61,21 +71,23 @@ set global innodb_replication_delay=' ';
ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
-4294967295
+0
set global innodb_replication_delay=" ";
ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
-4294967295
+0
set global innodb_replication_delay=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_replication_delay value: '-7'
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
0
set global innodb_replication_delay=-1024;
Warnings:
Warning 1292 Truncated incorrect innodb_replication_delay value: '-1024'
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
select @@global.innodb_replication_delay;
@@global.innodb_replication_delay
0
@@ -85,16 +97,18 @@ INNODB_REPLICATION_DELAY 0
SET @@global.innodb_replication_delay = 4294967296;
SELECT @@global.innodb_replication_delay IN (4294967296,4294967295);
@@global.innodb_replication_delay IN (4294967296,4294967295)
-1
+0
SET @@global.innodb_replication_delay = 12345678901;
SELECT @@global.innodb_replication_delay IN (12345678901,4294967295);
@@global.innodb_replication_delay IN (12345678901,4294967295)
-1
+0
SET @@global.innodb_replication_delay = 18446744073709551615;
SELECT @@global.innodb_replication_delay IN (18446744073709551615,4294967295);
@@global.innodb_replication_delay IN (18446744073709551615,4294967295)
-1
+0
SET @@global.innodb_replication_delay = @start_global_value;
+Warnings:
+Warning 138 The parameter innodb_replication_delay is deprecated and has no effect.
SELECT @@global.innodb_replication_delay;
@@global.innodb_replication_delay
0
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
index ca3c253604a..39d1a659a20 100644
--- a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
@@ -4,7 +4,11 @@ SELECT @global_start_value;
0
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_thread_concurrency = 0;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SET @@global.innodb_thread_concurrency = DEFAULT;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
0
@@ -17,26 +21,35 @@ SELECT @@innodb_thread_concurrency;
SELECT local.innodb_thread_concurrency;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_thread_concurrency = 0;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
0
'#--------------------FN_DYNVARS_046_03------------------------#'
SET @@global.innodb_thread_concurrency = 0;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
0
SET @@global.innodb_thread_concurrency = 1;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1
+0
SET @@global.innodb_thread_concurrency = 1000;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_thread_concurrency = -1;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_concurrency value: '-1'
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
0
@@ -63,14 +76,15 @@ SELECT @@global.innodb_thread_concurrency;
SET @@global.innodb_thread_concurrency = 1001;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001'
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
SET @@global.innodb_thread_concurrency = 255.01;
ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
'#----------------------FN_DYNVARS_046_05------------------------#'
SELECT @@global.innodb_thread_concurrency =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -80,32 +94,38 @@ VARIABLE_VALUE
1
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_thread_concurrency';
VARIABLE_VALUE
-1000
+0
'#---------------------FN_DYNVARS_046_06-------------------------#'
SET @@global.innodb_thread_concurrency = OFF;
ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
SET @@global.innodb_thread_concurrency = ON;
ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
'#---------------------FN_DYNVARS_046_07----------------------#'
SET @@global.innodb_thread_concurrency = TRUE;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1
+0
SET @@global.innodb_thread_concurrency = FALSE;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
0
SET @@global.innodb_thread_concurrency = @global_start_value;
+Warnings:
+Warning 138 The parameter innodb_thread_concurrency is deprecated and has no effect.
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
0
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
index c2017ee0b66..b6310bb5652 100644
--- a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
@@ -1,38 +1,40 @@
SET @start_global_value = @@global.innodb_thread_sleep_delay;
SELECT @start_global_value;
@start_global_value
-10000
+0
Valid values are zero or above
select @@global.innodb_thread_sleep_delay >=0;
@@global.innodb_thread_sleep_delay >=0
1
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-10000
+0
select @@session.innodb_thread_sleep_delay;
ERROR HY000: Variable 'innodb_thread_sleep_delay' is a GLOBAL variable
show global variables like 'innodb_thread_sleep_delay';
Variable_name Value
-innodb_thread_sleep_delay 10000
+innodb_thread_sleep_delay 0
show session variables like 'innodb_thread_sleep_delay';
Variable_name Value
-innodb_thread_sleep_delay 10000
+innodb_thread_sleep_delay 0
select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_THREAD_SLEEP_DELAY 10000
+INNODB_THREAD_SLEEP_DELAY 0
select * from information_schema.session_variables where variable_name='innodb_thread_sleep_delay';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_THREAD_SLEEP_DELAY 10000
+INNODB_THREAD_SLEEP_DELAY 0
set global innodb_thread_sleep_delay=10;
+Warnings:
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-10
+0
select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_THREAD_SLEEP_DELAY 10
+INNODB_THREAD_SLEEP_DELAY 0
select * from information_schema.session_variables where variable_name='innodb_thread_sleep_delay';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_THREAD_SLEEP_DELAY 10
+INNODB_THREAD_SLEEP_DELAY 0
set session innodb_thread_sleep_delay=1;
ERROR HY000: Variable 'innodb_thread_sleep_delay' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_thread_sleep_delay=1.1;
@@ -45,9 +47,11 @@ set global innodb_thread_sleep_delay=18446744073709551616;
Warnings:
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '9223372036854775807'
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
set global innodb_thread_sleep_delay=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7'
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
0
@@ -55,34 +59,46 @@ select * from information_schema.global_variables where variable_name='innodb_th
VARIABLE_NAME VARIABLE_VALUE
INNODB_THREAD_SLEEP_DELAY 0
set global innodb_thread_sleep_delay=0;
+Warnings:
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
0
set global innodb_thread_sleep_delay=1000;
+Warnings:
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-1000
+0
set global innodb_thread_sleep_delay=1000000;
+Warnings:
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-1000000
+0
set global innodb_thread_sleep_delay=1000001;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '1000001'
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-1000000
+0
set global innodb_thread_sleep_delay=4294967295;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '4294967295'
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-1000000
+0
set global innodb_thread_sleep_delay=555;
+Warnings:
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-555
+0
SET @@global.innodb_thread_sleep_delay = @start_global_value;
+Warnings:
+Warning 138 The parameter innodb_thread_sleep_delay is deprecated and has no effect.
SELECT @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
-10000
+0
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 0ac1b839d76..80bd2d7af5f 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -17,38 +17,38 @@ OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,i
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
-set global optimizer_switch=10;
-set session optimizer_switch=5;
+set global optimizer_switch=4101;
+set session optimizer_switch=2058;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=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
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 bb34436b4ec..e0f3e210feb 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
@@ -104,15 +104,9 @@ autocommit,character_set_client,character_set_connection,character_set_results,t
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/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
index 84aecf2ce36..2f39a472b99 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -9,15 +9,6 @@
VARIABLE_COMMENT Number of InnoDB Adaptive Hash Index Partitions (default 8)
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 512
-@@ -61,7 +61,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
@@ -73,7 +73,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 64
@@ -76,16 +67,7 @@
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
-@@ -373,7 +373,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
-@@ -409,7 +409,7 @@
+@@ -421,7 +421,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 5
VARIABLE_SCOPE GLOBAL
@@ -94,7 +76,7 @@
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
-@@ -433,7 +433,7 @@
+@@ -445,7 +445,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 50
VARIABLE_SCOPE GLOBAL
@@ -103,20 +85,7 @@
VARIABLE_COMMENT Percentage of empty space on a data page that can be reserved to make the page compressible.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 75
-@@ -445,10 +445,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
-@@ -673,7 +673,7 @@
+@@ -661,7 +661,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 120
VARIABLE_SCOPE GLOBAL
@@ -125,7 +94,7 @@
VARIABLE_COMMENT Number of pages reserved in doublewrite buffer for batch flushing
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 127
-@@ -769,7 +769,7 @@
+@@ -757,7 +757,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 600
VARIABLE_SCOPE GLOBAL
@@ -134,7 +103,7 @@
VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -817,7 +817,7 @@
+@@ -805,7 +805,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -143,7 +112,7 @@
VARIABLE_COMMENT Make the first page of the given tablespace dirty.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -829,7 +829,7 @@
+@@ -817,7 +817,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
@@ -152,7 +121,7 @@
VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1000
-@@ -853,7 +853,7 @@
+@@ -841,7 +841,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -161,7 +130,7 @@
VARIABLE_COMMENT Controls the durability/speed trade-off for commits. Set to 0 (write and flush redo log to disk only once per second), 1 (flush to disk at each commit), 2 (write to log at commit but flush to disk only once per second) or 3 (flush to disk at prepare and at commit, slower and usually redundant). 1 and 3 guarantees that after a crash, committed transactions will not be lost and will be consistent with the binlog and other transactional engines. 2 can get inconsistent and lose transactions if there is a power failure or kernel crash but not if mysqld crashes. 0 has no guarantees in case of crash. 0 and 2 can be faster than 1 or 3.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 3
-@@ -877,7 +877,7 @@
+@@ -865,7 +865,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -170,7 +139,7 @@
VARIABLE_COMMENT Set to 0 (don't flush neighbors from buffer pool), 1 (flush contiguous neighbors from buffer pool) or 2 (flush neighbors from buffer pool), when flushing a block
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -925,7 +925,7 @@
+@@ -913,7 +913,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -179,7 +148,7 @@
VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt. Value 5 can return bogus data, and 6 can permanently corrupt data.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 6
-@@ -949,7 +949,7 @@
+@@ -937,7 +937,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 8000000
VARIABLE_SCOPE GLOBAL
@@ -188,7 +157,7 @@
VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
NUMERIC_MIN_VALUE 1600000
NUMERIC_MAX_VALUE 80000000
-@@ -985,7 +985,7 @@
+@@ -973,7 +973,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 84
VARIABLE_SCOPE GLOBAL
@@ -197,7 +166,7 @@
VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
-@@ -997,7 +997,7 @@
+@@ -985,7 +985,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 3
VARIABLE_SCOPE GLOBAL
@@ -206,7 +175,7 @@
VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16
-@@ -1009,7 +1009,7 @@
+@@ -997,7 +997,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
@@ -215,7 +184,7 @@
VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
NUMERIC_MIN_VALUE 1000
NUMERIC_MAX_VALUE 10000
-@@ -1021,10 +1021,10 @@
+@@ -1009,10 +1009,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2000000000
VARIABLE_SCOPE GLOBAL
@@ -228,7 +197,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1045,7 +1045,7 @@
+@@ -1033,7 +1033,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
@@ -237,7 +206,7 @@
VARIABLE_COMMENT InnoDB Fulltext search parallel sort degree, will round up to nearest power of 2 number
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 16
-@@ -1057,7 +1057,7 @@
+@@ -1045,7 +1045,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 640000000
VARIABLE_SCOPE GLOBAL
@@ -246,7 +215,7 @@
VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
NUMERIC_MIN_VALUE 32000000
NUMERIC_MAX_VALUE 1600000000
-@@ -1081,7 +1081,7 @@
+@@ -1069,7 +1069,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -373,14 +342,14 @@
READ_ONLY YES
@@ -1489,7 +1489,7 @@
SESSION_VALUE NULL
- DEFAULT_VALUE 4
+ DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
-@@ -1525,7 +1525,7 @@
+@@ -1513,7 +1513,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 16384
VARIABLE_SCOPE GLOBAL
@@ -389,7 +358,7 @@
VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 65536
-@@ -1561,7 +1561,7 @@
+@@ -1549,7 +1549,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 300
VARIABLE_SCOPE GLOBAL
@@ -398,7 +367,7 @@
VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5000
-@@ -1573,7 +1573,7 @@
+@@ -1561,7 +1561,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -407,7 +376,7 @@
VARIABLE_COMMENT Dictates rate at which UNDO records are purged. Value N means purge rollback segment(s) on every Nth iteration of purge invocation
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -1609,7 +1609,7 @@
+@@ -1597,7 +1597,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 56
VARIABLE_SCOPE GLOBAL
@@ -416,7 +385,7 @@
VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
-@@ -1621,7 +1621,7 @@
+@@ -1609,7 +1609,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
@@ -425,20 +394,7 @@
VARIABLE_COMMENT Number of background read I/O threads in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
-@@ -1645,10 +1645,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
-@@ -1669,7 +1669,7 @@
+@@ -1657,7 +1657,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -447,7 +403,7 @@
VARIABLE_COMMENT An InnoDB page number.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1717,7 +1717,7 @@
+@@ -1705,7 +1705,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -456,7 +412,7 @@
VARIABLE_COMMENT Memory buffer size for index creation
NUMERIC_MIN_VALUE 65536
NUMERIC_MAX_VALUE 67108864
-@@ -1885,7 +1885,7 @@
+@@ -1873,7 +1873,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -465,7 +421,7 @@
VARIABLE_COMMENT Size of the mutex/lock wait array.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -1909,10 +1909,10 @@
+@@ -1897,10 +1897,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
@@ -478,25 +434,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1945,7 +1945,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
-@@ -1957,7 +1957,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
-@@ -2017,7 +2017,7 @@
+@@ -2005,7 +2005,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -505,7 +443,7 @@
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 128
-@@ -2041,7 +2041,7 @@
+@@ -2029,7 +2029,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -514,7 +452,7 @@
VARIABLE_COMMENT Number of undo tablespaces to use.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 127
-@@ -2065,7 +2065,7 @@
+@@ -2053,7 +2053,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 4d062995b1e..7e59a8ea810 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -59,10 +59,10 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ADAPTIVE_MAX_SLEEP_DELAY
SESSION_VALUE NULL
-DEFAULT_VALUE 150000
+DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT The upper limit of the sleep delay in usec. Value of 0 disables it.
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000000
NUMERIC_BLOCK_SIZE 0
@@ -385,8 +385,8 @@ VARIABLE_NAME INNODB_COMMIT_CONCURRENCY
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments.
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
NUMERIC_BLOCK_SIZE 0
@@ -455,12 +455,12 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_CONCURRENCY_TICKETS
SESSION_VALUE NULL
-DEFAULT_VALUE 5000
+DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket
-NUMERIC_MIN_VALUE 1
-NUMERIC_MAX_VALUE 18446744073709551615
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Deprecated parameter with no effect.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1633,10 +1633,10 @@ VARIABLE_NAME INNODB_REPLICATION_DELAY
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Replication thread delay (ms) on the slave server if innodb_thread_concurrency is reached (0 by default)
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1933,8 +1933,8 @@ VARIABLE_NAME INNODB_THREAD_CONCURRENCY
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
NUMERIC_BLOCK_SIZE 0
@@ -1943,10 +1943,10 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_THREAD_SLEEP_DELAY
SESSION_VALUE NULL
-DEFAULT_VALUE 10000
+DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000000
NUMERIC_BLOCK_SIZE 0
diff --git a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
index 4ed706b372b..67be561348a 100644
--- a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
@@ -52,8 +52,9 @@ SELECT @@global.innodb_commit_concurrency;
# Check if innodb_commit_concurrency can be accessed with and without @@ sign#
################################################################################
---Error ER_GLOBAL_VARIABLE
+--error ER_GLOBAL_VARIABLE
SET innodb_commit_concurrency = 1;
+SET GLOBAL innodb_commit_concurrency = 1;
SELECT @@innodb_commit_concurrency;
@@ -79,14 +80,8 @@ SELECT @@global.innodb_commit_concurrency;
# Change the value of innodb_commit_concurrency to invalid value #
###########################################################################
-#
-# InnoDB doesn't allow innodb_commit_concurrency to change from
-# zero to non-zero or vice versa
-#
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_commit_concurrency = 1;
SELECT @@global.innodb_commit_concurrency;
---Error ER_WRONG_VALUE_FOR_VAR
+SELECT @@global.innodb_commit_concurrency;
SET @@global.innodb_commit_concurrency = -1;
SELECT @@global.innodb_commit_concurrency;
--Error ER_WRONG_TYPE_FOR_VAR
@@ -98,7 +93,6 @@ SELECT @@global.innodb_commit_concurrency;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_commit_concurrency = 1.1;
SELECT @@global.innodb_commit_concurrency;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_commit_concurrency = 1001;
SELECT @@global.innodb_commit_concurrency;
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
index ef9d8f17832..ada22845f3e 100644
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
@@ -19,8 +19,8 @@ select * from information_schema.session_variables where variable_name='optimize
#
# show that it's writable
#
-set global optimizer_switch=10;
-set session optimizer_switch=5;
+set global optimizer_switch=4101;
+set session optimizer_switch=2058;
select @@global.optimizer_switch;
select @@session.optimizer_switch;
set global optimizer_switch="index_merge_sort_union=on";
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 e58d405cf0a..20f0cd6cf17 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/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index b945ca4fb5b..cc9891a1f6e 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -348,11 +348,7 @@ insert t1 values (1);
delete from t1;
set timestamp=unix_timestamp('2001-02-04 10:20:50');
insert t1 values (2);
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
delete from t1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
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 00:00:00 1
@@ -395,6 +391,22 @@ i
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;
## INTERVAL ... STARTS
create or replace table t1 (i int) with system versioning
partition by system_time interval 1 day starts 'a';
@@ -544,16 +556,10 @@ partition by system_time interval 1 day starts '2000-01-01 00:00:00'
partitions 3;
# we are warned when we push to present:
insert into t1 values (0);
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
set timestamp= unix_timestamp('2001-01-01 00:00:01');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
set timestamp= unix_timestamp('2001-01-01 00:00:02');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
select *, row_end from t1 partition (p0);
i row_end
select *, row_end from t1 partition (p1);
@@ -596,12 +602,8 @@ set timestamp= unix_timestamp('2000-01-02 00:00:01');
update t1 set i= i + 1;
set timestamp= unix_timestamp('2000-01-03 00:00:01');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
set timestamp= unix_timestamp('2000-01-04 00:00:01');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
alter table t1 add partition (partition p2 history, partition p3 history);
select *, row_end from t1 partition (p0);
i row_end
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index f7901d11d2a..cd26c341113 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -319,3 +319,34 @@ create or replace table t1 (f point, key(f)) with system versioning engine=myisa
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/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 507e8d40256..a154cc37ae2 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -311,6 +311,25 @@ 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;
+
--echo ## INTERVAL ... STARTS
--error ER_PART_WRONG_VALUE
create or replace table t1 (i int) with system versioning
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index 5b0a9eb5c42..06f81ea9064 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -245,4 +245,45 @@ 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/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 3d8a20e4f9a..14a4ea9e9bb 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -90,7 +90,8 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
__asm__(\"pmull v2.1q, v2.1d, v1.1d\");
return ret;
}
- int main() { foo(0); }" HAVE_ARMV8_CRYPTO)
+ #include <sys/auxv.h>
+ int main() { foo(0); getauxval(AT_HWCAP); }" HAVE_ARMV8_CRYPTO)
CHECK_C_COMPILER_FLAG(-march=armv8-a+crc+crypto HAVE_ARMV8_CRC_CRYPTO_INTRINSICS)
IF(HAVE_ARMV8_CRC_CRYPTO_INTRINSICS)
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 249fb1b5e4d..259b7af9a60 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -469,7 +469,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
/* Copy compiled charsets */
for (cs=compiled_charsets; cs->name; cs++)
- add_compiled_collation((struct charset_info_st *) cs);
+ add_compiled_extra_collation((struct charset_info_st *) cs);
return FALSE;
}
diff --git a/mysys/charset.c b/mysys/charset.c
index 5e999c8435d..32cfeb56e2d 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -20,6 +20,7 @@
#include <m_ctype.h>
#include <m_string.h>
#include <my_dir.h>
+#include <hash.h>
#include <my_xml.h>
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
@@ -28,6 +29,8 @@
#include <locale.h>
#endif
+extern HASH charset_name_hash;
+
/*
The code below implements this functionality:
@@ -38,15 +41,10 @@
- Setting server default character set
*/
-my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
-{
- return ((cs1 == cs2) || !strcmp(cs1->csname,cs2->csname));
-}
-
-
static uint
get_collation_number_internal(const char *name)
{
+
CHARSET_INFO **cs;
for (cs= all_charsets;
cs < all_charsets + array_elements(all_charsets);
@@ -72,11 +70,10 @@ static my_bool init_state_maps(struct charset_info_st *cs)
uchar *state_map;
uchar *ident_map;
- if (!(cs->state_map= state_map= (uchar*) my_once_alloc(256, MYF(MY_WME))))
+ if (!(cs->state_map= state_map= (uchar*) my_once_alloc(256*2, MYF(MY_WME))))
return 1;
- if (!(cs->ident_map= ident_map= (uchar*) my_once_alloc(256, MYF(MY_WME))))
- return 1;
+ cs->ident_map= ident_map= state_map + 256;
/* Fill state_map with states to get a faster parser */
for (i=0; i < 256 ; i++)
@@ -153,7 +150,8 @@ static int cs_copy_data(struct charset_info_st *to, CHARSET_INFO *from)
{
to->number= from->number ? from->number : to->number;
- if (from->csname)
+ /* Don't replace csname if already set */
+ if (from->csname && !to->csname)
if (!(to->csname= my_once_strdup(from->csname,MYF(MY_WME))))
goto err;
@@ -322,7 +320,21 @@ static int add_collation(struct charset_info_st *cs)
return MY_XML_ERROR;
bzero(newcs,sizeof(CHARSET_INFO));
}
-
+ else
+ {
+ /* Don't allow change of csname */
+ if (newcs->csname && strcmp(newcs->csname, cs->csname))
+ {
+ my_error(EE_DUPLICATE_CHARSET, MYF(ME_WARNING),
+ cs->number, cs->csname, newcs->csname);
+ /*
+ Continue parsing rest of Index.xml. We got an warning in the log
+ so the user can fix the wrong character set definition.
+ */
+ return MY_XML_OK;
+ }
+ }
+
if (cs->primary_number == cs->number)
cs->state |= MY_CS_PRIMARY;
@@ -402,8 +414,8 @@ static int add_collation(struct charset_info_st *cs)
{
newcs->state |= MY_CS_LOADED;
}
- newcs->state|= MY_CS_AVAILABLE;
}
+ add_compiled_extra_collation(newcs);
}
else
{
@@ -420,7 +432,7 @@ static int add_collation(struct charset_info_st *cs)
if (cs->comment)
if (!(newcs->comment= my_once_strdup(cs->comment,MYF(MY_WME))))
return MY_XML_ERROR;
- if (cs->csname)
+ if (cs->csname && ! newcs->csname)
if (!(newcs->csname= my_once_strdup(cs->csname,MYF(MY_WME))))
return MY_XML_ERROR;
if (cs->name)
@@ -557,14 +569,55 @@ char *get_charsets_dir(char *buf)
CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]={NULL};
CHARSET_INFO *default_charset_info = &my_charset_latin1;
+
+/*
+ Add standard character set compiled into the application
+ All related character sets should share same cname
+*/
+
void add_compiled_collation(struct charset_info_st *cs)
{
DBUG_ASSERT(cs->number < array_elements(all_charsets));
all_charsets[cs->number]= cs;
cs->state|= MY_CS_AVAILABLE;
+ if ((my_hash_insert(&charset_name_hash, (uchar*) cs)))
+ {
+#ifndef DBUG_OFF
+ CHARSET_INFO *org= (CHARSET_INFO*) my_hash_search(&charset_name_hash,
+ (uchar*) cs->csname,
+ strlen(cs->csname));
+ DBUG_ASSERT(org);
+ DBUG_ASSERT(org->csname == cs->csname);
+#endif
+ }
}
+/*
+ Add optional characters sets from ctype-extra.c
+
+ If cname is already in use, replace csname in new object with a pointer to
+ the already used csname to ensure that all csname's points to the same string
+ for the same character set.
+*/
+
+
+void add_compiled_extra_collation(struct charset_info_st *cs)
+{
+ DBUG_ASSERT(cs->number < array_elements(all_charsets));
+ all_charsets[cs->number]= cs;
+ cs->state|= MY_CS_AVAILABLE;
+ if ((my_hash_insert(&charset_name_hash, (uchar*) cs)))
+ {
+ CHARSET_INFO *org= (CHARSET_INFO*) my_hash_search(&charset_name_hash,
+ (uchar*) cs->csname,
+ strlen(cs->csname));
+ cs->csname= org->csname;
+ }
+}
+
+
+
static my_pthread_once_t charsets_initialized= MY_PTHREAD_ONCE_INIT;
static my_pthread_once_t charsets_template= MY_PTHREAD_ONCE_INIT;
@@ -612,14 +665,31 @@ const char *my_collation_get_tailoring(uint id)
}
+HASH charset_name_hash;
+
+static uchar *get_charset_key(const uchar *object,
+ size_t *size,
+ my_bool not_used __attribute__((unused)))
+{
+ CHARSET_INFO *cs= (CHARSET_INFO*) object;
+ *size= strlen(cs->csname);
+ return (uchar*) cs->csname;
+}
+
static void init_available_charsets(void)
{
char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
struct charset_info_st **cs;
MY_CHARSET_LOADER loader;
+ DBUG_ENTER("init_available_charsets");
bzero((char*) &all_charsets,sizeof(all_charsets));
bzero((char*) &my_collation_statistics, sizeof(my_collation_statistics));
+
+ my_hash_init2(key_memory_charsets, &charset_name_hash, 16,
+ &my_charset_latin1, 64, 0, 0, get_charset_key,
+ 0, 0, HASH_UNIQUE);
+
init_compiled_charsets(MYF(0));
/* Copy compiled charsets */
@@ -640,12 +710,14 @@ static void init_available_charsets(void)
my_charset_loader_init_mysys(&loader);
strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
my_read_charset_file(&loader, fname, MYF(0));
+ DBUG_VOID_RETURN;
}
void free_charsets(void)
{
charsets_initialized= charsets_template;
+ my_hash_free(&charset_name_hash);
}
@@ -1431,4 +1503,4 @@ const char* my_default_csname()
csname = my_os_charset_to_mysql_charset(csname);
#endif
return csname ? csname : MYSQL_DEFAULT_CHARSET_NAME;
-} \ No newline at end of file
+}
diff --git a/mysys/crc32/crc32_arm64.c b/mysys/crc32/crc32_arm64.c
index 09ac7a12a66..aae6f769002 100644
--- a/mysys/crc32/crc32_arm64.c
+++ b/mysys/crc32/crc32_arm64.c
@@ -18,8 +18,21 @@ int crc32_aarch64_available(void)
unsigned long auxv= getauxval(AT_HWCAP);
return (auxv & HWCAP_CRC32) != 0;
}
+
+#if defined(HAVE_ARMV8_CRYPTO)
+
+#ifndef HWCAP_PMULL
+#define HWCAP_PMULL (1 << 4)
#endif
+/* Check if target ARM machine support crc32 + pmull for computing crc32c */
+int crc32c_aarch64_available(void)
+{
+ return !(~getauxval(AT_HWCAP) & (HWCAP_CRC32 | HWCAP_PMULL));
+}
+#endif /* HAVE_ARMV8_CRYPTO */
+#endif /* HAVE_ARMV8_CRC */
+
#ifndef HAVE_ARMV8_CRC_CRYPTO_INTRINSICS
/* Request crc extension capabilities from the assembler */
diff --git a/mysys/errors.c b/mysys/errors.c
index a7ccf752c0c..d88540fe277 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -58,7 +58,8 @@ const char *globerrs[GLOBERRS]=
"Warning: Can't copy ownership for file '%s' (Errcode: %M)",
"Failed to release memory pointer %p, %zu bytes (Errcode: %M)",
"Lock Pages in memory access rights required",
- "Memcntl %s cmd %s error"
+ "Memcntl %s cmd %s error",
+ "Warning: Charset id '%d' csname '%s' trying to replace existing csname '%s'",
};
void init_glob_errs(void)
@@ -107,6 +108,7 @@ void init_glob_errs()
EE(EE_BADMEMORYRELEASE)= "Failed to release memory pointer %p, %zu bytes (Errcode: %M)";
EE(EE_PERM_LOCK_MEMORY)= "Lock Pages in memory access rights required";
EE(EE_MEMCNTL) = "Memcntl %s cmd %s error";
+ EE(EE_DUPLICATE_CHARSET)= "Warning: Charset id %d trying to replace csname %s with %s";
}
#endif
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c
index 447d5c50a59..e107c62b987 100644
--- a/mysys/my_largepage.c
+++ b/mysys/my_largepage.c
@@ -421,10 +421,12 @@ void my_large_free(void *ptr, size_t size)
{
my_error(EE_BADMEMORYRELEASE, MYF(ME_ERROR_LOG_ONLY), ptr, size, errno);
}
+# if !__has_feature(memory_sanitizer)
else
{
- MEM_UNDEFINED(ptr, size);
+ MEM_MAKE_ADDRESSABLE(ptr, size);
}
+# endif
#elif defined(_WIN32)
/*
When RELEASE memory, the size parameter must be 0.
@@ -435,10 +437,12 @@ void my_large_free(void *ptr, size_t size)
my_error(EE_BADMEMORYRELEASE, MYF(ME_ERROR_LOG_ONLY), ptr, size,
GetLastError());
}
+# if !__has_feature(memory_sanitizer)
else
{
- MEM_UNDEFINED(ptr, size);
+ MEM_MAKE_ADDRESSABLE(ptr, size);
}
+# endif
#else
my_free_lock(ptr);
#endif
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c
index dce3ca2be3b..1503a5db442 100644
--- a/mysys/my_rdtsc.c
+++ b/mysys/my_rdtsc.c
@@ -173,9 +173,29 @@ ulonglong my_timer_microseconds(void)
milliseconds.
*/
+#if defined(HAVE_CLOCK_GETTIME)
+#if defined(CLOCK_MONOTONIC_FAST)
+/* FreeBSD */
+#define MY_CLOCK_ID CLOCK_MONOTONIC_FAST
+#elif defined(CLOCK_MONOTONIC_COARSE)
+/* Linux */
+#define MY_CLOCK_ID CLOCK_MONOTONIC_COARSE
+#elif defined(CLOCK_MONOTONIC)
+/* POSIX (includes OSX) */
+#define MY_CLOCK_ID CLOCK_MONOTONIC
+#elif defined(CLOCK_REALTIME)
+/* Solaris (which doesn't seem to have MONOTONIC) */
+#define MY_CLOCK_ID CLOCK_REALTIME
+#endif
+#endif
+
ulonglong my_timer_milliseconds(void)
{
-#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
+#if defined(MY_CLOCK_ID)
+ struct timespec tp;
+ clock_gettime(MY_CLOCK_ID, &tp);
+ return (ulonglong)tp.tv_sec * 1000 + (ulonglong)tp.tv_nsec / 1000000;
+#elif defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
/* ftime() is obsolete but maybe the platform is old */
struct timeb ft;
ftime(&ft);
@@ -362,6 +382,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
#elif defined(__GNUC__) && defined(__s390__)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
+#elif defined(__GNUC__) && defined (__aarch64__)
+ mti->cycles.routine= MY_TIMER_ROUTINE_AARCH64;
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
#else
@@ -426,7 +448,9 @@ void my_timer_init(MY_TIMER_INFO *mti)
/* milliseconds */
mti->milliseconds.frequency= 1000; /* initial assumption */
-#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
+#ifdef MY_CLOCK_ID
+ mti->milliseconds.routine= MY_TIMER_ROUTINE_CLOCK_GETTIME;
+#elif defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
mti->milliseconds.routine= MY_TIMER_ROUTINE_FTIME;
#elif defined(_WIN32)
mti->milliseconds.routine= MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME;
@@ -607,7 +631,11 @@ void my_timer_init(MY_TIMER_INFO *mti)
time1= my_timer_cycles();
time2= my_timer_ticks();
time3= time2; /* Avoids a Microsoft/IBM compiler warning */
+#if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES)
+ for (i= 0; i < 1000; ++i)
+#else
for (i= 0; i < MY_TIMER_ITERATIONS * 1000; ++i)
+#endif
{
time3= my_timer_ticks();
if (time3 - time2 > 10) break;
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 6090e84011e..3c4b9efc1f8 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -47,6 +47,7 @@ PSI_memory_key key_memory_my_compress_alloc;
PSI_memory_key key_memory_my_err_head;
PSI_memory_key key_memory_my_file_info;
PSI_memory_key key_memory_pack_frm;
+PSI_memory_key key_memory_charsets;
#ifdef _WIN32
PSI_memory_key key_memory_win_SECURITY_ATTRIBUTES;
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 5115e0452d5..adf2d39046a 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -87,6 +87,7 @@ extern PSI_memory_key key_memory_my_compress_alloc;
extern PSI_memory_key key_memory_my_err_head;
extern PSI_memory_key key_memory_my_file_info;
extern PSI_memory_key key_memory_pack_frm;
+extern PSI_memory_key key_memory_charsets;
#ifdef _WIN32
extern PSI_memory_key key_memory_win_SECURITY_ATTRIBUTES;
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt
index 28a194927e9..93ac29cd425 100644
--- a/plugin/auth_pam/CMakeLists.txt
+++ b/plugin/auth_pam/CMakeLists.txt
@@ -25,7 +25,7 @@ IF(HAVE_PAM_APPL_H)
FIND_LIBRARY(PAM_LIBRARY pam) # for srpm build-depends detection
ADD_DEFINITIONS(-D_GNU_SOURCE)
MYSQL_ADD_PLUGIN(auth_pam_v1 auth_pam_v1.c LINK_LIBRARIES pam MODULE_ONLY)
- MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam dl MODULE_ONLY)
+ MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam ${LIBDL} MODULE_ONLY)
IF (TARGET auth_pam)
MYSQL_ADD_EXECUTABLE(auth_pam_tool auth_pam_tool.c DESTINATION ${INSTALL_PLUGINDIR}/auth_pam_tool_dir COMPONENT Server)
TARGET_LINK_LIBRARIES(auth_pam_tool pam)
diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c
index 4275b7d6750..c1c05bba216 100644
--- a/plugin/auth_pam/auth_pam.c
+++ b/plugin/auth_pam/auth_pam.c
@@ -36,12 +36,20 @@ static char *opt_plugin_dir; /* To be dynamically linked. */
static const char *tool_name= "auth_pam_tool_dir/auth_pam_tool";
static const int tool_name_len= 31;
+/*
+ sleep_limit is now 5 meaning up to 1 second sleep.
+ each step means 10 times longer sleep, so 6 would mean 10 seconds.
+*/
+static const unsigned int sleep_limit= 5;
+
static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
{
int p_to_c[2], c_to_p[2]; /* Parent-to-child and child-to-parent pipes. */
pid_t proc_id;
int result= CR_ERROR, pkt_len= 0;
unsigned char field, *pkt;
+ unsigned int n_sleep= 0;
+ useconds_t sleep_time= 100;
PAM_DEBUG((stderr, "PAM: opening pipes.\n"));
if (pipe(p_to_c) < 0 || pipe(c_to_p) < 0)
@@ -190,7 +198,24 @@ static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
error_ret:
close(p_to_c[1]);
close(c_to_p[0]);
- waitpid(proc_id, NULL, WNOHANG);
+ while (waitpid(proc_id, NULL, WNOHANG) != (int) proc_id)
+ {
+ if (n_sleep++ == sleep_limit)
+ {
+ /*
+ The auth_pam_tool application doesn't terminate.
+ Means something wrong happened there like pam_xxx.so hanged.
+ */
+ kill(proc_id, SIGKILL);
+ sleep_time= 1000000; /* 1 second wait should be enough. */
+ PAM_DEBUG((stderr, "PAM: auth_pam_tool doesn't terminate,"
+ " have to kill it.\n"));
+ }
+ else if (n_sleep > sleep_limit)
+ break;
+ usleep(sleep_time);
+ sleep_time*= 10;
+ }
PAM_DEBUG((stderr, "PAM: auth result %d.\n", result));
return result;
diff --git a/plugin/type_inet/sql_type_inet.cc b/plugin/type_inet/sql_type_inet.cc
index 76334ad1615..14d854be14f 100644
--- a/plugin/type_inet/sql_type_inet.cc
+++ b/plugin/type_inet/sql_type_inet.cc
@@ -622,10 +622,15 @@ class Field_inet6: public Field
Sql_condition::enum_warning_level level)
{
static const Name type_name= type_handler_inet6.name();
- if (get_thd()->count_cuted_fields > CHECK_FIELD_EXPRESSION)
- get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
- str.ptr(), table->s,
- field_name.str);
+ if (get_thd()->count_cuted_fields <= CHECK_FIELD_EXPRESSION)
+ return;
+ const TABLE_SHARE *s= table->s;
+ get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
+ str.ptr(),
+ s ? s->db.str : nullptr,
+ s ? s->table_name.str
+ : nullptr,
+ field_name.str);
}
int set_null_with_warn(const ErrConv &str)
{
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 4dad514f6af..9c4fdf6a234 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
-# Copyright (c) 2011, 2017, MariaDB Corporation
+# Copyright (c) 2011, 2020, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -293,6 +293,20 @@ ELSE()
SET(WSREP_SOURCE
wsrep_sst_common
)
+
+ INSTALL_LINK(wsrep_sst_rsync wsrep_sst_rsync_wan ${INSTALL_BINDIR} Server)
+ FOREACH(file ${WSREP_SOURCE})
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
+ IF(NOT ${file}_COMPONENT)
+ SET(${file}_COMPONENT Server)
+ ENDIF()
+ INSTALL(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${file}
+ DESTINATION ${INSTALL_BINDIR}
+ COMPONENT ${${file}_COMPONENT}
+ )
+ ENDFOREACH()
ENDIF()
IF (NOT WITHOUT_SERVER)
SET(SERVER_SCRIPTS
@@ -363,20 +377,6 @@ ELSE()
INSTALL_LINK(${file} ${binname} ${INSTALL_BINDIR} ${${file}_COMPONENT})
ENDIF()
ENDFOREACH()
-
- INSTALL_LINK(wsrep_sst_rsync wsrep_sst_rsync_wan ${INSTALL_BINDIR} Server)
- FOREACH(file ${WSREP_SOURCE})
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
- ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
- IF(NOT ${file}_COMPONENT)
- SET(${file}_COMPONENT Server)
- ENDIF()
- INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${file}
- DESTINATION ${INSTALL_BINDIR}
- COMPONENT ${${file}_COMPONENT}
- )
- ENDFOREACH()
ENDIF()
# Install libgcc as mylibgcc.a
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 308a3b06cc6..e390f36a98b 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -37,9 +37,15 @@ CREATE TABLE IF NOT EXISTS global_priv (Host char(60) binary DEFAULT '', User ch
set @had_sys_user= 0 <> (select count(*) from mysql.global_priv where Host="localhost" and User="mariadb.sys");
+set @exists_user_view= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user');
+
+set @exists_user_view_by_root= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost');
+
+set @need_sys_user_creation= (NOT @had_sys_user) AND (( NOT @exists_user_view) OR @exists_user_view_by_root);
+
CREATE TEMPORARY TABLE tmp_user_sys LIKE global_priv;
INSERT INTO tmp_user_sys (Host,User,Priv) VALUES ('localhost','mariadb.sys','{"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}');
-INSERT INTO global_priv SELECT * FROM tmp_user_sys WHERE NOT @had_sys_user;
+INSERT INTO global_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;
@@ -110,8 +116,8 @@ CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', H
CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv;
-INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Update,Delete');
-INSERT INTO tables_priv SELECT * FROM tmp_user_sys WHERE NOT @had_sys_user;
+INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Delete');
+INSERT INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;
CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
diff --git a/sql-common/client.c b/sql-common/client.c
index 1ce80a17d24..c12b3ef5c0a 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -512,6 +512,8 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
set_mysql_error(mysql, CR_NET_PACKET_TOO_LARGE, unknown_sqlstate);
goto end;
}
+ if (net->last_errno == ER_NET_ERROR_ON_WRITE && command == COM_BINLOG_DUMP)
+ goto end;
end_server(mysql);
if (mysql_reconnect(mysql) || stmt_skip)
goto end;
diff --git a/sql/field.cc b/sql/field.cc
index e73cc380196..8cd619571c4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -57,7 +57,7 @@ const char field_separator=',';
#define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \
((ulong) ((1LL << MY_MIN(arg, 4) * 8) - 1))
-// Column marked for read or the field set to read out or record[0] or [1]
+// Column marked for read or the field set to read out of record[0]
bool Field::marked_for_read() const
{
return !table ||
@@ -68,7 +68,7 @@ bool Field::marked_for_read() const
}
/*
- The name of this function is a bit missleading as in 10.4 we don't
+ The name of this function is a bit misleading as in 10.4 we don't
have to test anymore if the field is computed. Instead we mark
changed fields with DBUG_FIX_WRITE_SET() in table.cc
*/
@@ -1078,17 +1078,16 @@ Field_longstr::make_packed_sort_key_part(uchar *buff,
*buff++=1;
}
uchar *end= pack_sort_string(buff, sort_field);
- return static_cast<int>(end-buff);
+ return (uint) (end-buff);
}
uchar*
Field_longstr::pack_sort_string(uchar *to, const SORT_FIELD_ATTR *sort_field)
{
- String buf;
+ StringBuffer<LONGLONG_BUFFER_SIZE> buf;
val_str(&buf, &buf);
- return to + sort_field->pack_sort_string(to, buf.lex_cstring(),
- field_charset());
+ return to + sort_field->pack_sort_string(to, &buf);
}
@@ -2106,7 +2105,7 @@ void Field::make_send_field(Send_field *field)
field->org_table_name= field->db_name= empty_clex_str;
if (orig_table && orig_table->alias.ptr())
{
- field->table_name= orig_table->alias.lex_cstring();
+ orig_table->alias.get_value(&field->table_name);
field->org_col_name= field_name;
}
else
@@ -2402,7 +2401,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
bool Field::get_date(MYSQL_TIME *to, date_mode_t mode)
{
StringBuffer<40> tmp;
- Temporal::Warn_push warn(get_thd(), NULL, NullS, to, mode);
+ Temporal::Warn_push warn(get_thd(), nullptr, nullptr, nullptr, to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(get_thd(), &warn,
val_str(&tmp), mode);
return !t->is_valid_temporal();
@@ -10888,14 +10887,16 @@ void Field::set_datetime_warning(Sql_condition::enum_warning_level level,
if (thd->really_abort_on_warning() && level >= Sql_condition::WARN_LEVEL_WARN)
{
/*
- field_str.name can be NULL when field is not in the select list:
+ field_name.str can be NULL when field is not in the select list:
SET SESSION SQL_MODE= 'STRICT_ALL_TABLES,NO_ZERO_DATE';
CREATE OR REPLACE TABLE t2 SELECT 1 AS f FROM t1 GROUP BY FROM_DAYS(d);
Can't call push_warning_truncated_value_for_field() directly here,
as it expect a non-NULL name.
*/
thd->push_warning_wrong_or_truncated_value(level, false, typestr,
- str->ptr(), table->s,
+ str->ptr(),
+ table->s->db.str,
+ table->s->table_name.str,
field_name.str);
}
else
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 03af9c7b49a..1e811473a32 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -316,7 +316,8 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
while (memory_available >= min_sort_memory)
{
ulonglong keys= memory_available / (param.rec_length + sizeof(char*));
- param.max_keys_per_buffer= (uint) MY_MIN(num_rows, keys);
+ param.max_keys_per_buffer= (uint) MY_MAX(MERGEBUFF2,
+ MY_MIN(num_rows, keys));
sort->alloc_sort_buffer(param.max_keys_per_buffer, param.rec_length);
if (sort->sort_buffer_size() > 0)
break;
@@ -2110,9 +2111,7 @@ Type_handler_string_result::sort_length(THD *thd,
SORT_FIELD_ATTR *sortorder) const
{
CHARSET_INFO *cs;
- sortorder->length= item->max_length;
- set_if_smaller(sortorder->length, thd->variables.max_sort_length);
- sortorder->original_length= item->max_length;
+ sortorder->set_length_and_original_length(thd, item->max_length);
if (use_strnxfrm((cs= item->collation.collation)))
{
@@ -2219,9 +2218,9 @@ sortlength(THD *thd, Sort_keys *sort_keys, bool *allow_packing_for_sortkeys)
{
Field *field= sortorder->field;
CHARSET_INFO *cs= sortorder->field->sort_charset();
- sortorder->length= sortorder->field->sort_length();
+ sortorder->set_length_and_original_length(thd, field->sort_length());
+
sortorder->suffix_length= sortorder->field->sort_suffix_length();
- sortorder->original_length= sortorder->length;
sortorder->type= field->is_packable() ?
SORT_FIELD_ATTR::VARIABLE_SIZE :
SORT_FIELD_ATTR::FIXED_SIZE;
@@ -2554,7 +2553,6 @@ Type_handler_string_result::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
Sort_param *param) const
{
- CHARSET_INFO *cs= item->collation.collation;
bool maybe_null= item->maybe_null;
if (maybe_null)
@@ -2584,7 +2582,7 @@ Type_handler_string_result::make_packed_sort_key_part(uchar *to, Item *item,
return sort_field->original_length;
}
}
- return sort_field->pack_sort_string(to, res->lex_cstring(), cs);
+ return sort_field->pack_sort_string(to, res);
}
@@ -2757,6 +2755,14 @@ bool SORT_FIELD_ATTR::check_if_packing_possible(THD *thd) const
}
+void SORT_FIELD_ATTR::set_length_and_original_length(THD *thd, uint length_arg)
+{
+ length= length_arg;
+ set_if_smaller(length, thd->variables.max_sort_length);
+ original_length= length_arg;
+}
+
+
/*
Compare function used for packing sort keys
*/
@@ -2940,13 +2946,12 @@ int compare_packed_sort_keys(void *sort_param,
*/
uint
-SORT_FIELD_ATTR::pack_sort_string(uchar *to, const LEX_CSTRING &str,
- CHARSET_INFO *cs) const
+SORT_FIELD_ATTR::pack_sort_string(uchar *to, String *str) const
{
uchar *orig_to= to;
uint32 length, data_length;
- DBUG_ASSERT(str.length <= UINT32_MAX);
- length= (uint32)str.length;
+ DBUG_ASSERT(str->length() <= UINT32_MAX);
+ length= (uint32) str->length();
if (length + suffix_length <= original_length)
data_length= length;
@@ -2957,13 +2962,13 @@ SORT_FIELD_ATTR::pack_sort_string(uchar *to, const LEX_CSTRING &str,
store_key_part_length(data_length + suffix_length, to, length_bytes);
to+= length_bytes;
// copying data length bytes to the buffer
- memcpy(to, (uchar*)str.str, data_length);
+ memcpy(to, (uchar*)str->ptr(), data_length);
to+= data_length;
- if (cs == &my_charset_bin && suffix_length)
+ if (str->charset() == &my_charset_bin && suffix_length)
{
// suffix length stored in bigendian form
- store_bigendian(str.length, to, suffix_length);
+ store_bigendian(length, to, suffix_length);
to+= suffix_length;
}
return static_cast<uint>(to - orig_to);
diff --git a/sql/filesort_utils.cc b/sql/filesort_utils.cc
index 27f37d1d507..5a51300a0fa 100644
--- a/sql/filesort_utils.cc
+++ b/sql/filesort_utils.cc
@@ -1,4 +1,5 @@
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2020, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -108,14 +109,6 @@ uchar *Filesort_buffer::alloc_sort_buffer(uint num_records,
buff_size= ALIGN_SIZE(num_records * (record_length + sizeof(uchar*)));
- /*
- The minimum memory required should be each merge buffer can hold atmost
- one key.
- TODO varun: move this to the place where min_sort_memory is used.
- */
- set_if_bigger(buff_size,
- ALIGN_SIZE((record_length +sizeof(uchar*)) * MERGEBUFF2));
-
if (m_rawmem)
{
/*
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index f5eab028755..307f7ff24af 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -5712,8 +5712,9 @@ extern "C" int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2)
{
return res;
}
- if ((res= file->m_file[0]->cmp_ref(ref1 + PARTITION_BYTES_IN_POS + file->m_rec_length,
- ref2 + PARTITION_BYTES_IN_POS + file->m_rec_length)))
+ if ((res= file->get_open_file_sample()->cmp_ref(ref1 +
+ PARTITION_BYTES_IN_POS + file->m_rec_length,
+ ref2 + PARTITION_BYTES_IN_POS + file->m_rec_length)))
{
return res;
}
@@ -9744,7 +9745,7 @@ uint8 ha_partition::table_cache_type()
{
DBUG_ENTER("ha_partition::table_cache_type");
- DBUG_RETURN(m_file[0]->table_cache_type());
+ DBUG_RETURN(get_open_file_sample()->table_cache_type());
}
diff --git a/sql/handler.cc b/sql/handler.cc
index ace58869145..58f1c60edf9 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -188,7 +188,7 @@ private:
static int commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans,
- bool is_real_trans);
+ bool is_real_trans, bool rw_trans);
static plugin_ref ha_default_plugin(THD *thd)
@@ -1621,39 +1621,9 @@ int ha_commit_trans(THD *thd, bool all)
/* rw_trans is TRUE when we in a transaction changing data */
bool rw_trans= is_real_trans &&
(rw_ha_count > (thd->is_current_stmt_binlog_disabled()?0U:1U));
- MDL_request mdl_request;
- mdl_request.ticket= 0;
DBUG_PRINT("info", ("is_real_trans: %d rw_trans: %d rw_ha_count: %d",
is_real_trans, rw_trans, rw_ha_count));
- /*
- We need to test maria_hton because of plugin_innodb.test that changes
- the plugin table to innodb and thus plugin_load will call
- mysql_close_tables() which calls trans_commit_trans() with maria_hton = 0
- */
- if (rw_trans)
- {
- /*
- Acquire a metadata lock which will ensure that COMMIT is blocked
- by an active FLUSH TABLES WITH READ LOCK (and vice versa:
- COMMIT in progress blocks FTWRL).
-
- We allow the owner of FTWRL to COMMIT; we assume that it knows
- what it does.
- */
- MDL_REQUEST_INIT(&mdl_request, MDL_key::BACKUP, "", "", MDL_BACKUP_COMMIT,
- MDL_EXPLICIT);
-
- if (!WSREP(thd) &&
- thd->mdl_context.acquire_lock(&mdl_request,
- thd->variables.lock_wait_timeout))
- {
- ha_rollback_trans(thd, all);
- DBUG_RETURN(1);
- }
-
- DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
- }
if (rw_trans &&
opt_readonly &&
!(thd->security_ctx->master_access & PRIV_IGNORE_READ_ONLY) &&
@@ -1693,7 +1663,7 @@ int ha_commit_trans(THD *thd, bool all)
// Here, the call will not commit inside InnoDB. It is only working
// around closing thd->transaction.stmt open by TR_table::open().
if (all)
- commit_one_phase_2(thd, false, &thd->transaction->stmt, false);
+ commit_one_phase_2(thd, false, &thd->transaction->stmt, false, false);
}
}
#endif
@@ -1713,7 +1683,7 @@ int ha_commit_trans(THD *thd, bool all)
goto wsrep_err;
}
#endif /* WITH_WSREP */
- error= ha_commit_one_phase(thd, all);
+ error= ha_commit_one_phase(thd, all, rw_trans);
#ifdef WITH_WSREP
// Here in case of error we must return 2 for inconsistency
if (run_wsrep_hooks && !error)
@@ -1750,7 +1720,7 @@ int ha_commit_trans(THD *thd, bool all)
if (!is_real_trans)
{
- error= commit_one_phase_2(thd, all, trans, is_real_trans);
+ error= commit_one_phase_2(thd, all, trans, is_real_trans, rw_trans);
goto done;
}
@@ -1784,7 +1754,7 @@ int ha_commit_trans(THD *thd, bool all)
DEBUG_SYNC(thd, "ha_commit_trans_after_log_and_order");
DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_SUICIDE(););
- error= commit_one_phase_2(thd, all, trans, is_real_trans) ? 2 : 0;
+ error= commit_one_phase_2(thd, all, trans, is_real_trans, rw_trans) ? 2 : 0;
#ifdef WITH_WSREP
if (run_wsrep_hooks &&
(error || (error = wsrep_after_commit(thd, all))))
@@ -1848,22 +1818,16 @@ err:
ha_rollback_trans(thd, all);
else
{
+ /*
+ We are not really doing a rollback here, but the code in trans_commit()
+ requres that m_transaction_psi is 0 when we return from this function.
+ */
MYSQL_ROLLBACK_TRANSACTION(thd->m_transaction_psi);
thd->m_transaction_psi= NULL;
WSREP_DEBUG("rollback skipped %p %d",thd->rgi_slave,
thd->rgi_slave->is_parallel_exec);
}
end:
- if (mdl_request.ticket)
- {
- /*
- We do not always immediately release transactional locks
- after ha_commit_trans() (see uses of ha_enable_transaction()),
- thus we release the commit blocker lock as soon as it's
- not needed.
- */
- thd->mdl_context.release_lock(mdl_request.ticket);
- }
#ifdef WITH_WSREP
if (wsrep_is_active(thd) && is_real_trans && !error &&
(rw_ha_count == 0 || all) &&
@@ -1879,6 +1843,7 @@ end:
/**
@note
This function does not care about global read lock. A caller should.
+ However backup locks are handled in commit_one_phase_2.
@param[in] all Is set in case of explicit commit
(COMMIT statement), or implicit commit
@@ -1887,7 +1852,7 @@ end:
autocommit=1.
*/
-int ha_commit_one_phase(THD *thd, bool all)
+int ha_commit_one_phase(THD *thd, bool all, bool rw_trans)
{
THD_TRANS *trans=all ? &thd->transaction->all : &thd->transaction->stmt;
/*
@@ -1913,20 +1878,48 @@ int ha_commit_one_phase(THD *thd, bool all)
if ((res= thd->wait_for_prior_commit()))
DBUG_RETURN(res);
}
- res= commit_one_phase_2(thd, all, trans, is_real_trans);
+ res= commit_one_phase_2(thd, all, trans, is_real_trans, rw_trans);
DBUG_RETURN(res);
}
static int
-commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans)
+commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans,
+ bool rw_trans)
{
int error= 0;
uint count= 0;
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next;
+ MDL_request mdl_request;
+ mdl_request.ticket= 0;
DBUG_ENTER("commit_one_phase_2");
if (is_real_trans)
DEBUG_SYNC(thd, "commit_one_phase_2");
+
+ if (rw_trans)
+ {
+ /*
+ Acquire a metadata lock which will ensure that COMMIT is blocked
+ by an active FLUSH TABLES WITH READ LOCK (and vice versa:
+ COMMIT in progress blocks FTWRL).
+
+ We allow the owner of FTWRL to COMMIT; we assume that it knows
+ what it does.
+ */
+ MDL_REQUEST_INIT(&mdl_request, MDL_key::BACKUP, "", "", MDL_BACKUP_COMMIT,
+ MDL_EXPLICIT);
+
+ if (!WSREP(thd) &&
+ thd->mdl_context.acquire_lock(&mdl_request,
+ thd->variables.lock_wait_timeout))
+ {
+ my_error(ER_ERROR_DURING_COMMIT, MYF(0), 1);
+ ha_rollback_trans(thd, all);
+ DBUG_RETURN(1);
+ }
+ DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
+ }
+
if (ha_info)
{
for (; ha_info; ha_info= ha_info_next)
@@ -1955,6 +1948,17 @@ commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans)
#endif
}
}
+ if (mdl_request.ticket)
+ {
+ /*
+ We do not always immediately release transactional locks
+ after ha_commit_trans() (see uses of ha_enable_transaction()),
+ thus we release the commit blocker lock as soon as it's
+ not needed.
+ */
+ thd->mdl_context.release_lock(mdl_request.ticket);
+ }
+
/* Free resources and perform other cleanup even for 'empty' transactions. */
if (is_real_trans)
{
diff --git a/sql/handler.h b/sql/handler.h
index 0f72a394333..e3831eacd7a 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2514,6 +2514,9 @@ public:
/** true for online operation (LOCK=NONE) */
bool online;
+ /** which ALGORITHM and LOCK are supported by the storage engine */
+ enum_alter_inplace_result inplace_supported;
+
/**
Can be set by handler to describe why a given operation cannot be done
in-place (HA_ALTER_INPLACE_NOT_SUPPORTED) or why it cannot be done
@@ -5176,7 +5179,7 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
/* transactions: interface to handlerton functions */
int ha_start_consistent_snapshot(THD *thd);
int ha_commit_or_rollback_by_xid(XID *xid, bool commit);
-int ha_commit_one_phase(THD *thd, bool all);
+int ha_commit_one_phase(THD *thd, bool all, bool rw_trans);
int ha_commit_trans(THD *thd, bool all);
int ha_rollback_trans(THD *thd, bool all);
int ha_prepare(THD *thd);
diff --git a/sql/item.cc b/sql/item.cc
index 9b321103e07..3ea1a493db2 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1394,9 +1394,11 @@ bool Item::get_date_from_real(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate
bool Item::get_date_from_string(THD *thd, MYSQL_TIME *to, date_mode_t mode)
{
- StringBuffer<40> tmp;
- Temporal::Warn_push warn(thd, field_table_or_null(), field_name_or_null(),
- to, mode);
+ StringBuffer<MAX_DATETIME_FULL_WIDTH+1> tmp;
+ const TABLE_SHARE *s = field_table_or_null();
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name_or_null(), to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(thd, &warn, val_str(&tmp), mode);
return !t->is_valid_temporal();
}
@@ -2076,7 +2078,7 @@ Item_name_const::Item_name_const(THD *thd, Item *name_arg, Item *val):
Item::maybe_null= TRUE;
if (name_item->basic_const_item() &&
(name_str= name_item->val_str(&name_buffer))) // Can't have a NULL name
- set_name(thd, name_str->lex_cstring(), name_str->charset());
+ set_name(thd, name_str);
}
@@ -2430,7 +2432,7 @@ bool DTCollation::aggregate(const DTCollation &dt, uint flags)
{
if (derivation == DERIVATION_EXPLICIT)
{
- set(0, DERIVATION_NONE, 0);
+ set(0, DERIVATION_NONE, MY_REPERTOIRE_NONE);
return 1;
}
if (collation->state & MY_CS_BINSORT &&
@@ -2562,14 +2564,7 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
bool res= FALSE;
uint i;
- /*
- In case we're in statement prepare, create conversion item
- in its memory: it will be reused on each execute.
- */
- Query_arena backup;
- Query_arena *arena= thd->stmt_arena->is_stmt_prepare() ?
- thd->activate_stmt_arena_if_needed(&backup) :
- NULL;
+ DBUG_ASSERT(!thd->stmt_arena->is_stmt_prepare());
for (i= 0, arg= args; i < nargs; i++, arg+= item_sep)
{
@@ -2591,20 +2586,8 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
res= TRUE;
break; // we cannot return here, we need to restore "arena".
}
- /*
- If in statement prepare, then we create a converter for two
- constant items, do it once and then reuse it.
- If we're in execution of a prepared statement, arena is NULL,
- and the conv was created in runtime memory. This can be
- the case only if the argument is a parameter marker ('?'),
- because for all true constants the charset converter has already
- been created in prepare. In this case register the change for
- rollback.
- */
- if (thd->stmt_arena->is_stmt_prepare())
- *arg= conv;
- else
- thd->change_item_tree(arg, conv);
+
+ thd->change_item_tree(arg, conv);
if (conv->fix_fields_if_needed(thd, arg))
{
@@ -2612,8 +2595,6 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
break; // we cannot return here, we need to restore "arena".
}
}
- if (arena)
- thd->restore_active_arena(arena, &backup);
return res;
}
@@ -3626,9 +3607,10 @@ String *Item_int::val_str(String *str)
void Item_int::print(String *str, enum_query_type query_type)
{
+ StringBuffer<LONGLONG_BUFFER_SIZE> buf;
// my_charset_bin is good enough for numbers
- str_value.set_int(value, unsigned_flag, &my_charset_bin);
- str->append(str_value);
+ buf.set_int(value, unsigned_flag, &my_charset_bin);
+ str->append(buf);
}
@@ -3654,21 +3636,6 @@ Item_uint::Item_uint(THD *thd, const char *str_arg, longlong i, uint length):
}
-String *Item_uint::val_str(String *str)
-{
- str->set((ulonglong) value, collation.collation);
- return str;
-}
-
-
-void Item_uint::print(String *str, enum_query_type query_type)
-{
- // latin1 is good enough for numbers
- str_value.set((ulonglong) value, default_charset());
- str->append(str_value);
-}
-
-
Item_decimal::Item_decimal(THD *thd, const char *str_arg, size_t length,
CHARSET_INFO *charset):
Item_num(thd)
@@ -3911,7 +3878,7 @@ Item_null::make_string_literal_concat(THD *thd, const LEX_CSTRING *str)
if (str->length)
{
CHARSET_INFO *cs= thd->variables.collation_connection;
- uint repertoire= my_string_repertoire(cs, str->str, str->length);
+ my_repertoire_t repertoire= my_string_repertoire(cs, str->str, str->length);
return new (thd->mem_root) Item_string(thd,
str->str, (uint) str->length, cs,
DERIVATION_COERCIBLE, repertoire);
@@ -4156,7 +4123,7 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
{
ErrConvTime str(&value.time);
make_truncated_value_warning(current_thd, Sql_condition::WARN_LEVEL_WARN,
- &str, time_type, 0, 0);
+ &str, time_type, NULL, NULL, NULL);
set_zero_time(&value.time, time_type);
}
maybe_null= 0;
@@ -6688,8 +6655,9 @@ int Item_string::save_in_field(Field *field, bool no_conversions)
Item *Item_string::clone_item(THD *thd)
{
- return new (thd->mem_root)
- Item_string(thd, name, str_value.lex_cstring(), collation.collation);
+ LEX_CSTRING val;
+ str_value.get_value(&val);
+ return new (thd->mem_root) Item_string(thd, name, val, collation.collation);
}
diff --git a/sql/item.h b/sql/item.h
index 8118b079ca1..150d9cd215e 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -962,6 +962,10 @@ public:
#endif
} /*lint -e1509 */
void set_name(THD *thd, const char *str, size_t length, CHARSET_INFO *cs);
+ void set_name(THD *thd, String *str)
+ {
+ set_name(thd, str->ptr(), str->length(), str->charset());
+ }
void set_name(THD *thd, const LEX_CSTRING &str,
CHARSET_INFO *cs= system_charset_info)
{
@@ -1841,6 +1845,18 @@ public:
*/
virtual void top_level_item() {}
/*
+ Return TRUE if it is item of top WHERE level (AND/OR) and it is
+ important, return FALSE if it not important (we can not use to simplify
+ calculations) or not top level
+ */
+ virtual bool is_top_level_item() const
+ { return FALSE; /* not important */}
+ /*
+ return IN/ALL/ANY subquery or NULL
+ */
+ virtual Item_in_subselect* get_IN_subquery()
+ { return NULL; /* in is not IN/ALL/ANY */ }
+ /*
set field of temporary table for Item which can be switched on temporary
table during query processing (grouping and so on)
*/
@@ -2435,7 +2451,8 @@ public:
}
bool pushable_cond_checker_for_subquery(uchar *arg)
{
- return excl_dep_on_in_subq_left_part((Item_in_subselect *)arg);
+ DBUG_ASSERT(((Item*) arg)->get_IN_subquery());
+ return excl_dep_on_in_subq_left_part(((Item*)arg)->get_IN_subquery());
}
Item *build_pushable_cond(THD *thd,
Pushdown_checker checker,
@@ -2754,12 +2771,15 @@ protected:
{
my_string_metadata_get(this, str->charset(), str->ptr(), str->length());
}
- Metadata(const String *str, uint repertoire_arg)
+ Metadata(const String *str, my_repertoire_t repertoire_arg)
{
MY_STRING_METADATA::repertoire= repertoire_arg;
MY_STRING_METADATA::char_length= str->numchars();
}
- uint repertoire() const { return MY_STRING_METADATA::repertoire; }
+ my_repertoire_t repertoire() const
+ {
+ return MY_STRING_METADATA::repertoire;
+ }
size_t char_length() const { return MY_STRING_METADATA::char_length; }
};
void fix_charset_and_length(CHARSET_INFO *cs,
@@ -4222,9 +4242,7 @@ public:
Item_uint(THD *thd, ulonglong i): Item_int(thd, i, 10) {}
Item_uint(THD *thd, const char *str_arg, longlong i, uint length);
double val_real() { return ulonglong2double((ulonglong)value); }
- String *val_str(String*);
Item *clone_item(THD *thd);
- virtual void print(String *str, enum_query_type query_type);
Item *neg(THD *thd);
uint decimal_precision() const { return max_length; }
Item *get_copy(THD *thd)
@@ -4363,7 +4381,7 @@ protected:
const Metadata metadata)
{
fix_from_value(dv, metadata);
- set_name(thd, str_value.lex_cstring(), str_value.charset());
+ set_name(thd, &str_value);
}
protected:
/* Just create an item and do not fill string representation */
@@ -4387,7 +4405,7 @@ public:
}
// Constructors with the item name set from its value
Item_string(THD *thd, const char *str, uint length, CHARSET_INFO *cs,
- Derivation dv, uint repertoire)
+ Derivation dv, my_repertoire_t repertoire)
:Item_literal(thd)
{
str_value.set_or_copy_aligned(str, length, cs);
@@ -4401,7 +4419,7 @@ public:
fix_and_set_name_from_value(thd, dv, Metadata(&str_value));
}
Item_string(THD *thd, const String *str, CHARSET_INFO *tocs, uint *conv_errors,
- Derivation dv, uint repertoire)
+ Derivation dv, my_repertoire_t repertoire)
:Item_literal(thd)
{
if (str_value.copy(str, tocs, conv_errors))
@@ -4419,7 +4437,7 @@ public:
set_name(thd, name_par);
}
Item_string(THD *thd, const LEX_CSTRING &name_par, const LEX_CSTRING &str,
- CHARSET_INFO *cs, Derivation dv, uint repertoire)
+ CHARSET_INFO *cs, Derivation dv, my_repertoire_t repertoire)
:Item_literal(thd)
{
str_value.set_or_copy_aligned(str.str, str.length, cs);
@@ -4552,7 +4570,7 @@ public:
Item_static_string_func(THD *thd, const LEX_CSTRING &name_par,
const String *str,
CHARSET_INFO *tocs, uint *conv_errors,
- Derivation dv, uint repertoire):
+ Derivation dv, my_repertoire_t repertoire):
Item_string(thd, str, tocs, conv_errors, dv, repertoire),
func_name(name_par)
{}
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 24914accc6f..8203af5c7dc 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1197,11 +1197,9 @@ longlong Item_func_truth::val_int()
}
-bool Item_in_optimizer::is_top_level_item()
+bool Item_in_optimizer::is_top_level_item() const
{
- if (invisible_mode())
- return FALSE;
- return ((Item_in_subselect *)args[1])->is_top_level_item();
+ return args[1]->is_top_level_item();
}
@@ -1265,10 +1263,9 @@ void Item_in_optimizer::print(String *str, enum_query_type query_type)
void Item_in_optimizer::restore_first_argument()
{
- if (!invisible_mode())
- {
- args[0]= ((Item_in_subselect *)args[1])->left_expr;
- }
+ Item_in_subselect *in_subs= args[1]->get_IN_subquery();
+ if (in_subs)
+ args[0]= in_subs->left_exp();
}
@@ -1292,8 +1289,8 @@ bool Item_in_optimizer::fix_left(THD *thd)
the pointer to the post-transformation item. Because of that, on the
next execution we need to copy args[1]->left_expr again.
*/
- ref0= &(((Item_in_subselect *)args[1])->left_expr);
- args[0]= ((Item_in_subselect *)args[1])->left_expr;
+ ref0= args[1]->get_IN_subquery()->left_exp_ptr();
+ args[0]= (*ref0);
}
if ((*ref0)->fix_fields_if_needed(thd, ref0) ||
(!cache && !(cache= (*ref0)->get_cache(thd))))
@@ -1419,9 +1416,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref)
bool Item_in_optimizer::invisible_mode()
{
/* MAX/MIN transformed or EXISTS->IN prepared => do nothing */
- return (args[1]->type() != Item::SUBSELECT_ITEM ||
- ((Item_subselect *)args[1])->substype() ==
- Item_subselect::EXISTS_SUBS);
+ return (args[1]->get_IN_subquery() == NULL);
}
@@ -1583,7 +1578,7 @@ longlong Item_in_optimizer::val_int()
"<outer_value_list> [NOT] IN (SELECT <inner_value_list>...)"
where one or more of the outer values is NULL.
*/
- if (((Item_in_subselect*)args[1])->is_top_level_item())
+ if (args[1]->is_top_level_item())
{
/*
We're evaluating a top level item, e.g.
@@ -1606,7 +1601,7 @@ longlong Item_in_optimizer::val_int()
SELECT evaluated over the non-NULL values produces at least
one row, FALSE otherwise
*/
- Item_in_subselect *item_subs=(Item_in_subselect*)args[1];
+ Item_in_subselect *item_subs= args[1]->get_IN_subquery();
bool all_left_cols_null= true;
const uint ncols= cache->cols();
@@ -1752,8 +1747,7 @@ Item *Item_in_optimizer::transform(THD *thd, Item_transformer transformer,
((Item_subselect*)(args[1]))->substype() ==
Item_subselect::ANY_SUBS));
- Item_in_subselect *in_arg= (Item_in_subselect*)args[1];
- thd->change_item_tree(&in_arg->left_expr, args[0]);
+ thd->change_item_tree(args[1]->get_IN_subquery()->left_exp_ptr(), args[0]);
}
return (this->*transformer)(thd, argument);
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 6d02d6642e2..b943bfc90da 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -367,36 +367,37 @@ public:
Item_bool_func(thd, a, b), cache(0), expr_cache(0),
save_cache(0), result_for_null_param(UNKNOWN)
{ m_with_subquery= true; }
- bool fix_fields(THD *, Item **);
+ bool fix_fields(THD *, Item **) override;
bool fix_left(THD *thd);
- table_map not_null_tables() const { return 0; }
- bool is_null();
- longlong val_int();
- void cleanup();
- enum Functype functype() const { return IN_OPTIMIZER_FUNC; }
- const char *func_name() const { return "<in_optimizer>"; }
+ table_map not_null_tables() const override { return 0; }
+ bool is_null() override;
+ longlong val_int() override;
+ void cleanup() override;
+ enum Functype functype() const override { return IN_OPTIMIZER_FUNC; }
+ const char *func_name() const override { return "<in_optimizer>"; }
Item_cache **get_cache() { return &cache; }
void keep_top_level_cache();
- Item *transform(THD *thd, Item_transformer transformer, uchar *arg);
- virtual Item *expr_cache_insert_transformer(THD *thd, uchar *unused);
- bool is_expensive_processor(void *arg);
- bool is_expensive();
- void set_join_tab_idx(uint join_tab_idx_arg)
+ Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
+ Item *expr_cache_insert_transformer(THD *thd, uchar *unused) override;
+ bool is_expensive_processor(void *arg) override;
+ bool is_expensive() override;
+ void set_join_tab_idx(uint join_tab_idx_arg) override
{ args[1]->set_join_tab_idx(join_tab_idx_arg); }
- virtual void get_cache_parameters(List<Item> &parameters);
- bool is_top_level_item();
- bool eval_not_null_tables(void *opt_arg);
- bool find_not_null_fields(table_map allowed);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
+ void get_cache_parameters(List<Item> &parameters) override;
+ bool is_top_level_item() const override;
+ bool eval_not_null_tables(void *opt_arg) override;
+ bool find_not_null_fields(table_map allowed) override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref,
+ bool merge) override;
bool invisible_mode();
void reset_cache() { cache= NULL; }
- virtual void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
void restore_first_argument();
Item* get_wrapped_in_subselect_item()
{ return args[1]; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_in_optimizer>(thd, this); }
- enum precedence precedence() const { return args[1]->precedence(); }
+ enum precedence precedence() const override { return args[1]->precedence(); }
};
@@ -601,17 +602,17 @@ class Item_func_not :public Item_bool_func
public:
Item_func_not(THD *thd, Item *a):
Item_bool_func(thd, a), abort_on_null(FALSE) {}
- virtual void top_level_item() { abort_on_null= 1; }
- bool is_top_level_item() { return abort_on_null; }
- longlong val_int();
- enum Functype functype() const { return NOT_FUNC; }
- const char *func_name() const { return "not"; }
- bool find_not_null_fields(table_map allowed) { return false; }
- enum precedence precedence() const { return BANG_PRECEDENCE; }
- Item *neg_transformer(THD *thd);
- bool fix_fields(THD *, Item **);
- virtual void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void top_level_item() override { abort_on_null= 1; }
+ bool is_top_level_item() const override { return abort_on_null; }
+ longlong val_int() override;
+ enum Functype functype() const override { return NOT_FUNC; }
+ const char *func_name() const override { return "not"; }
+ bool find_not_null_fields(table_map allowed) override { return false; }
+ enum precedence precedence() const override { return BANG_PRECEDENCE; }
+ Item *neg_transformer(THD *thd) override;
+ bool fix_fields(THD *, Item **) override;
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_not>(thd, this); }
};
@@ -889,19 +890,22 @@ public:
Item_func_opt_neg(THD *thd, List<Item> &list):
Item_bool_func(thd, list), negated(0), pred_level(0) {}
public:
- inline void top_level_item() { pred_level= 1; }
- bool is_top_level_item() const { return pred_level; }
- Item *neg_transformer(THD *thd)
+ void top_level_item() override { pred_level= 1; }
+ bool is_top_level_item() const override { return pred_level; }
+ Item *neg_transformer(THD *thd) override
{
negated= !negated;
return this;
}
- bool eq(const Item *item, bool binary_cmp) const;
- CHARSET_INFO *compare_collation() const { return cmp_collation.collation; }
- Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) = 0;
+ bool eq(const Item *item, bool binary_cmp) const override;
+ CHARSET_INFO *compare_collation() const override
+ {
+ return cmp_collation.collation;
+ }
+ Item *propagate_equal_fields(THD *, const Context &,
+ COND_EQUAL *) override= 0;
};
-
class Item_func_between :public Item_func_opt_neg
{
protected:
diff --git a/sql/item_create.cc b/sql/item_create.cc
index edf44fc3cd3..62f4d9f9fee 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+ Copyright (c) 2008, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 9e30afd0239..813927df32b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2288,10 +2288,13 @@ bool Item_func_int_val::fix_length_and_dec()
{
DBUG_ENTER("Item_func_int_val::fix_length_and_dec");
DBUG_PRINT("info", ("name %s", func_name()));
- if (args[0]->cast_to_int_type_handler()->
- Item_func_int_val_fix_length_and_dec(this))
+ /*
+ We don't want to translate ENUM/SET to CHAR here.
+ So let's call real_type_handler(), not type_handler().
+ */
+ if (args[0]->real_type_handler()->Item_func_int_val_fix_length_and_dec(this))
DBUG_RETURN(TRUE);
- DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
+ DBUG_PRINT("info", ("Type: %s", real_type_handler()->name().ptr()));
DBUG_RETURN(FALSE);
}
@@ -2299,6 +2302,7 @@ bool Item_func_int_val::fix_length_and_dec()
longlong Item_func_ceiling::int_op()
{
switch (args[0]->result_type()) {
+ case STRING_RESULT: // hex hybrid
case INT_RESULT:
return val_int_from_item(args[0]);
case DECIMAL_RESULT:
@@ -2332,9 +2336,32 @@ my_decimal *Item_func_ceiling::decimal_op(my_decimal *decimal_value)
}
+bool Item_func_ceiling::date_op(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate)
+{
+ Datetime::Options opt(thd, TIME_FRAC_TRUNCATE);
+ Datetime *tm= new (to) Datetime(thd, args[0], opt);
+ tm->ceiling(thd);
+ null_value= !tm->is_valid_datetime();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
+bool Item_func_ceiling::time_op(THD *thd, MYSQL_TIME *to)
+{
+ static const Time::Options_for_round opt;
+ Time *tm= new (to) Time(thd, args[0], opt);
+ tm->ceiling();
+ null_value= !tm->is_valid_time();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
longlong Item_func_floor::int_op()
{
switch (args[0]->result_type()) {
+ case STRING_RESULT: // hex hybrid
case INT_RESULT:
return val_int_from_item(args[0]);
case DECIMAL_RESULT:
@@ -2372,6 +2399,28 @@ my_decimal *Item_func_floor::decimal_op(my_decimal *decimal_value)
}
+bool Item_func_floor::date_op(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate)
+{
+ // DATETIME is not negative, so FLOOR means just truncation
+ Datetime::Options opt(thd, TIME_FRAC_TRUNCATE);
+ Datetime *tm= new (to) Datetime(thd, args[0], opt, 0);
+ null_value= !tm->is_valid_datetime();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
+bool Item_func_floor::time_op(THD *thd, MYSQL_TIME *to)
+{
+ static const Time::Options_for_round opt;
+ Time *tm= new (to) Time(thd, args[0], opt);
+ tm->floor();
+ null_value= !tm->is_valid_time();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
void Item_func_round::fix_length_and_dec_decimal(uint decimals_to_set)
{
int decimals_delta= args[0]->decimals - decimals_to_set;
@@ -2467,8 +2516,27 @@ void Item_func_round::fix_arg_datetime()
}
-void Item_func_round::fix_arg_int()
+/**
+ Calculate data type and attributes for INT-alike input.
+
+ @param [IN] preferred - The preferred data type handler for simple cases
+ such as ROUND(x) and TRUNCATE(x,0), when the input
+ is short enough to fit into an integer type
+ (without extending to DECIMAL).
+ - If `preferred` is not NULL, then the code tries
+ to preserve the given data type handler and
+ the data type attributes `preferred_attrs`.
+ - If `preferred` is NULL, then the code fully
+ calculates attributes using
+ args[0]->decimal_precision() and chooses between
+ INT and BIGINT, depending on attributes.
+ @param [IN] preferred_attrs - The preferred data type attributes for
+ simple cases.
+*/
+void Item_func_round::fix_arg_int(const Type_handler *preferred,
+ const Type_std_attributes *preferred_attrs)
{
+ DBUG_ASSERT(args[0]->decimals == 0);
if (args[1]->const_item())
{
Longlong_hybrid val1= args[1]->to_longlong_hybrid();
@@ -2477,13 +2545,35 @@ void Item_func_round::fix_arg_int()
else if ((!val1.to_uint(DECIMAL_MAX_SCALE) && truncate) ||
args[0]->decimal_precision() < DECIMAL_LONGLONG_DIGITS)
{
+ // Here we can keep INT_RESULT
// Length can increase in some cases: ROUND(9,-1) -> 10
int length_can_increase= MY_TEST(!truncate && val1.neg());
- max_length= args[0]->max_length + length_can_increase;
- // Here we can keep INT_RESULT
- unsigned_flag= args[0]->unsigned_flag;
- decimals= 0;
- set_handler(type_handler_long_or_longlong());
+ if (preferred)
+ {
+ Type_std_attributes::set(preferred_attrs);
+ if (!length_can_increase)
+ {
+ // Preserve the exact data type and attributes
+ set_handler(preferred);
+ }
+ else
+ {
+ max_length++;
+ set_handler(type_handler_long_or_longlong());
+ }
+ }
+ else
+ {
+ /*
+ This branch is currently used for hex hybrid only.
+ It's known to be unsigned. So sign length is 0.
+ */
+ DBUG_ASSERT(args[0]->unsigned_flag); // no needs to add sign length
+ max_length= args[0]->decimal_precision() + length_can_increase;
+ unsigned_flag= true;
+ decimals= 0;
+ set_handler(type_handler_long_or_longlong());
+ }
}
else
fix_length_and_dec_decimal(val1.to_uint(DECIMAL_MAX_SCALE));
@@ -2610,9 +2700,7 @@ bool Item_func_round::time_op(THD *thd, MYSQL_TIME *to)
{
DBUG_ASSERT(args[0]->type_handler()->mysql_timestamp_type() ==
MYSQL_TIMESTAMP_TIME);
- Time::Options opt(Time::default_flags_for_get_date(),
- truncate ? TIME_FRAC_TRUNCATE : TIME_FRAC_ROUND,
- Time::DATETIME_TO_TIME_DISALLOW);
+ Time::Options_for_round opt(truncate ? TIME_FRAC_TRUNCATE : TIME_FRAC_ROUND);
Longlong_hybrid_null dec= args[1]->to_longlong_hybrid_null();
Time *tm= new (to) Time(thd, args[0], opt,
dec.to_uint(TIME_SECOND_PART_DIGITS));
diff --git a/sql/item_func.h b/sql/item_func.h
index 4922d20bd0c..07ee913b07d 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -450,6 +450,25 @@ public:
:Item_func(thd, item), Type_handler_hybrid_field_type(item) { }
const Type_handler *type_handler() const
{ return Type_handler_hybrid_field_type::type_handler(); }
+ void fix_length_and_dec_long_or_longlong(uint char_length, bool unsigned_arg)
+ {
+ collation= DTCollation_numeric();
+ unsigned_flag= unsigned_arg;
+ max_length= char_length;
+ set_handler(Type_handler::type_handler_long_or_longlong(char_length,
+ unsigned_arg));
+ }
+ void fix_length_and_dec_ulong_or_ulonglong_by_nbits(uint nbits)
+ {
+ uint digits= Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits(nbits);
+ collation= DTCollation_numeric();
+ unsigned_flag= true;
+ max_length= digits;
+ if (nbits > 32)
+ set_handler(&type_handler_ulonglong);
+ else
+ set_handler(&type_handler_ulong);
+ }
};
@@ -1813,13 +1832,32 @@ public:
};
-class Item_func_int_val :public Item_func_num1
+class Item_func_int_val :public Item_func_hybrid_field_type
{
public:
- Item_func_int_val(THD *thd, Item *a): Item_func_num1(thd, a) {}
+ Item_func_int_val(THD *thd, Item *a): Item_func_hybrid_field_type(thd, a) {}
+ bool check_partition_func_processor(void *int_arg) { return FALSE; }
+ bool check_vcol_func_processor(void *arg) { return FALSE; }
void fix_length_and_dec_double();
void fix_length_and_dec_int_or_decimal();
+ void fix_length_and_dec_time()
+ {
+ fix_attributes_time(0);
+ set_handler(&type_handler_time2);
+ }
+ void fix_length_and_dec_datetime()
+ {
+ fix_attributes_datetime(0);
+ set_handler(&type_handler_datetime2);
+ maybe_null= true; // E.g. CEILING(TIMESTAMP'0000-01-01 23:59:59.9')
+ }
bool fix_length_and_dec();
+ String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
+ bool native_op(THD *thd, Native *to)
+ {
+ DBUG_ASSERT(0);
+ return true;
+ }
};
@@ -1831,6 +1869,8 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
+ bool time_op(THD *thd, MYSQL_TIME *ltime);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_ceiling>(thd, this); }
};
@@ -1844,6 +1884,8 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
+ bool time_op(THD *thd, MYSQL_TIME *ltime);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_floor>(thd, this); }
};
@@ -1875,14 +1917,19 @@ public:
return NULL;
}
void fix_arg_decimal();
- void fix_arg_int();
+ void fix_arg_int(const Type_handler *preferred,
+ const Type_std_attributes *preferred_attributes);
void fix_arg_double();
void fix_arg_time();
void fix_arg_datetime();
void fix_arg_temporal(const Type_handler *h, uint int_part_length);
bool fix_length_and_dec()
{
- return args[0]->type_handler()->Item_func_round_fix_length_and_dec(this);
+ /*
+ We don't want to translate ENUM/SET to CHAR here.
+ So let's real_type_handler(), not type_handler().
+ */
+ return args[0]->real_type_handler()->Item_func_round_fix_length_and_dec(this);
}
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_round>(thd, this); }
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index bcc041ae9c6..7f853a73c71 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1391,8 +1391,8 @@ String *Item_func_regexp_replace::val_str(String *str)
!(replace= re.convert_if_needed(replace, &re.replace_converter)))
goto err;
- src= source->lex_cstring();
- rpl= replace->lex_cstring();
+ source->get_value(&src);
+ replace->get_value(&rpl);
str->length(0);
str->set_charset(collation.collation);
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 1690ec96e65..16fa06f4cda 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -4141,7 +4141,8 @@ int subselect_uniquesubquery_engine::exec()
TABLE *table= tab->table;
empty_result_set= TRUE;
table->status= 0;
- Item_in_subselect *in_subs= (Item_in_subselect *) item;
+ Item_in_subselect *in_subs= item->get_IN_subquery();
+ DBUG_ASSERT(in_subs);
if (!tab->preread_init_done && tab->preread_init())
DBUG_RETURN(1);
@@ -4186,11 +4187,11 @@ int subselect_uniquesubquery_engine::exec()
table->null_row= 0;
if (!table->status && (!cond || cond->val_int()))
{
- ((Item_in_subselect *) item)->value= 1;
+ in_subs->value= 1;
empty_result_set= FALSE;
}
else
- ((Item_in_subselect *) item)->value= 0;
+ in_subs->value= 0;
}
DBUG_RETURN(error != 0);
@@ -4229,9 +4230,9 @@ int subselect_uniquesubquery_engine::index_lookup()
table->null_row= 0;
if (!error && (!cond || cond->val_int()))
- ((Item_in_subselect *) item)->value= 1;
+ item->get_IN_subquery()->value= 1;
else
- ((Item_in_subselect *) item)->value= 0;
+ item->get_IN_subquery()->value= 0;
DBUG_RETURN(0);
}
@@ -4301,9 +4302,9 @@ int subselect_indexsubquery_engine::exec()
int error;
bool null_finding= 0;
TABLE *table= tab->table;
- Item_in_subselect *in_subs= (Item_in_subselect *) item;
+ Item_in_subselect *in_subs= item->get_IN_subquery();
- ((Item_in_subselect *) item)->value= 0;
+ in_subs->value= 0;
empty_result_set= TRUE;
table->status= 0;
@@ -4311,7 +4312,7 @@ int subselect_indexsubquery_engine::exec()
{
/* We need to check for NULL if there wasn't a matching value */
*tab->ref.null_ref_key= 0; // Search first for not null
- ((Item_in_subselect *) item)->was_null= 0;
+ in_subs->was_null= 0;
}
if (!tab->preread_init_done && tab->preread_init())
@@ -4363,9 +4364,9 @@ int subselect_indexsubquery_engine::exec()
{
empty_result_set= FALSE;
if (null_finding)
- ((Item_in_subselect *) item)->was_null= 1;
+ in_subs->was_null= 1;
else
- ((Item_in_subselect *) item)->value= 1;
+ in_subs->value= 1;
break;
}
error= table->file->ha_index_next_same(table->record[0],
@@ -4751,7 +4752,7 @@ bool subselect_uniquesubquery_engine::no_tables()
subselect_hash_sj_engine::exec_strategy
subselect_hash_sj_engine::get_strategy_using_schema()
{
- Item_in_subselect *item_in= (Item_in_subselect *) item;
+ Item_in_subselect *item_in= item->get_IN_subquery();
if (item_in->is_top_level_item())
return COMPLETE_MATCH;
@@ -4798,7 +4799,7 @@ subselect_hash_sj_engine::get_strategy_using_schema()
subselect_hash_sj_engine::exec_strategy
subselect_hash_sj_engine::get_strategy_using_data()
{
- Item_in_subselect *item_in= (Item_in_subselect *) item;
+ Item_in_subselect *item_in= item->get_IN_subquery();
select_materialize_with_stats *result_sink=
(select_materialize_with_stats *) result;
Item *outer_col;
@@ -5049,8 +5050,9 @@ bool subselect_hash_sj_engine::init(List<Item> *tmp_columns, uint subquery_id)
DBUG_RETURN(TRUE);
result_sink->get_tmp_table_param()->materialized_subquery= true;
- if (item->substype() == Item_subselect::IN_SUBS &&
- ((Item_in_subselect*)item)->is_jtbm_merged)
+
+ if (item->substype() == Item_subselect::IN_SUBS &&
+ (item->get_IN_subquery()->is_jtbm_merged))
{
result_sink->get_tmp_table_param()->force_not_null_cols= true;
}
@@ -5090,9 +5092,12 @@ bool subselect_hash_sj_engine::init(List<Item> *tmp_columns, uint subquery_id)
/*
Make sure there is only one index on the temp table, and it doesn't have
the extra key part created when s->uniques > 0.
+
+ NOTE: item have to be Item_in_subselect, because class constructor
+ accept Item_in_subselect as the parmeter.
*/
DBUG_ASSERT(tmp_table->s->keys == 1 &&
- ((Item_in_subselect *) item)->left_expr->cols() ==
+ item->get_IN_subquery()->left_expr->cols() ==
tmp_table->key_info->user_defined_key_parts);
if (make_semi_join_conds() ||
@@ -5141,7 +5146,7 @@ bool subselect_hash_sj_engine::make_semi_join_conds()
TABLE_LIST *tmp_table_ref;
/* Name resolution context for all tmp_table columns created below. */
Name_resolution_context *context;
- Item_in_subselect *item_in= (Item_in_subselect *) item;
+ Item_in_subselect *item_in= item->get_IN_subquery();
LEX_CSTRING table_name;
DBUG_ENTER("subselect_hash_sj_engine::make_semi_join_conds");
DBUG_ASSERT(semi_join_conds == NULL);
@@ -5203,7 +5208,7 @@ bool subselect_hash_sj_engine::make_semi_join_conds()
subselect_uniquesubquery_engine*
subselect_hash_sj_engine::make_unique_engine()
{
- Item_in_subselect *item_in= (Item_in_subselect *) item;
+ Item_in_subselect *item_in= item->get_IN_subquery();
Item_iterator_row it(item_in->left_expr);
/* The only index on the temporary table. */
KEY *tmp_key= tmp_table->key_info;
@@ -5225,7 +5230,7 @@ subselect_hash_sj_engine::make_unique_engine()
tab->preread_init_done= FALSE;
tab->ref.tmp_table_index_lookup_init(thd, tmp_key, it, FALSE);
- DBUG_RETURN(new subselect_uniquesubquery_engine(thd, tab, item,
+ DBUG_RETURN(new subselect_uniquesubquery_engine(thd, tab, item_in,
semi_join_conds));
}
@@ -5272,7 +5277,7 @@ void subselect_hash_sj_engine::cleanup()
at parse time and stored across executions, while all other materialization
related engines are created and chosen for each execution.
*/
- ((Item_in_subselect *) item)->engine= materialize_engine;
+ item->get_IN_subquery()->engine= materialize_engine;
if (lookup_engine_type == TABLE_SCAN_ENGINE ||
lookup_engine_type == ROWID_MERGE_ENGINE)
{
@@ -5512,7 +5517,7 @@ double get_post_group_estimate(JOIN* join, double join_op_rows)
int subselect_hash_sj_engine::exec()
{
- Item_in_subselect *item_in= (Item_in_subselect *) item;
+ Item_in_subselect *item_in= item->get_IN_subquery();
SELECT_LEX *save_select= thd->lex->current_select;
subselect_partial_match_engine *pm_engine= NULL;
int res= 0;
@@ -6129,7 +6134,7 @@ subselect_partial_match_engine::subselect_partial_match_engine(
int subselect_partial_match_engine::exec()
{
- Item_in_subselect *item_in= (Item_in_subselect *) item;
+ Item_in_subselect *item_in= item->get_IN_subquery();
int lookup_res;
DBUG_ASSERT(!(item_in->left_expr_has_null() &&
@@ -6251,7 +6256,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
select_materialize_with_stats *result_sink=
(select_materialize_with_stats *) result;
uint cur_keyid= 0;
- Item_in_subselect *item_in= (Item_in_subselect*) item;
+ Item *left= item->get_IN_subquery()->left_exp();
int error;
if (merge_keys_count == 0)
@@ -6286,7 +6291,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
/* Create the only non-NULL key if there is any. */
if (non_null_key_parts)
{
- non_null_key= new Ordered_key(cur_keyid, tmp_table, item_in->left_expr,
+ non_null_key= new Ordered_key(cur_keyid, tmp_table, left,
0, 0, 0, row_num_to_rowid);
if (non_null_key->init(non_null_key_parts))
return TRUE;
@@ -6318,7 +6323,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
merge_keys[cur_keyid]= new Ordered_key(
cur_keyid, tmp_table,
- item_in->left_expr->element_index(i),
+ left->element_index(i),
result_sink->get_null_count_of_col(i),
result_sink->get_min_null_of_col(i),
result_sink->get_max_null_of_col(i),
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 8f6e4836ac7..b4b278083fc 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -151,9 +151,7 @@ public:
virtual subs_type substype() { return UNKNOWN_SUBS; }
bool is_in_predicate()
{
- return (substype() == Item_subselect::IN_SUBS ||
- substype() == Item_subselect::ALL_SUBS ||
- substype() == Item_subselect::ANY_SUBS);
+ return get_IN_subquery() != NULL;
}
/*
@@ -165,7 +163,7 @@ public:
select_result_interceptor *result);
~Item_subselect();
- void cleanup();
+ void cleanup() override;
virtual void reset()
{
eliminated= FALSE;
@@ -175,22 +173,23 @@ public:
Set the subquery result to a default value consistent with the semantics of
the result row produced for queries with implicit grouping.
*/
- void no_rows_in_result()= 0;
+ void no_rows_in_result() override= 0;
virtual bool select_transformer(JOIN *join);
bool assigned() { return value_assigned; }
void assigned(bool a) { value_assigned= a; }
- enum Type type() const;
- bool is_null()
+ enum Type type() const override;
+ bool is_null() override
{
update_null_value();
return null_value;
}
- bool fix_fields(THD *thd, Item **ref);
- bool with_subquery() const { DBUG_ASSERT(fixed); return true; }
- bool with_sum_func() const { return m_with_sum_func; }
- With_sum_func_cache* get_with_sum_func_cache() { return this; }
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool with_subquery() const override { DBUG_ASSERT(fixed); return true; }
+ bool with_sum_func() const override { return m_with_sum_func; }
+ With_sum_func_cache* get_with_sum_func_cache() override { return this; }
bool mark_as_dependent(THD *thd, st_select_lex *select, Item *item);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref,
+ bool merge) override;
void recalc_used_tables(st_select_lex *new_parent, bool after_pullout);
virtual bool exec();
/*
@@ -204,13 +203,13 @@ public:
forced_const= TRUE;
}
virtual bool fix_length_and_dec();
- table_map used_tables() const;
- table_map not_null_tables() const { return 0; }
- bool const_item() const;
+ table_map used_tables() const override;
+ table_map not_null_tables() const override { return 0; }
+ bool const_item() const override;
inline table_map get_used_tables_cache() { return used_tables_cache; }
- Item *get_tmp_table_item(THD *thd);
- void update_used_tables();
- virtual void print(String *str, enum_query_type query_type);
+ Item *get_tmp_table_item(THD *thd) override;
+ void update_used_tables() override;
+ void print(String *str, enum_query_type query_type) override;
virtual bool have_guarded_conds() { return FALSE; }
bool change_engine(subselect_engine *eng)
{
@@ -225,7 +224,7 @@ public:
*/
bool is_evaluated() const;
bool is_uncacheable() const;
- bool is_expensive();
+ bool is_expensive() override;
/*
Used by max/min subquery to initialize value presence registration
@@ -233,13 +232,13 @@ public:
*/
virtual void reset_value_registration() {}
enum_parsing_place place() { return parsing_place; }
- bool walk(Item_processor processor, bool walk_subquery, void *arg);
- bool unknown_splocal_processor(void *arg);
- bool mark_as_eliminated_processor(void *arg);
- bool eliminate_subselect_processor(void *arg);
- bool set_fake_select_as_master_processor(void *arg);
- bool enumerate_field_refs_processor(void *arg);
- bool check_vcol_func_processor(void *arg)
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
+ bool unknown_splocal_processor(void *arg) override;
+ bool mark_as_eliminated_processor(void *arg) override;
+ bool eliminate_subselect_processor(void *arg) override;
+ bool set_fake_select_as_master_processor(void *arg) override;
+ bool enumerate_field_refs_processor(void *arg) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function("select ...", arg, VCOL_IMPOSSIBLE);
}
@@ -252,27 +251,27 @@ public:
@retval TRUE if the predicate is expensive
@retval FALSE otherwise
*/
- bool is_expensive_processor(void *arg) { return is_expensive(); }
+ bool is_expensive_processor(void *arg) override { return is_expensive(); }
/**
Get the SELECT_LEX structure associated with this Item.
@return the SELECT_LEX structure associated with this Item
*/
st_select_lex* get_select_lex();
- virtual bool expr_cache_is_needed(THD *);
- virtual void get_cache_parameters(List<Item> &parameters);
- virtual bool is_subquery_processor (void *opt_arg) { return 1; }
- bool exists2in_processor(void *opt_arg) { return 0; }
- bool limit_index_condition_pushdown_processor(void *opt_arg)
+ bool expr_cache_is_needed(THD *) override;
+ void get_cache_parameters(List<Item> &parameters) override;
+ bool is_subquery_processor (void *opt_arg) override { return 1; }
+ bool exists2in_processor(void *opt_arg) override { return 0; }
+ bool limit_index_condition_pushdown_processor(void *opt_arg) override
{
return TRUE;
}
void register_as_with_rec_ref(With_element *with_elem);
void init_expr_cache_tracker(THD *thd);
-
- Item* build_clone(THD *thd) { return 0; }
- Item* get_copy(THD *thd) { return 0; }
+
+ Item* build_clone(THD *thd) override { return 0; }
+ Item* get_copy(THD *thd) override { return 0; }
bool wrap_tvc_into_select(THD *thd, st_select_lex *tvc_sl);
@@ -395,37 +394,40 @@ public:
emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0)
{}
- subs_type substype() { return EXISTS_SUBS; }
- void reset()
+ subs_type substype() override { return EXISTS_SUBS; }
+ void reset() override
{
eliminated= FALSE;
value= 0;
}
- void no_rows_in_result();
+ void no_rows_in_result() override;
- const Type_handler *type_handler() const { return &type_handler_bool; }
- longlong val_int();
- double val_real();
- String *val_str(String*);
- my_decimal *val_decimal(my_decimal *);
- bool val_bool();
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ const Type_handler *type_handler() const override
+ {
+ return &type_handler_bool;
+ }
+ longlong val_int() override;
+ double val_real() override;
+ String *val_str(String*) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool val_bool() override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{ return get_date_from_int(thd, ltime, fuzzydate); }
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
- void print(String *str, enum_query_type query_type);
- bool select_transformer(JOIN *join);
- void top_level_item() { abort_on_null=1; }
- inline bool is_top_level_item() { return abort_on_null; }
- bool exists2in_processor(void *opt_arg);
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
+ void print(String *str, enum_query_type query_type) override;
+ bool select_transformer(JOIN *join) override;
+ void top_level_item() override { abort_on_null=1; }
+ bool is_top_level_item() const override { return abort_on_null; }
+ bool exists2in_processor(void *opt_arg) override;
- Item* expr_cache_insert_transformer(THD *thd, uchar *unused);
+ Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override;
- void mark_as_condition_AND_part(TABLE_LIST *embedding)
+ void mark_as_condition_AND_part(TABLE_LIST *embedding) override
{
emb_on_expr_nest= embedding;
}
- virtual void under_not(Item_func_not *upper) { upper_not= upper; };
+ void under_not(Item_func_not *upper) override { upper_not= upper; };
void set_exists_transformed() { exists_transformed= TRUE; }
@@ -507,7 +509,6 @@ protected:
bool create_row_in_to_exists_cond(JOIN * join,
Item **where_item,
Item **having_item);
-public:
Item *left_expr;
/*
Important for PS/SP: left_expr_orig is the item that left_expr originally
@@ -515,6 +516,7 @@ public:
left_expr could later be changed to something on the execution arena.
*/
Item *left_expr_orig;
+public:
/* Priority of this predicate in the convert-to-semi-join-nest process. */
int sj_convert_priority;
/* May be TRUE only for the candidates to semi-join conversion */
@@ -603,7 +605,7 @@ public:
if ( pushed_cond_guards)
pushed_cond_guards[i]= v;
}
- bool have_guarded_conds() { return MY_TEST(pushed_cond_guards); }
+ bool have_guarded_conds() override { return MY_TEST(pushed_cond_guards); }
Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery
@@ -613,41 +615,42 @@ public:
in_strategy(SUBS_NOT_TRANSFORMED),
pushed_cond_guards(NULL), func(NULL), do_not_convert_to_sj(FALSE),
is_jtbm_merged(FALSE), is_jtbm_const_tab(FALSE), upper_item(0) {}
- void cleanup();
- subs_type substype() { return IN_SUBS; }
- void reset()
+ void cleanup() override;
+ subs_type substype() override { return IN_SUBS; }
+ void reset() override
{
eliminated= FALSE;
value= 0;
null_value= 0;
was_null= 0;
}
- bool select_transformer(JOIN *join);
+ bool select_transformer(JOIN *join) override;
bool create_in_to_exists_cond(JOIN *join_arg);
bool inject_in_to_exists_cond(JOIN *join_arg);
- virtual bool exec();
- longlong val_int();
- double val_real();
- String *val_str(String*);
- my_decimal *val_decimal(my_decimal *);
- bool val_bool();
+ bool exec() override;
+ longlong val_int() override;
+ double val_real() override;
+ String *val_str(String*) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool val_bool() override;
bool test_limit(st_select_lex_unit *unit);
- void print(String *str, enum_query_type query_type);
- enum precedence precedence() const { return CMP_PRECEDENCE; }
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
- bool const_item() const
+ void print(String *str, enum_query_type query_type) override;
+ enum precedence precedence() const override { return CMP_PRECEDENCE; }
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref,
+ bool merge) override;
+ bool const_item() const override
{
return Item_subselect::const_item() && left_expr->const_item();
}
- void update_used_tables();
+ void update_used_tables() override;
bool setup_mat_engine();
bool init_left_expr_cache();
/* Inform 'this' that it was computed, and contains a valid result. */
void set_first_execution() { if (first_execution) first_execution= FALSE; }
- bool expr_cache_is_needed(THD *thd);
+ bool expr_cache_is_needed(THD *thd) override;
inline bool left_expr_has_null();
void disable_cond_guard_for_const_null_left_expr(int i)
@@ -739,19 +742,28 @@ public:
DBUG_VOID_RETURN;
}
- bool walk(Item_processor processor, bool walk_subquery, void *arg)
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override
{
return left_expr->walk(processor, walk_subquery, arg) ||
Item_subselect::walk(processor, walk_subquery, arg);
}
- bool exists2in_processor(void *opt_arg __attribute__((unused)))
+ bool exists2in_processor(void *opt_arg __attribute__((unused))) override
{
return 0;
};
bool pushdown_cond_for_in_subquery(THD *thd, Item *cond);
+ Item_in_subselect *get_IN_subquery() override
+ { return this; }
+ inline Item** left_exp_ptr()
+ { return &left_expr; }
+ inline Item* left_exp() const
+ { return left_expr; }
+ inline Item* left_exp_orig() const
+ { return left_expr_orig; }
+
friend class Item_ref_null_helper;
friend class Item_is_not_null_test;
friend class Item_in_optimizer;
@@ -964,9 +976,9 @@ public:
// constructor can assign THD because it will be called after JOIN::prepare
subselect_uniquesubquery_engine(THD *thd_arg, st_join_table *tab_arg,
- Item_subselect *subs, Item *where)
+ Item_in_subselect *subs, Item *where)
:subselect_engine(subs, 0), tab(tab_arg), cond(where)
- {}
+ { DBUG_ASSERT(subs); }
~subselect_uniquesubquery_engine();
void cleanup();
int prepare(THD *);
@@ -1027,12 +1039,12 @@ public:
// constructor can assign THD because it will be called after JOIN::prepare
subselect_indexsubquery_engine(THD *thd_arg, st_join_table *tab_arg,
- Item_subselect *subs, Item *where,
+ Item_in_subselect *subs, Item *where,
Item *having_arg, bool chk_null)
:subselect_uniquesubquery_engine(thd_arg, tab_arg, subs, where),
check_null(chk_null),
having(having_arg)
- {}
+ { DBUG_ASSERT(subs); }
int exec();
void print (String *str, enum_query_type query_type);
virtual enum_engine_type engine_type() { return INDEXSUBQUERY_ENGINE; }
@@ -1095,14 +1107,14 @@ public:
Name_resolution_context *semi_join_conds_context;
- subselect_hash_sj_engine(THD *thd_arg, Item_subselect *in_predicate,
+ subselect_hash_sj_engine(THD *thd_arg, Item_in_subselect *in_predicate,
subselect_single_select_engine *old_engine)
: subselect_engine(in_predicate, NULL),
tmp_table(NULL), is_materialized(FALSE), materialize_engine(old_engine),
materialize_join(NULL), semi_join_conds(NULL), lookup_engine(NULL),
count_partial_match_columns(0), count_null_only_columns(0),
count_columns_with_nulls(0), strategy(UNDEFINED)
- {}
+ { DBUG_ASSERT(in_predicate); }
~subselect_hash_sj_engine();
bool init(List<Item> *tmp_columns, uint subquery_id);
@@ -1410,7 +1422,7 @@ public:
from Item_in_optimizer::val_int() sets Item_in_optimizer::null_value
correctly.
*/
- return !(((Item_in_subselect *) item)->null_value);
+ return !(item->get_IN_subquery()->null_value);
}
void print(String*, enum_query_type);
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index e47d4fa7f0e..7bc34ee688c 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -449,7 +449,8 @@ static bool extract_date_time(THD *thd, DATE_TIME_FORMAT *format,
{
ErrConvString err(val_begin, length, &my_charset_bin);
make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- &err, cached_timestamp_type, 0, NullS);
+ &err, cached_timestamp_type,
+ nullptr, nullptr, nullptr);
break;
}
} while (++val != val_end);
@@ -473,7 +474,7 @@ err:
Create a formated date/time value in a string.
*/
-static bool make_date_time(const LEX_CSTRING &format, MYSQL_TIME *l_time,
+static bool make_date_time(String *format, MYSQL_TIME *l_time,
timestamp_type type, const MY_LOCALE *locale,
String *str)
{
@@ -488,7 +489,7 @@ static bool make_date_time(const LEX_CSTRING &format, MYSQL_TIME *l_time,
if (l_time->neg)
str->append('-');
- end= (ptr= format.str) + format.length;
+ end= (ptr= format->ptr()) + format->length();
for (; ptr != end ; ptr++)
{
if (*ptr != '%' || ptr+1 == end)
@@ -1576,7 +1577,7 @@ static void set_sec_part(ulong sec_part, MYSQL_TIME *ltime, Item *item)
{
ltime->second_part= sec_part;
if (item->decimals < TIME_SECOND_PART_DIGITS)
- my_time_trunc(ltime, item->decimals);
+ my_datetime_trunc(ltime, item->decimals);
}
}
@@ -1742,7 +1743,7 @@ bool Item_func_date_format::fix_length_and_dec()
decimals=0;
CHARSET_INFO *cs= thd->variables.collation_connection;
- uint32 repertoire= arg1->collation.repertoire;
+ my_repertoire_t repertoire= arg1->collation.repertoire;
if (!thd->variables.lc_time_names->is_ascii)
repertoire|= MY_REPERTOIRE_EXTENDED;
collation.set(cs, arg1->collation.derivation, repertoire);
@@ -1877,6 +1878,7 @@ String *Item_func_date_format::val_str(String *str)
DBUG_ASSERT(fixed == 1);
date_conv_mode_t mode= is_time_format ? TIME_TIME_ONLY : TIME_CONV_NONE;
THD *thd= current_thd;
+
if ((null_value= args[0]->get_date(thd, &l_time,
Temporal::Options(mode, thd))))
return 0;
@@ -1901,7 +1903,7 @@ String *Item_func_date_format::val_str(String *str)
/* Create the result string */
str->set_charset(collation.collation);
- if (!make_date_time(format->lex_cstring(), &l_time,
+ if (!make_date_time(format, &l_time,
is_time_format ? MYSQL_TIMESTAMP_TIME :
MYSQL_TIMESTAMP_DATE,
lc, str))
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index 25e86c5d777..24c2ef5a2f2 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -556,12 +556,10 @@ void Item_window_func::print(String *str, enum_query_type query_type)
}
window_func()->print(str, query_type);
str->append(" over ");
-#ifndef DBUG_OFF
- if (!window_spec) // one can call dbug_print_item() anytime in gdb
+ if (!window_spec)
str->append(window_name);
else
-#endif
- window_spec->print(str, query_type);
+ window_spec->print(str, query_type);
}
void Item_window_func::print_for_percentile_functions(String *str, enum_query_type query_type)
{
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index c3304122c1b..99ef738ac69 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2016,2019 MariaDB
+ Copyright (c) 2016, 2020, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -651,7 +651,7 @@ class Item_sum_ntile : public Item_sum_int,
{
public:
Item_sum_ntile(THD* thd, Item* num_quantiles_expr) :
- Item_sum_int(thd, num_quantiles_expr)
+ Item_sum_int(thd, num_quantiles_expr), n_old_val_(0)
{ }
longlong val_int()
@@ -664,11 +664,13 @@ class Item_sum_ntile : public Item_sum_int,
longlong num_quantiles= get_num_quantiles();
- if (num_quantiles <= 0) {
+ if (num_quantiles <= 0 ||
+ (static_cast<ulonglong>(num_quantiles) != n_old_val_ && n_old_val_ > 0))
+ {
my_error(ER_INVALID_NTILE_ARGUMENT, MYF(0));
return true;
}
-
+ n_old_val_= static_cast<ulonglong>(num_quantiles);
null_value= false;
ulonglong quantile_size = get_row_count() / num_quantiles;
ulonglong extra_rows = get_row_count() - quantile_size * num_quantiles;
@@ -694,6 +696,7 @@ class Item_sum_ntile : public Item_sum_int,
{
current_row_count_= 0;
partition_row_count_= 0;
+ n_old_val_= 0;
}
const char*func_name() const
@@ -717,6 +720,7 @@ class Item_sum_ntile : public Item_sum_int,
private:
longlong get_num_quantiles() { return args[0]->val_int(); }
+ ulonglong n_old_val_;
};
class Item_sum_percentile_disc : public Item_sum_num,
diff --git a/sql/log.cc b/sql/log.cc
index 5f4fd6bbcab..0bfe7d7ee8b 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2828,7 +2828,9 @@ bool MYSQL_LOG::open(
else if ((seek_offset= mysql_file_tell(file, MYF(MY_WME))))
goto err;
- if (init_io_cache(&log_file, file, IO_SIZE, io_cache_type, seek_offset, 0,
+ if (init_io_cache(&log_file, file, (log_type == LOG_NORMAL ? IO_SIZE :
+ LOG_BIN_IO_SIZE),
+ io_cache_type, seek_offset, 0,
MYF(MY_WME | MY_NABP |
((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0))))
goto err;
diff --git a/sql/log.h b/sql/log.h
index 063513fe908..58e681985eb 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -295,6 +295,12 @@ enum enum_log_type { LOG_UNKNOWN, LOG_NORMAL, LOG_BIN };
enum enum_log_state { LOG_OPENED, LOG_CLOSED, LOG_TO_BE_OPENED };
/*
+ Use larger buffers when reading from and to binary log
+ We make it one step smaller than 64K to account for malloc overhead.
+*/
+#define LOG_BIN_IO_SIZE MY_ALIGN_DOWN(65536-1, IO_SIZE)
+
+/*
TODO use mmap instead of IO_CACHE for binlog
(mmap+fsync is two times faster than write+fsync)
*/
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index c53a2b53769..bdc42885312 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -2036,8 +2036,7 @@ bool Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
}
else if (strcmp("COMMIT", query) == 0)
{
- if (my_b_write(&cache, (uchar*) "BEGIN", 5) ||
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ if (my_b_printf(&cache, "START TRANSACTION\n%s\n", print_event_info->delimiter))
goto err;
}
}
@@ -2396,7 +2395,7 @@ bool Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
my_b_printf(&cache, "\tXid = %s\n", buf))
goto err;
}
- if (my_b_printf(&cache, is_flashback ? "BEGIN%s\n" : "COMMIT%s\n",
+ if (my_b_printf(&cache, is_flashback ? "START TRANSACTION%s\n" : "COMMIT%s\n",
print_event_info->delimiter))
goto err;
@@ -3899,8 +3898,8 @@ Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
}
else if (!(flags2 & FL_STANDALONE))
{
- if (my_b_printf(&cache, is_flashback ? "COMMIT\n%s\n" : "BEGIN\n%s\n",
- print_event_info->delimiter))
+ if (my_b_printf(&cache, is_flashback ? "COMMIT\n%s\n" :
+ "START TRANSACTION\n%s\n", print_event_info->delimiter))
goto err;
}
diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc
index a6e02413d4c..88e30827dfd 100644
--- a/sql/log_event_server.cc
+++ b/sql/log_event_server.cc
@@ -8028,7 +8028,6 @@ end:
if (is_table_scan || is_index_scan)
issue_long_find_row_warning(get_general_type_code(), m_table->alias.c_ptr(),
is_index_scan, rgi);
- table->default_column_bitmaps();
DBUG_RETURN(error);
}
@@ -8263,7 +8262,13 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
#endif /* WSREP_PROC_INFO */
thd_proc_info(thd, message);
- int error= find_row(rgi);
+ // Temporary fix to find out why it fails [/Matz]
+ memcpy(m_table->read_set->bitmap, m_cols.bitmap, (m_table->read_set->n_bits + 7) / 8);
+ memcpy(m_table->write_set->bitmap, m_cols_ai.bitmap, (m_table->write_set->n_bits + 7) / 8);
+
+ m_table->mark_columns_per_binlog_row_image();
+
+ int error= find_row(rgi);
if (unlikely(error))
{
/*
@@ -8333,11 +8338,6 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
goto err;
}
- // Temporary fix to find out why it fails [/Matz]
- memcpy(m_table->read_set->bitmap, m_cols.bitmap, (m_table->read_set->n_bits + 7) / 8);
- memcpy(m_table->write_set->bitmap, m_cols_ai.bitmap, (m_table->write_set->n_bits + 7) / 8);
-
- m_table->mark_columns_per_binlog_row_image();
if (m_vers_from_plain && m_table->versioned(VERS_TIMESTAMP))
m_table->vers_update_fields();
error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]);
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 6cdea8c3ebd..4772dc017f9 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1035,7 +1035,7 @@ void MDL_ticket::destroy(MDL_ticket *ticket)
/**
Return the 'weight' of this ticket for the
- victim selection algorithm. Requests with
+ victim selection algorithm. Requests with
lower weight are preferred to requests
with higher weight when choosing a victim.
*/
@@ -2179,7 +2179,7 @@ MDL_context::clone_ticket(MDL_request *mdl_request)
to wait for another thread which is not ready to commit.
This is always an error, as the upper level of parallel replication
should not allow a scheduling of a conflicting DDL until all earlier
- transactions has commited.
+ transactions have been committed.
This function is only called for a slave using parallel replication
and trying to get an exclusive lock for the table.
diff --git a/sql/mdl.h b/sql/mdl.h
index dd10b3a45d0..f6b7154fba0 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -124,6 +124,8 @@ public:
*/
enum enum_mdl_type {
+ /* This means that the MDL_request is not initialized */
+ MDL_NOT_INITIALIZED= -1,
/*
An intention exclusive metadata lock (IX). Used only for scoped locks.
Owner of this type of lock can acquire upgradable exclusive locks on
@@ -599,12 +601,13 @@ public:
*/
MDL_request& operator=(const MDL_request &)
{
+ type= MDL_NOT_INITIALIZED;
ticket= NULL;
/* Do nothing, in particular, don't try to copy the key. */
return *this;
}
/* Another piece of ugliness for TABLE_LIST constructor */
- MDL_request() {}
+ MDL_request(): type(MDL_NOT_INITIALIZED), ticket(NULL) {}
MDL_request(const MDL_request *rhs)
:type(rhs->type),
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d4341b17401..6f379b2e352 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4143,8 +4143,10 @@ static int init_common_variables()
get corrupted if accesses with names of different case.
*/
DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names));
+ if(mysql_real_data_home_ptr == NULL || *mysql_real_data_home_ptr == 0)
+ mysql_real_data_home_ptr= mysql_real_data_home;
SYSVAR_AUTOSIZE(lower_case_file_system,
- test_if_case_insensitive(mysql_real_data_home));
+ test_if_case_insensitive(mysql_real_data_home_ptr));
if (!lower_case_table_names && lower_case_file_system == 1)
{
if (lower_case_table_names_used)
@@ -4161,7 +4163,7 @@ static int init_common_variables()
{
if (global_system_variables.log_warnings)
sql_print_warning("Setting lower_case_table_names=2 because file "
- "system for %s is case insensitive", mysql_real_data_home);
+ "system for %s is case insensitive", mysql_real_data_home_ptr);
SYSVAR_AUTOSIZE(lower_case_table_names, 2);
}
}
@@ -4172,7 +4174,7 @@ static int init_common_variables()
sql_print_warning("lower_case_table_names was set to 2, even though your "
"the file system '%s' is case sensitive. Now setting "
"lower_case_table_names to 0 to avoid future problems.",
- mysql_real_data_home);
+ mysql_real_data_home_ptr);
SYSVAR_AUTOSIZE(lower_case_table_names, 0);
}
else
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 3e173a47f02..ebd92a0e45a 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -45,6 +45,7 @@
#include <violite.h>
#include <signal.h>
#include "probes_mysql.h"
+#include <debug_sync.h>
#include "proxy_protocol.h"
PSI_memory_key key_memory_NET_buff;
@@ -494,6 +495,17 @@ net_write_command(NET *net,uchar command,
DBUG_ENTER("net_write_command");
DBUG_PRINT("enter",("length: %lu", (ulong) len));
+ DBUG_EXECUTE_IF("simulate_error_on_packet_write",
+ {
+ if (command == COM_BINLOG_DUMP)
+ {
+ net->last_errno = ER_NET_ERROR_ON_WRITE;
+ DBUG_ASSERT(!debug_sync_set_action(
+ (THD *)net->thd,
+ STRING_WITH_LEN("now SIGNAL parked WAIT_FOR continue")));
+ DBUG_RETURN(true);
+ }
+ };);
MYSQL_NET_WRITE_START(length);
buff[4]=command; /* For first packet */
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index ca5f00cbdae..8ae3ce5c995 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -592,10 +592,11 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
Item_subselect::subs_type substype= subselect->substype();
switch (substype) {
case Item_subselect::IN_SUBS:
- in_subs= (Item_in_subselect *)subselect;
+ in_subs= subselect->get_IN_subquery();
break;
case Item_subselect::ALL_SUBS:
case Item_subselect::ANY_SUBS:
+ DBUG_ASSERT(subselect->get_IN_subquery());
allany_subs= (Item_allany_subselect *)subselect;
break;
default:
@@ -640,13 +641,15 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
char const *save_where= thd->where;
thd->where= "IN/ALL/ANY subquery";
- bool failure= in_subs->left_expr->fix_fields_if_needed(thd,
- &in_subs->left_expr);
+ Item **left= in_subs->left_exp_ptr();
+ bool failure= (*left)->fix_fields_if_needed(thd, left);
thd->lex->current_select= current;
thd->where= save_where;
if (failure)
DBUG_RETURN(-1); /* purecov: deadcode */
+ // fix_field above can rewrite left expression
+ uint ncols= (*left)->cols();
/*
Check if the left and right expressions have the same # of
columns, i.e. we don't have a case like
@@ -655,9 +658,9 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
TODO why do we have this duplicated in IN->EXISTS transformers?
psergey-todo: fix these: grep for duplicated_subselect_card_check
*/
- if (select_lex->item_list.elements != in_subs->left_expr->cols())
+ if (select_lex->item_list.elements != ncols)
{
- my_error(ER_OPERAND_COLUMNS, MYF(0), in_subs->left_expr->cols());
+ my_error(ER_OPERAND_COLUMNS, MYF(0), ncols);
DBUG_RETURN(-1);
}
}
@@ -724,9 +727,8 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
{
DBUG_PRINT("info", ("Subquery can't be converted to merged semi-join"));
/* Test if the user has set a legal combination of optimizer switches. */
- if (!optimizer_flag(thd, OPTIMIZER_SWITCH_IN_TO_EXISTS) &&
- !optimizer_flag(thd, OPTIMIZER_SWITCH_MATERIALIZATION))
- my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0));
+ DBUG_ASSERT(optimizer_flag(thd, OPTIMIZER_SWITCH_IN_TO_EXISTS |
+ OPTIMIZER_SWITCH_MATERIALIZATION));
/*
Transform each subquery predicate according to its overloaded
transformer.
@@ -847,9 +849,10 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
static
bool subquery_types_allow_materialization(THD* thd, Item_in_subselect *in_subs)
{
+ Item *left_exp= in_subs->left_exp();
DBUG_ENTER("subquery_types_allow_materialization");
- DBUG_ASSERT(in_subs->left_expr->is_fixed());
+ DBUG_ASSERT(left_exp->is_fixed());
List_iterator<Item> it(in_subs->unit->first_select()->item_list);
uint elements= in_subs->unit->first_select()->item_list.elements;
@@ -871,7 +874,7 @@ bool subquery_types_allow_materialization(THD* thd, Item_in_subselect *in_subs)
uint32 total_key_length = 0;
for (uint i= 0; i < elements; i++)
{
- Item *outer= in_subs->left_expr->element_index(i);
+ Item *outer= left_exp->element_index(i);
Item *inner= it++;
all_are_fields &= (outer->real_item()->type() == Item::FIELD_ITEM &&
inner->real_item()->type() == Item::FIELD_ITEM);
@@ -1706,7 +1709,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
sj_nest->alias= sj_nest_name;
sj_nest->sj_subq_pred= subq_pred;
sj_nest->original_subq_pred_used_tables= subq_pred->used_tables() |
- subq_pred->left_expr->used_tables();
+ subq_pred->left_exp()->used_tables();
/* Nests do not participate in those 'chains', so: */
/* sj_nest->next_leaf= sj_nest->next_local= sj_nest->next_global == NULL*/
emb_join_list->push_back(sj_nest, thd->mem_root);
@@ -1794,14 +1797,17 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
*/
SELECT_LEX *save_lex= thd->lex->current_select;
thd->lex->current_select=subq_lex;
- if (subq_pred->left_expr->fix_fields_if_needed(thd, &subq_pred->left_expr))
+ Item **left= subq_pred->left_exp_ptr();
+ if ((*left)->fix_fields_if_needed(thd, left))
DBUG_RETURN(TRUE);
+ Item *left_exp= *left;
+ Item *left_exp_orig= subq_pred->left_exp_orig();
thd->lex->current_select=save_lex;
table_map subq_pred_used_tables= subq_pred->used_tables();
sj_nest->nested_join->sj_corr_tables= subq_pred_used_tables;
sj_nest->nested_join->sj_depends_on= subq_pred_used_tables |
- subq_pred->left_expr->used_tables();
+ left_exp->used_tables();
sj_nest->sj_on_expr= subq_lex->join->conds;
/*
@@ -1819,14 +1825,14 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
Item_direct_view_refs doesn't substitute itself with anything in
Item_direct_view_ref::fix_fields.
*/
- sj_nest->sj_in_exprs= subq_pred->left_expr->cols();
+ uint ncols= sj_nest->sj_in_exprs= left_exp->cols();
sj_nest->nested_join->sj_outer_expr_list.empty();
reset_equality_number_for_subq_conds(sj_nest->sj_on_expr);
- if (subq_pred->left_expr->cols() == 1)
+ if (ncols == 1)
{
/* add left = select_list_element */
- nested_join->sj_outer_expr_list.push_back(&subq_pred->left_expr,
+ nested_join->sj_outer_expr_list.push_back(left,
thd->mem_root);
/*
Create Item_func_eq. Note that
@@ -1838,36 +1844,36 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
with thd->change_item_tree
*/
Item_func_eq *item_eq=
- new (thd->mem_root) Item_func_eq(thd, subq_pred->left_expr_orig,
+ new (thd->mem_root) Item_func_eq(thd, left_exp_orig,
subq_lex->ref_pointer_array[0]);
if (!item_eq)
DBUG_RETURN(TRUE);
- if (subq_pred->left_expr_orig != subq_pred->left_expr)
- thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr);
+ if (left_exp_orig != left_exp)
+ thd->change_item_tree(item_eq->arguments(), left_exp);
item_eq->in_equality_no= 0;
sj_nest->sj_on_expr= and_items(thd, sj_nest->sj_on_expr, item_eq);
}
- else if (subq_pred->left_expr->type() == Item::ROW_ITEM)
+ else if (left_exp->type() == Item::ROW_ITEM)
{
/*
disassemple left expression and add
left1 = select_list_element1 and left2 = select_list_element2 ...
*/
- for (uint i= 0; i < subq_pred->left_expr->cols(); i++)
+ for (uint i= 0; i < ncols; i++)
{
- nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr->addr(i),
+ nested_join->sj_outer_expr_list.push_back(left_exp->addr(i),
thd->mem_root);
Item_func_eq *item_eq=
new (thd->mem_root)
- Item_func_eq(thd, subq_pred->left_expr_orig->element_index(i),
+ Item_func_eq(thd, left_exp_orig->element_index(i),
subq_lex->ref_pointer_array[i]);
if (!item_eq)
DBUG_RETURN(TRUE);
- DBUG_ASSERT(subq_pred->left_expr->element_index(i)->is_fixed());
- if (subq_pred->left_expr_orig->element_index(i) !=
- subq_pred->left_expr->element_index(i))
+ DBUG_ASSERT(left_exp->element_index(i)->is_fixed());
+ if (left_exp_orig->element_index(i) !=
+ left_exp->element_index(i))
thd->change_item_tree(item_eq->arguments(),
- subq_pred->left_expr->element_index(i));
+ left_exp->element_index(i));
item_eq->in_equality_no= i;
sj_nest->sj_on_expr= and_items(thd, sj_nest->sj_on_expr, item_eq);
}
@@ -1882,10 +1888,10 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
/* fix fields on subquery was call so they should be the same */
if (!row)
DBUG_RETURN(TRUE);
- DBUG_ASSERT(subq_pred->left_expr->cols() == row->cols());
- nested_join->sj_outer_expr_list.push_back(&subq_pred->left_expr);
+ DBUG_ASSERT(ncols == row->cols());
+ nested_join->sj_outer_expr_list.push_back(left);
Item_func_eq *item_eq=
- new (thd->mem_root) Item_func_eq(thd, subq_pred->left_expr_orig, row);
+ new (thd->mem_root) Item_func_eq(thd, left_exp_orig, row);
if (!item_eq)
DBUG_RETURN(TRUE);
for (uint i= 0; i < row->cols(); i++)
@@ -4140,7 +4146,8 @@ bool setup_sj_materialization_part2(JOIN_TAB *sjm_tab)
for (i= 0; i < tmp_key_parts; i++, cur_key_part++, ref_key++)
{
- tab_ref->items[i]= emb_sj_nest->sj_subq_pred->left_expr->element_index(i);
+ tab_ref->items[i]=
+ emb_sj_nest->sj_subq_pred->left_exp()->element_index(i);
int null_count= MY_TEST(cur_key_part->field->real_maybe_null());
*ref_key= new store_key_item(thd, cur_key_part->field,
/* TODO:
@@ -4325,18 +4332,20 @@ static Item *create_subq_in_equalities(THD *thd, SJ_MATERIALIZATION_INFO *sjm,
Item_in_subselect *subq_pred)
{
Item *res= NULL;
- if (subq_pred->left_expr->cols() == 1)
+ Item *left_exp= subq_pred->left_exp();
+ uint ncols= left_exp->cols();
+ if (ncols == 1)
{
- if (!(res= new (thd->mem_root) Item_func_eq(thd, subq_pred->left_expr,
+ if (!(res= new (thd->mem_root) Item_func_eq(thd, left_exp,
new (thd->mem_root) Item_field(thd, sjm->table->field[0]))))
return NULL; /* purecov: inspected */
}
else
{
Item *conj;
- for (uint i= 0; i < subq_pred->left_expr->cols(); i++)
+ for (uint i= 0; i < ncols; i++)
{
- if (!(conj= new (thd->mem_root) Item_func_eq(thd, subq_pred->left_expr->element_index(i),
+ if (!(conj= new (thd->mem_root) Item_func_eq(thd, left_exp->element_index(i),
new (thd->mem_root) Item_field(thd, sjm->table->field[i]))) ||
!(res= and_items(thd, res, conj)))
return NULL; /* purecov: inspected */
@@ -5404,7 +5413,7 @@ int rewrite_to_index_subquery_engine(JOIN *join)
change_engine(new
subselect_uniquesubquery_engine(thd,
join_tab,
- unit->item,
+ unit->item->get_IN_subquery(),
where)));
}
else if (join_tab[0].type == JT_REF &&
@@ -5418,7 +5427,7 @@ int rewrite_to_index_subquery_engine(JOIN *join)
change_engine(new
subselect_indexsubquery_engine(thd,
join_tab,
- unit->item,
+ unit->item->get_IN_subquery(),
where,
NULL,
0)));
@@ -5434,7 +5443,7 @@ int rewrite_to_index_subquery_engine(JOIN *join)
DBUG_RETURN(unit->item->
change_engine(new subselect_indexsubquery_engine(thd,
join_tab,
- unit->item,
+ unit->item->get_IN_subquery(),
join->conds,
join->having,
1)));
@@ -6109,11 +6118,13 @@ bool execute_degenerate_jtbm_semi_join(THD *thd,
subq_pred->jtbm_const_row_found= TRUE;
Item *eq_cond;
- for (uint i= 0; i < subq_pred->left_expr->cols(); i++)
+ Item *left_exp= subq_pred->left_exp();
+ uint ncols= left_exp->cols();
+ for (uint i= 0; i < ncols; i++)
{
eq_cond=
new (thd->mem_root) Item_func_eq(thd,
- subq_pred->left_expr->element_index(i),
+ left_exp->element_index(i),
new_sink->row[i]);
if (!eq_cond || eq_cond->fix_fields(thd, NULL) ||
eq_list.push_back(eq_cond, thd->mem_root))
@@ -6408,7 +6419,7 @@ bool JOIN::choose_subquery_plan(table_map join_tables)
if (is_in_subquery())
{
- in_subs= (Item_in_subselect*) unit->item;
+ in_subs= unit->item->get_IN_subquery();
if (in_subs->create_in_to_exists_cond(this))
return true;
}
@@ -6692,12 +6703,12 @@ bool JOIN::choose_tableless_subquery_plan()
everything as-is, setup_jtbm_semi_joins() has special handling for cases
like this.
*/
- if (subs_predicate->is_in_predicate() &&
- !(subs_predicate->substype() == Item_subselect::IN_SUBS &&
- ((Item_in_subselect*)subs_predicate)->is_jtbm_merged))
+ Item_in_subselect *in_subs;
+ in_subs= subs_predicate->get_IN_subquery();
+ if (in_subs &&
+ !(subs_predicate->substype() == Item_subselect::IN_SUBS &&
+ in_subs->is_jtbm_merged))
{
- Item_in_subselect *in_subs;
- in_subs= (Item_in_subselect*) subs_predicate;
in_subs->set_strategy(SUBS_IN_TO_EXISTS);
if (in_subs->create_in_to_exists_cond(this) ||
in_subs->inject_in_to_exists_cond(this))
@@ -6714,7 +6725,8 @@ bool Item::pushable_equality_checker_for_subquery(uchar *arg)
{
return
get_corresponding_field_pair(this,
- ((Item_in_subselect *)arg)->corresponding_fields);
+ ((Item *)arg)->get_IN_subquery()->
+ corresponding_fields);
}
@@ -6853,7 +6865,7 @@ Item *get_corresponding_item(THD *thd, Item *item,
Item *Item_field::in_subq_field_transformer_for_where(THD *thd, uchar *arg)
{
- Item_in_subselect *subq_pred= (Item_in_subselect *)arg;
+ Item_in_subselect *subq_pred= ((Item *)arg)->get_IN_subquery();
Item *producing_item= get_corresponding_item(thd, this, subq_pred);
if (producing_item)
return producing_item->build_clone(thd);
@@ -6866,7 +6878,7 @@ Item *Item_direct_view_ref::in_subq_field_transformer_for_where(THD *thd,
{
if (item_equal)
{
- Item_in_subselect *subq_pred= (Item_in_subselect *)arg;
+ Item_in_subselect *subq_pred= ((Item *)arg)->get_IN_subquery();
Item *producing_item= get_corresponding_item(thd, this, subq_pred);
DBUG_ASSERT (producing_item != NULL);
return producing_item->build_clone(thd);
@@ -6916,6 +6928,7 @@ get_corresponding_item_for_in_subq_having(THD *thd, Item *in_item,
Item *Item_field::in_subq_field_transformer_for_having(THD *thd, uchar *arg)
{
+ DBUG_ASSERT(((Item *)arg)->get_IN_subquery());
return get_corresponding_item_for_in_subq_having(thd, this,
(Item_in_subselect *)arg);
}
@@ -6928,6 +6941,7 @@ Item *Item_direct_view_ref::in_subq_field_transformer_for_having(THD *thd,
return this;
else
{
+ DBUG_ASSERT(((Item *)arg)->get_IN_subquery());
Item *new_item= get_corresponding_item_for_in_subq_having(thd, this,
(Item_in_subselect *)arg);
if (!new_item)
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 10f82242bca..8ad14ca260c 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2006, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2018, MariaDB Corporation.
+ Copyright (c) 2010, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -864,9 +864,6 @@ void partition_info::vers_set_hist_part(THD *thd)
if (next->range_value > thd->query_start())
return;
}
- my_error(WARN_VERS_PART_FULL, MYF(ME_WARNING|ME_ERROR_LOG),
- table->s->db.str, table->s->table_name.str,
- vers_info->hist_part->partition_name, "INTERVAL");
}
}
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ebc0c3815aa..ce4558a13c1 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -43,6 +43,12 @@ bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count);
static bool write_eof_packet(THD *, NET *, uint, uint);
#endif
+CHARSET_INFO *Protocol::character_set_results() const
+{
+ return thd->variables.character_set_results;
+}
+
+
#ifndef EMBEDDED_LIBRARY
bool Protocol::net_store_data(const uchar *from, size_t length)
#else
@@ -765,6 +771,7 @@ void Protocol::init(THD *thd_arg)
convert= &thd->convert_buffer;
#ifndef DBUG_OFF
field_handlers= 0;
+ field_pos= 0;
#endif
}
@@ -843,22 +850,25 @@ bool Protocol_text::store_field_metadata(const THD * thd,
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
{
- if (store(STRING_WITH_LEN("def"), cs, thd_charset) ||
- store_str(field.db_name, cs, thd_charset) ||
- store_str(field.table_name, cs, thd_charset) ||
- store_str(field.org_table_name, cs, thd_charset) ||
- store_str(field.col_name, cs, thd_charset) ||
- store_str(field.org_col_name, cs, thd_charset))
+ const LEX_CSTRING def= {STRING_WITH_LEN("def")};
+ if (store_ident(def, MY_REPERTOIRE_ASCII) ||
+ store_ident(field.db_name) ||
+ store_ident(field.table_name) ||
+ store_ident(field.org_table_name) ||
+ store_ident(field.col_name) ||
+ store_ident(field.org_col_name))
return true;
if (thd->client_capabilities & MARIADB_CLIENT_EXTENDED_METADATA)
{
Send_field_packed_extended_metadata metadata;
metadata.pack(field);
+
/*
Don't apply character set conversion:
extended metadata is a binary encoded data.
*/
- if (store_str(metadata.lex_cstring(), cs, &my_charset_bin))
+ if (store_binary_string(&metadata, cs,
+ MY_REPERTOIRE_UNICODE30))
return true;
}
if (packet->realloc(packet->length() + 12))
@@ -891,8 +901,8 @@ bool Protocol_text::store_field_metadata(const THD * thd,
}
else
{
- if (store_str(field.table_name, cs, thd_charset) ||
- store_str(field.col_name, cs, thd_charset) ||
+ if (store_ident(field.table_name) ||
+ store_ident(field.col_name) ||
packet->realloc(packet->length() + 10))
return true;
pos= (char*) packet->end();
@@ -1172,12 +1182,12 @@ bool Protocol_text::store_null()
*/
bool Protocol::store_string_aux(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs)
{
/* 'tocs' is set 0 when client issues SET character_set_results=NULL */
- if (tocs && !my_charset_same(fromcs, tocs) &&
- fromcs != &my_charset_bin &&
- tocs != &my_charset_bin)
+ if (needs_conversion(fromcs, from_repertoire, tocs))
{
/* Store with conversion */
return net_store_data_cs((uchar*) from, length, fromcs, tocs);
@@ -1199,29 +1209,19 @@ bool Protocol::store_warning(const char *from, size_t length)
}
-bool Protocol_text::store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
+bool Protocol_text::store_str(const char *from, size_t length,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs)
{
#ifndef DBUG_OFF
- DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_STRING));
- field_pos++;
-#endif
- return store_string_aux(from, length, fromcs, tocs);
-}
-
-
-bool Protocol_text::store(const char *from, size_t length,
- CHARSET_INFO *fromcs)
-{
- CHARSET_INFO *tocs= this->thd->variables.character_set_results;
-#ifndef DBUG_OFF
- DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*b", field_pos,
- field_count, (int) length, (length == 0 ? "" : from)));
+ DBUG_PRINT("info", ("Protocol_text::store field %u : %.*b", field_pos,
+ (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_handlers == 0 || field_pos < field_count);
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_STRING));
field_pos++;
#endif
- return store_string_aux(from, length, fromcs, tocs);
+ return store_string_aux(from, length, fromcs, from_repertoire, tocs);
}
@@ -1334,7 +1334,8 @@ bool Protocol_text::store(Field *field)
dbug_tmp_restore_column_map(table->read_set, old_map);
#endif
- return store_string_aux(str.ptr(), str.length(), str.charset(), tocs);
+ return store_string_aux(str.ptr(), str.length(), str.charset(),
+ field->dtcollation().repertoire, tocs);
}
@@ -1452,19 +1453,13 @@ void Protocol_binary::prepare_for_resend()
}
-bool Protocol_binary::store(const char *from, size_t length,
- CHARSET_INFO *fromcs)
-{
- CHARSET_INFO *tocs= thd->variables.character_set_results;
- field_pos++;
- return store_string_aux(from, length, fromcs, tocs);
-}
-
-bool Protocol_binary::store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
+bool Protocol_binary::store_str(const char *from, size_t length,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs)
{
field_pos++;
- return store_string_aux(from, length, fromcs, tocs);
+ return store_string_aux(from, length, fromcs, from_repertoire, tocs);
}
bool Protocol_binary::store_null()
@@ -1523,11 +1518,12 @@ bool Protocol_binary::store_decimal(const my_decimal *d)
{
#ifndef DBUG_OFF
DBUG_ASSERT(0); // This method is not used yet
- field_pos++;
#endif
StringBuffer<DECIMAL_MAX_STR_LENGTH> str;
(void) d->to_string(&str);
- return store(str.ptr(), str.length(), str.charset());
+ return store_str(str.ptr(), str.length(), str.charset(),
+ MY_REPERTOIRE_ASCII,
+ thd->variables.character_set_results);
}
bool Protocol_binary::store(float from, uint32 decimals, String *buffer)
@@ -1580,7 +1576,7 @@ bool Protocol_binary::store(MYSQL_TIME *tm, int decimals)
DBUG_ASSERT(decimals == AUTO_SEC_PART_DIGITS ||
(decimals >= 0 && decimals <= TIME_SECOND_PART_DIGITS));
if (decimals != AUTO_SEC_PART_DIGITS)
- my_time_trunc(tm, decimals);
+ my_datetime_trunc(tm, decimals);
int4store(pos+7, tm->second_part);
if (tm->second_part)
length=11;
diff --git a/sql/protocol.h b/sql/protocol.h
index 22d7990a194..188cea847c1 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -61,12 +61,26 @@ protected:
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;
#endif
+ bool needs_conversion(CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs) const
+ {
+ // 'tocs' is set 0 when client issues SET character_set_results=NULL
+ return tocs && !my_charset_same(fromcs, tocs) &&
+ fromcs != &my_charset_bin &&
+ tocs != &my_charset_bin &&
+ (from_repertoire != MY_REPERTOIRE_ASCII ||
+ (fromcs->state & MY_CS_NONASCII) ||
+ (tocs->state & MY_CS_NONASCII));
+ }
/*
The following two are low-level functions that are invoked from
higher-level store_xxx() funcs. The data is stored into this->packet.
*/
bool store_string_aux(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs);
virtual bool send_ok(uint server_status, uint statement_warn_count,
ulonglong affected_rows, ulonglong last_insert_id,
@@ -77,6 +91,8 @@ protected:
virtual bool send_error(uint sql_errno, const char *err_msg,
const char *sql_state);
+ CHARSET_INFO *character_set_results() const;
+
public:
THD *thd;
Protocol(THD *thd_arg) { init(thd_arg); }
@@ -120,13 +136,10 @@ public:
virtual bool store_long(longlong from)=0;
virtual bool store_longlong(longlong from, bool unsigned_flag)=0;
virtual bool store_decimal(const my_decimal *)=0;
- virtual bool store(const char *from, size_t length, CHARSET_INFO *cs)=0;
- virtual bool store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
- bool store_str(const LEX_CSTRING &s, CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
- {
- return store(s.str, (uint) s.length, fromcs, tocs);
- }
+ virtual bool store_str(const char *from, size_t length,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs)=0;
virtual bool store(float from, uint32 decimals, String *buffer)=0;
virtual bool store(double from, uint32 decimals, String *buffer)=0;
virtual bool store(MYSQL_TIME *time, int decimals)=0;
@@ -134,6 +147,35 @@ public:
virtual bool store_time(MYSQL_TIME *time, int decimals)=0;
virtual bool store(Field *field)=0;
+ // Various useful wrappers for the virtual store*() methods.
+ // Backward wrapper for store_str()
+ inline bool store(const char *from, size_t length, CHARSET_INFO *cs,
+ my_repertoire_t repertoire= MY_REPERTOIRE_UNICODE30)
+ {
+ return store_str(from, length, cs, repertoire, character_set_results());
+ }
+ inline bool store_lex_cstring(const LEX_CSTRING &s,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs)
+ {
+ return store_str(s.str, (uint) s.length, fromcs, from_repertoire, tocs);
+ }
+ inline bool store_binary_string(Binary_string *str,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire)
+ {
+ return store_str(str->ptr(), (uint) str->length(), fromcs, from_repertoire,
+ &my_charset_bin);
+ }
+ bool store_ident(const LEX_CSTRING &s,
+ my_repertoire_t repertoire= MY_REPERTOIRE_UNICODE30)
+ {
+ return store_lex_cstring(s, system_charset_info, repertoire,
+ character_set_results());
+ }
+ // End of wrappers
+
virtual bool send_out_parameters(List<Item_param> *sp_params)=0;
#ifdef EMBEDDED_LIBRARY
bool begin_dataset();
@@ -178,9 +220,10 @@ public:
virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag);
virtual bool store_decimal(const my_decimal *);
- virtual bool store(const char *from, size_t length, CHARSET_INFO *cs);
- virtual bool store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
+ virtual bool store_str(const char *from, size_t length,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs);
virtual bool store(MYSQL_TIME *time, int decimals);
virtual bool store_date(MYSQL_TIME *time);
virtual bool store_time(MYSQL_TIME *time, int decimals);
@@ -223,9 +266,10 @@ public:
virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag);
virtual bool store_decimal(const my_decimal *);
- virtual bool store(const char *from, size_t length, CHARSET_INFO *cs);
- virtual bool store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
+ virtual bool store_str(const char *from, size_t length,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs);
virtual bool store(MYSQL_TIME *time, int decimals);
virtual bool store_date(MYSQL_TIME *time);
virtual bool store_time(MYSQL_TIME *time, int decimals);
@@ -272,8 +316,11 @@ public:
bool store_long(longlong) { return false; }
bool store_longlong(longlong, bool) { return false; }
bool store_decimal(const my_decimal *) { return false; }
- bool store(const char *, size_t, CHARSET_INFO *) { return false; }
- bool store(const char *, size_t, CHARSET_INFO *, CHARSET_INFO *) { return false; }
+ bool store_str(const char *, size_t, CHARSET_INFO *, my_repertoire_t,
+ CHARSET_INFO *)
+ {
+ return false;
+ }
bool store(MYSQL_TIME *, int) { return false; }
bool store_date(MYSQL_TIME *) { return false; }
bool store_time(MYSQL_TIME *, int) { return false; }
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 94882230682..c12573f817f 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -1053,10 +1053,10 @@ handle_rpl_parallel_thread(void *arg)
server_threads.insert(thd);
set_current_thd(thd);
pthread_detach_this_thread();
+ thd->store_globals();
thd->init_for_queries();
thd->variables.binlog_annotate_row_events= 0;
init_thr_lock();
- thd->store_globals();
thd->system_thread= SYSTEM_THREAD_SLAVE_SQL;
thd->security_ctx->skip_grants();
thd->variables.max_allowed_packet= slave_max_allowed_packet;
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 11eccefdde9..941616a26d5 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -268,7 +268,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
msg= current_thd->get_stmt_da()->message();
goto err;
}
- if (init_io_cache(&info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L,0,
+ if (init_io_cache(&info_file, info_fd, LOG_BIN_IO_SIZE, READ_CACHE, 0L,0,
MYF(MY_WME)))
{
sql_print_error("Failed to create a cache on relay log info file '%s'",
@@ -303,7 +303,7 @@ Failed to open the existing relay log info file '%s' (errno %d)",
error= 1;
}
else if (init_io_cache(&info_file, info_fd,
- IO_SIZE*2, READ_CACHE, 0L, 0, MYF(MY_WME)))
+ LOG_BIN_IO_SIZE, READ_CACHE, 0L, 0, MYF(MY_WME)))
{
sql_print_error("Failed to create a cache on relay log info file '%s'",
fname);
diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc
index 6b06bddd773..f61db1e80e8 100644
--- a/sql/service_wsrep.cc
+++ b/sql/service_wsrep.cc
@@ -199,6 +199,16 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd,
extern "C" my_bool wsrep_thd_bf_abort(THD *bf_thd, THD *victim_thd,
my_bool signal)
{
+ DBUG_EXECUTE_IF("sync.before_wsrep_thd_abort",
+ {
+ const char act[]=
+ "now "
+ "SIGNAL sync.before_wsrep_thd_abort_reached "
+ "WAIT_FOR signal.before_wsrep_thd_abort";
+ DBUG_ASSERT(!debug_sync_set_action(bf_thd,
+ STRING_WITH_LEN(act)));
+ };);
+
my_bool ret= wsrep_bf_abort(bf_thd, victim_thd);
/*
Send awake signal if victim was BF aborted or does not
@@ -210,10 +220,22 @@ extern "C" my_bool wsrep_thd_bf_abort(THD *bf_thd, THD *victim_thd,
mysql_mutex_assert_not_owner(&victim_thd->LOCK_thd_data);
mysql_mutex_assert_not_owner(&victim_thd->LOCK_thd_kill);
mysql_mutex_lock(&victim_thd->LOCK_thd_data);
+
+ if (victim_thd->wsrep_aborter && victim_thd->wsrep_aborter != bf_thd->thread_id)
+ {
+ WSREP_DEBUG("victim is killed already by %llu, skipping awake",
+ victim_thd->wsrep_aborter);
+ mysql_mutex_unlock(&victim_thd->LOCK_thd_data);
+ return false;
+ }
+
mysql_mutex_lock(&victim_thd->LOCK_thd_kill);
+ victim_thd->wsrep_aborter= bf_thd->thread_id;
victim_thd->awake_no_mutex(KILL_QUERY);
mysql_mutex_unlock(&victim_thd->LOCK_thd_kill);
mysql_mutex_unlock(&victim_thd->LOCK_thd_data);
+ } else {
+ WSREP_DEBUG("wsrep_thd_bf_abort skipped awake");
}
return ret;
}
@@ -339,3 +361,15 @@ extern "C" ulong wsrep_OSU_method_get(const MYSQL_THD thd)
else
return(global_system_variables.wsrep_OSU_method);
}
+
+extern "C" bool wsrep_thd_set_wsrep_aborter(THD *bf_thd, THD *victim_thd)
+{
+ WSREP_DEBUG("wsrep_thd_set_wsrep_aborter called");
+ mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data);
+ if (victim_thd->wsrep_aborter && victim_thd->wsrep_aborter != bf_thd->thread_id)
+ {
+ return true;
+ }
+ victim_thd->wsrep_aborter = bf_thd->thread_id;
+ return false;
+} \ No newline at end of file
diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc
index 4cee6cb0dfa..1e5e356a5ba 100644
--- a/sql/session_tracker.cc
+++ b/sql/session_tracker.cc
@@ -189,7 +189,13 @@ bool sysvartrack_validate_value(THD *thd, const char *str, size_t len)
char *token, *lasts= NULL;
size_t rest= var_list.length;
- if (!var_list.str || var_list.length == 0 ||
+ if (!var_list.str)
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
+ "session_track_system_variables", "NULL");
+ return false;
+ }
+ if (var_list.length == 0 ||
!strcmp(var_list.str, "*"))
{
return false;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 8b180b466f8..42b3796d03c 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7961,4 +7961,4 @@ ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS
ER_NOT_ALLOWED_IN_THIS_CONTEXT
eng "'%-.128s' is not allowed in this context"
ER_DATA_WAS_COMMITED_UNDER_ROLLBACK
- eng "Engine %s does not support rollback. Changes where commited during rollback call"
+ eng "Engine %s does not support rollback. Changes where committed during rollback call"
diff --git a/sql/slave.cc b/sql/slave.cc
index 000900efe61..fba3992a820 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3727,7 +3727,8 @@ static int request_dump(THD *thd, MYSQL* mysql, Master_info* mi,
in the future, we should do a better error analysis, but for
now we just fill up the error log :-)
*/
- if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
+ if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED ||
+ mysql_errno(mysql) == ER_NET_ERROR_ON_WRITE)
*suppress_warnings= TRUE; // Suppress reconnect warning
else
sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs",
diff --git a/sql/sp.cc b/sql/sp.cc
index 971aa4a143f..3737bd11740 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1258,20 +1258,20 @@ Sp_handler::sp_create_routine(THD *thd, const sp_head *sp) const
switch (type()) {
case SP_TYPE_PACKAGE:
// Drop together with its PACKAGE BODY mysql.proc record
- ret= sp_handler_package_spec.sp_find_and_drop_routine(thd, table, sp);
+ if (sp_handler_package_spec.sp_find_and_drop_routine(thd, table, sp))
+ goto done;
break;
case SP_TYPE_PACKAGE_BODY:
case SP_TYPE_FUNCTION:
case SP_TYPE_PROCEDURE:
- ret= sp_drop_routine_internal(thd, sp, table);
+ if (sp_drop_routine_internal(thd, sp, table))
+ goto done;
break;
case SP_TYPE_TRIGGER:
case SP_TYPE_EVENT:
DBUG_ASSERT(0);
ret= SP_OK;
}
- if (ret != SP_OK)
- goto done;
}
else if (lex->create_info.if_not_exists())
{
@@ -1286,7 +1286,7 @@ Sp_handler::sp_create_routine(THD *thd, const sp_head *sp) const
if (type() == SP_TYPE_FUNCTION)
{
sp_returns_type(thd, retstr, sp);
- returns= retstr.lex_cstring();
+ retstr.get_value(&returns);
}
goto log;
}
@@ -1369,7 +1369,7 @@ Sp_handler::sp_create_routine(THD *thd, const sp_head *sp) const
if (type() == SP_TYPE_FUNCTION)
{
sp_returns_type(thd, retstr, sp);
- returns= retstr.lex_cstring();
+ retstr.get_value(&returns);
store_failed= store_failed ||
table->field[MYSQL_PROC_FIELD_RETURNS]->
@@ -2061,7 +2061,7 @@ Sp_handler::sp_clone_and_link_routine(THD *thd,
if (type() == SP_TYPE_FUNCTION)
{
sp_returns_type(thd, retstr, sp);
- returns= retstr.lex_cstring();
+ retstr.get_value(&returns);
}
if (sp->m_parent)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index d94016b7815..9cc35d0707f 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -800,6 +800,15 @@ class Grant_table_base
bool init_read_record(READ_RECORD* info) const
{
DBUG_ASSERT(m_table);
+
+ if (num_fields() < min_columns)
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "Fatal error: mysql.%s table is "
+ "damaged or in unsupported 3.20 format",
+ MYF(ME_ERROR_LOG), m_table->s->table_name.str);
+ return 1;
+ }
+
bool result= ::init_read_record(info, m_table->in_use, m_table,
NULL, NULL, 1, true, false);
if (!result)
@@ -824,7 +833,7 @@ class Grant_table_base
protected:
friend class Grant_tables;
- Grant_table_base() : start_priv_columns(0), end_priv_columns(0), m_table(0)
+ Grant_table_base() : min_columns(3), start_priv_columns(0), end_priv_columns(0), m_table(0)
{ }
/* Compute how many privilege columns this table has. This method
@@ -853,6 +862,9 @@ class Grant_table_base
}
}
+
+ /* the min number of columns a table should have */
+ uint min_columns;
/* The index at which privilege columns start. */
uint start_priv_columns;
/* The index after the last privilege column */
@@ -1266,7 +1278,7 @@ class User_table_tabular: public User_table
friend class Grant_tables;
/* Only Grant_tables can instantiate this class. */
- User_table_tabular() {}
+ User_table_tabular() { min_columns= 13; /* As in 3.20.13 */ }
/* The user table is a bit different compared to the other Grant tables.
Usually, we only add columns to the grant tables when adding functionality.
@@ -1288,13 +1300,6 @@ class User_table_tabular: public User_table
int setup_sysvars() const
{
- if (num_fields() < 13) // number of columns in 3.21
- {
- sql_print_error("Fatal error: mysql.user table is damaged or in "
- "unsupported 3.20 format.");
- return 1;
- }
-
username_char_length= MY_MIN(m_table->field[1]->char_length(),
USERNAME_CHAR_LENGTH);
using_global_priv_table= false;
@@ -1806,7 +1811,7 @@ class Db_table: public Grant_table_base
private:
friend class Grant_tables;
- Db_table() {}
+ Db_table() { min_columns= 9; /* as in 3.20.13 */ }
};
class Tables_priv_table: public Grant_table_base
@@ -1824,7 +1829,7 @@ class Tables_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Tables_priv_table() {}
+ Tables_priv_table() { min_columns= 8; /* as in 3.22.26a */ }
};
class Columns_priv_table: public Grant_table_base
@@ -1841,7 +1846,7 @@ class Columns_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Columns_priv_table() {}
+ Columns_priv_table() { min_columns= 7; /* as in 3.22.26a */ }
};
class Host_table: public Grant_table_base
@@ -1853,7 +1858,7 @@ class Host_table: public Grant_table_base
private:
friend class Grant_tables;
- Host_table() {}
+ Host_table() { min_columns= 8; /* as in 3.20.13 */ }
};
class Procs_priv_table: public Grant_table_base
@@ -1871,7 +1876,7 @@ class Procs_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Procs_priv_table() {}
+ Procs_priv_table() { min_columns=8; }
};
class Proxies_priv_table: public Grant_table_base
@@ -1888,7 +1893,7 @@ class Proxies_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Proxies_priv_table() {}
+ Proxies_priv_table() { min_columns= 7; }
};
class Roles_mapping_table: public Grant_table_base
@@ -1902,7 +1907,7 @@ class Roles_mapping_table: public Grant_table_base
private:
friend class Grant_tables;
- Roles_mapping_table() {}
+ Roles_mapping_table() { min_columns= 4; }
};
/**
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index a1d235086db..ede30263e48 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- Copyright (c) 2016, 2018, MariaDB Corporation
+ Copyright (c) 2016, 2020, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -129,10 +129,10 @@ const char* Alter_info::lock() const
}
-bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result,
+bool Alter_info::supports_algorithm(THD *thd,
const Alter_inplace_info *ha_alter_info)
{
- switch (result) {
+ switch (ha_alter_info->inplace_supported) {
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
case HA_ALTER_INPLACE_SHARED_LOCK:
case HA_ALTER_INPLACE_NO_LOCK:
@@ -173,10 +173,10 @@ bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result,
}
-bool Alter_info::supports_lock(THD *thd, enum_alter_inplace_result result,
+bool Alter_info::supports_lock(THD *thd,
const Alter_inplace_info *ha_alter_info)
{
- switch (result) {
+ switch (ha_alter_info->inplace_supported) {
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
// If SHARED lock and no particular algorithm was requested, use COPY.
if (requested_lock == Alter_info::ALTER_TABLE_LOCK_SHARED &&
@@ -377,7 +377,9 @@ void Alter_table_ctx::report_implicit_default_value_error(THD *thd,
thd->push_warning_truncated_value_for_field(Sql_condition::WARN_LEVEL_WARN,
h->name().ptr(),
h->default_value().ptr(),
- s, error_field->field_name.str);
+ s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ error_field->field_name.str);
}
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index ca343f36569..89eb4ebb3e9 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates.
- Copyright (c) 2013, 2018, MariaDB Corporation.
+ Copyright (c) 2013, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -203,29 +203,26 @@ public:
with the specified user alter algorithm.
@param thd Thread handle
- @param result Operation supported for inplace alter
@param ha_alter_info Structure describing changes to be done
by ALTER TABLE and holding data during
in-place alter
@retval false Supported operation
@retval true Not supported value
*/
- bool supports_algorithm(THD *thd, enum_alter_inplace_result result,
+ bool supports_algorithm(THD *thd,
const Alter_inplace_info *ha_alter_info);
/**
Check whether the given result can be supported
with the specified user lock type.
- @param result Operation supported for inplace alter
@param ha_alter_info Structure describing changes to be done
by ALTER TABLE and holding data during
in-place alter
@retval false Supported lock type
@retval true Not supported value
*/
- bool supports_lock(THD *thd, enum_alter_inplace_result result,
- const Alter_inplace_info *ha_alter_info);
+ bool supports_lock(THD *thd, const Alter_inplace_info *ha_alter_info);
/**
Return user requested algorithm. If user does not specify
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6d53a8ee6e3..45ce4be3eb5 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -5332,6 +5332,24 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table_list)
DBUG_VOID_RETURN;
}
+int TABLE::fix_vcol_exprs(THD *thd)
+{
+ for (Field **vf= vfield; vf && *vf; vf++)
+ if (fix_session_vcol_expr(thd, (*vf)->vcol_info))
+ return 1;
+
+ for (Field **df= default_field; df && *df; df++)
+ if ((*df)->default_value &&
+ fix_session_vcol_expr(thd, (*df)->default_value))
+ return 1;
+
+ for (Virtual_column_info **cc= check_constraints; cc && *cc; cc++)
+ if (fix_session_vcol_expr(thd, (*cc)))
+ return 1;
+
+ return 0;
+}
+
static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables)
{
@@ -5339,36 +5357,27 @@ static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables)
TABLE_LIST *first_not_own= thd->lex->first_not_own_table();
DBUG_ENTER("fix_session_vcol_expr");
- for (TABLE_LIST *table= tables; table && table != first_not_own;
+ int error= 0;
+ for (TABLE_LIST *table= tables; table && table != first_not_own && !error;
table= table->next_global)
{
TABLE *t= table->table;
if (!table->placeholder() && t->s->vcols_need_refixing &&
table->lock_type >= TL_WRITE_ALLOW_WRITE)
{
+ Query_arena *stmt_backup= thd->stmt_arena;
+ if (thd->stmt_arena->is_conventional())
+ thd->stmt_arena= t->expr_arena;
if (table->security_ctx)
thd->security_ctx= table->security_ctx;
- for (Field **vf= t->vfield; vf && *vf; vf++)
- if (fix_session_vcol_expr(thd, (*vf)->vcol_info))
- goto err;
-
- for (Field **df= t->default_field; df && *df; df++)
- if ((*df)->default_value &&
- fix_session_vcol_expr(thd, (*df)->default_value))
- goto err;
-
- for (Virtual_column_info **cc= t->check_constraints; cc && *cc; cc++)
- if (fix_session_vcol_expr(thd, (*cc)))
- goto err;
+ error= t->fix_vcol_exprs(thd);
thd->security_ctx= save_security_ctx;
+ thd->stmt_arena= stmt_backup;
}
}
- DBUG_RETURN(0);
-err:
- thd->security_ctx= save_security_ctx;
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
@@ -6328,10 +6337,11 @@ find_field_in_tables(THD *thd, Item_ident *item,
for (SELECT_LEX *sl= current_sel; sl && sl!=last_select;
sl=sl->outer_select())
{
- Item *subs= sl->master_unit()->item;
- if (subs->type() == Item::SUBSELECT_ITEM &&
- ((Item_subselect*)subs)->substype() == Item_subselect::IN_SUBS &&
- ((Item_in_subselect*)subs)->test_strategy(SUBS_SEMI_JOIN))
+ Item_in_subselect *in_subs=
+ sl->master_unit()->item->get_IN_subquery();
+ if (in_subs &&
+ in_subs->substype() == Item_subselect::IN_SUBS &&
+ in_subs->test_strategy(SUBS_SEMI_JOIN))
{
continue;
}
@@ -8230,7 +8240,7 @@ bool setup_on_expr(THD *thd, TABLE_LIST *table, bool is_update)
*/
if (embedded->sj_subq_pred)
{
- Item **left_expr= &embedded->sj_subq_pred->left_expr;
+ Item **left_expr= embedded->sj_subq_pred->left_exp_ptr();
if ((*left_expr)->fix_fields_if_needed(thd, left_expr))
return TRUE;
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 0b142a22f59..c507c99ddde 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -706,6 +706,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
wsrep_affected_rows(0),
wsrep_has_ignored_error(false),
wsrep_ignore_table(false),
+ wsrep_aborter(0),
/* wsrep-lib */
m_wsrep_next_trx_id(WSREP_UNDEFINED_TRX_ID),
@@ -1308,6 +1309,7 @@ void THD::init()
wsrep_rbr_buf = NULL;
wsrep_affected_rows = 0;
m_wsrep_next_trx_id = WSREP_UNDEFINED_TRX_ID;
+ wsrep_aborter = 0;
#endif /* WITH_WSREP */
if (variables.sql_log_bin)
@@ -1394,9 +1396,11 @@ void THD::update_all_stats()
void THD::init_for_queries()
{
- set_time();
- ha_enable_transaction(this,TRUE);
+ DBUG_ASSERT(transaction->on);
+ DBUG_ASSERT(m_transaction_psi == NULL);
+ /* Set time for --init-file queries */
+ set_time();
reset_root_defaults(mem_root, variables.query_alloc_block_size,
variables.query_prealloc_size);
reset_root_defaults(&transaction->mem_root,
@@ -1548,6 +1552,8 @@ void THD::cleanup(void)
trans_rollback(this);
DBUG_ASSERT(open_tables == NULL);
+ DBUG_ASSERT(m_transaction_psi == NULL);
+
/*
If the thread was in the middle of an ongoing transaction (rolled
back a few lines above) or under LOCK TABLES (unlocked the tables
@@ -1648,6 +1654,7 @@ void THD::reset_for_reuse()
abort_on_warning= 0;
free_connection_done= 0;
m_command= COM_CONNECT;
+ transaction->on= 1;
#if defined(ENABLED_PROFILING)
profiling.reset();
#endif
@@ -2139,11 +2146,19 @@ void THD::reset_killed()
DBUG_ENTER("reset_killed");
if (killed != NOT_KILLED)
{
+ mysql_mutex_assert_not_owner(&LOCK_thd_kill);
mysql_mutex_lock(&LOCK_thd_kill);
killed= NOT_KILLED;
killed_err= 0;
mysql_mutex_unlock(&LOCK_thd_kill);
}
+#ifdef WITH_WSREP
+ mysql_mutex_assert_not_owner(&LOCK_thd_data);
+ mysql_mutex_lock(&LOCK_thd_data);
+ wsrep_aborter= 0;
+ mysql_mutex_unlock(&LOCK_thd_data);
+#endif /* WITH_WSREP */
+
DBUG_VOID_RETURN;
}
@@ -2493,7 +2508,8 @@ bool THD::to_ident_sys_alloc(Lex_ident_sys_st *to, const Lex_ident_cli_st *ident
Item_basic_constant *
-THD::make_string_literal(const char *str, size_t length, uint repertoire)
+THD::make_string_literal(const char *str, size_t length,
+ my_repertoire_t repertoire)
{
if (!length && (variables.sql_mode & MODE_EMPTY_STRING_IS_NULL))
return new (mem_root) Item_null(this, 0, variables.collation_connection);
@@ -3738,7 +3754,6 @@ void select_dumpvar::cleanup()
Query_arena::Type Query_arena::type() const
{
- DBUG_ASSERT(0); /* Should never be called */
return STATEMENT;
}
@@ -5802,7 +5817,8 @@ start_new_trans::start_new_trans(THD *thd)
mdl_savepoint= thd->mdl_context.mdl_savepoint();
memcpy(old_ha_data, thd->ha_data, sizeof(old_ha_data));
thd->reset_n_backup_open_tables_state(&open_tables_state_backup);
- bzero(thd->ha_data, sizeof(thd->ha_data));
+ for (auto &data : thd->ha_data)
+ data.reset();
old_transaction= thd->transaction;
thd->transaction= &new_transaction;
new_transaction.on= 1;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index e13b896c820..fa64892d5a0 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1099,7 +1099,7 @@ public:
/* We build without RTTI, so dynamic_cast can't be used. */
enum Type
{
- STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE
+ STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE, TABLE_ARENA
};
Query_arena(MEM_ROOT *mem_root_arg, enum enum_state state_arg) :
@@ -2023,6 +2023,14 @@ struct Ha_data
*/
plugin_ref lock;
Ha_data() :ha_ptr(NULL) {}
+
+ void reset()
+ {
+ ha_ptr= nullptr;
+ for (auto &info : ha_info)
+ info.reset();
+ lock= nullptr;
+ }
};
/**
@@ -3926,10 +3934,10 @@ public:
@param repertoire - the repertoire of the string
*/
Item_basic_constant *make_string_literal(const char *str, size_t length,
- uint repertoire);
+ my_repertoire_t repertoire);
Item_basic_constant *make_string_literal(const Lex_string_with_metadata_st &str)
{
- uint repertoire= str.repertoire(variables.character_set_client);
+ my_repertoire_t repertoire= str.repertoire(variables.character_set_client);
return make_string_literal(str.str, str.length, repertoire);
}
Item_basic_constant *make_string_literal_nchar(const Lex_string_with_metadata_st &str);
@@ -4077,13 +4085,20 @@ public:
return 0;
}
+
+ bool is_item_tree_change_register_required()
+ {
+ return !stmt_arena->is_conventional()
+ || stmt_arena->type() == Query_arena::TABLE_ARENA;
+ }
+
void change_item_tree(Item **place, Item *new_value)
{
DBUG_ENTER("THD::change_item_tree");
DBUG_PRINT("enter", ("Register: %p (%p) <- %p",
*place, place, new_value));
/* TODO: check for OOM condition here */
- if (!stmt_arena->is_conventional())
+ if (is_item_tree_change_register_required())
nocheck_register_item_tree_change(place, *place, mem_root);
*place= new_value;
DBUG_VOID_RETURN;
@@ -4579,14 +4594,13 @@ public:
void push_warning_truncated_value_for_field(Sql_condition::enum_warning_level
level, const char *type_str,
const char *val,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *name)
{
DBUG_ASSERT(name);
char buff[MYSQL_ERRMSG_SIZE];
CHARSET_INFO *cs= &my_charset_latin1;
- const char *db_name= s ? s->db.str : NULL;
- const char *table_name= s ? s->table_name.str : NULL;
if (!db_name)
db_name= "";
@@ -4603,12 +4617,13 @@ public:
bool totally_useless_value,
const char *type_str,
const char *val,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *field_name)
{
if (field_name)
push_warning_truncated_value_for_field(level, type_str, val,
- s, field_name);
+ db_name, table_name, field_name);
else if (totally_useless_value)
push_warning_wrong_value(level, type_str, val);
else
@@ -5004,7 +5019,8 @@ public:
table updates from being replicated to other nodes via galera replication.
*/
bool wsrep_ignore_table;
-
+ /* thread who has started kill for this THD protected by LOCK_thd_data*/
+ my_thread_id wsrep_aborter;
/*
Transaction id:
@@ -6437,14 +6453,14 @@ struct SORT_FIELD_ATTR
*/
bool maybe_null;
CHARSET_INFO *cs;
- uint pack_sort_string(uchar *to, const LEX_CSTRING &str,
- CHARSET_INFO *cs) const;
+ uint pack_sort_string(uchar *to, String *str) const;
int compare_packed_fixed_size_vals(uchar *a, size_t *a_len,
uchar *b, size_t *b_len);
int compare_packed_varstrings(uchar *a, size_t *a_len,
uchar *b, size_t *b_len);
bool check_if_packing_possible(THD *thd) const;
bool is_variable_sized() { return type == VARIABLE_SIZE; }
+ void set_length_and_original_length(THD *thd, uint length_arg);
};
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 420a054a1b2..83f4de1b5df 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1279,7 +1279,6 @@ void prepare_new_connection_state(THD* thd)
}
thd->proc_info=0;
- thd->init_for_queries();
}
}
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 3ccab553bfe..e31e51d0316 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -671,7 +671,7 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, size_t mlen,
RETURN VALUES
FALSE Success
- TRUE Error and send_error already commited
+ TRUE Error and send_error already committed
*/
static bool mysqld_help_internal(THD *thd, const char *mask)
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 31badbe2aba..d25410292ef 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1717,6 +1717,10 @@ int vers_insert_history_row(TABLE *table)
if (row_start->cmp(row_start->ptr, row_end->ptr) >= 0)
return 0;
+ if (table->vfield &&
+ table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_READ))
+ return HA_ERR_GENERIC;
+
return table->file->ha_write_row(table->record[0]);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index f39f88fe843..baec470c471 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2941,6 +2941,7 @@ void st_select_lex::init_query()
n_sum_items= 0;
n_child_sum_items= 0;
hidden_bit_fields= 0;
+ fields_in_window_functions= 0;
subquery_in_having= explicit_limit= 0;
is_item_list_lookup= 0;
changed_elements= 0;
@@ -3503,7 +3504,8 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
select_n_having_items +
select_n_where_fields +
order_group_num +
- hidden_bit_fields) * 5;
+ hidden_bit_fields +
+ fields_in_window_functions) * 5;
if (!ref_pointer_array.is_null())
{
/*
@@ -4740,7 +4742,7 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only)
}
if (subquery_predicate->substype() == Item_subselect::IN_SUBS)
{
- Item_in_subselect *in_subs= (Item_in_subselect*) subquery_predicate;
+ Item_in_subselect *in_subs= subquery_predicate->get_IN_subquery();
if (in_subs->is_jtbm_merged)
continue;
}
@@ -5167,7 +5169,7 @@ void SELECT_LEX::update_used_tables()
*/
if (tl->jtbm_subselect)
{
- Item *left_expr= tl->jtbm_subselect->left_expr;
+ Item *left_expr= tl->jtbm_subselect->left_exp();
left_expr->walk(&Item::update_table_bitmaps_processor, FALSE, NULL);
}
@@ -5324,7 +5326,7 @@ void st_select_lex::set_explain_type(bool on_the_fly)
if ((parent_item= master_unit()->item) &&
parent_item->substype() == Item_subselect::IN_SUBS)
{
- Item_in_subselect *in_subs= (Item_in_subselect*)parent_item;
+ Item_in_subselect *in_subs= parent_item->get_IN_subquery();
/*
Surprisingly, in_subs->is_set_strategy() can return FALSE here,
even for the last invocation of this function for the select.
@@ -5613,9 +5615,10 @@ bool st_select_lex::is_merged_child_of(st_select_lex *ancestor)
sl=sl->outer_select())
{
Item *subs= sl->master_unit()->item;
- if (subs && subs->type() == Item::SUBSELECT_ITEM &&
+ Item_in_subselect *in_subs= (subs ? subs->get_IN_subquery() : NULL);
+ if (in_subs &&
((Item_subselect*)subs)->substype() == Item_subselect::IN_SUBS &&
- ((Item_in_subselect*)subs)->test_strategy(SUBS_SEMI_JOIN))
+ in_subs->test_strategy(SUBS_SEMI_JOIN))
{
continue;
}
@@ -6784,6 +6787,7 @@ bool LEX::sp_for_loop_cursor_declarations(THD *thd,
LEX_CSTRING name;
uint coffs, param_count= 0;
const sp_pcursor *pcursor;
+ DBUG_ENTER("LEX::sp_for_loop_cursor_declarations");
if ((item_splocal= item->get_item_splocal()))
name= item_splocal->m_name;
@@ -6815,23 +6819,23 @@ bool LEX::sp_for_loop_cursor_declarations(THD *thd,
else
{
thd->parse_error();
- return true;
+ DBUG_RETURN(true);
}
if (unlikely(!(pcursor= spcont->find_cursor_with_error(&name, &coffs,
false)) ||
pcursor->check_param_count_with_error(param_count)))
- return true;
+ DBUG_RETURN(true);
if (!(loop->m_index= sp_add_for_loop_cursor_variable(thd, index,
pcursor, coffs,
bounds.m_index,
item_func_sp)))
- return true;
+ DBUG_RETURN(true);
loop->m_target_bound= NULL;
loop->m_direction= bounds.m_direction;
loop->m_cursor_offset= coffs;
loop->m_implicit_cursor= bounds.m_implicit_cursor;
- return false;
+ DBUG_RETURN(false);
}
@@ -8185,6 +8189,7 @@ Item *LEX::create_item_ident_sp(THD *thd, Lex_ident_sys_st *name,
const Sp_rcontext_handler *rh;
sp_variable *spv;
+ uint unused_off;
DBUG_ASSERT(spcont);
DBUG_ASSERT(sphead);
if ((spv= find_variable(name, &rh)))
@@ -8223,6 +8228,15 @@ Item *LEX::create_item_ident_sp(THD *thd, Lex_ident_sys_st *name,
return new (thd->mem_root) Item_func_sqlerrm(thd);
}
+ if (!select_stack_head() &&
+ (current_select->parsing_place != FOR_LOOP_BOUND ||
+ spcont->find_cursor(name, &unused_off, false) == NULL))
+ {
+ // we are out of SELECT or FOR so it is syntax error
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), name->str);
+ return NULL;
+ }
+
if (current_select->parsing_place == FOR_LOOP_BOUND)
return create_item_for_loop_bound(thd, &null_clex_str, &null_clex_str,
name);
@@ -9712,7 +9726,8 @@ Item *LEX::create_item_query_expression(THD *thd,
// Add the subtree of subquery to the current SELECT_LEX
SELECT_LEX *curr_sel= select_stack_head();
- DBUG_ASSERT(current_select == curr_sel);
+ DBUG_ASSERT(current_select == curr_sel ||
+ (curr_sel == NULL && current_select == &builtin_select));
if (!curr_sel)
{
curr_sel= &builtin_select;
@@ -9955,7 +9970,8 @@ SELECT_LEX *LEX::parsed_subselect(SELECT_LEX_UNIT *unit)
// Add the subtree of subquery to the current SELECT_LEX
SELECT_LEX *curr_sel= select_stack_head();
- DBUG_ASSERT(current_select == curr_sel);
+ DBUG_ASSERT(current_select == curr_sel ||
+ (curr_sel == NULL && current_select == &builtin_select));
if (curr_sel)
{
curr_sel->register_unit(unit, &curr_sel->context);
@@ -10031,7 +10047,8 @@ TABLE_LIST *LEX::parsed_derived_table(SELECT_LEX_UNIT *unit,
// Add the subtree of subquery to the current SELECT_LEX
SELECT_LEX *curr_sel= select_stack_head();
- DBUG_ASSERT(current_select == curr_sel);
+ DBUG_ASSERT(current_select == curr_sel ||
+ (curr_sel == NULL && current_select == &builtin_select));
Table_ident *ti= new (thd->mem_root) Table_ident(unit);
if (ti == NULL)
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index b6dcb49ed08..92d4ec42c8f 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -85,13 +85,13 @@ public:
bool is_quoted() const { return m_quote != '\0'; }
char quote() const { return m_quote; }
// Get string repertoire by the 8-bit flag and the character set
- uint repertoire(CHARSET_INFO *cs) const
+ my_repertoire_t repertoire(CHARSET_INFO *cs) const
{
return !m_is_8bit && my_charset_is_ascii_based(cs) ?
MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
}
// Get string repertoire by the 8-bit flag, for ASCII-based character sets
- uint repertoire() const
+ my_repertoire_t repertoire() const
{
return !m_is_8bit ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
}
@@ -1215,6 +1215,14 @@ public:
converted to a GROUP BY involving BIT fields.
*/
uint hidden_bit_fields;
+ /*
+ Number of fields used in the definition of all the windows functions.
+ This includes:
+ 1) Fields in the arguments
+ 2) Fields in the PARTITION BY clause
+ 3) Fields in the ORDER BY clause
+ */
+ uint fields_in_window_functions;
enum_parsing_place parsing_place; /* where we are parsing expression */
enum_parsing_place save_parsing_place;
enum_parsing_place context_analysis_place; /* where we are in prepare */
@@ -1548,10 +1556,7 @@ public:
SQL_I_List<ORDER> win_order_list,
Window_frame *win_frame);
List<Item_window_func> window_funcs;
- bool add_window_func(Item_window_func *win_func)
- {
- return window_funcs.push_back(win_func);
- }
+ bool add_window_func(Item_window_func *win_func);
bool have_window_funcs() const { return (window_funcs.elements !=0); }
ORDER *find_common_window_func_partition_fields(THD *thd);
@@ -3693,8 +3698,9 @@ public:
if (unlikely(!select_stack_top))
{
- current_select= NULL;
- DBUG_PRINT("info", ("Top Select is empty"));
+ current_select= &builtin_select;
+ DBUG_PRINT("info", ("Top Select is empty -> sel builtin: %p",
+ current_select));
}
else
current_select= select_stack[select_stack_top - 1];
diff --git a/sql/sql_locale.h b/sql/sql_locale.h
index feeb7a44bdf..b7ce9f7ba1d 100644
--- a/sql/sql_locale.h
+++ b/sql/sql_locale.h
@@ -60,7 +60,7 @@ public:
grouping(grouping_par),
errmsgs(errmsgs_par)
{}
- uint repertoire() const
+ my_repertoire_t repertoire() const
{ return is_ascii ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_EXTENDED; }
};
/* Exported variables */
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1d830f60da0..144b86e8fc9 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1271,6 +1271,7 @@ bool do_command(THD *thd)
command= fetch_command(thd, packet);
#ifdef WITH_WSREP
+ DEBUG_SYNC(thd, "wsrep_before_before_command");
/*
Aborted by background rollbacker thread.
Handle error here and jump straight to out
@@ -7852,8 +7853,8 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
sp_cache_enforce_limit(thd->sp_package_spec_cache, stored_program_cache_size);
sp_cache_enforce_limit(thd->sp_package_body_cache, stored_program_cache_size);
thd->end_statement();
+ thd->Item_change_list::rollback_item_tree_changes();
thd->cleanup_after_query();
- DBUG_ASSERT(thd->Item_change_list::is_empty());
}
else
{
@@ -8664,6 +8665,11 @@ bool st_select_lex::add_window_def(THD *thd,
win_frame);
group_list= thd->lex->save_group_list;
order_list= thd->lex->save_order_list;
+ if (parsing_place != SELECT_LIST)
+ {
+ fields_in_window_functions+= win_part_list_ptr->elements +
+ win_order_list_ptr->elements;
+ }
return (win_def == NULL || window_specs.push_back(win_def));
}
@@ -8685,6 +8691,11 @@ bool st_select_lex::add_window_spec(THD *thd,
win_frame);
group_list= thd->lex->save_group_list;
order_list= thd->lex->save_order_list;
+ if (parsing_place != SELECT_LIST)
+ {
+ fields_in_window_functions+= win_part_list_ptr->elements +
+ win_order_list_ptr->elements;
+ }
thd->lex->win_spec= win_spec;
return (win_spec == NULL || window_specs.push_back(win_spec));
}
@@ -8916,6 +8927,8 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
SELECT_LEX *lex)
{
b->natural_join= a;
+ a->part_of_natural_join= TRUE;
+ b->part_of_natural_join= TRUE;
lex->prev_join_using= using_fields;
}
@@ -8945,7 +8958,6 @@ my_bool find_thread_callback(THD *thd, find_thread_callback_arg *arg)
if (thd->get_command() != COM_DAEMON &&
arg->id == (arg->query_id ? thd->query_id : (longlong) thd->thread_id))
{
- if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);
mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
arg->thd= thd;
return 1;
@@ -8961,6 +8973,26 @@ THD *find_thread_by_id(longlong id, bool query_id)
return arg.thd;
}
+#ifdef WITH_WSREP
+my_bool find_thread_with_thd_data_lock_callback(THD *thd, find_thread_callback_arg *arg)
+{
+ if (thd->get_command() != COM_DAEMON &&
+ arg->id == (arg->query_id ? thd->query_id : (longlong) thd->thread_id))
+ {
+ if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);
+ mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
+ arg->thd= thd;
+ return 1;
+ }
+ return 0;
+}
+THD *find_thread_by_id_with_thd_data_lock(longlong id, bool query_id)
+{
+ find_thread_callback_arg arg(id, query_id);
+ server_threads.iterate(find_thread_with_thd_data_lock_callback, &arg);
+ return arg.thd;
+}
+#endif
/**
kill one thread.
@@ -8978,8 +9010,11 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
DBUG_ENTER("kill_one_thread");
DBUG_PRINT("enter", ("id: %lld signal: %u", id, (uint) kill_signal));
- WSREP_DEBUG("kill_one_thread %llu", thd->thread_id);
+#ifdef WITH_WSREP
+ if (id && (tmp= find_thread_by_id_with_thd_data_lock(id, type == KILL_TYPE_QUERY)))
+#else
if (id && (tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY)))
+#endif
{
/*
If we're SUPER, we can KILL anything, including system-threads.
@@ -9011,13 +9046,31 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
thd->security_ctx->user_matches(tmp->security_ctx))
#endif /* WITH_WSREP */
{
- tmp->awake_no_mutex(kill_signal);
- error=0;
+#ifdef WITH_WSREP
+ DEBUG_SYNC(thd, "before_awake_no_mutex");
+ if (tmp->wsrep_aborter && tmp->wsrep_aborter != thd->thread_id)
+ {
+ /* victim is in hit list already, bail out */
+ WSREP_DEBUG("victim has wsrep aborter: %lu, skipping awake()",
+ tmp->wsrep_aborter);
+ error= 0;
+ }
+ else
+#endif /* WITH_WSREP */
+ {
+ WSREP_DEBUG("kill_one_thread %llu, victim: %llu wsrep_aborter %llu by signal %d",
+ thd->thread_id, id, tmp->wsrep_aborter, kill_signal);
+ tmp->awake_no_mutex(kill_signal);
+ WSREP_DEBUG("victim: %llu taken care of", id);
+ error= 0;
+ }
}
else
error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR :
ER_KILL_DENIED_ERROR);
+#ifdef WITH_WSREP
if (WSREP(tmp)) mysql_mutex_unlock(&tmp->LOCK_thd_data);
+#endif
mysql_mutex_unlock(&tmp->LOCK_thd_kill);
}
DBUG_PRINT("exit", ("%d", error));
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 7822cab5ff0..55abee72a52 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -563,12 +563,12 @@ bool Sql_cmd_alter_table_exchange_partition::
part_table= table_list->table;
swap_table= swap_table_list->table;
- if (part_table->file->check_if_updates_are_ignored("ALTER"))
- DBUG_RETURN(return_with_logging(thd));
-
if (unlikely(check_exchange_partition(swap_table, part_table)))
DBUG_RETURN(TRUE);
+ if (part_table->file->check_if_updates_are_ignored("ALTER"))
+ DBUG_RETURN(return_with_logging(thd));
+
/* Add IF EXISTS to binlog if shared table */
if (part_table->file->partition_ht()->flags &
HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE)
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 4526cac5af1..633d969b3de 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2018, Oracle and/or its affiliates.
- Copyright (c) 2010, 2020, MariaDB Corporation
+ Copyright (c) 2010, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1831,6 +1831,8 @@ static void plugin_load(MEM_ROOT *tmp_root)
int error;
THD *new_thd= new THD(0);
bool result;
+ unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
+ { MYSQL_AUDIT_GENERAL_CLASSMASK };
DBUG_ENTER("plugin_load");
if (global_system_variables.log_warnings >= 9)
@@ -1882,6 +1884,31 @@ static void plugin_load(MEM_ROOT *tmp_root)
continue;
/*
+ Pre-acquire audit plugins for events that may potentially occur
+ during [UN]INSTALL PLUGIN.
+
+ When audit event is triggered, audit subsystem acquires interested
+ plugins by walking through plugin list. Evidently plugin list
+ iterator protects plugin list by acquiring LOCK_plugin, see
+ plugin_foreach_with_mask().
+
+ On the other hand plugin_load is acquiring LOCK_plugin
+ rather for a long time.
+
+ When audit event is triggered during plugin_load plugin
+ list iterator acquires the same lock (within the same thread)
+ second time.
+
+ This hack should be removed when LOCK_plugin is fixed so it
+ protects only what it supposed to protect.
+
+ See also mysql_install_plugin(), mysql_uninstall_plugin() and
+ initialize_audit_plugin()
+ */
+ if (mysql_audit_general_enabled())
+ mysql_audit_acquire_plugins(new_thd, event_class_mask);
+
+ /*
there're no other threads running yet, so we don't need a mutex.
but plugin_add() before is designed to work in multi-threaded
environment, and it uses mysql_mutex_assert_owner(), so we lock
@@ -2281,27 +2308,30 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)) ||
plugin->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_DYING))
{
- myf MyFlags= thd->lex->if_exists() ? ME_NOTE : 0;
- my_error(ER_SP_DOES_NOT_EXIST, MyFlags, "PLUGIN", name->str);
- return !MyFlags;
- }
- if (!plugin->plugin_dl)
- {
- my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
- return 1;
+ // maybe plugin is present in mysql.plugin; postpone the error
+ plugin= nullptr;
}
- if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
+
+ if (plugin)
{
- my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
- return 1;
- }
+ if (!plugin->plugin_dl)
+ {
+ my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
+ return 1;
+ }
+ if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
+ {
+ my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
+ return 1;
+ }
- plugin->state= PLUGIN_IS_DELETED;
- if (plugin->ref_count)
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
- else
- reap_needed= true;
+ plugin->state= PLUGIN_IS_DELETED;
+ if (plugin->ref_count)
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
+ WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
+ else
+ reap_needed= true;
+ }
uchar user_key[MAX_KEY_LENGTH];
table->use_all_columns();
@@ -2325,6 +2355,12 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
return 1;
}
}
+ else if (!plugin)
+ {
+ const myf MyFlags= thd->lex->if_exists() ? ME_NOTE : 0;
+ my_error(ER_SP_DOES_NOT_EXIST, MyFlags, "PLUGIN", name->str);
+ return !MyFlags;
+ }
return 0;
}
diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic
index 2db426e7b57..e4f9f3c0d13 100644
--- a/sql/sql_plugin_services.ic
+++ b/sql/sql_plugin_services.ic
@@ -177,7 +177,8 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_thd_is_applying,
wsrep_OSU_method_get,
wsrep_thd_has_ignored_error,
- wsrep_thd_set_ignored_error
+ wsrep_thd_set_ignored_error,
+ wsrep_thd_set_wsrep_aborter
};
static struct thd_specifics_service_st thd_specifics_handler=
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 75c3bcd2083..f6920e7420f 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -262,9 +262,10 @@ protected:
virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag);
virtual bool store_decimal(const my_decimal *);
- virtual bool store(const char *from, size_t length, CHARSET_INFO *cs);
- virtual bool store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
+ virtual bool store_str(const char *from, size_t length,
+ CHARSET_INFO *fromcs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *tocs);
virtual bool store(MYSQL_TIME *time, int decimals);
virtual bool store_date(MYSQL_TIME *time);
virtual bool store_time(MYSQL_TIME *time, int decimals);
@@ -287,7 +288,9 @@ protected:
virtual bool send_error(uint sql_errno, const char *err_msg, const char* sqlstate);
private:
bool store_string(const char *str, size_t length,
- CHARSET_INFO *src_cs, CHARSET_INFO *dst_cs);
+ CHARSET_INFO *src_cs,
+ my_repertoire_t src_repertoire,
+ CHARSET_INFO *dst_cs);
bool store_column(const void *data, size_t length);
void opt_add_row_to_rset();
@@ -5270,14 +5273,14 @@ bool Protocol_local::store_column(const void *data, size_t length)
bool
Protocol_local::store_string(const char *str, size_t length,
- CHARSET_INFO *src_cs, CHARSET_INFO *dst_cs)
+ CHARSET_INFO *src_cs,
+ my_repertoire_t src_repertoire,
+ CHARSET_INFO *dst_cs)
{
/* Store with conversion */
uint error_unused;
- if (dst_cs && !my_charset_same(src_cs, dst_cs) &&
- src_cs != &my_charset_bin &&
- dst_cs != &my_charset_bin)
+ if (needs_conversion(src_cs, src_repertoire, dst_cs))
{
if (unlikely(convert->copy(str, length, src_cs, dst_cs, &error_unused)))
return TRUE;
@@ -5334,24 +5337,14 @@ bool Protocol_local::store_decimal(const my_decimal *value)
}
-/** Convert to cs_results and store a string. */
-
-bool Protocol_local::store(const char *str, size_t length,
- CHARSET_INFO *src_cs)
-{
- CHARSET_INFO *dst_cs;
-
- dst_cs= m_connection->m_thd->variables.character_set_results;
- return store_string(str, length, src_cs, dst_cs);
-}
-
-
/** Store a string. */
-bool Protocol_local::store(const char *str, size_t length,
- CHARSET_INFO *src_cs, CHARSET_INFO *dst_cs)
+bool Protocol_local::store_str(const char *str, size_t length,
+ CHARSET_INFO *src_cs,
+ my_repertoire_t from_repertoire,
+ CHARSET_INFO *dst_cs)
{
- return store_string(str, length, src_cs, dst_cs);
+ return store_string(str, length, src_cs, from_repertoire, dst_cs);
}
@@ -5360,7 +5353,7 @@ bool Protocol_local::store(const char *str, size_t length,
bool Protocol_local::store(MYSQL_TIME *time, int decimals)
{
if (decimals != AUTO_SEC_PART_DIGITS)
- my_time_trunc(time, decimals);
+ my_datetime_trunc(time, decimals);
return store_column(time, sizeof(MYSQL_TIME));
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index cef61ece5d8..7992ced036d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1425,7 +1425,7 @@ JOIN::prepare(TABLE_LIST *tables_init, COND *conds_init, uint og_num,
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY && !group_list &&
!(select_lex->master_unit()->item &&
select_lex->master_unit()->item->is_in_predicate() &&
- ((Item_in_subselect*)select_lex->master_unit()->item)->
+ select_lex->master_unit()->item->get_IN_subquery()->
test_set_strategy(SUBS_MAXMIN_INJECTED)) &&
select_lex->non_agg_field_used() &&
select_lex->agg_func_used())
@@ -5056,7 +5056,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
*/
bool skip_unprefixed_keyparts=
!(join->is_in_subquery() &&
- ((Item_in_subselect*)join->unit->item)->test_strategy(SUBS_IN_TO_EXISTS));
+ join->unit->item->get_IN_subquery()->test_strategy(SUBS_IN_TO_EXISTS));
if (keyuse_array->elements &&
sort_and_filter_keyuse(thd, keyuse_array,
@@ -5809,7 +5809,8 @@ static uint get_semi_join_select_list_index(Field *field)
{
Item_in_subselect *subq_pred= emb_sj_nest->sj_subq_pred;
st_select_lex *subq_lex= subq_pred->unit->first_select();
- if (subq_pred->left_expr->cols() == 1)
+ uint ncols= subq_pred->left_exp()->cols();
+ if (ncols == 1)
{
Item *sel_item= subq_lex->ref_pointer_array[0];
if (sel_item->type() == Item::FIELD_ITEM &&
@@ -5820,7 +5821,7 @@ static uint get_semi_join_select_list_index(Field *field)
}
else
{
- for (uint i= 0; i < subq_pred->left_expr->cols(); i++)
+ for (uint i= 0; i < ncols; i++)
{
Item *sel_item= subq_lex->ref_pointer_array[i];
if (sel_item->type() == Item::FIELD_ITEM &&
@@ -21258,7 +21259,7 @@ int join_read_key2(THD *thd, JOIN_TAB *tab, TABLE *table, TABLE_REF *table_ref)
if (tab && tab->bush_children)
{
TABLE_LIST *emb_sj_nest= tab->bush_children->start->emb_sj_nest;
- emb_sj_nest->sj_subq_pred->left_expr->bring_value();
+ emb_sj_nest->sj_subq_pred->left_exp()->bring_value();
}
/* TODO: Why don't we do "Late NULLs Filtering" here? */
@@ -24470,10 +24471,13 @@ int setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
List<Item> &fields, List<Item> &all_fields, ORDER *order,
bool from_window_spec)
{
+ SELECT_LEX *select = thd->lex->current_select;
enum_parsing_place context_analysis_place=
thd->lex->current_select->context_analysis_place;
thd->where="order clause";
- for (; order; order=order->next)
+ const bool for_union= select->master_unit()->is_unit_op() &&
+ select == select->master_unit()->fake_select_lex;
+ for (uint number = 1; order; order=order->next, number++)
{
if (find_order_in_list(thd, ref_pointer_array, tables, order, fields,
all_fields, false, true, from_window_spec))
@@ -24484,8 +24488,22 @@ int setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
my_error(ER_WINDOW_FUNCTION_IN_WINDOW_SPEC, MYF(0));
return 1;
}
- if (from_window_spec && (*order->item)->with_sum_func() &&
- (*order->item)->type() != Item::SUM_FUNC_ITEM)
+
+ if (!(*order->item)->with_sum_func())
+ continue;
+
+ /*
+ UNION queries cannot be used with an aggregate function in
+ an ORDER BY clause
+ */
+
+ if (for_union)
+ {
+ my_error(ER_AGGREGATE_ORDER_FOR_UNION, MYF(0), number);
+ return 1;
+ }
+
+ if (from_window_spec && (*order->item)->type() != Item::SUM_FUNC_ITEM)
(*order->item)->split_sum_func(thd, ref_pointer_array,
all_fields, SPLIT_SUM_SELECT);
}
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index c0925da59e1..b9d500d463c 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -1,5 +1,6 @@
/*
Copyright (c) 2017, MariaDB Corporation, Alibaba Corporation
+ Copyrgiht (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -483,6 +484,10 @@ int SEQUENCE::read_initial_values(TABLE *table)
if (mdl_lock_used)
thd->mdl_context.release_lock(mdl_request.ticket);
write_unlock(table);
+
+ if (!has_active_transaction && !thd->transaction->stmt.is_empty() &&
+ !thd->in_sub_stmt)
+ trans_commit_stmt(thd);
DBUG_RETURN(HA_ERR_LOCK_WAIT_TIMEOUT);
}
DBUG_ASSERT(table->reginfo.lock_type == TL_READ);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 64076197cf8..77ebc58bc02 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -8126,7 +8126,10 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
else
all_items= thd->free_list;
- mark_all_fields_used_in_query(thd, fields_info, &bitmap, all_items);
+ if (table_list->part_of_natural_join)
+ bitmap_set_all(&bitmap);
+ else
+ mark_all_fields_used_in_query(thd, fields_info, &bitmap, all_items);
TMP_TABLE_PARAM *tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM;
tmp_table_param->init();
@@ -8215,7 +8218,7 @@ int make_schemata_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
buffer.append(lex->wild->ptr());
buffer.append(')');
}
- field->set_name(thd, buffer.lex_cstring());
+ field->set_name(thd, &buffer);
}
return 0;
}
@@ -8224,7 +8227,7 @@ int make_schemata_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
int make_table_names_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
{
char tmp[128];
- String buffer(tmp,sizeof(tmp), thd->charset());
+ String buffer(tmp, sizeof(tmp), system_charset_info);
LEX *lex= thd->lex;
Name_resolution_context *context= &lex->first_select_lex()->context;
ST_FIELD_INFO *field_info= &schema_table->fields_info[2];
@@ -8242,7 +8245,7 @@ int make_table_names_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
Item_field *field= new (thd->mem_root) Item_field(thd, context, field_name);
if (add_item_to_list(thd, field))
return 1;
- field->set_name(thd, buffer.lex_cstring());
+ field->set_name(thd, &buffer);
if (thd->lex->verbose)
{
field_info= &schema_table->fields_info[3];
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 879955af723..2636299e330 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -2123,8 +2123,8 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
sizeof(Index_statistics) * keys);
uint key_parts= table->s->ext_key_parts;
- ulong *idx_avg_frequency= (ulong*) alloc_root(&table->mem_root,
- sizeof(ulong) * key_parts);
+ ulonglong *idx_avg_frequency= (ulonglong*) alloc_root(&table->mem_root,
+ sizeof(ulonglong) * key_parts);
uint columns= 0;
for (field_ptr= table->field; *field_ptr; field_ptr++)
@@ -2169,7 +2169,7 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
}
}
- memset(idx_avg_frequency, 0, sizeof(ulong) * key_parts);
+ memset(idx_avg_frequency, 0, sizeof(ulonglong) * key_parts);
KEY *key_info, *end;
for (key_info= table->key_info, end= key_info + table->s->keys;
@@ -2285,14 +2285,14 @@ static int alloc_statistics_for_table_share(THD* thd, TABLE_SHARE *table_share)
}
uint key_parts= table_share->ext_key_parts;
- ulong *idx_avg_frequency= table_stats->idx_avg_frequency;
+ ulonglong *idx_avg_frequency= table_stats->idx_avg_frequency;
if (!idx_avg_frequency)
{
- idx_avg_frequency= (ulong*) alloc_root(&stats_cb->mem_root,
- sizeof(ulong) * key_parts);
+ idx_avg_frequency= (ulonglong*) alloc_root(&stats_cb->mem_root,
+ sizeof(ulonglong) * key_parts);
if (idx_avg_frequency)
{
- memset(idx_avg_frequency, 0, sizeof(ulong) * key_parts);
+ memset(idx_avg_frequency, 0, sizeof(ulonglong) * key_parts);
table_stats->idx_avg_frequency= idx_avg_frequency;
for (key_info= table_share->key_info, end= key_info + keys;
key_info < end;
diff --git a/sql/sql_statistics.h b/sql/sql_statistics.h
index b90c614b74f..20ecf06bfee 100644
--- a/sql/sql_statistics.h
+++ b/sql/sql_statistics.h
@@ -294,7 +294,9 @@ public:
uchar *min_max_record_buffers; /* Record buffers for min/max values */
Column_statistics *column_stats; /* Array of statistical data for columns */
Index_statistics *index_stats; /* Array of statistical data for indexes */
- ulong *idx_avg_frequency; /* Array of records per key for index prefixes */
+
+ /* Array of records per key for index prefixes */
+ ulonglong *idx_avg_frequency;
uchar *histograms; /* Sequence of histograms */
};
@@ -346,7 +348,7 @@ private:
CHAR values are stripped of trailing spaces.
Flexible values are stripped of their length prefixes.
*/
- ulong avg_length;
+ ulonglong avg_length;
/*
The ratio N/D multiplied by the scale factor Scale_factor_avg_frequency,
@@ -354,7 +356,7 @@ private:
N is the number of rows with not null value in the column,
D the number of distinct values among them
*/
- ulong avg_frequency;
+ ulonglong avg_frequency;
public:
@@ -404,12 +406,12 @@ public:
void set_avg_length (double val)
{
- avg_length= (ulong) (val * Scale_factor_avg_length);
+ avg_length= (ulonglong) (val * Scale_factor_avg_length);
}
void set_avg_frequency (double val)
{
- avg_frequency= (ulong) (val * Scale_factor_avg_frequency);
+ avg_frequency= (ulonglong) (val * Scale_factor_avg_frequency);
}
bool min_max_values_are_provided()
@@ -448,11 +450,11 @@ private:
in the first k components, and D is the number of distinct
k-component prefixes among them
*/
- ulong *avg_frequency;
+ ulonglong *avg_frequency;
public:
- void init_avg_frequency(ulong *ptr) { avg_frequency= ptr; }
+ void init_avg_frequency(ulonglong *ptr) { avg_frequency= ptr; }
bool avg_frequency_is_inited() { return avg_frequency != NULL; }
@@ -463,7 +465,7 @@ public:
void set_avg_frequency(uint i, double val)
{
- avg_frequency[i]= (ulong) (val * Scale_factor_avg_frequency);
+ avg_frequency[i]= (ulonglong) (val * Scale_factor_avg_frequency);
}
};
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 2d38f6d5d13..274b1d9a5df 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -222,18 +222,6 @@ public:
inline bool is_empty() const { return (str_length == 0); }
inline const char *ptr() const { return Ptr; }
inline const char *end() const { return Ptr + str_length; }
-
- LEX_STRING lex_string() const
- {
- LEX_STRING str = { (char*) ptr(), length() };
- return str;
- }
- LEX_CSTRING lex_cstring() const
- {
- LEX_CSTRING skr = { ptr(), length() };
- return skr;
- }
-
bool has_8bit_bytes() const
{
for (const char *c= ptr(), *c_end= end(); c < c_end; c++)
@@ -488,6 +476,12 @@ public:
if (str.Alloced_length)
Alloced_length= (uint32) (str.Alloced_length - offset);
}
+ inline LEX_CSTRING *get_value(LEX_CSTRING *res)
+ {
+ res->str= Ptr;
+ res->length= str_length;
+ return res;
+ }
/* Take over handling of buffer from some other object */
void reset(char *ptr_arg, size_t length_arg, size_t alloced_length_arg)
@@ -888,13 +882,13 @@ public:
{
return Binary_string::append_hex((const char*)src, srclen);
}
- bool append_introducer_and_hex(CHARSET_INFO *cs, const LEX_CSTRING &str)
+ bool append_introducer_and_hex(String *str)
{
return
append(STRING_WITH_LEN("_")) ||
- append(cs->csname) ||
+ append(str->charset()->csname) ||
append(STRING_WITH_LEN(" 0x")) ||
- append_hex(str.str, (uint32) str.length);
+ append_hex(str->ptr(), (uint32) str->length());
}
bool append(IO_CACHE* file, uint32 arg_length)
{
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 87257bc9ab4..8834c4d26e9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7804,7 +7804,6 @@ static bool is_inplace_alter_impossible(TABLE *table,
@param ha_alter_info Structure describing ALTER TABLE to be carried
out and serving as a storage place for data
used during different phases.
- @param inplace_supported Enum describing the locking requirements.
@param target_mdl_request Metadata request/lock on the target table name.
@param alter_ctx ALTER TABLE runtime context.
@@ -7829,7 +7828,6 @@ static bool mysql_inplace_alter_table(THD *thd,
TABLE *table,
TABLE *altered_table,
Alter_inplace_info *ha_alter_info,
- enum_alter_inplace_result inplace_supported,
MDL_request *target_mdl_request,
Alter_table_ctx *alter_ctx)
{
@@ -7839,6 +7837,10 @@ static bool mysql_inplace_alter_table(THD *thd,
bool reopen_tables= false;
bool res;
handlerton *hton;
+
+ const enum_alter_inplace_result inplace_supported=
+ ha_alter_info->inplace_supported;
+
DBUG_ENTER("mysql_inplace_alter_table");
/* Downgrade DDL lock while we are waiting for exclusive lock below */
@@ -10521,27 +10523,31 @@ do_continue:;
if (alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_NONE)
ha_alter_info.online= true;
// Ask storage engine whether to use copy or in-place
- enum_alter_inplace_result inplace_supported=
+ ha_alter_info.inplace_supported=
table->file->check_if_supported_inplace_alter(&altered_table,
&ha_alter_info);
-
- Key *k;
- for (List_iterator<Key> it(alter_info->key_list);
- (k= it++) && inplace_supported != HA_ALTER_INPLACE_NOT_SUPPORTED;)
+ if (ha_alter_info.inplace_supported != HA_ALTER_INPLACE_NOT_SUPPORTED)
{
- if(k->without_overlaps)
- inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
+ List_iterator<Key> it(alter_info->key_list);
+ while (Key *k= it++)
+ {
+ if (k->without_overlaps)
+ {
+ ha_alter_info.inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
+ break;
+ }
+ }
}
- if (alter_info->supports_algorithm(thd, inplace_supported, &ha_alter_info) ||
- alter_info->supports_lock(thd, inplace_supported, &ha_alter_info))
+ if (alter_info->supports_algorithm(thd, &ha_alter_info) ||
+ alter_info->supports_lock(thd, &ha_alter_info))
{
cleanup_table_after_inplace_alter(&altered_table);
goto err_new_table_cleanup;
}
// If SHARED lock and no particular algorithm was requested, use COPY.
- if (inplace_supported == HA_ALTER_INPLACE_EXCLUSIVE_LOCK &&
+ if (ha_alter_info.inplace_supported == HA_ALTER_INPLACE_EXCLUSIVE_LOCK &&
alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_SHARED &&
alter_info->algorithm(thd) ==
Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT &&
@@ -10549,7 +10555,7 @@ do_continue:;
Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT)
use_inplace= false;
- if (inplace_supported == HA_ALTER_INPLACE_NOT_SUPPORTED)
+ if (ha_alter_info.inplace_supported == HA_ALTER_INPLACE_NOT_SUPPORTED)
use_inplace= false;
if (use_inplace)
@@ -10562,7 +10568,7 @@ do_continue:;
*/
thd->count_cuted_fields = CHECK_FIELD_WARN;
int res= mysql_inplace_alter_table(thd, table_list, table, &altered_table,
- &ha_alter_info, inplace_supported,
+ &ha_alter_info,
&target_mdl_request, &alter_ctx);
thd->count_cuted_fields= save_count_cuted_fields;
my_free(const_cast<uchar*>(frm.str));
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index c08e54bed87..8bb96dfa776 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -18,7 +18,6 @@
/* Functions to handle date and time */
#include "mariadb.h"
-#include "sql_priv.h"
#include "sql_time.h"
#include "tztime.h" // struct Time_zone
#include "sql_class.h" // THD
@@ -297,7 +296,7 @@ check_date_with_warn(THD *thd, const MYSQL_TIME *ltime,
{
ErrConvTime str(ltime);
make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- &str, ts_type, 0, 0);
+ &str, ts_type, nullptr, nullptr, nullptr);
return true;
}
return false;
@@ -431,7 +430,7 @@ str_to_datetime_with_warn(THD *thd, CHARSET_INFO *cs,
const char *str, size_t length, MYSQL_TIME *to,
date_mode_t mode)
{
- Temporal::Warn_push warn(thd, NULL, NullS, to, mode);
+ Temporal::Warn_push warn(thd, nullptr, nullptr, nullptr, to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(thd, &warn, str, length, cs, mode);
return !t->is_valid_temporal();
}
@@ -441,7 +440,9 @@ bool double_to_datetime_with_warn(THD *thd, double value, MYSQL_TIME *ltime,
date_mode_t fuzzydate,
const TABLE_SHARE *s, const char *field_name)
{
- Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate);
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name, ltime, fuzzydate);
Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, value, fuzzydate);
return !t->is_valid_temporal();
}
@@ -452,7 +453,9 @@ bool decimal_to_datetime_with_warn(THD *thd, const my_decimal *value,
date_mode_t fuzzydate,
const TABLE_SHARE *s, const char *field_name)
{
- Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate);
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name, ltime, fuzzydate);
Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, value, fuzzydate);
return !t->is_valid_temporal();
}
@@ -467,7 +470,9 @@ bool int_to_datetime_with_warn(THD *thd, const Longlong_hybrid &nr,
Note: conversion from an integer to TIME can overflow to '838:59:59.999999',
so the conversion result can have fractional digits.
*/
- Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate);
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name, ltime, fuzzydate);
Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, nr, fuzzydate);
return !t->is_valid_temporal();
}
@@ -896,12 +901,13 @@ void make_truncated_value_warning(THD *thd,
Sql_condition::enum_warning_level level,
const ErrConv *sval,
timestamp_type time_type,
- const TABLE_SHARE *s, const char *field_name)
+ const char *db_name, const char *table_name,
+ const char *field_name)
{
const char *type_str= Temporal::type_name_by_timestamp_type(time_type);
return thd->push_warning_wrong_or_truncated_value
(level, time_type <= MYSQL_TIMESTAMP_ERROR, type_str, sval->ptr(),
- s, field_name);
+ db_name, table_name, field_name);
}
diff --git a/sql/sql_time.h b/sql/sql_time.h
index fe9697adf67..c918eb6d807 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB
+ Copyright (c) 2011, 2020, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -78,7 +78,7 @@ void make_truncated_value_warning(THD *thd,
Sql_condition::enum_warning_level level,
const ErrConv *str_val,
timestamp_type time_type,
- const TABLE_SHARE *s,
+ const char *db_name, const char *table_name,
const char *field_name);
extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index aee9b4c165c..bce65e494d3 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -507,17 +507,21 @@ bool Sec6::convert_to_mysql_time(THD *thd, int *warn, MYSQL_TIME *ltime,
void Temporal::push_conversion_warnings(THD *thd, bool totally_useless_value,
int warn,
const char *typestr,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *field_name,
const char *value)
{
if (MYSQL_TIME_WARN_HAVE_WARNINGS(warn))
thd->push_warning_wrong_or_truncated_value(Sql_condition::WARN_LEVEL_WARN,
totally_useless_value,
- typestr, value, s, field_name);
+ typestr, value,
+ db_name, table_name,
+ field_name);
else if (MYSQL_TIME_WARN_HAVE_NOTES(warn))
thd->push_warning_wrong_or_truncated_value(Sql_condition::WARN_LEVEL_NOTE,
- false, typestr, value, s,
+ false, typestr, value,
+ db_name, table_name,
field_name);
}
@@ -1092,7 +1096,7 @@ bool Temporal::datetime_round_or_invalidate(THD *thd, uint dec, int *warn, ulong
DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
if (datetime_add_nanoseconds_or_invalidate(thd, warn, nsec))
return true;
- my_time_trunc(this, dec);
+ my_datetime_trunc(this, dec);
return false;
}
@@ -4069,7 +4073,7 @@ uint32
Type_handler_bit::Item_decimal_notation_int_digits(const Item *item)
const
{
- return Bit_decimal_notation_int_digits(item);
+ return Bit_decimal_notation_int_digits_by_nbits(item->max_length);
}
@@ -4087,9 +4091,23 @@ Type_handler_general_purpose_int::Item_decimal_notation_int_digits(
a divisor.
*/
uint32
-Type_handler_bit::Bit_decimal_notation_int_digits(const Item *item)
-{
- return item->max_length/3+1;
+Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits(uint nbits)
+{
+ DBUG_ASSERT(nbits > 0);
+ DBUG_ASSERT(nbits <= 64);
+ set_if_smaller(nbits, 64); // Safety
+ static uint ndigits[65]=
+ {0,
+ 1,1,1,2,2,2,3,3, // 1..8 bits
+ 3,4,4,4,4,5,5,5, // 9..16 bits
+ 6,6,6,7,7,7,7,8, // 17..24 bits
+ 8,8,9,9,9,10,10,10, // 25..32 bits
+ 10,11,11,11,12,12,12,13, // 33..40 bits
+ 13,13,13,14,14,14,15,15, // 41..48 bits
+ 15,16,16,16,16,17,17,17, // 49..56 bits
+ 18,18,18,19,19,19,19,20 // 57..64 bits
+ };
+ return ndigits[nbits];
}
/*************************************************************************/
@@ -4933,7 +4951,9 @@ bool Type_handler::Item_get_date_with_warn(THD *thd, Item *item,
MYSQL_TIME *ltime,
date_mode_t fuzzydate) const
{
- Temporal::Warn_push warn(thd, item->field_table_or_null(),
+ const TABLE_SHARE *s= item->field_table_or_null();
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
item->field_name_or_null(), ltime, fuzzydate);
Item_get_date(thd, item, &warn, ltime, fuzzydate);
return ltime->time_type < 0;
@@ -4945,7 +4965,9 @@ bool Type_handler::Item_func_hybrid_field_type_get_date_with_warn(THD *thd,
MYSQL_TIME *ltime,
date_mode_t mode) const
{
- Temporal::Warn_push warn(thd, item->field_table_or_null(),
+ const TABLE_SHARE *s= item->field_table_or_null();
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
item->field_name_or_null(), ltime, mode);
Item_func_hybrid_field_type_get_date(thd, item, &warn, ltime, mode);
return ltime->time_type < 0;
@@ -6143,7 +6165,40 @@ bool Type_handler_row::
bool Type_handler_int_result::
Item_func_round_fix_length_and_dec(Item_func_round *item) const
{
- item->fix_arg_int();
+ item->fix_arg_int(this, item->arguments()[0]);
+ return false;
+}
+
+
+bool Type_handler_year::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ item->fix_arg_int(&type_handler_ulong, item->arguments()[0]);
+ return false;
+}
+
+
+bool Type_handler_hex_hybrid::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ item->fix_arg_int(nullptr, nullptr);
+ return false;
+}
+
+
+bool Type_handler_bit::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ uint nbits= item->arguments()[0]->max_length;
+ item->fix_length_and_dec_ulong_or_ulonglong_by_nbits(nbits);
+ return false;
+}
+
+
+bool Type_handler_typelib::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ item->fix_length_and_dec_long_or_longlong(5, true);
return false;
}
@@ -6164,10 +6219,12 @@ bool Type_handler_decimal_result::
}
-bool Type_handler_temporal_result::
+bool Type_handler_date_common::
Item_func_round_fix_length_and_dec(Item_func_round *item) const
{
- item->fix_arg_double();
+ static const Type_std_attributes attr(Type_numeric_attributes(8, 0, true),
+ DTCollation_numeric());
+ item->fix_arg_int(&type_handler_ulong, &attr);
return false;
}
@@ -6217,7 +6274,43 @@ bool Type_handler_row::
bool Type_handler_int_result::
Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
{
- item->fix_length_and_dec_int_or_decimal();
+ item->Type_std_attributes::set(item->arguments()[0]);
+ item->set_handler(this);
+ return false;
+}
+
+
+bool Type_handler_year::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->Type_std_attributes::set(item->arguments()[0]);
+ item->set_handler(&type_handler_ulong);
+ return false;
+}
+
+
+bool Type_handler_bit::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ uint nbits= item->arguments()[0]->max_length;
+ item->fix_length_and_dec_ulong_or_ulonglong_by_nbits(nbits);
+ return false;
+}
+
+
+bool Type_handler_typelib::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_long_or_longlong(5, true);
+ return false;
+}
+
+
+bool Type_handler_hex_hybrid::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ uint nchars= item->arguments()[0]->decimal_precision();
+ item->fix_length_and_dec_long_or_longlong(nchars, true);
return false;
}
@@ -6238,10 +6331,36 @@ bool Type_handler_decimal_result::
}
-bool Type_handler_temporal_result::
+bool Type_handler_date_common::
Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
{
- item->fix_length_and_dec_int_or_decimal();
+ static const Type_numeric_attributes attr(8, 0/*dec*/, true/*unsigned*/);
+ item->Type_std_attributes::set(attr, DTCollation_numeric());
+ item->set_handler(&type_handler_ulong);
+ return false;
+}
+
+
+bool Type_handler_time_common::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_time();
+ return false;
+}
+
+
+bool Type_handler_datetime_common::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_datetime();
+ return false;
+}
+
+
+bool Type_handler_timestamp_common::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_datetime();
return false;
}
@@ -8589,7 +8708,8 @@ static void literal_warn(THD *thd, const Item *item,
ErrConvString err(str, length, cs);
thd->push_warning_wrong_or_truncated_value(
Sql_condition::time_warn_level(st->warnings),
- false, typestr, err.ptr(), NULL, NullS);
+ false, typestr, err.ptr(),
+ nullptr, nullptr, nullptr);
}
}
else if (send_error)
@@ -8981,8 +9101,8 @@ bool Type_handler::partition_field_append_value(
uint cnverr2= 0;
buf2.copy(res->ptr(), res->length(), res->charset(), field_cs, &cnverr2);
if (!cnverr2)
- return str->append_introducer_and_hex(buf2.charset(), buf2.lex_cstring());
- return str->append_introducer_and_hex(res->charset(), res->lex_cstring());
+ return str->append_introducer_and_hex(&buf2);
+ return str->append_introducer_and_hex(res);
}
StringBuffer<64> val(system_charset_info);
diff --git a/sql/sql_type.h b/sql/sql_type.h
index 0850d08c5ae..ed0aaaea400 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -807,34 +807,39 @@ public:
public:
void push_conversion_warnings(THD *thd, bool totally_useless_value,
date_mode_t mode, timestamp_type tstype,
- const TABLE_SHARE* s, const char *name)
+ const char *db_name, const char *table_name,
+ const char *name)
{
const char *typestr= tstype >= 0 ? type_name_by_timestamp_type(tstype) :
mode & (TIME_INTERVAL_hhmmssff | TIME_INTERVAL_DAY) ?
"interval" :
mode & TIME_TIME_ONLY ? "time" : "datetime";
Temporal::push_conversion_warnings(thd, totally_useless_value, warnings,
- typestr, s, name, ptr());
+ typestr, db_name, table_name, name,
+ ptr());
}
};
class Warn_push: public Warn
{
- THD *m_thd;
- const TABLE_SHARE *m_s;
- const char *m_name;
- const MYSQL_TIME *m_ltime;
- date_mode_t m_mode;
+ THD * const m_thd;
+ const char * const m_db_name;
+ const char * const m_table_name;
+ const char * const m_name;
+ const MYSQL_TIME * const m_ltime;
+ const date_mode_t m_mode;
public:
- Warn_push(THD *thd, const TABLE_SHARE *s, const char *name,
- const MYSQL_TIME *ltime, date_mode_t mode)
- :m_thd(thd), m_s(s), m_name(name), m_ltime(ltime), m_mode(mode)
+ Warn_push(THD *thd, const char *db_name, const char *table_name,
+ const char *name, const MYSQL_TIME *ltime, date_mode_t mode)
+ : m_thd(thd), m_db_name(db_name), m_table_name(table_name), m_name(name),
+ m_ltime(ltime), m_mode(mode)
{ }
~Warn_push()
{
if (warnings)
push_conversion_warnings(m_thd, m_ltime->time_type < 0,
- m_mode, m_ltime->time_type, m_s, m_name);
+ m_mode, m_ltime->time_type,
+ m_db_name, m_table_name, m_name);
}
};
@@ -875,7 +880,8 @@ public:
}
static void push_conversion_warnings(THD *thd, bool totally_useless_value, int warn,
const char *type_name,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *field_name,
const char *value);
/*
@@ -1503,6 +1509,14 @@ public:
{ }
};
+ class Options_for_round: public Options
+ {
+ public:
+ Options_for_round(time_round_mode_t round_mode= TIME_FRAC_TRUNCATE)
+ :Options(Time::default_flags_for_get_date(), round_mode,
+ Time::DATETIME_TO_TIME_DISALLOW)
+ { }
+ };
class Options_cmp: public Options
{
public:
@@ -1854,6 +1868,40 @@ public:
DBUG_ASSERT(is_valid_value_slow());
return *this;
}
+ Time &ceiling(int *warn)
+ {
+ if (is_valid_time())
+ {
+ if (neg)
+ my_time_trunc(this, 0);
+ else if (second_part)
+ round_or_set_max(0, warn, 999999999);
+ }
+ DBUG_ASSERT(is_valid_value_slow());
+ return *this;
+ }
+ Time &ceiling()
+ {
+ int warn= 0;
+ return ceiling(&warn);
+ }
+ Time &floor(int *warn)
+ {
+ if (is_valid_time())
+ {
+ if (!neg)
+ my_time_trunc(this, 0);
+ else if (second_part)
+ round_or_set_max(0, warn, 999999999);
+ }
+ DBUG_ASSERT(is_valid_value_slow());
+ return *this;
+ }
+ Time &floor()
+ {
+ int warn= 0;
+ return floor(&warn);
+ }
Time &round(uint dec, int *warn)
{
if (is_valid_time())
@@ -2421,10 +2469,22 @@ public:
Datetime &trunc(uint dec)
{
if (is_valid_datetime())
- my_time_trunc(this, dec);
+ my_datetime_trunc(this, dec);
+ DBUG_ASSERT(is_valid_value_slow());
+ return *this;
+ }
+ Datetime &ceiling(THD *thd, int *warn)
+ {
+ if (is_valid_datetime() && second_part)
+ round_or_invalidate(thd, 0, warn, 999999999);
DBUG_ASSERT(is_valid_value_slow());
return *this;
}
+ Datetime &ceiling(THD *thd)
+ {
+ int warn= 0;
+ return ceiling(thd, &warn);
+ }
Datetime &round(THD *thd, uint dec, int *warn)
{
if (is_valid_datetime())
@@ -2712,6 +2772,19 @@ public:
#define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII
+static inline my_repertoire_t operator|(const my_repertoire_t a,
+ const my_repertoire_t b)
+{
+ return (my_repertoire_t) ((uint) a | (uint) b);
+}
+
+static inline my_repertoire_t &operator|=(my_repertoire_t &a,
+ const my_repertoire_t b)
+{
+ return a= (my_repertoire_t) ((uint) a | (uint) b);
+}
+
+
enum Derivation
{
DERIVATION_IGNORABLE= 6,
@@ -2733,7 +2806,7 @@ class DTCollation {
public:
CHARSET_INFO *collation;
enum Derivation derivation;
- uint repertoire;
+ my_repertoire_t repertoire;
void set_repertoire_from_charset(CHARSET_INFO *cs)
{
@@ -2769,7 +2842,7 @@ public:
}
DTCollation(CHARSET_INFO *collation_arg,
Derivation derivation_arg,
- uint repertoire_arg)
+ my_repertoire_t repertoire_arg)
:collation(collation_arg),
derivation(derivation_arg),
repertoire(repertoire_arg)
@@ -2786,7 +2859,7 @@ public:
}
void set(CHARSET_INFO *collation_arg,
Derivation derivation_arg,
- uint repertoire_arg)
+ my_repertoire_t repertoire_arg)
{
collation= collation_arg;
derivation= derivation_arg;
@@ -5089,8 +5162,6 @@ public:
bool Item_func_between_fix_length_and_dec(Item_func_between *)const override;
bool Item_func_in_fix_comparator_compatible_types(THD *, Item_func_in *)
const override;
- bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
- bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *)const override;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
@@ -5616,6 +5687,8 @@ public:
const Column_definition_attributes *attr,
uint32 flags) const override;
Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *)const override;
void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
MYSQL_TIME *ltime, date_mode_t fuzzydate) const override;
void Item_func_hybrid_field_type_get_date(THD *,
@@ -5640,7 +5713,7 @@ public:
}
uint32 max_display_length(const Item *item) const override;
uint32 Item_decimal_notation_int_digits(const Item *item) const override;
- static uint32 Bit_decimal_notation_int_digits(const Item *item);
+ static uint32 Bit_decimal_notation_int_digits_by_nbits(uint nbits);
uint32 max_display_length_for_field(const Conv_source &src) const override;
uint32 calc_pack_length(uint32 length) const override { return length / 8; }
uint calc_key_length(const Column_definition &def) const override;
@@ -5657,6 +5730,8 @@ public:
}
void show_binlog_type(const Conv_source &src, const Field &, String *str)
const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
Field *make_conversion_table_field(MEM_ROOT *root,
TABLE *table, uint metadata,
const Field *target) const override;
@@ -5899,6 +5974,7 @@ public:
const override;
longlong Item_func_between_val_int(Item_func_between *func) const override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp)
const override;
bool set_comparator_func(Arg_comparator *cmp) const override;
@@ -6060,6 +6136,8 @@ public:
longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
my_decimal *) const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
bool Item_hybrid_func_fix_attributes(THD *thd,
const char *name,
Type_handler_hybrid_field_type *,
@@ -6195,6 +6273,7 @@ public:
String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
double Item_func_min_max_val_real(Item_func_min_max *) const override;
longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *, my_decimal *)
const override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
@@ -6324,6 +6403,7 @@ public:
int cmp_native(const Native &a, const Native &b) const override;
longlong Item_func_between_val_int(Item_func_between *func) const override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs)
const override;
@@ -6749,6 +6829,8 @@ class Type_handler_hex_hybrid: public Type_handler_varchar
public:
virtual ~Type_handler_hex_hybrid() {}
const Type_handler *cast_to_int_type_handler() const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
};
@@ -6967,6 +7049,8 @@ public:
enum_field_types field_type() const override { return MYSQL_TYPE_STRING; }
const Type_handler *type_handler_for_item_field() const override;
const Type_handler *cast_to_int_type_handler() const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
uint32 max_display_length_for_field(const Conv_source &src) const override;
bool Item_hybrid_func_fix_attributes(THD *thd,
const char *name,
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index 68a783341f3..af6a73006a8 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -3167,6 +3167,14 @@ Window_funcs_computation::save_explain_plan(MEM_ROOT *mem_root,
return xpl;
}
+
+bool st_select_lex::add_window_func(Item_window_func *win_func)
+{
+ if (parsing_place != SELECT_LIST)
+ fields_in_window_functions+= win_func->window_func()->argument_count();
+ return window_funcs.push_back(win_func);
+}
+
/////////////////////////////////////////////////////////////////////////////
// Unneeded comments (will be removed when we develop a replacement for
// the feature that was attempted here
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index d8ad3aef7c3..b42d68c26e1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -14698,13 +14698,15 @@ literal:
| UNDERSCORE_CHARSET hex_or_bin_String
{
Item_string_with_introducer *item_str;
+ LEX_CSTRING tmp;
+ $2->get_value(&tmp);
/*
Pass NULL as name. Name will be set in the "select_item" rule and
will include the introducer and the original hex/bin notation.
*/
item_str= new (thd->mem_root)
Item_string_with_introducer(thd, null_clex_str,
- $2->lex_cstring(), $1);
+ tmp, $1);
if (unlikely(!item_str ||
!item_str->check_well_formed_result(true)))
MYSQL_YYABORT;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 1badca024fd..4bda42b2ffa 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates.
- Copyright (c) 2012, 2018, MariaDB Corporation.
+ Copyright (c) 2012, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2728,12 +2728,23 @@ static bool fix_optimizer_switch(sys_var *self, THD *thd,
"engine_condition_pushdown=on"); // since 10.1.1
return false;
}
+static bool check_legal_optimizer_switch(sys_var *self, THD *thd,
+ set_var *var)
+{
+ if (var->save_result.ulonglong_value & (OPTIMIZER_SWITCH_MATERIALIZATION |
+ OPTIMIZER_SWITCH_IN_TO_EXISTS))
+ {
+ return false;
+ }
+ my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0));
+ return true;
+}
static Sys_var_flagset Sys_optimizer_switch(
"optimizer_switch",
"Fine-tune the optimizer behavior",
SESSION_VAR(optimizer_switch), CMD_LINE(REQUIRED_ARG),
optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT),
- NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_legal_optimizer_switch),
ON_UPDATE(fix_optimizer_switch));
static Sys_var_flagset Sys_optimizer_trace(
@@ -3852,6 +3863,12 @@ static bool fix_tp_min_threads(sys_var *, THD *, enum_var_type)
static bool check_threadpool_size(sys_var *self, THD *thd, set_var *var)
{
+
+#ifdef _WIN32
+ if (threadpool_mode != TP_MODE_GENERIC)
+ return false;
+#endif
+
ulonglong v= var->save_result.ulonglong_value;
if (v > threadpool_max_size)
{
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index ed2aaf49b9f..ba56a7b4bfb 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -534,7 +534,10 @@ public:
String str2(buff2, sizeof(buff2), charset), *res;
if (!(res=var->value->val_str(&str)))
+ {
var->save_result.string_value.str= 0;
+ var->save_result.string_value.length= 0; // safety
+ }
else
{
uint32 unused;
@@ -939,9 +942,16 @@ public:
String str(buff, sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
+ {
var->save_result.string_value.str= const_cast<char*>("");
+ var->save_result.string_value.length= 0;
+ }
else
- var->save_result.string_value.str= thd->strmake(res->ptr(), res->length());
+ {
+ size_t len= res->length();
+ var->save_result.string_value.str= thd->strmake(res->ptr(), len);
+ var->save_result.string_value.length= len;
+ }
return false;
}
bool session_update(THD *thd, set_var *var)
@@ -965,6 +975,7 @@ public:
{
char *ptr= (char*)(intptr)option.def_value;
var->save_result.string_value.str= ptr;
+ var->save_result.string_value.length= safe_strlen(ptr);
}
uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base)
{
diff --git a/sql/table.cc b/sql/table.cc
index 32d0ee6f538..e4ed862f41b 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -50,6 +50,17 @@
#define MYSQL57_GENERATED_FIELD 128
#define MYSQL57_GCOL_HEADER_SIZE 4
+class Table_arena: public Query_arena
+{
+public:
+ Table_arena(MEM_ROOT *mem_root, enum enum_state state_arg) :
+ Query_arena(mem_root, state_arg){}
+ virtual Type type() const
+ {
+ return TABLE_ARENA;
+ }
+};
+
struct extra2_fields
{
LEX_CUSTRING version;
@@ -1145,8 +1156,9 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
We need to use CONVENTIONAL_EXECUTION here to ensure that
any new items created by fix_fields() are not reverted.
*/
- table->expr_arena= new (alloc_root(mem_root, sizeof(Query_arena)))
- Query_arena(mem_root, Query_arena::STMT_CONVENTIONAL_EXECUTION);
+ table->expr_arena= new (alloc_root(mem_root, sizeof(Table_arena)))
+ Table_arena(mem_root,
+ Query_arena::STMT_CONVENTIONAL_EXECUTION);
if (!table->expr_arena)
DBUG_RETURN(1);
@@ -8809,29 +8821,24 @@ void TABLE::vers_update_fields()
bitmap_set_bit(write_set, vers_start_field()->field_index);
bitmap_set_bit(write_set, vers_end_field()->field_index);
- if (versioned(VERS_TIMESTAMP))
+ if (!vers_write)
{
- if (!vers_write)
- {
- file->column_bitmaps_signal();
- return;
- }
- if (vers_start_field()->store_timestamp(in_use->query_start(),
- in_use->query_start_sec_part()))
- DBUG_ASSERT(0);
+ file->column_bitmaps_signal();
+ return;
}
- else
+
+ if (versioned(VERS_TIMESTAMP) &&
+ vers_start_field()->store_timestamp(in_use->query_start(),
+ in_use->query_start_sec_part()))
{
- if (!vers_write)
- {
- file->column_bitmaps_signal();
- return;
- }
+ DBUG_ASSERT(0);
}
vers_end_field()->set_max();
bitmap_set_bit(read_set, vers_end_field()->field_index);
file->column_bitmaps_signal();
+ if (vfield)
+ update_virtual_fields(file, VCOL_UPDATE_FOR_READ);
}
diff --git a/sql/table.h b/sql/table.h
index 4db27270509..efac9558450 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1667,6 +1667,7 @@ public:
TABLE *tmp_table,
TMP_TABLE_PARAM *tmp_table_param,
bool with_cleanup);
+ int fix_vcol_exprs(THD *thd);
Field *find_field_by_name(LEX_CSTRING *str) const;
bool export_structure(THD *thd, class Row_definition_list *defs);
bool is_splittable() { return spl_opt_info != NULL; }
@@ -2236,6 +2237,7 @@ struct TABLE_LIST
parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
*/
TABLE_LIST *natural_join;
+ bool part_of_natural_join;
/*
True if 'this' represents a nested join that is a NATURAL JOIN.
For one of the operands of 'this', the member 'natural_join' points
diff --git a/sql/threadpool.h b/sql/threadpool.h
index 285b46e3b27..11132b3bf95 100644
--- a/sql/threadpool.h
+++ b/sql/threadpool.h
@@ -76,6 +76,7 @@ enum TP_STATE
{
TP_STATE_IDLE,
TP_STATE_RUNNING,
+ TP_STATE_PENDING
};
/*
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index c27f42b3d62..b26f41c6e9a 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -459,11 +459,25 @@ void tp_timeout_handler(TP_connection *c)
{
if (c->state != TP_STATE_IDLE)
return;
- THD *thd=c->thd;
+ THD *thd= c->thd;
mysql_mutex_lock(&thd->LOCK_thd_kill);
- thd->set_killed_no_mutex(KILL_WAIT_TIMEOUT);
- c->priority= TP_PRIORITY_HIGH;
- post_kill_notification(thd);
+ Vio *vio= thd->net.vio;
+ if (vio && (vio_pending(vio) > 0 || vio->has_data(vio)) &&
+ c->state == TP_STATE_IDLE)
+ {
+ /*
+ There is some data on that connection, i.e
+ i.e there was no inactivity timeout.
+ Don't kill.
+ */
+ c->state= TP_STATE_PENDING;
+ }
+ else if (c->state == TP_STATE_IDLE)
+ {
+ thd->set_killed_no_mutex(KILL_WAIT_TIMEOUT);
+ c->priority= TP_PRIORITY_HIGH;
+ post_kill_notification(thd);
+ }
mysql_mutex_unlock(&thd->LOCK_thd_kill);
}
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index 2a5587fa04a..7895431bc13 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 Monty Program Ab
+/* Copyright (C) 2012, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -505,11 +505,21 @@ static my_bool timeout_check(THD *thd, pool_timer_t *timer)
DBUG_ENTER("timeout_check");
if (thd->net.reading_or_writing == 1)
{
- /*
- Check if connection does not have scheduler data. This happens for example
- if THD belongs to a different scheduler, that is listening to extra_port.
- */
- if (auto connection= (TP_connection_generic *) thd->event_scheduler.data)
+ TP_connection_generic *connection= (TP_connection_generic *)thd->event_scheduler.data;
+ if (!connection || connection->state != TP_STATE_IDLE)
+ {
+ /*
+ Connection does not have scheduler data. This happens for example
+ if THD belongs to a different scheduler, that is listening to extra_port.
+ */
+ DBUG_RETURN(0);
+ }
+
+ if(connection->abs_wait_timeout < timer->current_microtime)
+ {
+ tp_timeout_handler(connection);
+ }
+ else
{
if (connection->abs_wait_timeout < timer->current_microtime)
tp_timeout_handler(connection);
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 525e7a8a56a..ae860f0143b 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -86,6 +86,13 @@ static uchar* extra2_write_str(uchar *pos, const LEX_CSTRING &str)
return pos + str.length;
}
+static uchar* extra2_write_str(uchar *pos, Binary_string *str)
+{
+ pos= extra2_write_len(pos, str->length());
+ memcpy(pos, str->ptr(), str->length());
+ return pos + str->length();
+}
+
static uchar *extra2_write(uchar *pos, enum extra2_frm_value_type type,
const LEX_CSTRING &str)
{
@@ -178,11 +185,11 @@ class Field_data_type_info_image: public BinaryStringBuffer<512>
{
return net_store_length(pos, length);
}
- static uchar *store_string(uchar *pos, const LEX_CSTRING &str)
+ static uchar *store_string(uchar *pos, Binary_string *str)
{
- pos= store_length(pos, str.length);
- memcpy(pos, str.str, str.length);
- return pos + str.length;
+ pos= store_length(pos, str->length());
+ memcpy(pos, str->ptr(), str->length());
+ return pos + str->length();
}
static uint store_length_required_length(ulonglong length)
{
@@ -206,7 +213,7 @@ public:
return true; // Error
uchar *pos= (uchar *) end();
pos= store_length(pos, fieldnr);
- pos= store_string(pos, type_info.lex_cstring());
+ pos= store_string(pos, &type_info);
size_t new_length= (const char *) pos - ptr();
DBUG_ASSERT(new_length < alloced_length());
length((uint32) new_length);
@@ -471,7 +478,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING &table,
goto err;
}
*pos= EXTRA2_FIELD_DATA_TYPE_INFO;
- pos= extra2_write_str(pos + 1, field_data_type_info_image.lex_cstring());
+ pos= extra2_write_str(pos + 1, &field_data_type_info_image);
}
// PERIOD
diff --git a/sql/winservice.c b/sql/winservice.c
index 44e9302e3d3..a11087e5cd5 100644
--- a/sql/winservice.c
+++ b/sql/winservice.c
@@ -116,6 +116,24 @@ BOOL exclude_service(mysqld_service_properties *props)
}
+static void get_datadir_from_ini(const char *ini, char *service_name, char *datadir, size_t sz)
+{
+ *datadir= 0;
+ const char *sections[]= {service_name, "mysqld", "server", "mariadb",
+ "mariadbd"};
+ for (int i= 0; i < sizeof(sections) / sizeof(sections[0]); i++)
+ {
+ if (sections[i])
+ {
+ GetPrivateProfileStringA(sections[i], "datadir", NULL, datadir,
+ (DWORD) sz, ini);
+ if (*datadir)
+ return;
+ }
+ }
+}
+
+
/*
Retrieve some properties from windows mysqld service binary path.
We're interested in ini file location and datadir, and also in version of
@@ -135,6 +153,7 @@ int get_mysql_service_properties(const wchar_t *bin_path,
wchar_t **args= NULL;
int retval= 1;
BOOL have_inifile;
+ char service_name[MAX_PATH];
props->datadir[0]= 0;
props->inifile[0]= 0;
@@ -163,6 +182,9 @@ int get_mysql_service_properties(const wchar_t *bin_path,
goto end;
}
+ /* Last parameter is the service name*/
+ wcstombs(service_name, args[numargs-1], MAX_PATH);
+
if(have_inifile && wcsncmp(args[1], L"--defaults-file=", 16) != 0)
goto end;
@@ -195,8 +217,8 @@ int get_mysql_service_properties(const wchar_t *bin_path,
normalize_path(props->inifile, MAX_PATH);
if (GetFileAttributes(props->inifile) != INVALID_FILE_ATTRIBUTES)
{
- GetPrivateProfileString("mysqld", "datadir", NULL, props->datadir, MAX_PATH,
- props->inifile);
+ get_datadir_from_ini(props->inifile, service_name, props->datadir,
+ sizeof(props->datadir));
}
else
{
@@ -245,8 +267,8 @@ int get_mysql_service_properties(const wchar_t *bin_path,
if (GetFileAttributes(props->inifile) != INVALID_FILE_ATTRIBUTES)
{
/* Ini file found, get datadir from there */
- GetPrivateProfileString("mysqld", "datadir", NULL, props->datadir,
- MAX_PATH, props->inifile);
+ get_datadir_from_ini(props->inifile, service_name, props->datadir,
+ sizeof(props->datadir));
}
else
{
diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc
index 6405a5d2cb7..139cd5cd7ae 100644
--- a/sql/wsrep_dummy.cc
+++ b/sql/wsrep_dummy.cc
@@ -149,4 +149,6 @@ my_bool wsrep_thd_has_ignored_error(const THD*)
void wsrep_thd_set_ignored_error(THD*, my_bool)
{ }
ulong wsrep_OSU_method_get(const THD*)
+{ return 0;}
+bool wsrep_thd_set_wsrep_aborter(THD*, THD*)
{ return 0;} \ No newline at end of file
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index de0aab4b81a..8f52938f9ed 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -292,6 +292,8 @@ int Wsrep_high_priority_service::append_fragment_and_commit(
ret= ret || (m_thd->wsrep_cs().after_applying(), 0);
m_thd->mdl_context.release_transactional_locks();
+ free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));
+
thd_proc_info(m_thd, "wsrep applier committed");
DBUG_RETURN(ret);
@@ -350,6 +352,8 @@ int Wsrep_high_priority_service::commit(const wsrep::ws_handle& ws_handle,
thd->lex->sql_command= SQLCOM_END;
+ free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC));
+
must_exit_= check_exit_status();
DBUG_RETURN(ret);
}
@@ -370,6 +374,9 @@ int Wsrep_high_priority_service::rollback(const wsrep::ws_handle& ws_handle,
int ret= (trans_rollback_stmt(m_thd) || trans_rollback(m_thd));
m_thd->mdl_context.release_transactional_locks();
m_thd->mdl_context.release_explicit_locks();
+
+ free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));
+
DBUG_RETURN(ret);
}
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 0c31631d19b..9a2d5e635a5 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1968,7 +1968,7 @@ static int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len)
if (sp->m_handler->type() == SP_TYPE_FUNCTION)
{
sp_returns_type(thd, retstr, sp);
- returns= retstr.lex_cstring();
+ retstr.get_value(&returns);
}
if (sp->m_handler->
show_create_sp(thd, &log_query,
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index 08c90e488bd..643f0072ebf 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -492,12 +492,11 @@ static int scan(TABLE* table, uint field, INTTYPE& val)
static int scan(TABLE* table, uint field, char* strbuf, uint strbuf_len)
{
- String str;
- (void)table->field[field]->val_str(&str);
- LEX_CSTRING tmp= str.lex_cstring();
- uint len = tmp.length;
- strncpy(strbuf, tmp.str, std::min(len, strbuf_len));
- strbuf[strbuf_len - 1]= '\0';
+ uint len;
+ StringBuffer<STRING_BUFFER_USUAL_SIZE> str;
+ (void) table->field[field]->val_str(&str);
+ len= str.length();
+ strmake(strbuf, str.ptr(), MY_MIN(len, strbuf_len-1));
return 0;
}
diff --git a/sql/xa.cc b/sql/xa.cc
index 68e6e67fa0b..e8e6dc43c56 100644
--- a/sql/xa.cc
+++ b/sql/xa.cc
@@ -689,7 +689,8 @@ bool trans_xa_commit(THD *thd)
{
DEBUG_SYNC(thd, "trans_xa_commit_after_acquire_commit_lock");
- if ((res= MY_TEST(ha_commit_one_phase(thd, 1))))
+ res= MY_TEST(ha_commit_one_phase(thd, 1, 1));
+ if (res)
my_error(ER_XAER_RMERR, MYF(0));
else
{
@@ -842,6 +843,7 @@ bool trans_xa_detach(THD *thd)
thd->transaction->all.ha_list= 0;
thd->transaction->all.no_2pc= 0;
+ thd->m_transaction_psi= 0;
return false;
}
diff --git a/storage/columnstore/CMakeLists.txt b/storage/columnstore/CMakeLists.txt
index 34a4255b2c5..f71cce38bd8 100644
--- a/storage/columnstore/CMakeLists.txt
+++ b/storage/columnstore/CMakeLists.txt
@@ -22,7 +22,7 @@ CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
# Needed to bump the component changes up to the main scope
APPEND_FOR_CPACK(CPACK_COMPONENTS_ALL)
IF (RPM)
- APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES " binutils net-tools python3")
+ APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES " binutils jemalloc net-tools python3")
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_USER_FILELIST ";%ignore /var/lib;%ignore /var")
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_CONFLICTS " thrift MariaDB-columnstore-platform MariaDB-columnstore-libs")
# these three don't have the list semantics, so no append here
diff --git a/storage/columnstore/columnstore b/storage/columnstore/columnstore
-Subproject d9a8f5fd3cad63d736ca9c900ce3e9d76c4c094
+Subproject bca0d90d5537050951a6c2282411d955569a8c5
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index b6ea78115e9..0547674a4dd 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -235,7 +235,6 @@ SET(INNOBASE_SOURCES
include/row0upd.h
include/row0upd.ic
include/row0vers.h
- include/srv0conc.h
include/srv0mon.h
include/srv0mon.ic
include/srv0srv.h
@@ -328,7 +327,6 @@ SET(INNOBASE_SOURCES
row/row0upd.cc
row/row0quiesce.cc
row/row0vers.cc
- srv/srv0conc.cc
srv/srv0mon.cc
srv/srv0srv.cc
srv/srv0start.cc
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 43a3b44903f..126f873569f 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -930,8 +930,10 @@ void btr_page_get_father(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
mem_heap_free(heap);
}
+#ifdef UNIV_DEBUG
/** PAGE_INDEX_ID value for freed index B-trees */
constexpr index_id_t BTR_FREED_INDEX_ID = 0;
+#endif
/** Free a B-tree root page. btr_free_but_not_root() must already
have been called.
@@ -1342,7 +1344,7 @@ btr_write_autoinc(dict_index_t* index, ib_uint64_t autoinc, bool reset)
static void btr_page_reorganize_low(page_cur_t *cursor, dict_index_t *index,
mtr_t *mtr)
{
- const mtr_log_t log_mode= mtr->set_log_mode(MTR_LOG_NONE);
+ const mtr_log_t log_mode= mtr->set_log_mode(MTR_LOG_NO_REDO);
buf_block_t *const block= cursor->block;
@@ -4920,8 +4922,13 @@ loop:
mtr_release_block_at_savepoint(
&mtr, savepoint, right_block);
- btr_block_get(*index, parent_right_page_no,
- RW_SX_LATCH, false, &mtr);
+ if (parent_right_page_no != FIL_NULL) {
+ btr_block_get(*index,
+ parent_right_page_no,
+ RW_SX_LATCH, false,
+ &mtr);
+ }
+
right_block = btr_block_get(*index,
right_page_no,
RW_SX_LATCH,
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 15f0335e819..a44b96add2c 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -29,6 +29,7 @@ Created 03/11/2014 Shaohua Wang
#include "btr0cur.h"
#include "btr0pcur.h"
#include "ibuf0ibuf.h"
+#include "page0page.h"
#include "trx0trx.h"
/** Innodb B-tree index fill factor for bulk load. */
@@ -123,7 +124,6 @@ PageBulk::init()
}
m_block = new_block;
- m_block->skip_flush_check = true;
m_page = new_page;
m_page_no = new_page_no;
m_cur_rec = page_get_infimum_rec(new_page);
@@ -142,7 +142,11 @@ PageBulk::init()
srv_page_size - dict_index_zip_pad_optimal_page_size(m_index);
m_heap_top = page_header_get_ptr(new_page, PAGE_HEAP_TOP);
m_rec_no = page_header_get_field(new_page, PAGE_N_RECS);
-
+ /* Temporarily reset PAGE_DIRECTION_B from PAGE_NO_DIRECTION to 0,
+ without writing redo log, to ensure that needs_finish() will hold
+ on an empty page. */
+ ut_ad(m_page[PAGE_HEADER + PAGE_DIRECTION_B] == PAGE_NO_DIRECTION);
+ m_page[PAGE_HEADER + PAGE_DIRECTION_B] = 0;
ut_d(m_total_data = 0);
return(DB_SUCCESS);
@@ -358,7 +362,6 @@ and set page header members.
template<PageBulk::format fmt>
inline void PageBulk::finishPage()
{
- ut_ad(m_rec_no > 0);
ut_ad((m_page_zip != nullptr) == (fmt == COMPRESSED));
ut_ad((fmt != REDUNDANT) == m_is_comp);
@@ -374,7 +377,7 @@ inline void PageBulk::finishPage()
ut_ad(offset >= PAGE_NEW_SUPREMUM - PAGE_NEW_INFIMUM);
offset= static_cast<uint16_t>(offset + PAGE_NEW_INFIMUM);
/* Set owner & dir. */
- do
+ while (offset != PAGE_NEW_SUPREMUM)
{
ut_ad(offset >= PAGE_NEW_SUPREMUM);
ut_ad(offset < page_offset(slot));
@@ -401,7 +404,6 @@ inline void PageBulk::finishPage()
ut_ad(next);
offset= next;
}
- while (offset != PAGE_NEW_SUPREMUM);
if (slot0 != slot && (count + 1 + (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2 <=
PAGE_DIR_SLOT_MAX_N_OWNED))
@@ -431,7 +433,7 @@ inline void PageBulk::finishPage()
mach_read_from_2(PAGE_OLD_INFIMUM - REC_NEXT + m_page);
/* Set owner & dir. */
- do
+ while (insert_rec != m_page + PAGE_OLD_SUPREMUM)
{
count++;
n_recs++;
@@ -446,7 +448,6 @@ inline void PageBulk::finishPage()
insert_rec= m_page + mach_read_from_2(insert_rec - REC_NEXT);
}
- while (insert_rec != m_page + PAGE_OLD_SUPREMUM);
if (slot0 != slot && (count + 1 + (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2 <=
PAGE_DIR_SLOT_MAX_N_OWNED))
@@ -465,9 +466,8 @@ inline void PageBulk::finishPage()
false, &m_mtr);
}
- ut_ad(!m_index->is_spatial());
-
- if (fmt != COMPRESSED)
+ if (!m_rec_no);
+ else if (fmt != COMPRESSED)
{
static_assert(PAGE_N_DIR_SLOTS == 0, "compatibility");
alignas(8) byte page_header[PAGE_N_HEAP + 2];
@@ -496,45 +496,75 @@ inline void PageBulk::finishPage()
}
}
+inline bool PageBulk::needs_finish() const
+{
+ ut_ad(page_align(m_cur_rec) == m_block->frame);
+ ut_ad(m_page == m_block->frame);
+ if (!m_page[PAGE_HEADER + PAGE_DIRECTION_B])
+ return true;
+ ulint heap_no, n_heap= page_header_get_field(m_page, PAGE_N_HEAP);
+ ut_ad((n_heap & 0x7fff) >= PAGE_HEAP_NO_USER_LOW);
+ if (n_heap & 0x8000)
+ {
+ n_heap&= 0x7fff;
+ heap_no= rec_get_heap_no_new(m_cur_rec);
+ if (heap_no == PAGE_HEAP_NO_INFIMUM &&
+ page_header_get_field(m_page, PAGE_HEAP_TOP) == PAGE_NEW_SUPREMUM_END)
+ return false;
+ }
+ else
+ {
+ heap_no= rec_get_heap_no_old(m_cur_rec);
+ if (heap_no == PAGE_HEAP_NO_INFIMUM &&
+ page_header_get_field(m_page, PAGE_HEAP_TOP) == PAGE_OLD_SUPREMUM_END)
+ return false;
+ }
+ return heap_no != n_heap - 1;
+}
+
/** Mark end of insertion to the page. Scan all records to set page dirs,
and set page header members.
@tparam compressed whether the page is in ROW_FORMAT=COMPRESSED */
inline void PageBulk::finish()
{
- if (UNIV_LIKELY_NULL(m_page_zip))
+ ut_ad(!m_index->is_spatial());
+
+ if (!needs_finish());
+ else if (UNIV_LIKELY_NULL(m_page_zip))
finishPage<COMPRESSED>();
else if (m_is_comp)
finishPage<DYNAMIC>();
else
finishPage<REDUNDANT>();
+ /* In MariaDB 10.2, 10.3, 10.4, we would initialize
+ PAGE_DIRECTION_B, PAGE_N_DIRECTION, PAGE_LAST_INSERT
+ in the same way as we would during normal INSERT operations.
+ Starting with MariaDB Server 10.5, bulk insert will not
+ touch those fields. */
+ ut_ad(!m_page[PAGE_HEADER + PAGE_INSTANT]);
+ /* Restore the temporary change of PageBulk::init() that was necessary to
+ ensure that PageBulk::needs_finish() holds on an empty page. */
+ m_page[PAGE_HEADER + PAGE_DIRECTION_B]= PAGE_NO_DIRECTION;
+
ut_ad(!page_header_get_field(m_page, PAGE_FREE));
ut_ad(!page_header_get_field(m_page, PAGE_GARBAGE));
ut_ad(!page_header_get_field(m_page, PAGE_LAST_INSERT));
- ut_ad(page_header_get_field(m_page, PAGE_INSTANT) == PAGE_NO_DIRECTION);
ut_ad(!page_header_get_field(m_page, PAGE_N_DIRECTION));
ut_ad(m_total_data + page_dir_calc_reserved_space(m_rec_no) <=
page_get_free_space_of_empty(m_is_comp));
- m_block->skip_flush_check= false;
+ ut_ad(!needs_finish());
+ ut_ad(page_validate(m_page, m_index));
}
/** Commit inserts done to the page
@param[in] success Flag whether all inserts succeed. */
-void
-PageBulk::commit(
- bool success)
+void PageBulk::commit(bool success)
{
- if (success) {
- ut_ad(page_validate(m_page, m_index));
-
- /* Set no free space left and no buffered changes in ibuf. */
- if (!dict_index_is_clust(m_index) && page_is_leaf(m_page)) {
- ibuf_set_bitmap_for_bulk_load(
- m_block, innobase_fill_factor == 100);
- }
- }
-
- m_mtr.commit();
+ finish();
+ if (success && !dict_index_is_clust(m_index) && page_is_leaf(m_page))
+ ibuf_set_bitmap_for_bulk_load(m_block, innobase_fill_factor == 100);
+ m_mtr.commit();
}
/** Compress a page of compressed table
@@ -775,7 +805,9 @@ PageBulk::storeExt(
const big_rec_t* big_rec,
rec_offs* offsets)
{
- /* Note: not all fileds are initialized in btr_pcur. */
+ finish();
+
+ /* Note: not all fields are initialized in btr_pcur. */
btr_pcur_t btr_pcur;
btr_pcur.pos_state = BTR_PCUR_IS_POSITIONED;
btr_pcur.latch_mode = BTR_MODIFY_LEAF;
@@ -804,7 +836,7 @@ Note: log_free_check requires holding no lock/latch in current thread. */
void
PageBulk::release()
{
- ut_ad(!dict_index_is_spatial(m_index));
+ finish();
/* We fix the block because we will re-pin it soon. */
buf_block_buf_fix_inc(m_block, __FILE__, __LINE__);
@@ -856,12 +888,11 @@ BtrBulk::pageSplit(
{
ut_ad(page_bulk->getPageZip() != NULL);
- /* 1. Check if we have only one user record on the page. */
if (page_bulk->getRecNo() <= 1) {
return(DB_TOO_BIG_RECORD);
}
- /* 2. create a new page. */
+ /* Initialize a new page */
PageBulk new_page_bulk(m_index, m_trx->id, FIL_NULL,
page_bulk->getLevel());
dberr_t err = new_page_bulk.init();
@@ -869,19 +900,18 @@ BtrBulk::pageSplit(
return(err);
}
- /* 3. copy the upper half to new page. */
+ /* Copy the upper half to the new page. */
rec_t* split_rec = page_bulk->getSplitRec();
new_page_bulk.copyIn(split_rec);
page_bulk->copyOut(split_rec);
- /* 4. commit the splitted page. */
+ /* Commit the pages after split. */
err = pageCommit(page_bulk, &new_page_bulk, true);
if (err != DB_SUCCESS) {
pageAbort(&new_page_bulk);
return(err);
}
- /* 5. commit the new page. */
err = pageCommit(&new_page_bulk, next_page_bulk, true);
if (err != DB_SUCCESS) {
pageAbort(&new_page_bulk);
@@ -1103,11 +1133,9 @@ BtrBulk::insert(
ut_ad(page_bulk->getLevel() == 0);
ut_ad(page_bulk == m_page_bulks.at(0));
- /* Release all latched but leaf node. */
+ /* Release all pages above the leaf level */
for (ulint level = 1; level <= m_root_level; level++) {
- PageBulk* page_bulk = m_page_bulks.at(level);
-
- page_bulk->release();
+ m_page_bulks.at(level)->release();
}
err = page_bulk->storeExt(big_rec, offsets);
@@ -1190,6 +1218,7 @@ BtrBulk::finish(dberr_t err)
return(err);
}
root_page_bulk.copyIn(first_rec);
+ root_page_bulk.finish();
/* Remove last page. */
btr_page_free(m_index, last_block, &mtr);
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 550e3f36c6c..daa1901181e 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -772,6 +772,7 @@ btr_cur_optimistic_latch_leaves(
{
rw_lock_type_t mode;
ulint left_page_no;
+ ulint curr_page_no;
switch (*latch_mode) {
case BTR_SEARCH_LEAF:
@@ -795,13 +796,33 @@ btr_cur_optimistic_latch_leaves(
goto unpin_failed;
}
+ curr_page_no = block->page.id().page_no();
left_page_no = btr_page_get_prev(block->frame);
rw_lock_s_unlock(&block->lock);
- cursor->left_block = left_page_no != FIL_NULL
- ? btr_block_get(*cursor->index, left_page_no, mode,
- page_is_leaf(block->frame), mtr)
- : NULL;
+ if (left_page_no != FIL_NULL) {
+ dberr_t err = DB_SUCCESS;
+ cursor->left_block = buf_page_get_gen(
+ page_id_t(cursor->index->table->space_id,
+ left_page_no),
+ cursor->index->table->space->zip_size(),
+ mode, nullptr, BUF_GET_POSSIBLY_FREED,
+ __FILE__, __LINE__, mtr, &err);
+
+ if (err == DB_DECRYPTION_FAILED) {
+ cursor->index->table->file_unreadable = true;
+ }
+
+ if (btr_page_get_next(cursor->left_block->frame)
+ != curr_page_no) {
+ /* release the left block */
+ btr_leaf_page_release(
+ cursor->left_block, mode, mtr);
+ goto unpin_failed;
+ }
+ } else {
+ cursor->left_block = NULL;
+ }
if (buf_page_optimistic_get(mode, block, modify_clock,
file, line, mtr)) {
@@ -5074,6 +5095,11 @@ btr_cur_pessimistic_update(
btr_page_reorganize(page_cursor, index, mtr);
rec = page_cursor->rec;
rec_offs_make_valid(rec, index, true, *offsets);
+ if (page_cursor->block->page.id().page_no()
+ == index->page) {
+ btr_set_instant(page_cursor->block, *index,
+ mtr);
+ }
} else if (!dict_table_is_locking_disabled(index->table)) {
lock_rec_restore_from_page_infimum(
btr_cur_get_block(cursor), rec, block);
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 92cb38d0a85..3b28724c948 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -39,7 +39,6 @@ Created 2/17/1996 Heikki Tuuri
#include "btr0cur.h"
#include "btr0pcur.h"
#include "btr0btr.h"
-#include "ha0ha.h"
#include "srv0mon.h"
/** Is search system enabled.
@@ -1291,26 +1290,6 @@ retry:
ut_ad(block->page.id().space() == index->table->space_id);
ut_a(index_id == index->id);
ut_ad(!dict_index_is_ibuf(index));
-#ifdef UNIV_DEBUG
- switch (dict_index_get_online_status(index)) {
- case ONLINE_INDEX_CREATION:
- /* The index is being created (bulk loaded). */
- case ONLINE_INDEX_COMPLETE:
- /* The index has been published. */
- case ONLINE_INDEX_ABORTED:
- /* Either the index creation was aborted due to an
- error observed by InnoDB (in which case there should
- not be any adaptive hash index entries), or it was
- completed and then flagged aborted in
- rollback_inplace_alter_table(). */
- break;
- case ONLINE_INDEX_ABORTED_DROPPED:
- /* The index should have been dropped from the tablespace
- already, and the adaptive hash index entries should have
- been dropped as well. */
- ut_error;
- }
-#endif /* UNIV_DEBUG */
n_fields = block->curr_n_fields;
n_bytes = block->curr_n_bytes;
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 4deb34efc74..6a8c4869659 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1306,8 +1306,6 @@ buf_block_init(buf_block_t* block, byte* frame)
#ifdef BTR_CUR_HASH_ADAPT
block->index = NULL;
#endif /* BTR_CUR_HASH_ADAPT */
- block->skip_flush_check = false;
-
ut_d(block->in_unzip_LRU_list = false);
ut_d(block->in_withdraw_list = false);
@@ -1356,7 +1354,7 @@ inline bool buf_pool_t::chunk_t::create(size_t bytes)
if (UNIV_UNLIKELY(!mem))
return false;
- MEM_MAKE_ADDRESSABLE(mem, mem_size());
+ MEM_UNDEFINED(mem, mem_size());
#ifdef HAVE_LIBNUMA
if (srv_numa_interleave)
@@ -1488,8 +1486,10 @@ static void buf_block_free_mutexes(buf_block_t* block)
void buf_pool_t::page_hash_table::create(ulint n)
{
n_cells= ut_find_prime(n);
- array= static_cast<hash_cell_t*>
- (ut_zalloc_nokey(pad(n_cells) * sizeof *array));
+ const size_t size= pad(n_cells) * sizeof *array;
+ void* v= aligned_malloc(size, CPU_LEVEL1_DCACHE_LINESIZE);
+ memset(v, 0, size);
+ array= static_cast<hash_cell_t*>(v);
}
/** Create the buffer pool.
@@ -2257,7 +2257,18 @@ withdraw_retry:
ulint sum_freed = 0;
while (chunk < echunk) {
+ /* buf_LRU_block_free_non_file_page() invokes
+ MEM_NOACCESS() on any buf_pool.free blocks.
+ We must cancel the effect of that. In
+ MemorySanitizer, MEM_NOACCESS() is no-op, so
+ we must not do anything special for it here. */
+#ifdef HAVE_valgrind
+# if !__has_feature(memory_sanitizer)
+ MEM_MAKE_DEFINED(chunk->mem, chunk->mem_size());
+# endif
+#else
MEM_MAKE_ADDRESSABLE(chunk->mem, chunk->size);
+#endif
buf_block_t* block = chunk->blocks;
@@ -2645,14 +2656,9 @@ void buf_page_free(const page_id_t page_id,
buf_block_t *block= reinterpret_cast<buf_block_t*>
(buf_pool.page_hash_get_low(page_id, fold));
-#if 0 /* FIXME: MDEV-22970 Potential corruption */
- /* TODO: Find out how and when a freed page can be marked
- allocated in the same mini-transaction. At least it seems to
- happen during a pessimistic insert operation. */
/* TODO: try to all this part of mtr_t::free() */
if (srv_immediate_scrub_data_uncompressed || mtr->is_page_compressed())
mtr->add_freed_offset(page_id);
-#endif
if (!block || block->page.state() != BUF_BLOCK_FILE_PAGE)
{
@@ -2788,7 +2794,6 @@ buf_block_init_low(
/*===============*/
buf_block_t* block) /*!< in: block to init */
{
- block->skip_flush_check = false;
#ifdef BTR_CUR_HASH_ADAPT
/* No adaptive hash index entries may point to a previously
unused (and now freshly allocated) block. */
@@ -3831,15 +3836,25 @@ buf_page_create(fil_space_t *space, uint32_t offset,
if (block && block->page.in_file() &&
!buf_pool.watch_is_sentinel(block->page))
{
+#ifdef BTR_CUR_HASH_ADAPT
+ const bool drop_hash_entry= block->page.state() == BUF_BLOCK_FILE_PAGE &&
+ UNIV_LIKELY_NULL(block->index);
+ if (UNIV_UNLIKELY(drop_hash_entry))
+ block->page.set_io_fix(BUF_IO_PIN);
+#endif /* BTR_CUR_HASH_ADAPT */
+
/* Page can be found in buf_pool */
buf_LRU_block_free_non_file_page(free_block);
mutex_exit(&buf_pool.mutex);
#ifdef BTR_CUR_HASH_ADAPT
- if (block->page.state() == BUF_BLOCK_FILE_PAGE &&
- UNIV_LIKELY_NULL(block->index))
+ if (UNIV_UNLIKELY(drop_hash_entry))
+ {
btr_search_drop_page_hash_index(block);
+ block->page.io_unfix();
+ }
#endif /* BTR_CUR_HASH_ADAPT */
+
if (!recv_recovery_is_on())
/* FIXME: Remove the redundant lookup and avoid
the unnecessary invocation of buf_zip_decompress().
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 3f8fc7b75a8..516aeef1002 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -483,6 +483,8 @@ func_exit:
void
buf_dblwr_process()
{
+ ut_ad(recv_sys.parse_start_lsn);
+
ulint page_no_dblwr = 0;
byte* read_buf;
recv_dblwr_t& recv_dblwr = recv_sys.dblwr;
@@ -492,17 +494,43 @@ buf_dblwr_process()
}
read_buf = static_cast<byte*>(
- aligned_malloc(2 * srv_page_size, srv_page_size));
+ aligned_malloc(3 * srv_page_size, srv_page_size));
byte* const buf = read_buf + srv_page_size;
for (recv_dblwr_t::list::iterator i = recv_dblwr.pages.begin();
i != recv_dblwr.pages.end();
++i, ++page_no_dblwr) {
- byte* page = *i;
- ulint space_id = page_get_space_id(page);
- fil_space_t* space = fil_space_get(space_id);
+ byte* page = *i;
+ const ulint page_no = page_get_page_no(page);
+
+ if (!page_no) {
+ /* page 0 should have been recovered
+ already via Datafile::restore_from_doublewrite() */
+ continue;
+ }
+
+ const ulint space_id = page_get_space_id(page);
+ const lsn_t lsn = mach_read_from_8(page + FIL_PAGE_LSN);
+
+ if (recv_sys.parse_start_lsn > lsn) {
+ /* Pages written before the checkpoint are
+ not useful for recovery. */
+ continue;
+ }
- if (space == NULL) {
+ const page_id_t page_id(space_id, page_no);
+
+ if (recv_sys.scanned_lsn < lsn) {
+ ib::warn() << "Ignoring a doublewrite copy of page "
+ << page_id
+ << " with future log sequence number "
+ << lsn;
+ continue;
+ }
+
+ fil_space_t* space = fil_space_acquire_for_io(space_id);
+
+ if (!space) {
/* Maybe we have dropped the tablespace
and this page once belonged to it: do nothing */
continue;
@@ -510,19 +538,20 @@ buf_dblwr_process()
fil_space_open_if_needed(space);
- const ulint page_no = page_get_page_no(page);
- const page_id_t page_id(space_id, page_no);
-
- if (page_no >= space->size) {
+ if (UNIV_UNLIKELY(page_no >= space->size)) {
/* Do not report the warning for undo
tablespaces, because they can be truncated in place. */
if (!srv_is_undo_tablespace(space_id)) {
- ib::warn() << "A copy of page " << page_id
+ ib::warn() << "A copy of page " << page_no
<< " in the doublewrite buffer slot "
<< page_no_dblwr
- << " is not within space bounds";
+ << " is beyond the end of tablespace "
+ << space->name
+ << " (" << space->size << " pages)";
}
+next_page:
+ space->release_for_io();
continue;
}
@@ -555,92 +584,32 @@ buf_dblwr_process()
fio.node->space->release_for_io();
}
- const bool is_all_zero = buf_is_zeroes(
- span<const byte>(read_buf, physical_size));
- const bool expect_encrypted = space->crypt_data
- && space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED;
- bool is_corrupted = false;
-
- if (is_all_zero) {
+ if (buf_is_zeroes(span<const byte>(read_buf, physical_size))) {
/* We will check if the copy in the
doublewrite buffer is valid. If not, we will
ignore this page (there should be redo log
records to initialize it). */
+ } else if (recv_dblwr.validate_page(
+ page_id, read_buf, space, buf)) {
+ goto next_page;
} else {
- /* Decompress the page before
- validating the checksum. */
- ulint decomp = fil_page_decompress(buf, read_buf,
- space->flags);
- if (!decomp || (zip_size && decomp != srv_page_size)) {
- goto bad;
- }
-
- if (expect_encrypted
- && buf_page_get_key_version(read_buf, space->flags)) {
- is_corrupted = !buf_page_verify_crypt_checksum(
- read_buf, space->flags);
- } else {
- is_corrupted = buf_page_is_corrupted(
- true, read_buf, space->flags);
- }
-
- if (!is_corrupted) {
- /* The page is good; there is no need
- to consult the doublewrite buffer. */
- continue;
- }
-
-bad:
/* We intentionally skip this message for
- is_all_zero pages. */
+ all-zero pages. */
ib::info()
<< "Trying to recover page " << page_id
<< " from the doublewrite buffer.";
}
- ulint decomp = fil_page_decompress(buf, page, space->flags);
- if (!decomp || (zip_size && decomp != srv_page_size)) {
- continue;
- }
-
- if (expect_encrypted
- && buf_page_get_key_version(read_buf, space->flags)) {
- is_corrupted = !buf_page_verify_crypt_checksum(
- page, space->flags);
- } else {
- is_corrupted = buf_page_is_corrupted(
- true, page, space->flags);
- }
-
- if (is_corrupted) {
- /* Theoretically we could have another good
- copy for this page in the doublewrite
- buffer. If not, we will report a fatal error
- for a corrupted page somewhere else if that
- page was truly needed. */
- continue;
- }
+ page = recv_dblwr.find_page(page_id, space, buf);
- if (page_no == 0) {
- /* Check the FSP_SPACE_FLAGS. */
- ulint flags = fsp_header_get_flags(page);
- if (!fil_space_t::is_valid_flags(flags, space_id)
- && fsp_flags_convert_from_101(flags)
- == ULINT_UNDEFINED) {
- ib::warn() << "Ignoring a doublewrite copy"
- " of page " << page_id
- << " due to invalid flags "
- << ib::hex(flags);
- continue;
- }
- /* The flags on the page should be converted later. */
+ if (!page) {
+ goto next_page;
}
/* Write the good page from the doublewrite buffer to
the intended position. */
fio = fil_io(IORequestWrite, true, page_id, zip_size,
- 0, physical_size, const_cast<byte*>(page),
- nullptr);
+ 0, physical_size, page, nullptr);
if (fio.node) {
ut_ad(fio.err == DB_SUCCESS);
@@ -649,6 +618,8 @@ bad:
<< "' from the doublewrite buffer.";
fio.node->space->release_for_io();
}
+
+ goto next_page;
}
recv_dblwr.pages.clear();
@@ -784,10 +755,6 @@ buf_dblwr_check_block(
{
ut_ad(block->page.state() == BUF_BLOCK_FILE_PAGE);
- if (block->skip_flush_check) {
- return;
- }
-
switch (fil_page_get_type(block->frame)) {
case FIL_PAGE_INDEX:
case FIL_PAGE_TYPE_INSTANT:
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index af9302aa113..8f7e2b04782 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -1262,7 +1262,7 @@ static page_id_t buf_flush_check_neighbors(const fil_space_t &space,
page_id_t low= id - (id.page_no() % buf_flush_area);
page_id_t high= low + buf_flush_area;
high.set_page_no(std::min(high.page_no(),
- static_cast<uint32_t>(space.size - 1)));
+ static_cast<uint32_t>(space.committed_size - 1)));
/* Determine the contiguous dirty area around id. */
const ulint id_fold= id.fold();
@@ -1308,7 +1308,8 @@ innodb_immediate_scrub_data_uncompressed from the freed ranges.
static void buf_flush_freed_pages(fil_space_t *space)
{
ut_ad(space != NULL);
- if (!srv_immediate_scrub_data_uncompressed && !space->is_compressed())
+ const bool punch_hole= space->punch_hole;
+ if (!srv_immediate_scrub_data_uncompressed && !punch_hole)
return;
lsn_t flush_to_disk_lsn= log_sys.get_flushed_lsn();
@@ -1322,11 +1323,6 @@ static void buf_flush_freed_pages(fil_space_t *space)
range_set freed_ranges= std::move(space->freed_ranges);
freed_lock.unlock();
- const bool punch_hole=
-#if defined(HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE) || defined(_WIN32)
- space->is_compressed() ||
-#endif
- false;
for (const auto &range : freed_ranges)
{
@@ -2585,7 +2581,7 @@ static os_thread_ret_t DECLARE_THREAD(buf_flush_page_cleaner)(void*)
idle and there are no pending IOs in the buffer pool
and there is work to do. */
if (!n_flushed || !buf_pool.n_pend_reads
- || srv_check_activity(last_activity)) {
+ || srv_check_activity(&last_activity)) {
ret_sleep = pc_sleep_if_needed(
next_loop_time, sig_count, curr_time);
@@ -2675,7 +2671,7 @@ static os_thread_ret_t DECLARE_THREAD(buf_flush_page_cleaner)(void*)
n_flushed = n_flushed_lru + n_flushed_list;
- } else if (srv_check_activity(last_activity)) {
+ } else if (srv_check_activity(&last_activity)) {
ulint n_to_flush;
lsn_t lsn_limit;
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 577f1dae91c..5d9a39b0c9e 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -760,12 +760,11 @@ got_mutex:
/* If there is a block in the free list, take it */
block = buf_LRU_get_free_only();
- if (block != NULL) {
+ if (block) {
if (!have_mutex) {
mutex_exit(&buf_pool.mutex);
}
memset(&block->page.zip, 0, sizeof block->page.zip);
- block->skip_flush_check = false;
return(block);
}
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 0f6e0e84e84..ed36873837e 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -415,7 +415,7 @@ buf_read_ahead_random(const page_id_t page_id, ulint zip_size, bool ibuf)
const page_id_t low= page_id - (page_id.page_no() % buf_read_ahead_area);
page_id_t high= low + buf_read_ahead_area;
high.set_page_no(std::min(high.page_no(),
- static_cast<uint32_t>(space->size - 1)));
+ static_cast<uint32_t>(space->committed_size - 1)));
/* Count how many blocks in the area have been recently accessed,
that is, reside near the start of the LRU list. */
@@ -600,7 +600,7 @@ buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf)
fil_space_t *space= fil_space_acquire(page_id.space());
if (!space)
return 0;
- if (high_1.page_no() >= space->size)
+ if (high_1.page_no() >= space->committed_size)
{
/* The area is not whole. */
space->release();
@@ -663,7 +663,7 @@ hard_fail:
if (id != new_low && id != new_high_1)
/* This is not a border page of the area: return */
goto hard_fail;
- if (new_high_1.page_no() >= space->size)
+ if (new_high_1.page_no() >= space->committed_size)
/* The area is not whole */
goto hard_fail;
}
@@ -746,6 +746,13 @@ buf_read_recv_pages(
const ulint zip_size = space->zip_size();
for (ulint i = 0; i < n_stored; i++) {
+
+ /* Ignore if the page already present in freed ranges. */
+ if (space->freed_ranges.contains(
+ static_cast<uint32_t>(page_nos[i]))) {
+ continue;
+ }
+
const page_id_t cur_page_id(space_id, page_nos[i]);
ulint limit = 0;
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index a3b8d025b10..0f1b3b461a8 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1193,7 +1193,7 @@ inline void dict_sys_t::add(dict_table_t* table)
ulint fold = ut_fold_string(table->name.m_name);
- mutex_create(LATCH_ID_AUTOINC, &table->autoinc_mutex);
+ new (&table->autoinc_mutex) std::mutex();
/* Look for a table with the same name: error if such exists */
{
@@ -1322,7 +1322,7 @@ dict_index_t *dict_index_t::clone() const
(mem_heap_zalloc(heap, n_uniq * sizeof *stat_n_sample_sizes));
index->stat_n_non_null_key_vals= static_cast<ib_uint64_t*>
(mem_heap_zalloc(heap, n_uniq * sizeof *stat_n_non_null_key_vals));
- mutex_create(LATCH_ID_ZIP_PAD_MUTEX, &index->zip_pad.mutex);
+ new (&index->zip_pad.mutex) std::mutex();
return index;
}
@@ -1984,7 +1984,7 @@ void dict_sys_t::remove(dict_table_t* table, bool lru, bool keep)
UT_DELETE(table->vc_templ);
}
- mutex_free(&table->autoinc_mutex);
+ table->autoinc_mutex.~mutex();
if (keep) {
return;
@@ -4324,6 +4324,7 @@ dict_set_corrupted_index_cache_only(
is corrupted */
if (dict_index_is_clust(index)) {
index->table->corrupted = TRUE;
+ index->table->file_unreadable = true;
}
index->type |= DICT_CORRUPT;
@@ -5180,10 +5181,10 @@ dict_index_zip_success(
return;
}
- mutex_enter(&index->zip_pad.mutex);
+ index->zip_pad.mutex.lock();
++index->zip_pad.success;
dict_index_zip_pad_update(&index->zip_pad, zip_threshold);
- mutex_exit(&index->zip_pad.mutex);
+ index->zip_pad.mutex.unlock();
}
/*********************************************************************//**
@@ -5200,10 +5201,10 @@ dict_index_zip_failure(
return;
}
- mutex_enter(&index->zip_pad.mutex);
+ index->zip_pad.mutex.lock();
++index->zip_pad.failure;
dict_index_zip_pad_update(&index->zip_pad, zip_threshold);
- mutex_exit(&index->zip_pad.mutex);
+ index->zip_pad.mutex.unlock();
}
/*********************************************************************//**
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index 22a77a7a220..1e8c9ec2131 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -124,19 +124,25 @@ bool dict_col_t::same_encoding(uint16_t a, uint16_t b)
return false;
}
-/**********************************************************************//**
-Creates a table memory object.
+/** Creates a table memory object.
+@param[in] name table name
+@param[in] space tablespace
+@param[in] n_cols total number of columns including virtual and
+ non-virtual columns
+@param[in] n_v_cols number of virtual columns
+@param[in] flags table flags
+@param[in] flags2 table flags2
+@param[in] init_stats_latch whether to init the stats latch
@return own: table object */
dict_table_t*
dict_mem_table_create(
-/*==================*/
- const char* name, /*!< in: table name */
- fil_space_t* space, /*!< in: tablespace */
- ulint n_cols, /*!< in: total number of columns including
- virtual and non-virtual columns */
- ulint n_v_cols,/*!< in: number of virtual columns */
- ulint flags, /*!< in: table flags */
- ulint flags2) /*!< in: table flags2 */
+ const char* name,
+ fil_space_t* space,
+ ulint n_cols,
+ ulint n_v_cols,
+ ulint flags,
+ ulint flags2,
+ bool init_stats_latch)
{
dict_table_t* table;
mem_heap_t* heap;
@@ -204,8 +210,11 @@ dict_mem_table_create(
new(&table->foreign_set) dict_foreign_set();
new(&table->referenced_set) dict_foreign_set();
- rw_lock_create(dict_table_stats_key, &table->stats_latch,
- SYNC_INDEX_TREE);
+ if (init_stats_latch) {
+ rw_lock_create(dict_table_stats_key, &table->stats_latch,
+ SYNC_INDEX_TREE);
+ table->stats_latch_inited = true;
+ }
return(table);
}
@@ -249,7 +258,9 @@ dict_mem_table_free(
UT_DELETE(table->s_cols);
- rw_lock_free(&table->stats_latch);
+ if (table->stats_latch_inited) {
+ rw_lock_free(&table->stats_latch);
+ }
mem_heap_free(table->heap);
}
@@ -793,7 +804,7 @@ dict_mem_index_create(
dict_mem_fill_index_struct(index, heap, index_name, type, n_fields);
- mutex_create(LATCH_ID_ZIP_PAD_MUTEX, &index->zip_pad.mutex);
+ new (&index->zip_pad.mutex) std::mutex();
if (type & DICT_SPATIAL) {
index->rtr_track = new
@@ -1102,7 +1113,7 @@ dict_mem_index_free(
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
- mutex_free(&index->zip_pad.mutex);
+ index->zip_pad.mutex.~mutex();
if (dict_index_is_spatial(index)) {
for (auto& rtr_info : index->rtr_track->rtr_active) {
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index f8f03dd12d7..c08f1eedc33 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1784,12 +1784,6 @@ fil_crypt_rotate_page(
mtr.write<1,mtr_t::FORCED>(*block,
&frame[FIL_PAGE_SPACE_ID],
frame[FIL_PAGE_SPACE_ID]);
- /* This may be a freed page. Until
- MDEV-21347 has been fixed, a page on which
- BtrBulk::finish() invoked btr_page_free() may
- be an inconsistent B-tree page. For now,
- let us disable the flush-time check. */
- block->skip_flush_check = true;
/* statistics */
state->crypt_stat.pages_modified++;
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 34afe458687..cca2d0b93b7 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -284,34 +284,6 @@ fil_space_get(
return(space);
}
-/** Returns the latch of a file space.
-@param[in] id space id
-@param[out] flags tablespace flags
-@return latch protecting storage allocation */
-rw_lock_t*
-fil_space_get_latch(
- ulint id,
- ulint* flags)
-{
- fil_space_t* space;
-
- ut_ad(fil_system.is_initialised());
-
- mutex_enter(&fil_system.mutex);
-
- space = fil_space_get_by_id(id);
-
- ut_a(space);
-
- if (flags) {
- *flags = space->flags;
- }
-
- mutex_exit(&fil_system.mutex);
-
- return(&(space->latch));
-}
-
/**********************************************************************//**
Checks if all the file nodes in a space are flushed.
@return true if all are flushed */
@@ -751,7 +723,7 @@ fil_space_extend_must_retry(
os_offset_t(FIL_IBD_FILE_INITIAL_SIZE << srv_page_size_shift));
*success = os_file_set_size(node->name, node->handle, new_size,
- FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags));
+ space->is_compressed());
os_has_said_disk_full = *success;
if (*success) {
@@ -879,6 +851,9 @@ fil_mutex_enter_and_prepare_for_io(
ut_a(success);
/* InnoDB data files cannot shrink. */
ut_a(space->size >= size);
+ if (size > space->committed_size) {
+ space->committed_size = size;
+ }
/* There could be multiple concurrent I/O requests for
this tablespace (multiple threads trying to extend
@@ -1775,37 +1750,6 @@ fil_space_acquire_for_io(ulint id)
return(space);
}
-/********************************************************//**
-Creates the database directory for a table if it does not exist yet. */
-void
-fil_create_directory_for_tablename(
-/*===============================*/
- const char* name) /*!< in: name in the standard
- 'databasename/tablename' format */
-{
- const char* namend;
- char* path;
- ulint len;
-
- len = strlen(fil_path_to_mysql_datadir);
- namend = strchr(name, '/');
- ut_a(namend);
- path = static_cast<char*>(
- ut_malloc_nokey(len + ulint(namend - name) + 2));
-
- memcpy(path, fil_path_to_mysql_datadir, len);
- path[len] = '/';
- memcpy(path + len + 1, name, ulint(namend - name));
- path[len + ulint(namend - name) + 1] = 0;
-
- os_normalize_path(path);
-
- bool success = os_file_create_directory(path, false);
- ut_a(success);
-
- ut_free(path);
-}
-
/** Write a log record about a file operation.
@param type file operation
@param first_page_no first page number in the file
@@ -2709,7 +2653,7 @@ fil_ibd_create(
return NULL;
}
- const bool is_compressed = FSP_FLAGS_HAS_PAGE_COMPRESSION(flags);
+ const bool is_compressed = fil_space_t::is_compressed(flags);
bool punch_hole = is_compressed;
#ifdef _WIN32
@@ -3534,7 +3478,7 @@ fil_ibd_load(
/* Adjust the memory-based flags that would normally be set by
dict_tf_to_fsp_flags(). In recovery, we have no data dictionary. */
ulint flags = file.flags();
- if (FSP_FLAGS_HAS_PAGE_COMPRESSION(flags)) {
+ if (fil_space_t::is_compressed(flags)) {
flags |= page_zip_level
<< FSP_FLAGS_MEM_COMPRESSION_LEVEL;
}
@@ -3959,6 +3903,12 @@ fil_io(
if (punch_hole) {
/* Punch the hole to the file */
err = os_file_punch_hole(node->handle, offset, len);
+ /* Punch hole is not supported, make space not to
+ support punch hole */
+ if (UNIV_UNLIKELY(err == DB_IO_NO_PUNCH_HOLE)) {
+ node->space->punch_hole = false;
+ err = DB_SUCCESS;
+ }
} else {
/* Queue the aio request */
err = os_aio(
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index 198d69206ec..a8f04a754b4 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -768,10 +768,10 @@ Datafile::restore_from_doublewrite()
}
/* Find if double write buffer contains page_no of given space id. */
- const byte* page = recv_sys.dblwr.find_page(m_space_id, 0);
const page_id_t page_id(m_space_id, 0);
+ const byte* page = recv_sys.dblwr.find_page(page_id);
- if (page == NULL) {
+ if (!page) {
/* If the first page of the given user tablespace is not there
in the doublewrite buffer, then the recovery is going to fail
now. Hence this is treated as an error. */
@@ -788,15 +788,10 @@ Datafile::restore_from_doublewrite()
FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page);
if (!fil_space_t::is_valid_flags(flags, m_space_id)) {
- ulint cflags = fsp_flags_convert_from_101(flags);
- if (cflags == ULINT_UNDEFINED) {
- ib::warn()
- << "Ignoring a doublewrite copy of page "
- << page_id
- << " due to invalid flags " << ib::hex(flags);
- return(true);
- }
- flags = cflags;
+ flags = fsp_flags_convert_from_101(flags);
+ /* recv_dblwr_t::validate_page() inside find_page()
+ checked this already. */
+ ut_ad(flags != ULINT_UNDEFINED);
/* The flags on the page should be converted later. */
}
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index 94a11778beb..a2a6335a17a 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -319,7 +319,7 @@ xdes_get_descriptor_with_space_hdr(
ulint limit;
ulint size;
ulint descr_page_no;
- ut_ad(mtr->memo_contains(space->latch, MTR_MEMO_X_LOCK));
+ ut_ad(mtr->memo_contains(*space));
ut_ad(mtr->memo_contains_flagged(header, MTR_MEMO_PAGE_SX_FIX));
/* Read free limit and space size */
limit = mach_read_from_4(FSP_HEADER_OFFSET + FSP_FREE_LIMIT
@@ -444,7 +444,7 @@ xdes_lst_get_descriptor(
buf_block_t** block,
mtr_t* mtr)
{
- ut_ad(mtr->memo_contains(space->latch, MTR_MEMO_X_LOCK));
+ ut_ad(mtr->memo_contains(*space));
return fut_get_ptr(space->id, space->zip_size(),
lst_node, RW_SX_LATCH, mtr, block)
- XDES_FLST_NODE;
@@ -887,30 +887,20 @@ fsp_fill_free_list(
FIL_PAGE_TYPE_XDES);
}
- /* Initialize the ibuf bitmap page in a separate
- mini-transaction because it is low in the latching
- order, and we must be able to release its latch.
- Note: Insert-Buffering is disabled for tables that
- reside in the temp-tablespace. */
if (space->purpose != FIL_TYPE_TEMPORARY) {
- mtr_t ibuf_mtr;
-
- ibuf_mtr.start();
- ibuf_mtr.set_named_space(space);
-
+ const auto savepoint = mtr->get_savepoint();
block = buf_page_create(
space,
static_cast<uint32_t>(
i + FSP_IBUF_BITMAP_OFFSET),
- zip_size, &ibuf_mtr);
- ibuf_mtr.sx_latch_at_savepoint(0, block);
+ zip_size, mtr);
+ mtr->sx_latch_at_savepoint(savepoint, block);
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
- fsp_init_file_page(space, block, &ibuf_mtr);
- ibuf_mtr.write<2>(*block,
- block->frame + FIL_PAGE_TYPE,
- FIL_PAGE_IBUF_BITMAP);
- ibuf_mtr.commit();
+ fsp_init_file_page(space, block, mtr);
+ mtr->write<2>(*block,
+ block->frame + FIL_PAGE_TYPE,
+ FIL_PAGE_IBUF_BITMAP);
}
}
@@ -1296,7 +1286,7 @@ static void fsp_free_page(fil_space_t* space, page_no_t offset, mtr_t* mtr)
@param[in,out] mtr mini-transaction */
static void fsp_free_extent(fil_space_t* space, page_no_t offset, mtr_t* mtr)
{
- ut_ad(mtr->memo_contains(space->latch, MTR_MEMO_X_LOCK));
+ ut_ad(mtr->memo_contains(*space));
buf_block_t *block= fsp_get_header(space, mtr);
buf_block_t *xdes= 0;
@@ -1308,8 +1298,8 @@ static void fsp_free_extent(fil_space_t* space, page_no_t offset, mtr_t* mtr)
xdes_init(*xdes, descr, mtr);
flst_add_last(block, FSP_HEADER_OFFSET + FSP_FREE,
- xdes, static_cast<uint16_t>(descr - xdes->frame
- + XDES_FLST_NODE), mtr);
+ xdes, static_cast<uint16_t>(descr - xdes->frame +
+ XDES_FLST_NODE), mtr);
space->free_len++;
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 858fefaf2de..cf51b91af64 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -157,9 +157,6 @@ void close_thread_tables(THD* thd);
#endif /* WITH_WSREP */
/** to force correct commit order in binlog */
-static ulong commit_threads = 0;
-static mysql_cond_t commit_cond;
-static mysql_mutex_t commit_cond_m;
static mysql_mutex_t pending_checkpoint_mutex;
#define INSIDE_HA_INNOBASE_CC
@@ -174,7 +171,6 @@ static const long AUTOINC_NO_LOCKING = 2;
static ulong innobase_open_files;
static long innobase_autoinc_lock_mode;
-static ulong innobase_commit_concurrency;
static ulonglong innobase_buffer_pool_size;
@@ -369,14 +365,6 @@ TYPELIB innodb_flush_method_typelib = {
NULL
};
-/* The following counter is used to convey information to InnoDB
-about server activity: in case of normal DML ops it is not
-sensible to call srv_active_wake_master_thread after each
-operation, we only do it every INNOBASE_WAKE_INTERVAL'th step. */
-
-#define INNOBASE_WAKE_INTERVAL 32
-static ulong innobase_active_counter = 0;
-
/** Allowed values of innodb_change_buffering */
static const char* innodb_change_buffering_names[] = {
"none", /* IBUF_USE_NONE */
@@ -519,7 +507,6 @@ static PSI_cond_info all_innodb_conds[] = {
performance schema instrumented if "UNIV_PFS_MUTEX"
is defined */
static PSI_mutex_info all_innodb_mutexes[] = {
- PSI_KEY(autoinc_mutex),
PSI_KEY(buf_pool_mutex),
PSI_KEY(cache_last_read_mutex),
PSI_KEY(dict_foreign_err_mutex),
@@ -567,7 +554,6 @@ static PSI_mutex_info all_innodb_mutexes[] = {
PSI_KEY(rtr_match_mutex),
PSI_KEY(rtr_path_mutex),
PSI_KEY(trx_sys_mutex),
- PSI_KEY(zip_pad_mutex)
};
# endif /* UNIV_PFS_MUTEX */
@@ -1194,20 +1180,6 @@ innobase_release_savepoint(
static void innobase_checkpoint_request(handlerton *hton, void *cookie);
-/** @brief Initialize the default value of innodb_commit_concurrency.
-
-Once InnoDB is running, the innodb_commit_concurrency must not change
-from zero to nonzero. (Bug #42101)
-
-The initial default value is 0, and without this extra initialization,
-SET GLOBAL innodb_commit_concurrency=DEFAULT would set the parameter
-to 0, even if it was initially set to nonzero at the command line
-or configuration file. */
-static
-void
-innobase_commit_concurrency_init_default();
-/*=======================================*/
-
/** @brief Adjust some InnoDB startup parameters based on file contents
or innodb_page_size. */
static
@@ -1387,36 +1359,6 @@ innobase_fts_store_docid(
}
#endif
-/*************************************************************//**
-Check for a valid value of innobase_commit_concurrency.
-@return 0 for valid innodb_commit_concurrency */
-static
-int
-innobase_commit_concurrency_validate(
-/*=================================*/
- THD*, st_mysql_sys_var*,
- void* save, /*!< out: immediate result
- for update function */
- struct st_mysql_value* value) /*!< in: incoming string */
-{
- long long intbuf;
- ulong commit_concurrency;
-
- DBUG_ENTER("innobase_commit_concurrency_validate");
-
- if (value->val_int(value, &intbuf)) {
- /* The value is NULL. That is invalid. */
- DBUG_RETURN(1);
- }
-
- *reinterpret_cast<ulong*>(save) = commit_concurrency
- = static_cast<ulong>(intbuf);
-
- /* Allow the value to be updated, as long as it remains zero
- or nonzero. */
- DBUG_RETURN(!(!commit_concurrency == !innobase_commit_concurrency));
-}
-
/*******************************************************************//**
Function for constructing an InnoDB table handler instance. */
static
@@ -1459,10 +1401,7 @@ innodb_page_size_validate(
/******************************************************************//**
Returns true if the thread is the replication thread on the slave
-server. Used in srv_conc_enter_innodb() to determine if the thread
-should be allowed to enter InnoDB - the replication thread is treated
-differently than other threads. Also used in
-srv_conc_force_exit_innodb().
+server.
@return true if thd is the replication thread */
ibool
thd_is_replication_slave_thread(
@@ -1551,77 +1490,6 @@ thd_trx_is_auto_commit(
&& thd_is_select(thd));
}
-/** Enter InnoDB engine after checking the max number of user threads
-allowed, else the thread is put into sleep.
-@param[in,out] prebuilt row prebuilt handler */
-static inline void innobase_srv_conc_enter_innodb(row_prebuilt_t *prebuilt)
-{
- trx_t* trx = prebuilt->trx;
-
-#ifdef WITH_WSREP
- if (trx->is_wsrep() && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) return;
-#endif /* WITH_WSREP */
-
- if (srv_thread_concurrency) {
- if (trx->n_tickets_to_enter_innodb > 0) {
-
- /* If trx has 'free tickets' to enter the engine left,
- then use one such ticket */
-
- --trx->n_tickets_to_enter_innodb;
-
- } else if (trx->mysql_thd != NULL
- && thd_is_replication_slave_thread(trx->mysql_thd)) {
- const ulonglong end = my_interval_timer()
- + ulonglong(srv_replication_delay) * 1000000;
- while ((srv_conc_get_active_threads()
- >= srv_thread_concurrency)
- && my_interval_timer() < end) {
- os_thread_sleep(2000 /* 2 ms */);
- }
- } else {
- srv_conc_enter_innodb(prebuilt);
- }
- }
-}
-
-/** Note that the thread wants to leave InnoDB only if it doesn't have
-any spare tickets.
-@param[in,out] m_prebuilt row prebuilt handler */
-static inline void innobase_srv_conc_exit_innodb(row_prebuilt_t *prebuilt)
-{
- ut_ad(!sync_check_iterate(sync_check()));
-
- trx_t* trx = prebuilt->trx;
-
-#ifdef WITH_WSREP
- if (trx->is_wsrep() && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) return;
-#endif /* WITH_WSREP */
-
- /* This is to avoid making an unnecessary function call. */
- if (trx->declared_to_be_inside_innodb
- && trx->n_tickets_to_enter_innodb == 0) {
-
- srv_conc_force_exit_innodb(trx);
- }
-}
-
-/******************************************************************//**
-Force a thread to leave InnoDB even if it has spare tickets. */
-static inline
-void
-innobase_srv_conc_force_exit_innodb(
-/*================================*/
- trx_t* trx) /*!< in: transaction handle */
-{
- ut_ad(!sync_check_iterate(sync_check()));
-
- /* This is to avoid making an unnecessary function call. */
- if (trx->declared_to_be_inside_innodb) {
- srv_conc_force_exit_innodb(trx);
- }
-}
-
/******************************************************************//**
Returns the NUL terminated value of glob_hostname.
@return pointer to glob_hostname. */
@@ -1726,23 +1594,6 @@ static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid);
static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid);
#endif /* WITH_WSREP */
/********************************************************************//**
-Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth
-time calls srv_active_wake_master_thread. This function should be used
-when a single database operation may introduce a small need for
-server utility activity, like checkpointing. */
-inline
-void
-innobase_active_small(void)
-/*=======================*/
-{
- innobase_active_counter++;
-
- if ((innobase_active_counter % INNOBASE_WAKE_INTERVAL) == 0) {
- srv_active_wake_master_thread();
- }
-}
-
-/********************************************************************//**
Converts an InnoDB error code to a MySQL error code and also tells to MySQL
about a possible transaction rollback inside InnoDB caused by a lock wait
timeout or a deadlock.
@@ -2382,7 +2233,7 @@ ha_innobase::innobase_reset_autoinc(
if (error == DB_SUCCESS) {
dict_table_autoinc_initialize(m_prebuilt->table, autoinc);
- mutex_exit(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.unlock();
}
return(error);
@@ -2932,8 +2783,6 @@ innobase_query_caching_of_table_permitted(
return(false);
}
- innobase_srv_conc_force_exit_innodb(trx);
-
if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)
&& trx->n_mysql_tables_in_use == 0) {
/* We are going to retrieve the query result from the query
@@ -3231,8 +3080,6 @@ ha_innobase::init_table_handle_for_HANDLER(void)
/* Initialize the m_prebuilt struct much like it would be inited in
external_lock */
- innobase_srv_conc_force_exit_innodb(m_prebuilt->trx);
-
/* If the transaction is not started yet, start it */
trx_start_if_not_started_xa(m_prebuilt->trx, false);
@@ -3415,6 +3262,65 @@ static uint innodb_background_scrub_data_interval;
static const char* innodb_background_scrub_data_interval_msg
= "The parameter innodb_background_scrub_data_interval is deprecated and"
" has no effect.";
+
+uint replication_delay;
+uint thread_concurrency;
+uint commit_concurrency;
+uint concurrency_tickets;
+uint adaptive_max_sleep_delay;
+uint thread_sleep_delay;
+
+static const char * const replication_delay_msg
+= "The parameter innodb_replication_delay is deprecated and has no effect.";
+static const char * const thread_concurrency_msg
+= "The parameter innodb_thread_concurrency is deprecated and has no effect.";
+static const char * const commit_concurrency_msg
+= "The parameter innodb_commit_concurrency is deprecated and has no effect.";
+static const char * const concurrency_tickets_msg
+= "The parameter innodb_concurrency_tickets is deprecated and has no effect.";
+static const char * const adaptive_max_sleep_delay_msg
+= "The parameter innodb_adaptive_max_sleep_delay is deprecated and"
+ " has no effect.";
+static const char * const thread_sleep_delay_msg
+= "The parameter innodb_thread_sleep_delay is deprecated and has no effect.";
+
+static void replication_delay_warn(THD* thd, st_mysql_sys_var*, void*,
+ const void*)
+{
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED,
+ replication_delay_msg);
+}
+static void thread_concurrency_warn(THD* thd, st_mysql_sys_var*, void*,
+ const void*)
+{
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED,
+ thread_concurrency_msg);
+}
+static void commit_concurrency_warn(THD* thd, st_mysql_sys_var*, void*,
+ const void*)
+{
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED,
+ commit_concurrency_msg);
+}
+static void concurrency_tickets_warn(THD* thd, st_mysql_sys_var*, void*,
+ const void*)
+{
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED,
+ concurrency_tickets_msg);
+}
+static void adaptive_max_sleep_delay_warn(THD* thd, st_mysql_sys_var*, void*,
+ const void*)
+{
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED,
+ adaptive_max_sleep_delay_msg);
+}
+static void thread_sleep_delay_warn(THD* thd, st_mysql_sys_var*, void*,
+ const void*)
+{
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED,
+ thread_sleep_delay_msg);
+}
+
} // namespace deprecated
/** Initialize, validate and normalize the InnoDB startup parameters.
@@ -3489,6 +3395,31 @@ static int innodb_init_params()
deprecated::innodb_undo_logs = TRX_SYS_N_RSEGS;
}
+ if (UNIV_UNLIKELY(deprecated::replication_delay)) {
+ sql_print_warning(deprecated::replication_delay_msg);
+ deprecated::replication_delay = 0;
+ }
+ if (UNIV_UNLIKELY(deprecated::thread_concurrency)) {
+ sql_print_warning(deprecated::thread_concurrency_msg);
+ deprecated::thread_concurrency = 0;
+ }
+ if (UNIV_UNLIKELY(deprecated::commit_concurrency)) {
+ sql_print_warning(deprecated::commit_concurrency_msg);
+ deprecated::commit_concurrency = 0;
+ }
+ if (UNIV_UNLIKELY(deprecated::concurrency_tickets)) {
+ sql_print_warning(deprecated::concurrency_tickets_msg);
+ deprecated::concurrency_tickets = 0;
+ }
+ if (UNIV_UNLIKELY(deprecated::adaptive_max_sleep_delay)) {
+ sql_print_warning(deprecated::adaptive_max_sleep_delay_msg);
+ deprecated::adaptive_max_sleep_delay = 0;
+ }
+ if (UNIV_UNLIKELY(deprecated::thread_sleep_delay)) {
+ sql_print_warning(deprecated::thread_sleep_delay_msg);
+ deprecated::thread_sleep_delay = 0;
+ }
+
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
if (innobase_buffer_pool_size > UINT_MAX32) {
@@ -3801,8 +3732,6 @@ static int innodb_init_params()
data_mysql_default_charset_coll = (ulint) default_charset_info->number;
- innobase_commit_concurrency_init_default();
-
srv_use_atomic_writes
= innobase_use_atomic_writes && my_may_have_atomic_write;
if (srv_use_atomic_writes && !srv_file_per_table)
@@ -4013,9 +3942,6 @@ static int innodb_init(void* p)
ibuf_max_size_update(srv_change_buffer_max_size);
- mysql_mutex_init(commit_cond_mutex_key,
- &commit_cond_m, MY_MUTEX_INIT_FAST);
- mysql_cond_init(commit_cond_key, &commit_cond, 0);
mysql_mutex_init(pending_checkpoint_mutex_key,
&pending_checkpoint_mutex,
MY_MUTEX_INIT_FAST);
@@ -4085,8 +4011,6 @@ innobase_end(handlerton*, ha_panic_function)
innodb_shutdown();
innobase_space_shutdown();
- mysql_mutex_destroy(&commit_cond_m);
- mysql_cond_destroy(&commit_cond);
mysql_mutex_destroy(&pending_checkpoint_mutex);
}
@@ -4154,8 +4078,6 @@ innobase_start_trx_and_assign_read_view(
trx_t* trx = check_trx_exists(thd);
- innobase_srv_conc_force_exit_innodb(trx);
-
/* The transaction should not be active yet, start it */
ut_ad(!trx_is_started(trx));
@@ -4195,30 +4117,9 @@ innobase_commit_ordered_2(
{
DBUG_ENTER("innobase_commit_ordered_2");
- bool read_only = trx->read_only || trx->id == 0;
+ const bool read_only = trx->read_only || trx->id == 0;
if (!read_only) {
-
- while (innobase_commit_concurrency > 0) {
-
- mysql_mutex_lock(&commit_cond_m);
-
- ++commit_threads;
-
- if (commit_threads
- <= innobase_commit_concurrency) {
-
- mysql_mutex_unlock(&commit_cond_m);
- break;
- }
-
- --commit_threads;
-
- mysql_cond_wait(&commit_cond, &commit_cond_m);
-
- mysql_mutex_unlock(&commit_cond_m);
- }
-
/* The following call reads the binary log position of
the transaction being committed.
@@ -4252,18 +4153,6 @@ innobase_commit_ordered_2(
if (!read_only) {
trx->mysql_log_file_name = NULL;
trx->flush_log_later = false;
-
- if (innobase_commit_concurrency > 0) {
-
- mysql_mutex_lock(&commit_cond_m);
-
- ut_ad(commit_threads > 0);
- --commit_threads;
-
- mysql_cond_signal(&commit_cond);
-
- mysql_mutex_unlock(&commit_cond_m);
- }
}
DBUG_VOID_RETURN;
@@ -4404,8 +4293,6 @@ innobase_commit(
/* This is a statement level variable. */
trx->fts_next_doc_id = 0;
- innobase_srv_conc_force_exit_innodb(trx);
-
DBUG_RETURN(0);
}
@@ -4433,8 +4320,6 @@ innobase_rollback(
ut_ad(trx->dict_operation_lock_mode == 0);
ut_ad(trx->dict_operation == TRX_DICT_OP_NONE);
- innobase_srv_conc_force_exit_innodb(trx);
-
/* Reset the number AUTO-INC rows required */
trx->n_autoinc_rows = 0;
@@ -4485,8 +4370,6 @@ innobase_rollback_trx(
DBUG_ENTER("innobase_rollback_trx");
DBUG_PRINT("trans", ("aborting transaction"));
- innobase_srv_conc_force_exit_innodb(trx);
-
/* If we had reserved the auto-inc lock for some table (if
we come here to roll back the latest SQL statement) we
release it now before a possibly lengthy rollback */
@@ -4657,8 +4540,6 @@ innobase_rollback_to_savepoint(
trx_t* trx = check_trx_exists(thd);
- innobase_srv_conc_force_exit_innodb(trx);
-
/* TODO: use provided savepoint data area to store savepoint data */
char name[64];
@@ -4763,8 +4644,6 @@ innobase_savepoint(
trx_t* trx = check_trx_exists(thd);
- innobase_srv_conc_force_exit_innodb(trx);
-
/* Cannot happen outside of transaction */
DBUG_ASSERT(trx_is_registered_for_2pc(trx));
@@ -5729,7 +5608,7 @@ initialize_auto_increment(dict_table_t* table, const Field* field)
const unsigned col_no = innodb_col_no(field);
- mutex_enter(&table->autoinc_mutex);
+ table->autoinc_mutex.lock();
table->persistent_autoinc = static_cast<uint16_t>(
dict_table_get_nth_col_pos(table, col_no, NULL) + 1)
@@ -5760,7 +5639,7 @@ initialize_auto_increment(dict_table_t* table, const Field* field)
innobase_get_int_col_max_value(field));
}
- mutex_exit(&table->autoinc_mutex);
+ table->autoinc_mutex.unlock();
}
/** Open an InnoDB table
@@ -6195,11 +6074,6 @@ ha_innobase::close()
MONITOR_INC(MONITOR_TABLE_CLOSE);
- /* Tell InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
DBUG_RETURN(0);
}
@@ -7568,7 +7442,7 @@ ha_innobase::innobase_lock_autoinc(void)
switch (innobase_autoinc_lock_mode) {
case AUTOINC_NO_LOCKING:
/* Acquire only the AUTOINC mutex. */
- mutex_enter(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.lock();
break;
case AUTOINC_NEW_STYLE_LOCKING:
@@ -7577,24 +7451,19 @@ ha_innobase::innobase_lock_autoinc(void)
transaction has already acquired the AUTOINC lock on
behalf of a LOAD FILE or INSERT ... SELECT etc. type of
statement. */
- if (thd_sql_command(m_user_thd) == SQLCOM_INSERT
- || thd_sql_command(m_user_thd) == SQLCOM_REPLACE
- || thd_sql_command(m_user_thd) == SQLCOM_END // RBR event
- ) {
-
+ switch (thd_sql_command(m_user_thd)) {
+ case SQLCOM_INSERT:
+ case SQLCOM_REPLACE:
+ case SQLCOM_END: // RBR event
/* Acquire the AUTOINC mutex. */
- mutex_enter(&m_prebuilt->table->autoinc_mutex);
-
+ m_prebuilt->table->autoinc_mutex.lock();
/* We need to check that another transaction isn't
already holding the AUTOINC lock on the table. */
- if (m_prebuilt->table->n_waiting_or_granted_auto_inc_locks) {
- /* Release the mutex to avoid deadlocks and
- fall back to old style locking. */
- mutex_exit(&m_prebuilt->table->autoinc_mutex);
- } else {
+ if (!m_prebuilt->table->n_waiting_or_granted_auto_inc_locks) {
/* Do not fall back to old style locking. */
- break;
+ DBUG_RETURN(error);
}
+ m_prebuilt->table->autoinc_mutex.unlock();
}
/* Use old style locking. */
/* fall through */
@@ -7606,7 +7475,7 @@ ha_innobase::innobase_lock_autoinc(void)
if (error == DB_SUCCESS) {
/* Acquire the AUTOINC mutex. */
- mutex_enter(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.lock();
}
break;
@@ -7634,7 +7503,7 @@ ha_innobase::innobase_set_max_autoinc(
if (error == DB_SUCCESS) {
dict_table_autoinc_update_if_greater(m_prebuilt->table, auto_inc);
- mutex_exit(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.unlock();
}
return(error);
@@ -7720,8 +7589,6 @@ ha_innobase::write_row(
build_template(true);
}
- innobase_srv_conc_enter_innodb(m_prebuilt);
-
vers_set_fields = table->versioned_write(VERS_TRX_ID) ?
ROW_INS_VERSIONED : ROW_INS_NORMAL;
@@ -7791,8 +7658,6 @@ ha_innobase::write_row(
wsrep_thd_query(m_user_thd));
error= DB_SUCCESS;
wsrep_thd_self_abort(m_user_thd);
- innobase_srv_conc_exit_innodb(
- m_prebuilt);
/* jump straight to func exit over
* later wsrep hooks */
goto func_exit;
@@ -7860,8 +7725,6 @@ set_max_autoinc:
}
}
- innobase_srv_conc_exit_innodb(m_prebuilt);
-
report_error:
/* Cleanup and exit. */
if (error == DB_TABLESPACE_DELETED) {
@@ -7897,8 +7760,6 @@ report_error:
}
func_exit:
- innobase_active_small();
-
DBUG_RETURN(error_result);
}
@@ -8515,8 +8376,6 @@ ha_innobase::update_row(
? VERSIONED_DELETE
: NO_DELETE;
- innobase_srv_conc_enter_innodb(m_prebuilt);
-
error = row_update_for_mysql(m_prebuilt);
if (error == DB_SUCCESS && vers_ins_row
@@ -8569,8 +8428,6 @@ ha_innobase::update_row(
}
}
- innobase_srv_conc_exit_innodb(m_prebuilt);
-
func_exit:
if (error == DB_FTS_INVALID_DOCID) {
err = HA_FTS_INVALID_DOCID;
@@ -8580,11 +8437,6 @@ func_exit:
error, m_prebuilt->table->flags, m_user_thd);
}
- /* Tell InnoDB server that there might be work for
- utility threads: */
-
- innobase_active_small();
-
#ifdef WITH_WSREP
if (error == DB_SUCCESS && trx->is_wsrep()
&& wsrep_thd_is_local(m_user_thd)
@@ -8640,17 +8492,8 @@ ha_innobase::delete_row(
? VERSIONED_DELETE
: PLAIN_DELETE;
- innobase_srv_conc_enter_innodb(m_prebuilt);
-
error = row_update_for_mysql(m_prebuilt);
- innobase_srv_conc_exit_innodb(m_prebuilt);
-
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- innobase_active_small();
-
#ifdef WITH_WSREP
if (error == DB_SUCCESS && trx->is_wsrep()
&& wsrep_thd_is_local(m_user_thd)
@@ -8951,20 +8794,8 @@ ha_innobase::index_read(
m_last_match_mode = (uint) match_mode;
- dberr_t ret;
-
- if (mode != PAGE_CUR_UNSUPP) {
-
- innobase_srv_conc_enter_innodb(m_prebuilt);
-
- ret = row_search_mvcc(
- buf, mode, m_prebuilt, match_mode, 0);
-
- innobase_srv_conc_exit_innodb(m_prebuilt);
- } else {
-
- ret = DB_UNSUPPORTED;
- }
+ dberr_t ret = mode == PAGE_CUR_UNSUPP ? DB_UNSUPPORTED
+ : row_search_mvcc(buf, mode, m_prebuilt, match_mode, 0);
DBUG_EXECUTE_IF("ib_select_query_failure", ret = DB_ERROR;);
@@ -9220,16 +9051,10 @@ ha_innobase::general_fetch(
: HA_ERR_NO_SUCH_TABLE);
}
- innobase_srv_conc_enter_innodb(m_prebuilt);
-
- dberr_t ret = row_search_mvcc(
- buf, PAGE_CUR_UNSUPP, m_prebuilt, match_mode, direction);
-
- innobase_srv_conc_exit_innodb(m_prebuilt);
-
int error;
- switch (ret) {
+ switch (dberr_t ret = row_search_mvcc(buf, PAGE_CUR_UNSUPP, m_prebuilt,
+ match_mode, direction)) {
case DB_SUCCESS:
error = 0;
table->status = 0;
@@ -9740,16 +9565,11 @@ next_record:
tuple. */
innobase_fts_create_doc_id_key(tuple, index, &search_doc_id);
- innobase_srv_conc_enter_innodb(m_prebuilt);
-
- dberr_t ret = row_search_for_mysql(
- (byte*) buf, PAGE_CUR_GE, m_prebuilt, ROW_SEL_EXACT, 0);
-
- innobase_srv_conc_exit_innodb(m_prebuilt);
-
int error;
- switch (ret) {
+ switch (dberr_t ret = row_search_for_mysql(buf, PAGE_CUR_GE,
+ m_prebuilt,
+ ROW_SEL_EXACT, 0)) {
case DB_SUCCESS:
error = 0;
table->status = 0;
@@ -13027,7 +12847,6 @@ create_table_info_t::create_table_update_dict()
if (m_flags2 & DICT_TF2_FTS) {
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
dict_table_close(innobase_table, FALSE, FALSE);
- srv_active_wake_master_thread();
trx_free(m_trx);
DBUG_RETURN(-1);
}
@@ -13046,7 +12865,7 @@ create_table_info_t::create_table_update_dict()
autoinc = 1;
}
- mutex_enter(&innobase_table->autoinc_mutex);
+ innobase_table->autoinc_mutex.lock();
dict_table_autoinc_initialize(innobase_table, autoinc);
if (innobase_table->is_temporary()) {
@@ -13074,7 +12893,7 @@ create_table_info_t::create_table_update_dict()
}
}
- mutex_exit(&innobase_table->autoinc_mutex);
+ innobase_table->autoinc_mutex.unlock();
}
innobase_parse_hint_from_comment(m_thd, innobase_table, m_form->s);
@@ -13180,11 +12999,6 @@ ha_innobase::create(
error = info.create_table_update_dict();
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
DBUG_RETURN(error);
}
@@ -15695,8 +15509,6 @@ ha_innobase::start_stmt(
trx = m_prebuilt->trx;
- innobase_srv_conc_force_exit_innodb(trx);
-
/* Reset the AUTOINC statement level counter for multi-row INSERTs. */
trx->n_autoinc_rows = 0;
@@ -16002,8 +15814,6 @@ ha_innobase::external_lock(
trx->n_mysql_tables_in_use--;
m_mysql_has_locked = false;
- innobase_srv_conc_force_exit_innodb(trx);
-
/* If the MySQL lock count drops to zero we know that the current SQL
statement has ended */
@@ -16078,10 +15888,6 @@ innodb_show_status(
srv_wake_purge_thread_if_not_active();
- trx_t* trx = check_trx_exists(thd);
-
- innobase_srv_conc_force_exit_innodb(trx);
-
/* We let the InnoDB Monitor to output at most MAX_STATUS_SIZE
bytes of text. */
@@ -16388,7 +16194,7 @@ innodb_show_rwlock_status(
{
DBUG_ENTER("innodb_show_rwlock_status");
- rw_lock_t* block_rwlock = NULL;
+ const rw_lock_t* block_rwlock= nullptr;
ulint block_rwlock_oswait_count = 0;
uint hton_name_len = (uint) strlen(innobase_hton_name);
@@ -16396,36 +16202,34 @@ innodb_show_rwlock_status(
mutex_enter(&rw_lock_list_mutex);
- for (rw_lock_t* rw_lock = UT_LIST_GET_FIRST(rw_lock_list);
- rw_lock != NULL;
- rw_lock = UT_LIST_GET_NEXT(list, rw_lock)) {
+ for (const rw_lock_t& rw_lock : rw_lock_list) {
- if (rw_lock->count_os_wait == 0) {
+ if (rw_lock.count_os_wait == 0) {
continue;
}
int buf1len;
char buf1[IO_SIZE];
- if (rw_lock->is_block_lock) {
+ if (rw_lock.is_block_lock) {
- block_rwlock = rw_lock;
- block_rwlock_oswait_count += rw_lock->count_os_wait;
+ block_rwlock = &rw_lock;
+ block_rwlock_oswait_count += rw_lock.count_os_wait;
continue;
}
buf1len = snprintf(
buf1, sizeof buf1, "rwlock: %s:%u",
- innobase_basename(rw_lock->cfile_name),
- rw_lock->cline);
+ innobase_basename(rw_lock.cfile_name),
+ rw_lock.cline);
int buf2len;
char buf2[IO_SIZE];
buf2len = snprintf(
buf2, sizeof buf2, "waits=%u",
- rw_lock->count_os_wait);
+ rw_lock.count_os_wait);
if (stat_print(thd, innobase_hton_name,
hton_name_len,
@@ -16743,7 +16547,7 @@ ha_innobase::innobase_get_autoinc(
/* It should have been initialized during open. */
if (*value == 0) {
m_prebuilt->autoinc_error = DB_UNSUPPORTED;
- mutex_exit(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.unlock();
}
}
@@ -16767,7 +16571,7 @@ ha_innobase::innobase_peek_autoinc(void)
innodb_table = m_prebuilt->table;
- mutex_enter(&innodb_table->autoinc_mutex);
+ innodb_table->autoinc_mutex.lock();
auto_inc = dict_table_autoinc_read(innodb_table);
@@ -16776,7 +16580,7 @@ ha_innobase::innobase_peek_autoinc(void)
" '" << innodb_table->name << "'";
}
- mutex_exit(&innodb_table->autoinc_mutex);
+ innodb_table->autoinc_mutex.unlock();
return(auto_inc);
}
@@ -16883,7 +16687,7 @@ ha_innobase::get_auto_increment(
/* Out of range number. Let handler::update_auto_increment()
take care of this */
m_prebuilt->autoinc_last_value = 0;
- mutex_exit(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.unlock();
*nb_reserved_values= 0;
return;
}
@@ -16926,7 +16730,7 @@ ha_innobase::get_auto_increment(
m_prebuilt->autoinc_offset = offset;
m_prebuilt->autoinc_increment = increment;
- mutex_exit(&m_prebuilt->table->autoinc_mutex);
+ m_prebuilt->table->autoinc_mutex.unlock();
}
/*******************************************************************//**
@@ -17196,8 +17000,6 @@ innobase_xa_prepare(
thd_get_xid(thd, (MYSQL_XID*) trx->xid);
- innobase_srv_conc_force_exit_innodb(trx);
-
if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) {
sql_print_error("Transaction not registered for MariaDB 2PC,"
@@ -19022,10 +18824,17 @@ wsrep_innobase_kill_one_trx(THD* bf_thd, trx_t *victim_trx,
/* Mark transaction as a victim for Galera abort */
victim_trx->lock.was_chosen_as_wsrep_victim= true;
+ if (wsrep_thd_set_wsrep_aborter(bf_thd, thd))
+ {
+ WSREP_DEBUG("innodb kill transaction skipped due to wsrep_aborter set");
+ wsrep_thd_UNLOCK(thd);
+ DBUG_RETURN(0);
+ }
/* Note that we need to release this as it will be acquired
below in wsrep-lib */
wsrep_thd_UNLOCK(thd);
+ DEBUG_SYNC(bf_thd, "before_wsrep_thd_abort");
if (wsrep_thd_bf_abort(bf_thd, thd, signal))
{
@@ -19079,7 +18888,6 @@ wsrep_abort_transaction(
victim_trx, signal);
trx_mutex_exit(victim_trx);
lock_mutex_exit();
- wsrep_srv_conc_cancel_wait(victim_trx);
DBUG_RETURN(rcode);
} else {
wsrep_thd_bf_abort(bf_thd, victim_thd, signal);
@@ -19436,11 +19244,10 @@ static MYSQL_SYSVAR_ULONG(adaptive_hash_index_parts, btr_ahi_parts,
NULL, NULL, 8, 1, 512, 0);
#endif /* BTR_CUR_HASH_ADAPT */
-static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay,
+static MYSQL_SYSVAR_UINT(replication_delay, deprecated::replication_delay,
PLUGIN_VAR_RQCMDARG,
- "Replication thread delay (ms) on the slave server if"
- " innodb_thread_concurrency is reached (0 by default)",
- NULL, NULL, 0, 0, ~0UL, 0);
+ innodb_deprecated_ignored, nullptr, deprecated::replication_delay_warn,
+ 0, 0, ~0U, 0);
static MYSQL_SYSVAR_UINT(compression_level, page_zip_level,
PLUGIN_VAR_RQCMDARG,
@@ -19636,15 +19443,15 @@ static MYSQL_SYSVAR_ULONG(flush_neighbors, srv_flush_neighbors,
" when flushing a block",
NULL, NULL, 1, 0, 2, 0);
-static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
+static MYSQL_SYSVAR_UINT(commit_concurrency, deprecated::commit_concurrency,
PLUGIN_VAR_RQCMDARG,
- "Helps in performance tuning in heavily concurrent environments.",
- innobase_commit_concurrency_validate, NULL, 0, 0, 1000, 0);
+ innodb_deprecated_ignored, nullptr, deprecated::commit_concurrency_warn,
+ 0, 0, 1000, 0);
-static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter,
+static MYSQL_SYSVAR_UINT(concurrency_tickets, deprecated::concurrency_tickets,
PLUGIN_VAR_RQCMDARG,
- "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
- NULL, NULL, 5000L, 1L, ~0UL, 0);
+ innodb_deprecated_ignored, nullptr, deprecated::concurrency_tickets_warn,
+ 0, 0, ~0U, 0);
static MYSQL_SYSVAR_BOOL(deadlock_detect, innobase_deadlock_detect,
PLUGIN_VAR_NOCMDARG,
@@ -19793,19 +19600,16 @@ static MYSQL_SYSVAR_UINT(spin_wait_delay, srv_spin_wait_delay,
"Maximum delay between polling for a spin lock (4 by default)",
NULL, NULL, 4, 0, 6000, 0);
-static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
+static MYSQL_SYSVAR_UINT(thread_concurrency, deprecated::thread_concurrency,
PLUGIN_VAR_RQCMDARG,
- "Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.",
- NULL, NULL, 0, 0, 1000, 0);
+ innodb_deprecated_ignored, nullptr, deprecated::thread_concurrency_warn,
+ 0, 0, 1000, 0);
-static MYSQL_SYSVAR_ULONG(
- adaptive_max_sleep_delay, srv_adaptive_max_sleep_delay,
+static MYSQL_SYSVAR_UINT(
+ adaptive_max_sleep_delay, deprecated::adaptive_max_sleep_delay,
PLUGIN_VAR_RQCMDARG,
- "The upper limit of the sleep delay in usec. Value of 0 disables it.",
- NULL, NULL,
- 150000, /* Default setting */
- 0, /* Minimum value */
- 1000000, 0); /* Maximum value */
+ innodb_deprecated_ignored,
+ nullptr, deprecated::adaptive_max_sleep_delay_warn, 0, 0, 1000000, 0);
static MYSQL_SYSVAR_BOOL(prefix_index_cluster_optimization,
srv_prefix_index_cluster_optimization,
@@ -19813,14 +19617,10 @@ static MYSQL_SYSVAR_BOOL(prefix_index_cluster_optimization,
"Enable prefix optimization to sometimes avoid cluster index lookups.",
NULL, NULL, FALSE);
-static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
+static MYSQL_SYSVAR_UINT(thread_sleep_delay, deprecated::thread_sleep_delay,
PLUGIN_VAR_RQCMDARG,
- "Time of innodb thread sleeping before joining InnoDB queue (usec)."
- " Value 0 disable a sleep",
- NULL, NULL,
- 10000L,
- 0L,
- 1000000L, 0);
+ innodb_deprecated_ignored, nullptr, deprecated::thread_sleep_delay_warn,
+ 0, 0, 1000000, 0);
static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
@@ -20493,24 +20293,6 @@ i_s_innodb_sys_semaphore_waits,
i_s_innodb_tablespaces_encryption
maria_declare_plugin_end;
-/** @brief Initialize the default value of innodb_commit_concurrency.
-
-Once InnoDB is running, the innodb_commit_concurrency must not change
-from zero to nonzero. (Bug #42101)
-
-The initial default value is 0, and without this extra initialization,
-SET GLOBAL innodb_commit_concurrency=DEFAULT would set the parameter
-to 0, even if it was initially set to nonzero at the command line
-or configuration file. */
-static
-void
-innobase_commit_concurrency_init_default()
-/*======================================*/
-{
- MYSQL_SYSVAR_NAME(commit_concurrency).def_val
- = innobase_commit_concurrency;
-}
-
/** @brief Adjust some InnoDB startup parameters based on file contents
or innodb_page_size. */
static
@@ -21055,6 +20837,31 @@ bool ha_innobase::rowid_filter_push(Rowid_filter* pk_filter)
DBUG_RETURN(false);
}
+static bool is_part_of_a_key_prefix(const Field_longstr *field)
+{
+ const TABLE_SHARE *s= field->table->s;
+
+ for (uint i= 0; i < s->keys; i++)
+ {
+ const KEY &key= s->key_info[i];
+ for (uint j= 0; j < key.user_defined_key_parts; j++)
+ {
+ const KEY_PART_INFO &info= key.key_part[j];
+ // When field is a part of some key, a key part and field will have the
+ // same length. And their length will be different when only some prefix
+ // of a field is used as a key part. That's what we're looking for here.
+ if (info.field->field_index == field->field_index &&
+ info.length != field->field_length)
+ {
+ DBUG_ASSERT(info.length < field->field_length);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
static bool
is_part_of_a_primary_key(const Field* field)
{
@@ -21064,43 +20871,40 @@ is_part_of_a_primary_key(const Field* field)
&& field->part_of_key.is_set(s->primary_key);
}
-bool
-ha_innobase::can_convert_string(const Field_string* field,
- const Column_definition& new_type) const
+bool ha_innobase::can_convert_string(const Field_string *field,
+ const Column_definition &new_type) const
{
- DBUG_ASSERT(!field->compression_method());
- if (new_type.type_handler() != field->type_handler()) {
- return false;
- }
+ DBUG_ASSERT(!field->compression_method());
+ if (new_type.type_handler() != field->type_handler())
+ return false;
- if (new_type.char_length < field->char_length()) {
- return false;
- }
+ if (new_type.char_length != field->char_length())
+ return false;
- if (new_type.charset != field->charset()) {
- if (new_type.length != field->max_display_length()
- && !m_prebuilt->table->not_redundant()) {
- return IS_EQUAL_NO;
- }
+ const Charset field_cs(field->charset());
- Charset field_cs(field->charset());
- if (!field_cs.encoding_allows_reinterpret_as(
- new_type.charset)) {
- return false;
- }
+ if (new_type.length != field->max_display_length() &&
+ (!m_prebuilt->table->not_redundant() ||
+ field_cs.mbminlen() == field_cs.mbmaxlen()))
+ return false;
- if (!field_cs.eq_collation_specific_names(new_type.charset)) {
- return !is_part_of_a_primary_key(field);
- }
+ if (new_type.charset != field->charset())
+ {
+ if (!field_cs.encoding_allows_reinterpret_as(new_type.charset))
+ return false;
- return true;
- }
+ if (!field_cs.eq_collation_specific_names(new_type.charset))
+ return !is_part_of_a_primary_key(field);
- if (new_type.length != field->max_display_length()) {
- return false;
- }
+ // Fully indexed case works instantly like
+ // Compare_keys::EqualButKeyPartLength. But prefix case isn't implemented.
+ if (is_part_of_a_key_prefix(field))
+ return false;
- return true;
+ return true;
+ }
+
+ return true;
}
static bool
@@ -21111,88 +20915,100 @@ supports_enlarging(const dict_table_t* table, const Field_varstring* field,
|| field->field_length > 255 || !table->not_redundant();
}
-bool
-ha_innobase::can_convert_varstring(const Field_varstring* field,
- const Column_definition& new_type) const
+bool ha_innobase::can_convert_varstring(
+ const Field_varstring *field, const Column_definition &new_type) const
{
- if (new_type.length < field->field_length) {
- return false;
- }
+ if (new_type.length < field->field_length)
+ return false;
- if (new_type.char_length < field->char_length()) {
- return false;
- }
+ if (new_type.char_length < field->char_length())
+ return false;
- if (!new_type.compression_method() != !field->compression_method()) {
- return false;
- }
+ if (!new_type.compression_method() != !field->compression_method())
+ return false;
- if (new_type.type_handler() != field->type_handler()) {
- return false;
- }
+ if (new_type.type_handler() != field->type_handler())
+ return false;
- if (new_type.charset != field->charset()) {
- if (!supports_enlarging(m_prebuilt->table, field, new_type)) {
- return false;
- }
+ if (new_type.charset != field->charset())
+ {
+ if (!supports_enlarging(m_prebuilt->table, field, new_type))
+ return false;
- Charset field_cs(field->charset());
- if (!field_cs.encoding_allows_reinterpret_as(
- new_type.charset)) {
- return false;
- }
+ Charset field_cs(field->charset());
+ if (!field_cs.encoding_allows_reinterpret_as(new_type.charset))
+ return false;
- if (!field_cs.eq_collation_specific_names(new_type.charset)) {
- return !is_part_of_a_primary_key(field);
- }
+ if (!field_cs.eq_collation_specific_names(new_type.charset))
+ return !is_part_of_a_primary_key(field);
- return true;
- }
+ // Fully indexed case works instantly like
+ // Compare_keys::EqualButKeyPartLength. But prefix case isn't implemented.
+ if (is_part_of_a_key_prefix(field))
+ return false;
- if (new_type.length != field->field_length) {
- if (!supports_enlarging(m_prebuilt->table, field, new_type)) {
- return false;
- }
+ return true;
+ }
- return true;
- }
+ if (new_type.length != field->field_length)
+ {
+ if (!supports_enlarging(m_prebuilt->table, field, new_type))
+ return false;
- return true;
+ return true;
+ }
+
+ return true;
}
-bool
-ha_innobase::can_convert_blob(const Field_blob* field,
- const Column_definition& new_type) const
+static bool is_part_of_a_key(const Field_blob *field)
{
- if (new_type.type_handler() != field->type_handler()) {
- return false;
- }
+ const TABLE_SHARE *s= field->table->s;
- if (!new_type.compression_method() != !field->compression_method()) {
- return false;
- }
+ for (uint i= 0; i < s->keys; i++)
+ {
+ const KEY &key= s->key_info[i];
+ for (uint j= 0; j < key.user_defined_key_parts; j++)
+ {
+ const KEY_PART_INFO &info= key.key_part[j];
+ if (info.field->field_index == field->field_index)
+ return true;
+ }
+ }
- if (new_type.pack_length != field->pack_length()) {
- return false;
- }
+ return false;
+}
- if (new_type.charset != field->charset()) {
- Charset field_cs(field->charset());
- if (!field_cs.encoding_allows_reinterpret_as(
- new_type.charset)) {
- return false;
- }
+bool ha_innobase::can_convert_blob(const Field_blob *field,
+ const Column_definition &new_type) const
+{
+ if (new_type.type_handler() != field->type_handler())
+ return false;
- if (!field_cs.eq_collation_specific_names(new_type.charset)) {
- bool is_part_of_a_key
- = !field->part_of_key.is_clear_all();
- return !is_part_of_a_key;
- }
+ if (!new_type.compression_method() != !field->compression_method())
+ return false;
- return true;
- }
+ if (new_type.pack_length != field->pack_length())
+ return false;
+
+ if (new_type.charset != field->charset())
+ {
+ Charset field_cs(field->charset());
+ if (!field_cs.encoding_allows_reinterpret_as(new_type.charset))
+ return false;
+
+ if (!field_cs.eq_collation_specific_names(new_type.charset))
+ return !is_part_of_a_key(field);
+
+ // Fully indexed case works instantly like
+ // Compare_keys::EqualButKeyPartLength. But prefix case isn't implemented.
+ if (is_part_of_a_key_prefix(field))
+ return false;
+
+ return true;
+ }
- return true;
+ return true;
}
Compare_keys ha_innobase::compare_key_parts(
@@ -21818,3 +21634,70 @@ ib_push_frm_error(
break;
}
}
+
+/** Writes 8 bytes to nth tuple field
+@param[in] tuple where to write
+@param[in] nth index in tuple
+@param[in] data what to write
+@param[in] buf field data buffer */
+static void set_tuple_col_8(dtuple_t *tuple, int col, uint64_t data, byte *buf)
+{
+ dfield_t *dfield= dtuple_get_nth_field(tuple, col);
+ ut_ad(dfield->type.len == 8);
+ if (dfield->len == UNIV_SQL_NULL)
+ {
+ dfield_set_data(dfield, buf, 8);
+ }
+ ut_ad(dfield->len == dfield->type.len && dfield->data);
+ mach_write_to_8(dfield->data, data);
+}
+
+void ins_node_t::vers_update_end(row_prebuilt_t *prebuilt, bool history_row)
+{
+ ut_ad(prebuilt->ins_node == this);
+ trx_t *trx= prebuilt->trx;
+#ifndef DBUG_OFF
+ ut_ad(table->vers_start != table->vers_end);
+ const mysql_row_templ_t *t= prebuilt->get_template_by_col(table->vers_end);
+ ut_ad(t);
+ ut_ad(t->mysql_col_len == 8);
+#endif
+
+ if (history_row)
+ {
+ set_tuple_col_8(row, table->vers_end, trx->id, vers_end_buf);
+ }
+ else /* ROW_INS_VERSIONED */
+ {
+ set_tuple_col_8(row, table->vers_end, TRX_ID_MAX, vers_end_buf);
+#ifndef DBUG_OFF
+ t= prebuilt->get_template_by_col(table->vers_start);
+ ut_ad(t);
+ ut_ad(t->mysql_col_len == 8);
+#endif
+ set_tuple_col_8(row, table->vers_start, trx->id, vers_start_buf);
+ }
+ dict_index_t *clust_index= dict_table_get_first_index(table);
+ THD *thd= trx->mysql_thd;
+ TABLE *mysql_table= prebuilt->m_mysql_table;
+ mem_heap_t *local_heap= NULL;
+ for (ulint col_no= 0; col_no < dict_table_get_n_v_cols(table); col_no++)
+ {
+
+ const dict_v_col_t *v_col= dict_table_get_nth_v_col(table, col_no);
+ for (ulint i= 0; i < unsigned(v_col->num_base); i++)
+ {
+ dict_col_t *base_col= v_col->base_col[i];
+ if (base_col->ind == table->vers_end)
+ {
+ innobase_get_computed_value(row, v_col, clust_index, &local_heap,
+ table->heap, NULL, thd, mysql_table,
+ mysql_table->record[0], NULL, NULL, NULL);
+ }
+ }
+ }
+ if (local_heap)
+ {
+ mem_heap_free(local_heap);
+ }
+}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index f878a483019..253675266c9 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -169,8 +169,6 @@ inline void dict_table_t::init_instant(const dict_table_t& table)
ut_d(unsigned n_nullable = 0);
for (unsigned i = u; i < index.n_fields; i++) {
auto& f = index.fields[i];
- DBUG_ASSERT(dict_col_get_fixed_size(f.col, not_redundant())
- <= DICT_MAX_FIXED_COL_LEN);
ut_d(n_nullable += f.col->is_nullable());
if (!f.col->is_dropped()) {
@@ -215,6 +213,9 @@ inline void dict_table_t::prepare_instant(const dict_table_t& old,
DBUG_ASSERT(old.n_cols == old.n_def);
DBUG_ASSERT(n_cols == n_def);
DBUG_ASSERT(old.supports_instant());
+ DBUG_ASSERT(not_redundant() == old.not_redundant());
+ DBUG_ASSERT(DICT_TF_HAS_ATOMIC_BLOBS(flags)
+ == DICT_TF_HAS_ATOMIC_BLOBS(old.flags));
DBUG_ASSERT(!persistent_autoinc
|| persistent_autoinc == old.persistent_autoinc);
/* supports_instant() does not necessarily hold here,
@@ -6123,6 +6124,15 @@ prepare_inplace_alter_table_dict(
user_table = ctx->new_table;
+ if (ha_alter_info->inplace_supported == HA_ALTER_INPLACE_INSTANT) {
+ /* If we promised ALGORITHM=INSTANT capability, we must
+ retain the original ROW_FORMAT of the table. */
+ flags = (user_table->flags & (DICT_TF_MASK_COMPACT
+ | DICT_TF_MASK_ATOMIC_BLOBS))
+ | (flags & ~(DICT_TF_MASK_COMPACT
+ | DICT_TF_MASK_ATOMIC_BLOBS));
+ }
+
trx_start_if_not_started_xa(ctx->prebuilt->trx, true);
if (ha_alter_info->handler_flags
@@ -11060,11 +11070,6 @@ foreign_fail:
crash_inject_count++);
}
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
if (fail) {
for (inplace_alter_handler_ctx** pctx = ctx_array;
*pctx; pctx++) {
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 0f1fe0bf814..897bda85d9b 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -470,8 +470,7 @@ fill_innodb_trx_from_cache(
row->trx_rows_modified, true));
/* trx_concurrency_tickets */
- OK(fields[IDX_TRX_CONNCURRENCY_TICKETS]->store(
- row->trx_concurrency_tickets, true));
+ OK(fields[IDX_TRX_CONNCURRENCY_TICKETS]->store(0, true));
/* trx_isolation_level */
OK(fields[IDX_TRX_ISOLATION_LEVEL]->store(
@@ -2046,7 +2045,7 @@ i_s_metrics_fill(
time_diff = 0;
}
- /* Unless MONITOR__NO_AVERAGE is marked, we will need
+ /* Unless MONITOR_NO_AVERAGE is set, we must
to calculate the average value. If this is a monitor set
owner marked by MONITOR_SET_OWNER, divide
the value by another counter (number of calls) designated
@@ -2054,8 +2053,9 @@ i_s_metrics_fill(
Otherwise average the counter value by the time between the
time that the counter is enabled and time it is disabled
or time it is sampled. */
- if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE)
- && (monitor_info->monitor_type & MONITOR_SET_OWNER)
+ if ((monitor_info->monitor_type
+ & (MONITOR_NO_AVERAGE | MONITOR_SET_OWNER))
+ == MONITOR_SET_OWNER
&& monitor_info->monitor_related_id) {
mon_type_t value_start
= MONITOR_VALUE_SINCE_START(
@@ -2071,18 +2071,18 @@ i_s_metrics_fill(
fields[METRIC_AVG_VALUE_START]->set_null();
}
- if (MONITOR_VALUE(monitor_info->monitor_related_id)) {
- OK(fields[METRIC_AVG_VALUE_RESET]->store(
- MONITOR_VALUE(count)
- / MONITOR_VALUE(
- monitor_info->monitor_related_id),
- FALSE));
+ if (mon_type_t related_value =
+ MONITOR_VALUE(monitor_info->monitor_related_id)) {
+ OK(fields[METRIC_AVG_VALUE_RESET]
+ ->store(MONITOR_VALUE(count)
+ / related_value, false));
+ fields[METRIC_AVG_VALUE_RESET]->set_notnull();
} else {
fields[METRIC_AVG_VALUE_RESET]->set_null();
}
- } else if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE)
- && !(monitor_info->monitor_type
- & MONITOR_DISPLAY_CURRENT)) {
+ } else if (!(monitor_info->monitor_type
+ & (MONITOR_NO_AVERAGE
+ | MONITOR_DISPLAY_CURRENT))) {
if (time_diff != 0) {
OK(fields[METRIC_AVG_VALUE_START]->store(
(double) MONITOR_VALUE_SINCE_START(
@@ -2817,6 +2817,8 @@ no_fts:
conv_str.f_len = sizeof word;
conv_str.f_str = word;
+ rw_lock_s_lock(&cache->lock);
+
for (ulint i = 0; i < ib_vector_size(cache->indexes); i++) {
fts_index_cache_t* index_cache;
@@ -2827,6 +2829,7 @@ no_fts:
index_cache, thd, &conv_str, tables));
}
+ rw_lock_s_unlock(&cache->lock);
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_sys.latch);
@@ -7165,9 +7168,8 @@ i_s_innodb_mutexes_fill_table(
TABLE_LIST* tables, /*!< in/out: tables to fill */
Item* ) /*!< in: condition (not used) */
{
- rw_lock_t* lock;
ulint block_lock_oswait_count = 0;
- rw_lock_t* block_lock = NULL;
+ const rw_lock_t* block_lock= nullptr;
Field** fields = tables->table->field;
DBUG_ENTER("i_s_innodb_mutexes_fill_table");
@@ -7210,32 +7212,31 @@ i_s_innodb_mutexes_fill_table(
char lock_name[sizeof "buf0dump.cc:12345"];
- for (lock = UT_LIST_GET_FIRST(rw_lock_list); lock != NULL;
- lock = UT_LIST_GET_NEXT(list, lock)) {
- if (lock->count_os_wait == 0) {
+ for (const rw_lock_t& lock : rw_lock_list) {
+ if (lock.count_os_wait == 0) {
continue;
}
- if (buf_pool.is_block_lock(lock)) {
- block_lock = lock;
- block_lock_oswait_count += lock->count_os_wait;
+ if (buf_pool.is_block_lock(&lock)) {
+ block_lock = &lock;
+ block_lock_oswait_count += lock.count_os_wait;
continue;
}
const char* basename = innobase_basename(
- lock->cfile_name);
+ lock.cfile_name);
snprintf(lock_name, sizeof lock_name, "%s:%u",
- basename, lock->cline);
+ basename, lock.cline);
OK(field_store_string(fields[MUTEXES_NAME],
lock_name));
OK(field_store_string(fields[MUTEXES_CREATE_FILE],
basename));
- OK(fields[MUTEXES_CREATE_LINE]->store(lock->cline,
+ OK(fields[MUTEXES_CREATE_LINE]->store(lock.cline,
true));
fields[MUTEXES_CREATE_LINE]->set_notnull();
- OK(fields[MUTEXES_OS_WAITS]->store(lock->count_os_wait,
+ OK(fields[MUTEXES_OS_WAITS]->store(lock.count_os_wait,
true));
fields[MUTEXES_OS_WAITS]->set_notnull();
OK(schema_table_store_record(thd, tables->table));
diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h
index 781041bdfd4..385c249d9d5 100644
--- a/storage/innobase/handler/i_s.h
+++ b/storage/innobase/handler/i_s.h
@@ -63,7 +63,6 @@ extern struct st_maria_plugin i_s_innodb_sys_datafiles;
extern struct st_maria_plugin i_s_innodb_mutexes;
extern struct st_maria_plugin i_s_innodb_sys_virtual;
extern struct st_maria_plugin i_s_innodb_tablespaces_encryption;
-extern struct st_maria_plugin i_s_innodb_tablespaces_scrubbing;
extern struct st_maria_plugin i_s_innodb_sys_semaphore_waits;
/** The latest successfully looked up innodb_fts_aux_table */
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 9ae9eb6580c..a3ed5b104c6 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -1309,7 +1309,7 @@ ibuf_dummy_index_create(
dict_index_t* index;
table = dict_mem_table_create("IBUF_DUMMY", NULL, n, 0,
- comp ? DICT_TF_COMPACT : 0, 0);
+ comp ? DICT_TF_COMPACT : 0, 0, false);
index = dict_mem_index_create(table, "IBUF_DUMMY", 0, n);
diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h
index d345e7b254f..dc28d15b391 100644
--- a/storage/innobase/include/btr0bulk.h
+++ b/storage/innobase/include/btr0bulk.h
@@ -118,6 +118,9 @@ public:
dirs, and set page header members. */
inline void finish();
+ /** @return whether finish() actually needs to do something */
+ inline bool needs_finish() const;
+
/** Commit mtr for a page
@param[in] success Flag whether all inserts succeed. */
void commit(bool success);
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index 99aa787df79..03ebf6f448f 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -69,7 +69,6 @@ struct btr_latch_leaves_t {
#include "que0types.h"
#include "row0types.h"
-#include "ha0ha.h"
#ifdef UNIV_DEBUG
/*********************************************************//**
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index e316e1b7dab..20bf8d5b24b 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1186,9 +1186,6 @@ struct buf_block_t{
# define assert_block_ahi_empty_on_init(block) /* nothing */
# define assert_block_ahi_valid(block) /* nothing */
#endif /* BTR_CUR_HASH_ADAPT */
- bool skip_flush_check;
- /*!< Skip check in buf_dblwr_check_block
- during bulk load, protected by lock.*/
# ifdef UNIV_DEBUG
/** @name Debug fields */
/* @{ */
@@ -1201,12 +1198,11 @@ struct buf_block_t{
void fix() { page.fix(); }
uint32_t unfix()
{
- uint32_t fix_count= page.unfix();
- ut_ad(fix_count || page.io_fix() != BUF_IO_NONE ||
+ ut_ad(page.buf_fix_count() || page.io_fix() != BUF_IO_NONE ||
page.state() == BUF_BLOCK_ZIP_PAGE ||
!rw_lock_own_flagged(&lock, RW_LOCK_FLAG_X | RW_LOCK_FLAG_S |
RW_LOCK_FLAG_SX));
- return fix_count;
+ return page.unfix();
}
/** @return the physical size, in bytes */
@@ -1828,11 +1824,12 @@ public:
{
/** Number of array[] elements per page_hash_latch.
Must be one less than a power of 2. */
- static constexpr size_t ELEMENTS_PER_LATCH= 1023;
+ static constexpr size_t ELEMENTS_PER_LATCH= CPU_LEVEL1_DCACHE_LINESIZE /
+ sizeof(void*) - 1;
/** number of payload elements in array[] */
Atomic_relaxed<ulint> n_cells;
- /** the hash array, with pad(n_cells) elements */
+ /** the hash table, with pad(n_cells) elements, aligned to L1 cache size */
hash_cell_t *array;
/** Create the hash table.
@@ -1840,7 +1837,7 @@ public:
void create(ulint n);
/** Free the hash table. */
- void free() { ut_free(array); array= nullptr; }
+ void free() { aligned_free(array); array= nullptr; }
/** @return the index of an array element */
ulint calc_hash(ulint fold) const { return calc_hash(fold, n_cells); }
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 2a153f448e9..b5319d51c9a 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -336,7 +336,6 @@ UNIV_INLINE
void
dict_table_autoinc_initialize(dict_table_t* table, ib_uint64_t value)
{
- ut_ad(mutex_own(&table->autoinc_mutex));
table->autoinc = value;
}
@@ -349,7 +348,6 @@ UNIV_INLINE
ib_uint64_t
dict_table_autoinc_read(const dict_table_t* table)
{
- ut_ad(mutex_own(&table->autoinc_mutex));
return(table->autoinc);
}
@@ -363,8 +361,6 @@ UNIV_INLINE
bool
dict_table_autoinc_update_if_greater(dict_table_t* table, ib_uint64_t value)
{
- ut_ad(mutex_own(&table->autoinc_mutex));
-
if (value > table->autoinc) {
table->autoinc = value;
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 694c7081574..81a76ac8bab 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -52,6 +52,7 @@ Created 1/8/1996 Heikki Tuuri
#include <algorithm>
#include <iterator>
#include <ostream>
+#include <mutex>
/* Forward declaration. */
struct ib_rbt_t;
@@ -297,22 +298,21 @@ parent table will fail, and user has to drop excessive foreign constraint
before proceeds. */
#define FK_MAX_CASCADE_DEL 15
-/**********************************************************************//**
-Creates a table memory object.
+/** Creates a table memory object.
+@param[in] name table name
+@param[in] space tablespace
+@param[in] n_cols total number of columns including virtual and
+ non-virtual columns
+@param[in] n_v_cols number of virtual columns
+@param[in] flags table flags
+@param[in] flags2 table flags2
+@param[in] init_stats_latch whether to init the stats latch
@return own: table object */
-dict_table_t*
-dict_mem_table_create(
-/*==================*/
- const char* name, /*!< in: table name */
- fil_space_t* space, /*!< in: tablespace */
- ulint n_cols, /*!< in: total number of columns
- including virtual and non-virtual
- columns */
- ulint n_v_cols, /*!< in: number of virtual columns */
- ulint flags, /*!< in: table flags */
- ulint flags2); /*!< in: table flags2 */
-/****************************************************************//**
-Free a table memory object. */
+dict_table_t *dict_mem_table_create(const char *name, fil_space_t *space,
+ ulint n_cols, ulint n_v_cols, ulint flags,
+ ulint flags2, bool init_stats_latch= true);
+/****************************************************************/ /**
+ Free a table memory object. */
void
dict_mem_table_free(
/*================*/
@@ -933,7 +933,9 @@ extern ulong zip_pad_max;
an uncompressed page should be left as padding to avoid compression
failures. This estimate is based on a self-adapting heuristic. */
struct zip_pad_info_t {
- SysMutex mutex; /*!< mutex protecting the info */
+ /** Dummy assignment operator for dict_index_t::clone() */
+ zip_pad_info_t &operator=(const zip_pad_info_t&) { return *this; }
+ std::mutex mutex; /*!< mutex protecting the info */
Atomic_relaxed<ulint>
pad; /*!< number of bytes used as pad */
ulint success;/*!< successful compression ops during
@@ -2146,6 +2148,8 @@ public:
performance reasons. */
rw_lock_t stats_latch;
+ bool stats_latch_inited= false;
+
/** TRUE if statistics have been calculated the first time after
database startup or table creation. */
unsigned stat_initialized:1;
@@ -2269,7 +2273,7 @@ public:
lock_t* autoinc_lock;
/** Mutex protecting the autoincrement counter. */
- ib_mutex_t autoinc_mutex;
+ std::mutex autoinc_mutex;
/** Autoinc counter value to give to the next inserted row. */
ib_uint64_t autoinc;
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 6bc150184ef..a29f1e9fe4c 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -132,6 +132,20 @@ class range_set
{
private:
range_set_t ranges;
+
+ range_set_t::iterator find(uint32_t value) const
+ {
+ auto r_offset= ranges.lower_bound({value, value});
+ const auto r_end= ranges.end();
+ if (r_offset != r_end);
+ else if (empty())
+ return r_end;
+ else
+ r_offset= std::prev(r_end);
+ if (r_offset->first <= value && r_offset->last >= value)
+ return r_offset;
+ return r_end;
+ }
public:
/** Merge the current range with previous range.
@param[in] range range to be merged
@@ -194,7 +208,7 @@ public:
@param[in] value Value to be removed. */
void remove_value(uint32_t value)
{
- if (ranges.empty())
+ if (empty())
return;
range_t new_range {value, value};
range_set_t::iterator range= ranges.lower_bound(new_range);
@@ -273,6 +287,22 @@ new_range:
add_range(new_range);
}
+ bool remove_if_exists(uint32_t value)
+ {
+ auto r_offset= find(value);
+ if (r_offset != ranges.end())
+ {
+ remove_within_range(r_offset, value);
+ return true;
+ }
+ return false;
+ }
+
+ bool contains(uint32_t value) const
+ {
+ return find(value) != ranges.end();
+ }
+
ulint size() { return ranges.size(); }
void clear() { ranges.clear(); }
bool empty() const { return ranges.empty(); }
@@ -326,6 +356,8 @@ struct fil_space_t
/*!< recovered tablespace size in pages;
0 if no size change was read from the redo log,
or if the size change was implemented */
+ /** the committed size of the tablespace in pages */
+ Atomic_relaxed<ulint> committed_size;
ulint n_reserved_extents;
/*!< number of reserved free extents for
ongoing operations like B-tree page split */
@@ -386,6 +418,15 @@ struct fil_space_t
/** @return whether the tablespace is about to be dropped */
bool is_stopping() const { return stop_new_ops; }
+ /** Clamp a page number for batched I/O, such as read-ahead.
+ @param offset page number limit
+ @return offset clamped to the tablespace size */
+ ulint max_page_number_for_io(ulint offset) const
+ {
+ const ulint limit= committed_size;
+ return limit > offset ? offset : limit;
+ }
+
/** @return whether doublewrite buffering is needed */
bool use_doublewrite() const
{
@@ -1327,15 +1368,6 @@ inline void fil_node_t::complete_io(bool write)
#include "fil0crypt.h"
-/** Returns the latch of a file space.
-@param[in] id space id
-@param[out] flags tablespace flags
-@return latch protecting storage allocation */
-rw_lock_t*
-fil_space_get_latch(
- ulint id,
- ulint* flags);
-
/** Create a space memory object and put it to the fil_system hash table.
Error messages are issued to the server log.
@param[in] name tablespace name
@@ -1488,13 +1520,6 @@ fil_space_t*
fil_space_keyrotate_next(fil_space_t* prev_space, bool remove)
MY_ATTRIBUTE((warn_unused_result));
-/********************************************************//**
-Creates the database directory for a table if it does not exist yet. */
-void
-fil_create_directory_for_tablename(
-/*===============================*/
- const char* name); /*!< in: name in the standard
- 'databasename/tablename' format */
/** Replay a file rename operation if possible.
@param[in] space_id tablespace identifier
@param[in] name old file name
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index ef1174c95dd..0632c0c5140 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -110,10 +110,7 @@ innobase_convert_name(
/******************************************************************//**
Returns true if the thread is the replication thread on the slave
-server. Used in srv_conc_enter_innodb() to determine if the thread
-should be allowed to enter InnoDB - the replication thread is treated
-differently than other threads. Also used in
-srv_conc_force_exit_innodb().
+server.
@return true if thd is the replication thread */
ibool
thd_is_replication_slave_thread(
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic
index ba772359630..2c2620511c7 100644
--- a/storage/innobase/include/ibuf0ibuf.ic
+++ b/storage/innobase/include/ibuf0ibuf.ic
@@ -46,7 +46,7 @@ ibuf_mtr_start(
mtr->enter_ibuf();
if (high_level_read_only || srv_read_only_mode) {
- mtr_set_log_mode(mtr, MTR_LOG_NONE);
+ mtr_set_log_mode(mtr, MTR_LOG_NO_REDO);
}
}
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index 5e29a334d3a..fe36b3a5c83 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -116,23 +116,35 @@ struct log_rec_t
const lsn_t lsn;
};
-struct recv_dblwr_t {
- /** Add a page frame to the doublewrite recovery buffer. */
- void add(byte* page) {
- pages.push_front(page);
- }
-
- /** Find a doublewrite copy of a page.
- @param[in] space_id tablespace identifier
- @param[in] page_no page number
- @return page frame
- @retval NULL if no page was found */
- const byte* find_page(ulint space_id, ulint page_no);
-
- typedef std::deque<byte*, ut_allocator<byte*> > list;
-
- /** Recovered doublewrite buffer page frames */
- list pages;
+struct recv_dblwr_t
+{
+ /** Add a page frame to the doublewrite recovery buffer. */
+ void add(byte *page) { pages.push_front(page); }
+
+ /** Validate the page.
+ @param page_id page identifier
+ @param page page contents
+ @param space the tablespace of the page (not available for page 0)
+ @param tmp_buf 2*srv_page_size for decrypting and decompressing any
+ page_compressed or encrypted pages
+ @return whether the page is valid */
+ bool validate_page(const page_id_t page_id, const byte *page,
+ const fil_space_t *space, byte *tmp_buf);
+
+ /** Find a doublewrite copy of a page.
+ @param page_id page identifier
+ @param space tablespace (not available for page_id.page_no()==0)
+ @param tmp_buf 2*srv_page_size for decrypting and decompressing any
+ page_compressed or encrypted pages
+ @return page frame
+ @retval NULL if no valid page for page_id was found */
+ byte* find_page(const page_id_t page_id, const fil_space_t *space= NULL,
+ byte *tmp_buf= NULL);
+
+ typedef std::deque<byte*, ut_allocator<byte*> > list;
+
+ /** Recovered doublewrite buffer page frames */
+ list pages;
};
/** the recovery state and buffered records for a page */
diff --git a/storage/innobase/include/mtr0log.h b/storage/innobase/include/mtr0log.h
index 926411a6f97..ee611f6f2ee 100644
--- a/storage/innobase/include/mtr0log.h
+++ b/storage/innobase/include/mtr0log.h
@@ -511,7 +511,17 @@ inline void mtr_t::memcpy(const buf_block_t &b, void *dest, const void *str,
@param[in,out] b buffer page */
inline void mtr_t::init(buf_block_t *b)
{
- ut_ad(!m_freed_pages);
+ if (UNIV_LIKELY_NULL(m_freed_pages))
+ {
+ ut_ad(m_user_space->id == b->page.id().space());
+ if (m_freed_pages->remove_if_exists(b->page.id().page_no()) &&
+ m_freed_pages->empty())
+ {
+ delete m_freed_pages;
+ m_freed_pages= nullptr;
+ }
+ }
+
b->page.status= buf_page_t::INIT_ON_FLUSH;
if (m_log_mode != MTR_LOG_ALL)
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 6058d0daaf6..599da234904 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -141,10 +141,15 @@ struct mtr_t {
return static_cast<mtr_log_t>(m_log_mode);
}
- /** Change the logging mode.
- @param mode logging mode
- @return old mode */
- inline mtr_log_t set_log_mode(mtr_log_t mode);
+ /** Change the logging mode.
+ @param mode logging mode
+ @return old mode */
+ mtr_log_t set_log_mode(mtr_log_t mode)
+ {
+ const mtr_log_t old_mode= get_log_mode();
+ m_log_mode= mode & 3;
+ return old_mode;
+ }
/** Copy the tablespaces associated with the mini-transaction
(needed for generating FILE_MODIFY records)
@@ -264,7 +269,8 @@ struct mtr_t {
ut_ad(space->purpose == FIL_TYPE_TEMPORARY
|| space->purpose == FIL_TYPE_IMPORT
|| space->purpose == FIL_TYPE_TABLESPACE);
- x_lock(&space->latch, file, line);
+ memo_push(space, MTR_MEMO_SPACE_X_LOCK);
+ rw_lock_x_lock_inline(&space->latch, 0, file, line);
}
/** Release an object in the memo stack.
@@ -280,19 +286,13 @@ struct mtr_t {
private:
/** Note that the mini-transaction will modify data. */
void flag_modified() { m_modifications = true; }
-#ifdef UNIV_DEBUG
/** Mark the given latched page as modified.
@param block page that will be modified */
void modify(const buf_block_t& block);
public:
/** Note that the mini-transaction will modify a block. */
void set_modified(const buf_block_t &block)
- { flag_modified(); if (m_log_mode == MTR_LOG_ALL) modify(block); }
-#else /* UNIV_DEBUG */
-public:
- /** Note that the mini-transaction will modify a block. */
- void set_modified(const buf_block_t &) { flag_modified(); }
-#endif /* UNIV_DEBUG */
+ { flag_modified(); if (m_log_mode != MTR_LOG_NONE) modify(block); }
/** Set the state to not-modified. This will not log the changes.
This is only used during redo log apply, to avoid logging the changes. */
@@ -337,6 +337,12 @@ public:
@return whether (lock,type) is contained */
bool memo_contains(const rw_lock_t &lock, mtr_memo_type_t type)
MY_ATTRIBUTE((warn_unused_result));
+ /** Check if we are holding exclusive tablespace latch
+ @param space tablespace to search for
+ @return whether space.latch is being held */
+ bool memo_contains(const fil_space_t& space)
+ MY_ATTRIBUTE((warn_unused_result));
+
/** Check if memo contains the given item.
@param object object to search
diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic
index 16777da1044..9540290fd19 100644
--- a/storage/innobase/include/mtr0mtr.ic
+++ b/storage/innobase/include/mtr0mtr.ic
@@ -43,7 +43,7 @@ mtr_t::memo_push(void* object, mtr_memo_type_t type)
ut_ad(is_active());
ut_ad(object != NULL);
ut_ad(type >= MTR_MEMO_PAGE_S_FIX);
- ut_ad(type <= MTR_MEMO_SX_LOCK);
+ ut_ad(type <= MTR_MEMO_SPACE_X_LOCK);
ut_ad(ut_is_2pow(type));
/* If this mtr has x-fixed a clean page then we set
@@ -171,39 +171,3 @@ mtr_t::release_block_at_savepoint(
slot->object = NULL;
}
-
-/**
-Changes the logging mode of a mini-transaction.
-@return old mode */
-
-mtr_log_t
-mtr_t::set_log_mode(mtr_log_t mode)
-{
- ut_ad(mode >= MTR_LOG_ALL);
- ut_ad(mode <= MTR_LOG_NO_REDO);
-
- const mtr_log_t old_mode = get_log_mode();
-
- switch (old_mode) {
- case MTR_LOG_NO_REDO:
- /* Once this mode is set, it must not be changed. */
- ut_ad(mode == MTR_LOG_NO_REDO || mode == MTR_LOG_NONE);
- return(old_mode);
- case MTR_LOG_NONE:
- if (mode == old_mode) {
- /* Keep MTR_LOG_NONE. */
- return(old_mode);
- }
- ut_ad(mode == MTR_LOG_ALL);
- /* fall through */
- case MTR_LOG_ALL:
- /* MTR_LOG_NO_REDO can only be set before generating
- any redo log records. */
- ut_ad(mode != MTR_LOG_NO_REDO || m_log.empty());
- m_log_mode = mode & 3;
- return(old_mode);
- }
-
- ut_ad(0);
- return(old_mode);
-}
diff --git a/storage/innobase/include/mtr0types.h b/storage/innobase/include/mtr0types.h
index f110e45aad8..d1b6784ae86 100644
--- a/storage/innobase/include/mtr0types.h
+++ b/storage/innobase/include/mtr0types.h
@@ -41,8 +41,7 @@ enum mtr_log_t {
MTR_LOG_ALL = 0,
/** Log no operations and dirty pages are not added to the flush list.
- Set when applying log in crash recovery or when a modification of a
- ROW_FORMAT=COMPRESSED page is attempted. */
+ Set for attempting modification of a ROW_FORMAT=COMPRESSED page. */
MTR_LOG_NONE,
/** Don't generate REDO log but add dirty pages to flush list */
@@ -329,15 +328,19 @@ enum mtr_memo_type_t {
MTR_MEMO_BUF_FIX = RW_NO_LATCH,
-#ifdef UNIV_DEBUG
MTR_MEMO_MODIFY = 16,
-#endif /* UNIV_DEBUG */
+
+ MTR_MEMO_PAGE_X_MODIFY = MTR_MEMO_PAGE_X_FIX | MTR_MEMO_MODIFY,
+ MTR_MEMO_PAGE_SX_MODIFY = MTR_MEMO_PAGE_SX_FIX | MTR_MEMO_MODIFY,
MTR_MEMO_S_LOCK = RW_S_LATCH << 5,
MTR_MEMO_X_LOCK = RW_X_LATCH << 5,
- MTR_MEMO_SX_LOCK = RW_SX_LATCH << 5
+ MTR_MEMO_SX_LOCK = RW_SX_LATCH << 5,
+
+ /** acquire X-latch on fil_space_t::latch */
+ MTR_MEMO_SPACE_X_LOCK = MTR_MEMO_SX_LOCK << 1
};
#endif /* !UNIV_CHECKSUM */
diff --git a/storage/innobase/include/que0types.h b/storage/innobase/include/que0types.h
index d9005095d3c..38f6e380a30 100644
--- a/storage/innobase/include/que0types.h
+++ b/storage/innobase/include/que0types.h
@@ -35,6 +35,7 @@ typedef void que_node_t;
/* Query graph root is a fork node */
typedef struct que_fork_t que_t;
+struct row_prebuilt_t;
struct que_thr_t;
/* Query graph node types */
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index c51e831fb0e..0acff406326 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -810,8 +810,11 @@ rec_get_nth_cfield(
ulint n,
ulint* len)
{
- ut_ad(rec_offs_validate(rec, index, offsets));
-
+ /* Because this function may be invoked by innobase_rec_to_mysql()
+ for reporting a duplicate key during ALTER TABLE or
+ CREATE UNIQUE INDEX, and in that case the rec omit the fixed-size
+ header of 5 or 6 bytes, the check
+ rec_offs_validate(rec, index, offsets) must be avoided here. */
if (!rec_offs_nth_default(offsets, n)) {
return rec_get_nth_field(rec, offsets, n, len);
}
diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h
index 95f4388902d..34427dc6dc7 100644
--- a/storage/innobase/include/row0ins.h
+++ b/storage/innobase/include/row0ins.h
@@ -163,6 +163,8 @@ row_ins_step(
#define INS_NODE_INSERT_ENTRIES 3 /* index entries should be built and
inserted */
+struct row_prebuilt_t;
+
/** Insert node structure */
struct ins_node_t
{
@@ -203,6 +205,7 @@ struct ins_node_t
entry_list and sys fields are stored here;
if this is NULL, entry list should be created
and buffers for sys fields in row allocated */
+ void vers_update_end(row_prebuilt_t *prebuilt, bool history_row);
};
/** Create an insert object.
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h
index 65f70be7134..f9d949fc2d7 100644
--- a/storage/innobase/include/row0upd.h
+++ b/storage/innobase/include/row0upd.h
@@ -354,7 +354,32 @@ struct upd_t{
fields[n_fields++] = field;
}
- /** Determine if the given field_no is modified.
+ void remove_element(ulint i)
+ {
+ ut_ad(n_fields > 0);
+ ut_ad(i < n_fields);
+ while (i < n_fields - 1)
+ {
+ fields[i]= fields[i + 1];
+ i++;
+ }
+ n_fields--;
+ }
+
+ bool remove(const ulint field_no)
+ {
+ for (ulint i= 0; i < n_fields; ++i)
+ {
+ if (field_no == fields[i].field_no)
+ {
+ remove_element(i);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** Determine if the given field_no is modified.
@return true if modified, false otherwise. */
bool is_modified(uint16_t field_no) const
{
@@ -494,25 +519,25 @@ private:
make_versioned_delete().
@param[in] trx transaction
@param[in] vers_sys_idx table->row_start or table->row_end */
- void make_versioned_helper(const trx_t* trx, ulint idx);
+ void vers_update_fields(const trx_t *trx, ulint idx);
public:
/** Also set row_start = CURRENT_TIMESTAMP/trx->id
@param[in] trx transaction */
- void make_versioned_update(const trx_t* trx)
- {
- make_versioned_helper(trx, table->vers_start);
- }
+ void vers_make_update(const trx_t *trx)
+ {
+ vers_update_fields(trx, table->vers_start);
+ }
/** Only set row_end = CURRENT_TIMESTAMP/trx->id.
Do not touch other fields at all.
@param[in] trx transaction */
- void make_versioned_delete(const trx_t* trx)
- {
+ void vers_make_delete(const trx_t *trx)
+ {
update->n_fields = 0;
is_delete = VERSIONED_DELETE;
- make_versioned_helper(trx, table->vers_end);
- }
+ vers_update_fields(trx, table->vers_end);
+ }
};
#define UPD_NODE_MAGIC_N 1579975
diff --git a/storage/innobase/include/srv0conc.h b/storage/innobase/include/srv0conc.h
deleted file mode 100644
index d24107735ed..00000000000
--- a/storage/innobase/include/srv0conc.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
-
-Portions of this file contain modifications contributed and copyrighted by
-Google, Inc. Those modifications are gratefully acknowledged and are described
-briefly in the InnoDB documentation. The contributions by Google are
-incorporated with their permission, and subject to the conditions contained in
-the file COPYING.Google.
-
-Portions of this file contain modifications contributed and copyrighted
-by Percona Inc.. Those modifications are
-gratefully acknowledged and are described briefly in the InnoDB
-documentation. The contributions by Percona Inc. are incorporated with
-their permission, and subject to the conditions contained in the file
-COPYING.Percona.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file srv/srv0conc.h
-
-InnoDB concurrency manager header file
-
-Created 2011/04/18 Sunny Bains
-*******************************************************/
-
-#ifndef srv_conc_h
-#define srv_conc_h
-
-/** We are prepared for a situation that we have this many threads waiting for
-a semaphore inside InnoDB. srv_start() sets the value. */
-extern ulint srv_max_n_threads;
-
-/** The following controls how many threads we let inside InnoDB concurrently:
-threads waiting for locks are not counted into the number because otherwise
-we could get a deadlock. Value of 0 will disable the concurrency check. */
-
-extern ulong srv_thread_concurrency;
-
-struct row_prebuilt_t;
-/*********************************************************************//**
-Puts an OS thread to wait if there are too many concurrent threads
-(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue.
-@param[in,out] prebuilt row prebuilt handler */
-void
-srv_conc_enter_innodb(
- row_prebuilt_t* prebuilt);
-
-/*********************************************************************//**
-This lets a thread enter InnoDB regardless of the number of threads inside
-InnoDB. This must be called when a thread ends a lock wait. */
-void
-srv_conc_force_enter_innodb(
-/*========================*/
- trx_t* trx); /*!< in: transaction object associated with
- the thread */
-
-/*********************************************************************//**
-This must be called when a thread exits InnoDB in a lock wait or at the
-end of an SQL statement. */
-void
-srv_conc_force_exit_innodb(
-/*=======================*/
- trx_t* trx); /*!< in: transaction object associated with
- the thread */
-
-/*********************************************************************//**
-Get the count of threads waiting inside InnoDB. */
-ulint
-srv_conc_get_waiting_threads(void);
-/*==============================*/
-
-/*********************************************************************//**
-Get the count of threads active inside InnoDB. */
-ulint
-srv_conc_get_active_threads(void);
-/*==============================*/
-
-#endif /* srv_conc_h */
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index d4b6425c44b..57542b32719 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -39,14 +39,12 @@ The server main program
Created 10/10/1995 Heikki Tuuri
*******************************************************/
-#ifndef srv0srv_h
-#define srv0srv_h
+#pragma once
#include "log0log.h"
#include "os0event.h"
#include "que0types.h"
#include "trx0types.h"
-#include "srv0conc.h"
#include "fil0fil.h"
#include "mysql/psi/mysql_stage.h"
@@ -198,6 +196,10 @@ struct srv_stats_t
ulint_ctr_1_t lock_deadlock_count;
};
+/** We are prepared for a situation that we have this many threads waiting for
+a semaphore inside InnoDB. srv_start() sets the value. */
+extern ulint srv_max_n_threads;
+
extern const char* srv_main_thread_op_info;
/** Prefix used by MySQL to indicate pre-5.1 table name encoding */
@@ -246,10 +248,6 @@ extern my_bool high_level_read_only;
/** store to its own file each table created by an user; data
dictionary tables are in the system tablespace 0 */
extern my_bool srv_file_per_table;
-/** Sleep delay for threads waiting to enter InnoDB. In micro-seconds. */
-extern ulong srv_thread_sleep_delay;
-/** Maximum sleep delay (in micro-seconds), value of 0 disables it.*/
-extern ulong srv_adaptive_max_sleep_delay;
/** Sort buffer size in index creation */
extern ulong srv_sort_buf_size;
@@ -423,8 +421,6 @@ extern double srv_max_buf_pool_modified_pct;
extern ulong srv_max_purge_lag;
extern ulong srv_max_purge_lag_delay;
-extern ulong srv_replication_delay;
-
extern my_bool innodb_encrypt_temporary_tables;
extern my_bool srv_immediate_scrub_data_uncompressed;
@@ -455,8 +451,6 @@ extern bool srv_monitor_active;
extern ulong srv_n_spin_wait_rounds;
-extern ulong srv_n_free_tickets_to_enter;
-extern ulong srv_thread_sleep_delay;
extern uint srv_spin_wait_delay;
extern ulint srv_truncated_status_writes;
@@ -643,19 +637,6 @@ srv_reset_io_thread_op_info();
/** Wake up the purge if there is work to do. */
void
srv_wake_purge_thread_if_not_active();
-/** Wake up the InnoDB master thread */
-void
-srv_active_wake_master_thread_low();
-
-#define srv_active_wake_master_thread() \
- do { \
- if (!srv_read_only_mode) { \
- srv_active_wake_master_thread_low(); \
- } \
- } while (0)
-/** Wake up the master */
-void
-srv_wake_master_thread();
/******************************************************************//**
Outputs to a file the output of the InnoDB Monitor.
@@ -684,13 +665,13 @@ reading this value as it is only used in heuristics.
ulint
srv_get_activity_count(void);
/*========================*/
-/*******************************************************************//**
-Check if there has been any activity.
+
+/** Check if there has been any activity.
+@param[in,out] activity_count recent activity count to be returned
+if there is a change
@return FALSE if no change in activity counter. */
-ibool
-srv_check_activity(
-/*===============*/
- ulint old_activity_count); /*!< old activity count */
+bool srv_check_activity(ulint *activity_count);
+
/******************************************************************//**
Increment the server activity counter. */
void
@@ -955,14 +936,3 @@ static inline void srv_start_periodic_timer(std::unique_ptr<tpool::timer>& t,
void srv_thread_pool_init();
void srv_thread_pool_end();
-
-#ifdef WITH_WSREP
-UNIV_INTERN
-void
-wsrep_srv_conc_cancel_wait(
-/*==================*/
- trx_t* trx); /*!< in: transaction object associated with the
- thread */
-#endif /* WITH_WSREP */
-
-#endif
diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h
index 596f6d4f5ab..23dc8347129 100644
--- a/storage/innobase/include/srv0start.h
+++ b/storage/innobase/include/srv0start.h
@@ -24,8 +24,7 @@ Starts the Innobase database server
Created 10/10/1995 Heikki Tuuri
*******************************************************/
-#ifndef srv0start_h
-#define srv0start_h
+#pragma once
#include "log0log.h"
#include "ut0byte.h"
@@ -133,4 +132,3 @@ extern enum srv_shutdown_t srv_shutdown_state;
/** Files comprising the system tablespace */
extern pfs_os_file_t files[1000];
-#endif
diff --git a/storage/innobase/include/sync0policy.h b/storage/innobase/include/sync0policy.h
index 4fd03eaea06..68397827891 100644
--- a/storage/innobase/include/sync0policy.h
+++ b/storage/innobase/include/sync0policy.h
@@ -220,7 +220,8 @@ public:
meta.get_counter()->single_register(&m_count);
- sync_file_created_register(this, filename, uint16_t(line));
+ m_filename = filename;
+ m_line = line;
}
/** Called when the mutex is destroyed. */
@@ -230,8 +231,6 @@ public:
latch_meta_t& meta = sync_latch_get_meta(m_id);
meta.get_counter()->single_deregister(&m_count);
-
- sync_file_created_deregister(this);
}
/** Called after a successful mutex acquire.
@@ -272,13 +271,21 @@ public:
/** @return the string representation */
std::string to_string() const
- { return sync_mutex_to_string(get_id(), sync_file_created_get(this)); }
+ {
+ return sync_mutex_to_string(get_id(),
+ std::string(m_filename)
+ .append(":")
+ .append(std::to_string(m_line)));
+ }
#ifdef UNIV_DEBUG
MutexDebug<Mutex> context;
#endif
private:
+ const char *m_filename;
+ uint32_t m_line;
+
/** The user visible counters, registered with the meta-data. */
latch_meta_t::CounterType::Count m_count;
diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h
index 84f4957c4f6..e7bf694a4cc 100644
--- a/storage/innobase/include/sync0rw.h
+++ b/storage/innobase/include/sync0rw.h
@@ -36,6 +36,7 @@ Created 9/11/1995 Heikki Tuuri
#include "os0event.h"
#include "ut0mutex.h"
+#include "ilist.h"
/** Counters for RW locks. */
struct rw_lock_stats_t {
@@ -105,9 +106,7 @@ struct rw_lock_t;
struct rw_lock_debug_t;
#endif /* UNIV_DEBUG */
-typedef UT_LIST_BASE_NODE_T(rw_lock_t) rw_lock_list_t;
-
-extern rw_lock_list_t rw_lock_list;
+extern ilist<rw_lock_t> rw_lock_list;
extern ib_mutex_t rw_lock_list_mutex;
/** Counters for RW locks. */
@@ -562,11 +561,14 @@ readers, a writer may queue for x-lock by decrementing lock_word: no
new readers will be let in while the thread waits for readers to
exit. */
-struct rw_lock_t
+struct rw_lock_t :
#ifdef UNIV_DEBUG
- : public latch_t
+ public latch_t,
#endif /* UNIV_DEBUG */
+ public ilist_node<>
{
+ ut_d(bool created= false;)
+
/** Holds the state of the lock. */
Atomic_relaxed<int32_t> lock_word;
@@ -615,9 +617,6 @@ struct rw_lock_t
/** Count of os_waits. May not be accurate */
uint32_t count_os_wait;
- /** All allocated rw locks are put into a list */
- UT_LIST_NODE_T(rw_lock_t) list;
-
#ifdef UNIV_PFS_RWLOCK
/** The instrumentation hook */
struct PSI_rwlock* pfs_psi;
diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
index c63fedb43ee..062d7c8a2dc 100644
--- a/storage/innobase/include/sync0sync.h
+++ b/storage/innobase/include/sync0sync.h
@@ -50,7 +50,6 @@ instrumentation due to their large number of instances. */
#ifdef UNIV_PFS_MUTEX
/* Key defines to register InnoDB mutexes with performance schema */
-extern mysql_pfs_key_t autoinc_mutex_key;
extern mysql_pfs_key_t buf_pool_mutex_key;
extern mysql_pfs_key_t cache_last_read_mutex_key;
extern mysql_pfs_key_t dict_foreign_err_mutex_key;
@@ -102,7 +101,6 @@ extern mysql_pfs_key_t event_mutex_key;
extern mysql_pfs_key_t event_manager_mutex_key;
extern mysql_pfs_key_t sync_array_mutex_key;
extern mysql_pfs_key_t thread_mutex_key;
-extern mysql_pfs_key_t zip_pad_mutex_key;
extern mysql_pfs_key_t row_drop_list_mutex_key;
extern mysql_pfs_key_t rw_trx_hash_element_mutex_key;
extern mysql_pfs_key_t read_view_mutex_key;
diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h
index 0aa1326509e..160c0ff0e82 100644
--- a/storage/innobase/include/sync0types.h
+++ b/storage/innobase/include/sync0types.h
@@ -253,7 +253,6 @@ enum latch_level_t {
SYNC_IBUF_HEADER,
SYNC_DICT_HEADER,
SYNC_STATS_AUTO_RECALC,
- SYNC_DICT_AUTOINC_MUTEX,
SYNC_DICT,
SYNC_FTS_CACHE,
@@ -282,7 +281,6 @@ enum latch_level_t {
up its meta-data. See sync0debug.c. */
enum latch_id_t {
LATCH_ID_NONE = 0,
- LATCH_ID_AUTOINC,
LATCH_ID_BUF_POOL,
LATCH_ID_CACHE_LAST_READ,
LATCH_ID_DICT_FOREIGN_ERR,
@@ -332,7 +330,6 @@ enum latch_id_t {
LATCH_ID_EVENT_MANAGER,
LATCH_ID_EVENT_MUTEX,
LATCH_ID_SYNC_ARRAY_MUTEX,
- LATCH_ID_ZIP_PAD_MUTEX,
LATCH_ID_OS_AIO_READ_MUTEX,
LATCH_ID_OS_AIO_WRITE_MUTEX,
LATCH_ID_OS_AIO_LOG_MUTEX,
@@ -941,27 +938,6 @@ sync_latch_get_name(latch_level_t level);
const char*
sync_basename(const char* filename);
-/** Register a latch, called when it is created
-@param[in] ptr Latch instance that was created
-@param[in] filename Filename where it was created
-@param[in] line Line number in filename */
-void
-sync_file_created_register(
- const void* ptr,
- const char* filename,
- uint16_t line);
-
-/** Deregister a latch, called when it is destroyed
-@param[in] ptr Latch to be destroyed */
-void
-sync_file_created_deregister(const void* ptr);
-
-/** Get the string where the file was created. Its format is "name:line"
-@param[in] ptr Latch instance
-@return created information or "" if can't be found */
-std::string
-sync_file_created_get(const void* ptr);
-
#ifdef UNIV_DEBUG
/** All (ordered) latches, used in debugging, must derive from this class. */
diff --git a/storage/innobase/include/trx0i_s.h b/storage/innobase/include/trx0i_s.h
index 4eab97c0b02..892ee3cfe18 100644
--- a/storage/innobase/include/trx0i_s.h
+++ b/storage/innobase/include/trx0i_s.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -141,9 +141,6 @@ struct i_s_trx_row_t {
trx->lock_heap) */
ulint trx_rows_locked;/*!< lock_number_of_rows_locked() */
uintmax_t trx_rows_modified;/*!< trx_t::undo_no */
- ulint trx_concurrency_tickets;
- /*!< n_tickets_to_enter_innodb in
- trx_t */
uint trx_isolation_level;
/*!< trx_t::isolation_level */
bool trx_unique_checks;
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index 034552fc62e..20043a6c4a4 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -864,17 +864,6 @@ public:
ulint duplicates; /*!< TRX_DUP_IGNORE | TRX_DUP_REPLACE */
trx_dict_op_t dict_operation; /**< @see enum trx_dict_op_t */
- /* Fields protected by the srv_conc_mutex. */
- bool declared_to_be_inside_innodb;
- /*!< this is TRUE if we have declared
- this transaction in
- srv_conc_enter_innodb to be inside the
- InnoDB engine */
- ib_uint32_t n_tickets_to_enter_innodb;
- /*!< this can be > 0 only when
- declared_to_... is TRUE; when we come
- to srv_conc_innodb_enter, if the value
- here is > 0, we decrement this by 1 */
ib_uint32_t dict_operation_lock_mode;
/*!< 0, RW_S_LATCH, or RW_X_LATCH:
the latch mode trx currently holds
@@ -1018,10 +1007,6 @@ public:
/*!< Total table lock wait time
up to this moment. */
-#ifdef WITH_WSREP
- os_event_t wsrep_event; /* event waited for in srv_conc_slot */
-#endif /* WITH_WSREP */
-
rw_trx_hash_element_t *rw_trx_hash_element;
LF_PINS *rw_trx_hash_pins;
ulint magic_n;
diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc
index 7b184495aa3..6b6e2c04659 100644
--- a/storage/innobase/lock/lock0wait.cc
+++ b/storage/innobase/lock/lock0wait.cc
@@ -234,7 +234,6 @@ lock_wait_suspend_thread(
{
srv_slot_t* slot;
trx_t* trx;
- ibool was_declared_inside_innodb;
ulong lock_wait_timeout;
ut_a(lock_sys.timeout_timer.get());
@@ -329,16 +328,6 @@ lock_wait_suspend_thread(
/* Suspend this thread and wait for the event. */
- was_declared_inside_innodb = trx->declared_to_be_inside_innodb;
-
- if (was_declared_inside_innodb) {
- /* We must declare this OS thread to exit InnoDB, since a
- possible other thread holding a lock which this thread waits
- for must be allowed to enter, sooner or later */
-
- srv_conc_force_exit_innodb(trx);
- }
-
/* Unknown is also treated like a record lock */
if (lock_type == ULINT_UNDEFINED || lock_type == LOCK_REC) {
thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_LOCK);
@@ -354,13 +343,6 @@ lock_wait_suspend_thread(
/* After resuming, reacquire the data dictionary latch if
necessary. */
- if (was_declared_inside_innodb) {
-
- /* Return back inside InnoDB */
-
- srv_conc_force_enter_innodb(trx);
- }
-
if (had_dict_lock) {
row_mysql_freeze_data_dictionary(trx);
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 84589e7950f..62de68790ed 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -448,7 +448,7 @@ log_set_capacity(ulonglong file_size)
by single query steps: running out of free log space is a serious
system error which requires rebooting the database. */
- free = LOG_CHECKPOINT_FREE_PER_THREAD * (10 + srv_thread_concurrency)
+ free = LOG_CHECKPOINT_FREE_PER_THREAD * 10
+ LOG_CHECKPOINT_EXTRA_FREE;
if (free >= smallest_capacity / 2) {
ib::error() << "Cannot continue operation because log file is "
@@ -1642,6 +1642,9 @@ wait_suspend_loop:
"Waiting for page cleaner");
ib::info() << "Waiting for page_cleaner to "
"finish flushing of buffer pool";
+ /* This is a workaround to avoid the InnoDB hang
+ when OS datetime changed backwards */
+ os_event_set(buf_flush_event);
count = 0;
}
}
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 7afac5c7d54..791e13e014e 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -54,6 +54,7 @@ Created 9/20/1997 Heikki Tuuri
#include "buf0rea.h"
#include "srv0srv.h"
#include "srv0start.h"
+#include "fil0pagecompress.h"
/** Read-ahead area in applying log records to file pages */
#define RECV_READ_AHEAD_AREA 32U
@@ -1779,7 +1780,6 @@ append:
log_phys_t(start_lsn, lsn, l, len));
}
-#if 0 /* FIXME: MDEV-22970 Potential corruption */
/** Store/remove the freed pages in fil_name_t of recv_spaces.
@param[in] page_id freed or init page_id
@param[in] freed TRUE if page is freed */
@@ -1789,6 +1789,8 @@ static void store_freed_or_init_rec(page_id_t page_id, bool freed)
uint32_t page_no= page_id.page_no();
if (is_predefined_tablespace(space_id))
{
+ if (!srv_immediate_scrub_data_uncompressed)
+ return;
fil_space_t *space;
if (space_id == TRX_SYS_SPACE)
space= fil_system.sys_space;
@@ -1808,7 +1810,6 @@ static void store_freed_or_init_rec(page_id_t page_id, bool freed)
i->second.remove_freed_page(page_no);
}
}
-#endif
/** Parse and register one mini-transaction in log_t::FORMAT_10_5.
@param checkpoint_lsn the log sequence number of the latest checkpoint
@@ -2008,9 +2009,7 @@ same_page:
case INIT_PAGE:
last_offset= FIL_PAGE_TYPE;
free_or_init_page:
-#if 0 /* FIXME: MDEV-22970 Potential corruption */
store_freed_or_init_rec(id, (b & 0x70) == FREE_PAGE);
-#endif
if (UNIV_UNLIKELY(rlen != 0))
goto record_corrupted;
break;
@@ -2135,12 +2134,12 @@ same_page:
case STORE_NO:
if (!is_init)
continue;
+ mlog_init.add(id, start_lsn);
map::iterator i= pages.find(id);
if (i == pages.end())
continue;
i->second.log.clear();
pages.erase(i);
- mlog_init.add(id, start_lsn);
}
}
#if 1 /* MDEV-14425 FIXME: this must be in the checkpoint file only! */
@@ -2168,7 +2167,7 @@ same_page:
if (lsn == checkpoint_lsn)
{
- ut_ad(mlog_checkpoint_lsn <= recovered_lsn);
+ /* There can be multiple FILE_CHECKPOINT for the same LSN. */
if (mlog_checkpoint_lsn)
continue;
mlog_checkpoint_lsn= recovered_lsn;
@@ -2494,7 +2493,7 @@ void recv_recover_page(fil_space_t* space, buf_page_t* bpage)
{
mtr_t mtr;
mtr.start();
- mtr.set_log_mode(MTR_LOG_NONE);
+ mtr.set_log_mode(MTR_LOG_NO_REDO);
ut_ad(bpage->state() == BUF_BLOCK_FILE_PAGE);
buf_block_t* block = reinterpret_cast<buf_block_t*>(bpage);
@@ -2578,7 +2577,7 @@ inline buf_block_t *recv_sys_t::recover_low(const page_id_t page_id,
else if (fil_space_t *space= fil_space_acquire_for_io(page_id.space()))
{
mtr.start();
- mtr.set_log_mode(MTR_LOG_NONE);
+ mtr.set_log_mode(MTR_LOG_NO_REDO);
block= buf_page_create(space, page_id.page_no(), space->zip_size(), &mtr);
p= recv_sys.pages.find(page_id);
if (p == recv_sys.pages.end())
@@ -2695,7 +2694,7 @@ void recv_sys_t::apply(bool last_batch)
continue;
case page_recv_t::RECV_NOT_PROCESSED:
mtr.start();
- mtr.set_log_mode(MTR_LOG_NONE);
+ mtr.set_log_mode(MTR_LOG_NO_REDO);
if (buf_block_t *block= buf_page_get_low(page_id, 0, RW_X_LATCH,
nullptr, BUF_GET_IF_IN_POOL,
__FILE__, __LINE__,
@@ -3291,9 +3290,13 @@ recv_init_crash_recovery_spaces(bool rescan, bool& missing_tablespace)
/* Add the freed page ranges in the respective
tablespace */
- if (!rs.second.freed_ranges.empty())
- rs.second.space->add_free_ranges(
+ if (!rs.second.freed_ranges.empty()
+ && (srv_immediate_scrub_data_uncompressed
+ || rs.second.space->is_compressed())) {
+
+ rs.second.space->add_free_ranges(
std::move(rs.second.freed_ranges));
+ }
} else if (rs.second.name == "") {
ib::error() << "Missing FILE_CREATE, FILE_DELETE"
" or FILE_MODIFY before FILE_CHECKPOINT"
@@ -3540,6 +3543,8 @@ completed:
rescan = true;
}
+ recv_sys.parse_start_lsn = checkpoint_lsn;
+
if (srv_operation == SRV_OPERATION_NORMAL) {
buf_dblwr_process();
}
@@ -3669,25 +3674,92 @@ recv_recovery_from_checkpoint_finish(void)
ut_d(sync_check_enable());
}
-/** Find a doublewrite copy of a page.
-@param[in] space_id tablespace identifier
-@param[in] page_no page number
-@return page frame
-@retval NULL if no page was found */
-const byte*
-recv_dblwr_t::find_page(ulint space_id, ulint page_no)
+bool recv_dblwr_t::validate_page(const page_id_t page_id,
+ const byte *page,
+ const fil_space_t *space,
+ byte *tmp_buf)
+{
+ if (page_id.page_no() == 0)
+ {
+ ulint flags= fsp_header_get_flags(page);
+ if (!fil_space_t::is_valid_flags(flags, page_id.space()))
+ {
+ ulint cflags= fsp_flags_convert_from_101(flags);
+ if (cflags == ULINT_UNDEFINED)
+ {
+ ib::warn() << "Ignoring a doublewrite copy of page " << page_id
+ << "due to invalid flags " << ib::hex(flags);
+ return false;
+ }
+
+ flags= cflags;
+ }
+
+ /* Page 0 is never page_compressed or encrypted. */
+ return !buf_page_is_corrupted(true, page, flags);
+ }
+
+ ut_ad(tmp_buf);
+ byte *tmp_frame= tmp_buf;
+ byte *tmp_page= tmp_buf + srv_page_size;
+ const uint16_t page_type= mach_read_from_2(page + FIL_PAGE_TYPE);
+ const bool expect_encrypted= space->crypt_data &&
+ space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED;
+
+ if (space->full_crc32())
+ return !buf_page_is_corrupted(true, page, space->flags);
+
+ if (expect_encrypted &&
+ mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION))
+ {
+ if (!fil_space_verify_crypt_checksum(page, space->zip_size()))
+ return false;
+ if (page_type != FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED)
+ return true;
+ if (space->zip_size())
+ return false;
+ memcpy(tmp_page, page, space->physical_size());
+ if (!fil_space_decrypt(space, tmp_frame, tmp_page))
+ return false;
+ }
+
+ switch (page_type) {
+ case FIL_PAGE_PAGE_COMPRESSED:
+ memcpy(tmp_page, page, space->physical_size());
+ /* fall through */
+ case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
+ if (space->zip_size())
+ return false; /* ROW_FORMAT=COMPRESSED cannot be page_compressed */
+ ulint decomp= fil_page_decompress(tmp_frame, tmp_page, space->flags);
+ if (!decomp)
+ return false; /* decompression failed */
+ if (decomp == srv_page_size)
+ return false; /* the page was not compressed (invalid page type) */
+ return !buf_page_is_corrupted(true, tmp_page, space->flags);
+ }
+
+ return !buf_page_is_corrupted(true, page, space->flags);
+}
+
+byte *recv_dblwr_t::find_page(const page_id_t page_id,
+ const fil_space_t *space, byte *tmp_buf)
{
- const byte *result= NULL;
+ byte *result= NULL;
lsn_t max_lsn= 0;
- for (const byte *page : pages)
+ for (byte *page : pages)
{
- if (page_get_page_no(page) != page_no ||
- page_get_space_id(page) != space_id)
+ if (page_get_page_no(page) != page_id.page_no() ||
+ page_get_space_id(page) != page_id.space())
continue;
const lsn_t lsn= mach_read_from_8(page + FIL_PAGE_LSN);
- if (lsn <= max_lsn)
+ if (lsn <= max_lsn ||
+ !validate_page(page_id, page, space, tmp_buf))
+ {
+ /* Mark processed for subsequent iterations in buf_dblwr_process() */
+ memset(page + FIL_PAGE_LSN, 0, 8);
continue;
+ }
max_lsn= lsn;
result= page;
}
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 940429b2cd6..94a88bd3f83 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -205,28 +205,37 @@ private:
static void memo_slot_release(mtr_memo_slot_t *slot)
{
switch (slot->type) {
-#ifdef UNIV_DEBUG
- default:
- ut_ad("invalid type" == 0);
- break;
- case MTR_MEMO_MODIFY:
- break;
-#endif /* UNIV_DEBUG */
case MTR_MEMO_S_LOCK:
rw_lock_s_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
break;
case MTR_MEMO_SX_LOCK:
rw_lock_sx_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
break;
+ case MTR_MEMO_SPACE_X_LOCK:
+ {
+ fil_space_t *space= static_cast<fil_space_t*>(slot->object);
+ space->committed_size= space->size;
+ rw_lock_x_unlock(&space->latch);
+ }
+ break;
case MTR_MEMO_X_LOCK:
rw_lock_x_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
break;
- case MTR_MEMO_BUF_FIX:
- case MTR_MEMO_PAGE_S_FIX:
- case MTR_MEMO_PAGE_SX_FIX:
- case MTR_MEMO_PAGE_X_FIX:
+ default:
+#ifdef UNIV_DEBUG
+ switch (slot->type & ~MTR_MEMO_MODIFY) {
+ case MTR_MEMO_BUF_FIX:
+ case MTR_MEMO_PAGE_S_FIX:
+ case MTR_MEMO_PAGE_SX_FIX:
+ case MTR_MEMO_PAGE_X_FIX:
+ break;
+ default:
+ ut_ad("invalid type" == 0);
+ break;
+ }
+#endif /* UNIV_DEBUG */
buf_block_t *block= reinterpret_cast<buf_block_t*>(slot->object);
- buf_page_release_latch(block, slot->type);
+ buf_page_release_latch(block, slot->type & ~MTR_MEMO_MODIFY);
block->unfix();
break;
}
@@ -241,28 +250,37 @@ struct ReleaseLatches {
if (!slot->object)
return true;
switch (slot->type) {
-#ifdef UNIV_DEBUG
- default:
- ut_ad("invalid type" == 0);
- break;
- case MTR_MEMO_MODIFY:
- break;
-#endif /* UNIV_DEBUG */
case MTR_MEMO_S_LOCK:
rw_lock_s_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
break;
+ case MTR_MEMO_SPACE_X_LOCK:
+ {
+ fil_space_t *space= static_cast<fil_space_t*>(slot->object);
+ space->committed_size= space->size;
+ rw_lock_x_unlock(&space->latch);
+ }
+ break;
case MTR_MEMO_X_LOCK:
rw_lock_x_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
break;
case MTR_MEMO_SX_LOCK:
rw_lock_sx_unlock(reinterpret_cast<rw_lock_t*>(slot->object));
break;
- case MTR_MEMO_BUF_FIX:
- case MTR_MEMO_PAGE_S_FIX:
- case MTR_MEMO_PAGE_SX_FIX:
- case MTR_MEMO_PAGE_X_FIX:
+ default:
+#ifdef UNIV_DEBUG
+ switch (slot->type & ~MTR_MEMO_MODIFY) {
+ case MTR_MEMO_BUF_FIX:
+ case MTR_MEMO_PAGE_S_FIX:
+ case MTR_MEMO_PAGE_SX_FIX:
+ case MTR_MEMO_PAGE_X_FIX:
+ break;
+ default:
+ ut_ad("invalid type" == 0);
+ break;
+ }
+#endif /* UNIV_DEBUG */
buf_block_t *block= reinterpret_cast<buf_block_t*>(slot->object);
- buf_page_release_latch(block, slot->type);
+ buf_page_release_latch(block, slot->type & ~MTR_MEMO_MODIFY);
block->unfix();
break;
}
@@ -294,50 +312,42 @@ struct DebugCheck {
};
#endif
-/** Release a resource acquired by the mini-transaction. */
-struct ReleaseBlocks {
- /** Release specific object */
- ReleaseBlocks(lsn_t start_lsn, lsn_t end_lsn)
- :
- m_end_lsn(end_lsn),
- m_start_lsn(start_lsn)
- {
- /* Do nothing */
- }
-
- /** Add the modified page to the buffer flush list. */
- void add_dirty_page_to_flush_list(mtr_memo_slot_t* slot) const
- {
- ut_ad(m_end_lsn > 0);
- ut_ad(m_start_lsn > 0);
-
- buf_block_t* block;
-
- block = reinterpret_cast<buf_block_t*>(slot->object);
-
- buf_flush_note_modification(block, m_start_lsn, m_end_lsn);
- }
-
- /** @return true always. */
- bool operator()(mtr_memo_slot_t* slot) const
- {
- if (slot->object != NULL) {
-
- if (slot->type == MTR_MEMO_PAGE_X_FIX
- || slot->type == MTR_MEMO_PAGE_SX_FIX) {
-
- add_dirty_page_to_flush_list(slot);
- }
- }
+/** Release page latches held by the mini-transaction. */
+struct ReleaseBlocks
+{
+ const lsn_t start, end;
+#ifdef UNIV_DEBUG
+ const mtr_buf_t &memo;
- return(true);
- }
+ ReleaseBlocks(lsn_t start, lsn_t end, const mtr_buf_t &memo) :
+ start(start), end(end), memo(memo)
+#else /* UNIV_DEBUG */
+ ReleaseBlocks(lsn_t start, lsn_t end, const mtr_buf_t&) :
+ start(start), end(end)
+#endif /* UNIV_DEBUG */
+ {
+ ut_ad(start);
+ ut_ad(end);
+ }
- /** Mini-transaction REDO start LSN */
- lsn_t m_end_lsn;
+ /** @return true always */
+ bool operator()(mtr_memo_slot_t* slot) const
+ {
+ if (!slot->object)
+ return true;
+ switch (slot->type) {
+ case MTR_MEMO_PAGE_X_MODIFY:
+ case MTR_MEMO_PAGE_SX_MODIFY:
+ break;
+ default:
+ ut_ad(!(slot->type & MTR_MEMO_MODIFY));
+ return true;
+ }
- /** Mini-transaction REDO end LSN */
- lsn_t m_start_lsn;
+ buf_flush_note_modification(static_cast<buf_block_t*>(slot->object),
+ start, end);
+ return true;
+ }
};
/** Write the block contents to the REDO log */
@@ -427,7 +437,7 @@ void mtr_t::commit()
freed_space= fil_system.sys_space;
}
- ut_ad(memo_contains(freed_space->latch, MTR_MEMO_X_LOCK));
+ ut_ad(memo_contains(*freed_space));
/* Update the last freed lsn */
freed_space->update_last_freed_lsn(m_commit_lsn);
@@ -443,7 +453,8 @@ void mtr_t::commit()
}
m_memo.for_each_block_in_reverse(CIterate<const ReleaseBlocks>
- (ReleaseBlocks(start_lsn, m_commit_lsn)));
+ (ReleaseBlocks(start_lsn, m_commit_lsn,
+ m_memo)));
if (m_made_dirty)
log_flush_order_mutex_exit();
@@ -719,6 +730,18 @@ bool mtr_t::memo_contains(const rw_lock_t &lock, mtr_memo_type_t type)
return true;
}
+/** Check if we are holding exclusive tablespace latch
+@param space tablespace to search for
+@return whether space.latch is being held */
+bool mtr_t::memo_contains(const fil_space_t& space)
+{
+ Iterate<Find> iteration(Find(&space, MTR_MEMO_SPACE_X_LOCK));
+ if (m_memo.for_each_block_in_reverse(iteration))
+ return false;
+ ut_ad(rw_lock_own(const_cast<rw_lock_t*>(&space.latch), RW_LOCK_X));
+ return true;
+}
+
/** Debug check for flags */
struct FlaggedCheck {
FlaggedCheck(const void* ptr, ulint flags)
@@ -808,19 +831,32 @@ mtr_t::memo_contains_page_flagged(
? NULL : iteration.functor.get_block();
}
+/** Print info of an mtr handle. */
+void
+mtr_t::print() const
+{
+ ib::info() << "Mini-transaction handle: memo size "
+ << m_memo.size() << " bytes log size "
+ << get_log()->size() << " bytes";
+}
+
+#endif /* UNIV_DEBUG */
+
+
/** Find a block, preferrably in MTR_MEMO_MODIFY state */
struct FindModified
{
- const mtr_memo_slot_t *found= nullptr;
+ mtr_memo_slot_t *found= nullptr;
const buf_block_t& block;
FindModified(const buf_block_t &block) : block(block) {}
- bool operator()(const mtr_memo_slot_t* slot)
+ bool operator()(mtr_memo_slot_t *slot)
{
if (slot->object != &block)
return true;
found= slot;
- return slot->type != MTR_MEMO_MODIFY;
+ return !(slot->type & (MTR_MEMO_MODIFY |
+ MTR_MEMO_PAGE_X_FIX | MTR_MEMO_PAGE_SX_FIX));
}
};
@@ -828,20 +864,20 @@ struct FindModified
@param block page that will be modified */
void mtr_t::modify(const buf_block_t &block)
{
- Iterate<FindModified> iteration(block);
- m_memo.for_each_block_in_reverse(iteration);
- ut_ad(iteration.functor.found);
- if (iteration.functor.found->type != MTR_MEMO_MODIFY)
- memo_push(const_cast<buf_block_t*>(&block), MTR_MEMO_MODIFY);
-}
+ if (UNIV_UNLIKELY(m_memo.empty()))
+ {
+ /* This must be PageConverter::update_page() in IMPORT TABLESPACE. */
+ ut_ad(!block.page.in_LRU_list);
+ ut_ad(!buf_pool.is_uncompressed(&block));
+ return;
+ }
-/** Print info of an mtr handle. */
-void
-mtr_t::print() const
-{
- ib::info() << "Mini-transaction handle: memo size "
- << m_memo.size() << " bytes log size "
- << get_log()->size() << " bytes";
+ Iterate<FindModified> iteration((FindModified(block)));
+ if (UNIV_UNLIKELY(m_memo.for_each_block(iteration)))
+ {
+ ut_ad("modifying an unlatched page" == 0);
+ return;
+ }
+ iteration.functor.found->type= static_cast<mtr_memo_type_t>
+ (iteration.functor.found->type | MTR_MEMO_MODIFY);
}
-
-#endif /* UNIV_DEBUG */
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 12ad59bcff2..8f0e8e99bd0 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -4573,14 +4573,19 @@ invalid:
space->flags = (space->flags & FSP_FLAGS_MEM_MASK) | flags;
+ space->punch_hole = space->is_compressed();
this->size = ulint(size_bytes / psize);
- space->size += this->size;
+ space->committed_size = space->size += this->size;
} else if (space->id != TRX_SYS_SPACE || space->size_in_header) {
/* If this is not the first-time open, do nothing.
For the system tablespace, we always get invoked as
first=false, so we detect the true first-time-open based
- on size_in_header and proceed to initiailze the data. */
+ on size_in_header and proceed to initialize the data. */
return true;
+ } else {
+ /* Initialize the size of predefined tablespaces
+ to FSP_SIZE. */
+ space->committed_size = size;
}
ut_ad(space->free_limit == 0 || space->free_limit == free_limit);
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index 36fdde82cb3..5f42deaaf8e 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -1493,7 +1493,10 @@ inc_dir:
rec_set_bit_field_1(next_rec, n_owned + 1, REC_NEW_N_OWNED,
REC_N_OWNED_MASK, REC_N_OWNED_SHIFT);
if (mtr->get_log_mode() != MTR_LOG_ALL)
+ {
+ mtr->set_modified(*block);
goto copied;
+ }
const byte * const c_start= cur->rec - extra_size;
if (extra_size > REC_N_NEW_EXTRA_BYTES &&
@@ -1532,7 +1535,10 @@ inc_dir:
rec_set_bit_field_1(next_rec, n_owned + 1, REC_OLD_N_OWNED,
REC_N_OWNED_MASK, REC_N_OWNED_SHIFT);
if (mtr->get_log_mode() != MTR_LOG_ALL)
+ {
+ mtr->set_modified(*block);
goto copied;
+ }
ut_ad(extra_size > REC_N_OLD_EXTRA_BYTES);
const byte * const c_start= cur->rec - extra_size;
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index 474884d1d4c..a04537ea6c3 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/page/page0page.cc
@@ -1608,10 +1608,9 @@ page_simple_validate_old(
n_slots = page_dir_get_n_slots(page);
- if (UNIV_UNLIKELY(n_slots > srv_page_size / 4)) {
- ib::error() << "Nonsensical number " << n_slots
- << " of page dir slots";
-
+ if (UNIV_UNLIKELY(n_slots < 2 || n_slots > srv_page_size / 4)) {
+ ib::error() << "Nonsensical number of page dir slots: "
+ << n_slots;
goto func_exit;
}
@@ -1808,10 +1807,9 @@ page_simple_validate_new(
n_slots = page_dir_get_n_slots(page);
- if (UNIV_UNLIKELY(n_slots > srv_page_size / 4)) {
- ib::error() << "Nonsensical number " << n_slots
- << " of page dir slots";
-
+ if (UNIV_UNLIKELY(n_slots < 2 || n_slots > srv_page_size / 4)) {
+ ib::error() << "Nonsensical number of page dir slots: "
+ << n_slots;
goto func_exit;
}
@@ -2023,6 +2021,7 @@ func_exit2:
<< " of table " << index->table->name;
return FALSE;
}
+
if (page_is_comp(page)) {
if (UNIV_UNLIKELY(!page_simple_validate_new(page))) {
goto func_exit2;
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index 0f6a1c33e54..12c8731ed3d 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -1628,7 +1628,7 @@ page_zip_fields_free(
{
if (index) {
dict_table_t* table = index->table;
- mutex_free(&index->zip_pad.mutex);
+ index->zip_pad.mutex.~mutex();
mem_heap_free(index->heap);
dict_mem_table_free(table);
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 9612d95690b..9fc7425957a 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -234,7 +234,7 @@ public:
memset(&m_cur, 0x0, sizeof(m_cur));
/* Make page_cur_delete_rec() happy. */
m_mtr.start();
- m_mtr.set_log_mode(MTR_LOG_NONE);
+ m_mtr.set_log_mode(MTR_LOG_NO_REDO);
}
/** Position the cursor on the first user record. */
@@ -560,14 +560,6 @@ protected:
/** Space id of the file being iterated over. */
ulint m_space;
- /** Minimum page number for which the free list has not been
- initialized: the pages >= this limit are, by definition, free;
- note that in a single-table tablespace where size < 64 pages,
- this number is 64, i.e., we have initialized the space about
- the first extent, but have not physically allocted those pages
- to the file. @see FSP_LIMIT. */
- ulint m_free_limit;
-
/** Current size of the space in pages */
ulint m_size;
@@ -627,7 +619,6 @@ AbstractCallback::init(
}
m_size = mach_read_from_4(page + FSP_SIZE);
- m_free_limit = mach_read_from_4(page + FSP_FREE_LIMIT);
if (m_space == ULINT_UNDEFINED) {
m_space = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_ID
+ page);
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 0f1e8007d36..cdd12a10cf7 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -2224,8 +2224,14 @@ row_ins_duplicate_online(
return(DB_SUCCESS);
}
- if (fields == n_uniq + 2) {
- /* rec is an exact match of entry. */
+ ulint trx_id_len;
+
+ if (fields == n_uniq + 2
+ && memcmp(rec_get_nth_field(rec, offsets, n_uniq, &trx_id_len),
+ reset_trx_id, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN)) {
+ ut_ad(trx_id_len == DATA_TRX_ID_LEN);
+ /* rec is an exact match of entry, and DB_TRX_ID belongs
+ to a transaction that started after our ALTER TABLE. */
return(DB_SUCCESS_LOCKED_REC);
}
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 20f06fc5444..f7868135a94 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -1331,23 +1331,6 @@ row_mysql_get_table_status(
return(err);
}
-/** Writes 8 bytes to nth tuple field
-@param[in] tuple where to write
-@param[in] nth index in tuple
-@param[in] data what to write
-@param[in] buf field data buffer */
-static
-void
-set_tuple_col_8(dtuple_t* tuple, int col, uint64_t data, byte* buf) {
- dfield_t* dfield = dtuple_get_nth_field(tuple, col);
- ut_ad(dfield->type.len == 8);
- if (dfield->len == UNIV_SQL_NULL) {
- dfield_set_data(dfield, buf, 8);
- }
- ut_ad(dfield->len == dfield->type.len && dfield->data);
- mach_write_to_8(dfield->data, data);
-}
-
/** Does an insert for MySQL.
@param[in] mysql_rec row in the MySQL format
@param[in,out] prebuilt prebuilt struct in MySQL handle
@@ -1415,29 +1398,8 @@ row_insert_for_mysql(
&blob_heap);
if (ins_mode != ROW_INS_NORMAL) {
-#ifndef DBUG_OFF
- ut_ad(table->vers_start != table->vers_end);
- const mysql_row_templ_t* t
- = prebuilt->get_template_by_col(table->vers_end);
- ut_ad(t);
- ut_ad(t->mysql_col_len == 8);
-#endif
-
- if (ins_mode == ROW_INS_HISTORICAL) {
- set_tuple_col_8(node->row, table->vers_end, trx->id,
- node->vers_end_buf);
- } else /* ROW_INS_VERSIONED */ {
- set_tuple_col_8(node->row, table->vers_end, TRX_ID_MAX,
- node->vers_end_buf);
-#ifndef DBUG_OFF
- t = prebuilt->get_template_by_col(table->vers_start);
- ut_ad(t);
- ut_ad(t->mysql_col_len == 8);
-#endif
- set_tuple_col_8(node->row, table->vers_start, trx->id,
- node->vers_start_buf);
- }
- }
+ node->vers_update_end(prebuilt, ins_mode == ROW_INS_HISTORICAL);
+ }
savept = trx_savept_take(trx);
@@ -1871,10 +1833,10 @@ row_update_for_mysql(row_prebuilt_t* prebuilt)
if (prebuilt->versioned_write) {
if (node->is_delete == VERSIONED_DELETE) {
- node->make_versioned_delete(trx);
- } else if (node->update->affects_versioned()) {
- node->make_versioned_update(trx);
- }
+ node->vers_make_delete(trx);
+ } else if (node->update->affects_versioned()) {
+ node->vers_make_update(trx);
+ }
}
for (;;) {
@@ -2230,14 +2192,14 @@ row_update_cascade_for_mysql(
if (table->versioned()) {
if (node->is_delete == PLAIN_DELETE) {
- node->make_versioned_delete(trx);
- } else if (node->update->affects_versioned()) {
+ node->vers_make_delete(trx);
+ } else if (node->update->affects_versioned()) {
dberr_t err = row_update_vers_insert(thr, node);
if (err != DB_SUCCESS) {
return err;
}
- node->make_versioned_update(trx);
- }
+ node->vers_make_update(trx);
+ }
}
for (;;) {
@@ -3845,7 +3807,7 @@ funct_exit_all_freed:
trx->op_info = "";
- srv_wake_master_thread();
+ srv_inc_activity_count();
DBUG_RETURN(err);
}
diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc
index 05c1f7a32c1..ff50e4f1510 100644
--- a/storage/innobase/row/row0quiesce.cc
+++ b/storage/innobase/row/row0quiesce.cc
@@ -659,13 +659,18 @@ row_quiesce_set_state(
" FTS auxiliary tables will not be flushed.");
}
+ dict_index_t* clust_index = dict_table_get_first_index(table);
+
row_mysql_lock_data_dictionary(trx);
- for (dict_index_t* index = dict_table_get_first_index(table);
+
+ for (dict_index_t* index = dict_table_get_next_index(clust_index);
index != NULL;
index = dict_table_get_next_index(index)) {
rw_lock_x_lock(&index->lock);
}
+ rw_lock_x_lock(&clust_index->lock);
+
switch (state) {
case QUIESCE_START:
break;
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index fe81cb46916..2639f3ec7ea 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -3173,34 +3173,59 @@ Supposed to be called only by make_versioned_update() and
make_versioned_delete().
@param[in] trx transaction
@param[in] vers_sys_idx table->row_start or table->row_end */
-void upd_node_t::make_versioned_helper(const trx_t* trx, ulint idx)
+void upd_node_t::vers_update_fields(const trx_t *trx, ulint idx)
{
- ut_ad(in_mysql_interface); // otherwise needs to recalculate
- // node->cmpl_info
- ut_ad(idx == table->vers_start || idx == table->vers_end);
-
- dict_index_t* clust_index = dict_table_get_first_index(table);
-
- /* row_create_update_node_for_mysql() pre-allocated this much.
- At least one PK column always remains unchanged. */
- ut_ad(update->n_fields < ulint(table->n_cols + table->n_v_cols));
-
- update->n_fields++;
- upd_field_t* ufield = upd_get_nth_field(update, update->n_fields - 1);
- const dict_col_t* col = dict_table_get_nth_col(table, idx);
-
- upd_field_set_field_no(ufield, static_cast<uint16_t>(
- dict_col_get_clust_pos(
- col, clust_index)),
- clust_index);
-
- char* where = reinterpret_cast<char*>(update->vers_sys_value);
- if (col->vers_native()) {
- mach_write_to_8(where, trx->id);
- } else {
- thd_get_query_start_data(trx->mysql_thd, where);
- }
-
- dfield_set_data(&ufield->new_val, update->vers_sys_value, col->len);
+ ut_ad(in_mysql_interface); // otherwise needs to recalculate node->cmpl_info
+ ut_ad(idx == table->vers_start || idx == table->vers_end);
+
+ dict_index_t *clust_index= dict_table_get_first_index(table);
+ const dict_col_t *col= dict_table_get_nth_col(table, idx);
+ ulint field_no= dict_col_get_clust_pos(col, clust_index);
+ upd_field_t *ufield;
+
+ for (ulint i= 0; i < update->n_fields; ++i)
+ {
+ if (update->fields[i].field_no == field_no)
+ {
+ ufield= &update->fields[i];
+ goto skip_append;
+ }
+ }
+
+ /* row_create_update_node_for_mysql() pre-allocated this much.
+ At least one PK column always remains unchanged. */
+ ut_ad(update->n_fields < ulint(table->n_cols + table->n_v_cols));
+
+ update->n_fields++;
+ ufield= upd_get_nth_field(update, update->n_fields - 1);
+ upd_field_set_field_no(ufield, static_cast<uint16_t>(field_no), clust_index);
+
+skip_append:
+ char *where= reinterpret_cast<char *>(update->vers_sys_value);
+ if (col->vers_native())
+ mach_write_to_8(where, trx->id);
+ else
+ thd_get_query_start_data(trx->mysql_thd, where);
+
+ dfield_set_data(&ufield->new_val, update->vers_sys_value, col->len);
+
+ for (ulint col_no= 0; col_no < dict_table_get_n_v_cols(table); col_no++)
+ {
+ const dict_v_col_t *v_col= dict_table_get_nth_v_col(table, col_no);
+ if (!v_col->m_col.ord_part)
+ continue;
+ for (ulint i= 0; i < unsigned(v_col->num_base); i++)
+ {
+ dict_col_t *base_col= v_col->base_col[i];
+ if (base_col->ind == col->ind)
+ {
+ /* Virtual column depends on system field value
+ which we updated above. Remove it from update
+ vector, so it is recalculated in
+ row_upd_store_v_row() (see !update branch). */
+ update->remove(v_col->v_pos);
+ break;
+ }
+ }
+ }
}
-
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index d84747c9007..eb948855032 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -93,7 +93,7 @@ row_vers_impl_x_locked_low(
trx_id_t trx_id;
rec_t* prev_version = NULL;
rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE];
- rec_offs* clust_offsets = clust_offsets_;
+ rec_offs* clust_offsets;
mem_heap_t* heap;
dtuple_t* ientry = NULL;
mem_heap_t* v_heap = NULL;
@@ -115,7 +115,7 @@ row_vers_impl_x_locked_low(
heap = mem_heap_create(1024);
- clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets,
+ clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets_,
true, ULINT_UNDEFINED, &heap);
trx_id = row_get_rec_trx_id(clust_rec, clust_index, clust_offsets);
@@ -204,7 +204,7 @@ row_vers_impl_x_locked_low(
ut_ad(committed || prev_version
|| !rec_get_deleted_flag(version, comp));
- /* Free version. */
+ /* Free version and clust_offsets. */
mem_heap_free(old_heap);
if (committed) {
@@ -239,7 +239,7 @@ not_locked:
}
clust_offsets = rec_get_offsets(
- prev_version, clust_index, clust_offsets, true,
+ prev_version, clust_index, clust_offsets_, true,
ULINT_UNDEFINED, &heap);
vers_del = rec_get_deleted_flag(prev_version, comp);
diff --git a/storage/innobase/srv/srv0conc.cc b/storage/innobase/srv/srv0conc.cc
deleted file mode 100644
index 07e0299dc98..00000000000
--- a/storage/innobase/srv/srv0conc.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2020, MariaDB Corporation.
-
-Portions of this file contain modifications contributed and copyrighted by
-Google, Inc. Those modifications are gratefully acknowledged and are described
-briefly in the InnoDB documentation. The contributions by Google are
-incorporated with their permission, and subject to the conditions contained in
-the file COPYING.Google.
-
-Portions of this file contain modifications contributed and copyrighted
-by Percona Inc.. Those modifications are
-gratefully acknowledged and are described briefly in the InnoDB
-documentation. The contributions by Percona Inc. are incorporated with
-their permission, and subject to the conditions contained in the file
-COPYING.Percona.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file srv/srv0conc.cc
-
-InnoDB concurrency manager
-
-Created 2011/04/18 Sunny Bains
-*******************************************************/
-
-#include "srv0srv.h"
-#include "trx0trx.h"
-#include "row0mysql.h"
-#include "dict0dict.h"
-#include <mysql/service_thd_wait.h>
-#include <mysql/service_wsrep.h>
-
-/** Number of times a thread is allowed to enter InnoDB within the same
-SQL query after it has once got the ticket. */
-ulong srv_n_free_tickets_to_enter = 500;
-
-/** Maximum sleep delay (in micro-seconds), value of 0 disables it. */
-ulong srv_adaptive_max_sleep_delay = 150000;
-
-ulong srv_thread_sleep_delay = 10000;
-
-
-/** We are prepared for a situation that we have this many threads waiting for
-a semaphore inside InnoDB. srv_start() sets the value. */
-ulint srv_max_n_threads;
-
-/** The following controls how many threads we let inside InnoDB concurrently:
-threads waiting for locks are not counted into the number because otherwise
-we could get a deadlock. Value of 0 will disable the concurrency check. */
-
-ulong srv_thread_concurrency = 0;
-
-/** Variables tracking the active and waiting threads. */
-struct srv_conc_t {
- /** Number of transactions that have declared_to_be_inside_innodb */
- MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) Atomic_counter<ulint> n_active;
-
- /** Number of OS threads waiting in the FIFO for permission to
- enter InnoDB */
- MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) Atomic_counter<ulint> n_waiting;
-};
-
-/* Control variables for tracking concurrency. */
-static srv_conc_t srv_conc;
-
-/*********************************************************************//**
-Note that a user thread is entering InnoDB. */
-static
-void
-srv_enter_innodb_with_tickets(
-/*==========================*/
- trx_t* trx) /*!< in/out: transaction that wants
- to enter InnoDB */
-{
- trx->declared_to_be_inside_innodb = TRUE;
- trx->n_tickets_to_enter_innodb = static_cast<uint32_t>(
- srv_n_free_tickets_to_enter);
-}
-
-/*********************************************************************//**
-Handle the scheduling of a user thread that wants to enter InnoDB. Setting
-srv_adaptive_max_sleep_delay > 0 switches the adaptive sleep calibration to
-ON. When set, we want to wait in the queue for as little time as possible.
-However, very short waits will result in a lot of context switches and that
-is also not desirable. When threads need to sleep multiple times we increment
-os_thread_sleep_delay by one. When we see threads getting a slot without
-waiting and there are no other threads waiting in the queue, we try and reduce
-the wait as much as we can. Currently we reduce it by half each time. If the
-thread only had to wait for one turn before it was able to enter InnoDB we
-decrement it by one. This is to try and keep the sleep time stable around the
-"optimum" sleep time. */
-static
-void
-srv_conc_enter_innodb_with_atomics(
-/*===============================*/
- trx_t* trx) /*!< in/out: transaction that wants
- to enter InnoDB */
-{
- ulint n_sleeps = 0;
- ibool notified_mysql = FALSE;
-
- ut_a(!trx->declared_to_be_inside_innodb);
-
- for (;;) {
- ulint sleep_in_us;
-#ifdef WITH_WSREP
- if (trx->is_wsrep() && wsrep_thd_is_aborting(trx->mysql_thd)) {
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::info() <<
- "srv_conc_enter due to MUST_ABORT";
- }
- srv_conc_force_enter_innodb(trx);
- return;
- }
-#endif /* WITH_WSREP */
-
- if (srv_thread_concurrency == 0) {
- if (notified_mysql) {
- srv_conc.n_waiting--;
- thd_wait_end(trx->mysql_thd);
- }
-
- return;
- }
-
- if (srv_conc.n_active < srv_thread_concurrency) {
-
- /* Check if there are any free tickets. */
- if (srv_conc.n_active++ < srv_thread_concurrency) {
-
- srv_enter_innodb_with_tickets(trx);
-
- if (notified_mysql) {
- srv_conc.n_waiting--;
- thd_wait_end(trx->mysql_thd);
- }
-
- if (srv_adaptive_max_sleep_delay > 0) {
- if (srv_thread_sleep_delay > 20
- && n_sleeps == 1) {
-
- --srv_thread_sleep_delay;
- }
-
- if (srv_conc.n_waiting == 0) {
- srv_thread_sleep_delay >>= 1;
- }
- }
-
- return;
- }
-
- /* Since there were no free seats, we relinquish
- the overbooked ticket. */
-
- srv_conc.n_active--;
- }
-
- if (!notified_mysql) {
- srv_conc.n_waiting++;
-
- thd_wait_begin(trx->mysql_thd, THD_WAIT_USER_LOCK);
-
- notified_mysql = TRUE;
- }
-
- DEBUG_SYNC_C("user_thread_waiting");
- trx->op_info = "sleeping before entering InnoDB";
-
- sleep_in_us = srv_thread_sleep_delay;
-
- /* Guard against overflow when adaptive sleep delay is on. */
-
- if (srv_adaptive_max_sleep_delay > 0
- && sleep_in_us > srv_adaptive_max_sleep_delay) {
-
- sleep_in_us = srv_adaptive_max_sleep_delay;
- srv_thread_sleep_delay = static_cast<ulong>(sleep_in_us);
- }
-
- os_thread_sleep(sleep_in_us);
-
- trx->op_info = "";
-
- ++n_sleeps;
-
- if (srv_adaptive_max_sleep_delay > 0 && n_sleeps > 1) {
- ++srv_thread_sleep_delay;
- }
- }
-}
-
-/*********************************************************************//**
-Note that a user thread is leaving InnoDB code. */
-static
-void
-srv_conc_exit_innodb_with_atomics(
-/*==============================*/
- trx_t* trx) /*!< in/out: transaction */
-{
- trx->n_tickets_to_enter_innodb = 0;
- trx->declared_to_be_inside_innodb = FALSE;
-
- srv_conc.n_active--;
-}
-
-/*********************************************************************//**
-Puts an OS thread to wait if there are too many concurrent threads
-(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue.
-@param[in,out] prebuilt row prebuilt handler */
-void
-srv_conc_enter_innodb(
- row_prebuilt_t* prebuilt)
-{
- trx_t* trx = prebuilt->trx;
-
- ut_ad(!sync_check_iterate(sync_check()));
-
- srv_conc_enter_innodb_with_atomics(trx);
-}
-
-/*********************************************************************//**
-This lets a thread enter InnoDB regardless of the number of threads inside
-InnoDB. This must be called when a thread ends a lock wait. */
-void
-srv_conc_force_enter_innodb(
-/*========================*/
- trx_t* trx) /*!< in: transaction object associated with the
- thread */
-{
- ut_ad(!sync_check_iterate(sync_check()));
-
- if (!srv_thread_concurrency) {
-
- return;
- }
-
- srv_conc.n_active++;
-
- trx->n_tickets_to_enter_innodb = 1;
- trx->declared_to_be_inside_innodb = TRUE;
-}
-
-/*********************************************************************//**
-This must be called when a thread exits InnoDB in a lock wait or at the
-end of an SQL statement. */
-void
-srv_conc_force_exit_innodb(
-/*=======================*/
- trx_t* trx) /*!< in: transaction object associated with the
- thread */
-{
- if ((trx->mysql_thd != NULL
- && thd_is_replication_slave_thread(trx->mysql_thd))
- || trx->declared_to_be_inside_innodb == FALSE) {
-
- return;
- }
-
- srv_conc_exit_innodb_with_atomics(trx);
-
- ut_ad(!sync_check_iterate(sync_check()));
-}
-
-/*********************************************************************//**
-Get the count of threads waiting inside InnoDB. */
-ulint
-srv_conc_get_waiting_threads(void)
-/*==============================*/
-{
- return(srv_conc.n_waiting);
-}
-
-/*********************************************************************//**
-Get the count of threads active inside InnoDB. */
-ulint
-srv_conc_get_active_threads(void)
-/*==============================*/
-{
- return(srv_conc.n_active);
-}
-
-#ifdef WITH_WSREP
-UNIV_INTERN
-void
-wsrep_srv_conc_cancel_wait(
-/*=======================*/
- trx_t* trx) /*!< in: transaction object associated with the
- thread */
-{
-#ifdef HAVE_ATOMIC_BUILTINS
- /* aborting transactions will enter innodb by force in
- srv_conc_enter_innodb_with_atomics(). No need to cancel here,
- thr will wake up after os_sleep and let to enter innodb
- */
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::info() << "WSREP: conc slot cancel, no atomics";
- }
-#else
- // JAN: TODO: MySQL 5.7
- //os_fast_mutex_lock(&srv_conc_mutex);
- if (trx->wsrep_event) {
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::info() << "WSREP: conc slot cancel";
- }
- os_event_set(trx->wsrep_event);
- }
- //os_fast_mutex_unlock(&srv_conc_mutex);
-#endif
-}
-#endif /* WITH_WSREP */
-
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 8b8765b2748..aa8a5ea2d14 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -76,7 +76,6 @@ Created 10/8/1995 Heikki Tuuri
#include <my_service_manager.h>
-
/* The following is the maximum allowed duration of a lock wait. */
UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT;
@@ -349,9 +348,6 @@ number of pages to use in LRU and flush_list batch flushing.
The rest of the doublewrite buffer is used for single-page flushing. */
ulong srv_doublewrite_batch_size = 120;
-/** innodb_replication_delay */
-ulong srv_replication_delay;
-
/** innodb_sync_spin_loops */
ulong srv_n_spin_wait_rounds;
/** innodb_spin_wait_delay */
@@ -1007,12 +1003,6 @@ srv_printf_innodb_monitor(
fputs("--------------\n"
"ROW OPERATIONS\n"
"--------------\n", file);
- fprintf(file,
- ULINTPF " queries inside InnoDB, "
- ULINTPF " queries in queue\n",
- srv_conc_get_active_threads(),
- srv_conc_get_waiting_threads());
-
fprintf(file, ULINTPF " read views open inside InnoDB\n",
trx_sys.view_count());
@@ -1507,17 +1497,6 @@ bool srv_any_background_activity()
}
#endif /* UNIV_DEBUG */
-/** Wake up the InnoDB master thread if it was suspended (not sleeping). */
-void
-srv_active_wake_master_thread_low()
-{
- ut_ad(!srv_read_only_mode);
- ut_ad(!mutex_own(&srv_sys.mutex));
-
- srv_inc_activity_count();
-}
-
-
static void purge_worker_callback(void*);
static void purge_coordinator_callback(void*);
static void purge_coordinator_timer_callback(void*);
@@ -1606,13 +1585,6 @@ void purge_sys_t::resume()
rw_lock_x_unlock(&latch);
}
-/** Wake up the master thread if it is suspended or being suspended. */
-void
-srv_wake_master_thread()
-{
- srv_inc_activity_count();
-}
-
/*******************************************************************//**
Get current server activity count. We don't hold srv_sys::mutex while
reading this value as it is only used in heuristics.
@@ -1624,15 +1596,20 @@ srv_get_activity_count(void)
return(srv_sys.activity_count);
}
-/*******************************************************************//**
-Check if there has been any activity.
+/** Check if there has been any activity.
+@param[in,out] activity_count recent activity count to be returned
+if there is a change
@return FALSE if no change in activity counter. */
-ibool
-srv_check_activity(
-/*===============*/
- ulint old_activity_count) /*!< in: old activity count */
+bool srv_check_activity(ulint *activity_count)
{
- return(srv_sys.activity_count != old_activity_count);
+ ulint new_activity_count= srv_sys.activity_count;
+ if (new_activity_count != *activity_count)
+ {
+ *activity_count= new_activity_count;
+ return true;
+ }
+
+ return false;
}
/********************************************************************//**
@@ -1923,6 +1900,10 @@ srv_master_do_idle_tasks(void)
log_checkpoint();
MONITOR_INC_TIME_IN_MICRO_SECS(MONITOR_SRV_CHECKPOINT_MICROSECOND,
counter_time);
+
+ /* This is a workaround to avoid the InnoDB hang when OS datetime
+ changed backwards.*/
+ os_event_set(buf_flush_event);
}
/**
@@ -1971,8 +1952,7 @@ void srv_master_callback(void*)
srv_main_thread_op_info = "";
MONITOR_INC(MONITOR_MASTER_THREAD_SLEEP);
- if (srv_check_activity(old_activity_count)) {
- old_activity_count = srv_get_activity_count();
+ if (srv_check_activity(&old_activity_count)) {
srv_master_do_active_tasks();
} else {
srv_master_do_idle_tasks();
@@ -2097,15 +2077,13 @@ static uint32_t srv_do_purge(ulint* n_total_purged)
++n_use_threads;
}
- } else if (srv_check_activity(old_activity_count)
+ } else if (srv_check_activity(&old_activity_count)
&& n_use_threads > 1) {
/* History length same or smaller since last snapshot,
use fewer threads. */
--n_use_threads;
-
- old_activity_count = srv_get_activity_count();
}
/* Ensure that the purge threads are less than what
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 5dbf01c6b49..85fc90a8e0c 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -101,6 +101,10 @@ Created 2/16/1996 Heikki Tuuri
#include "zlib.h"
#include "ut0crc32.h"
+/** We are prepared for a situation that we have this many threads waiting for
+a semaphore inside InnoDB. srv_start() sets the value. */
+ulint srv_max_n_threads;
+
/** Log sequence number at shutdown */
lsn_t srv_shutdown_lsn;
@@ -583,6 +587,7 @@ err_exit:
{
space->size= file->size= ulint(size >> srv_page_size_shift);
space->size_in_header= SRV_UNDO_TABLESPACE_SIZE_IN_PAGES;
+ space->committed_size= SRV_UNDO_TABLESPACE_SIZE_IN_PAGES;
}
else
{
@@ -887,7 +892,6 @@ srv_shutdown_all_bg_threads()
/* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM
HERE OR EARLIER */
-
if (!srv_read_only_mode) {
/* b. srv error monitor thread exits automatically,
no need to do anything here */
@@ -1196,9 +1200,7 @@ dberr_t srv_start(bool create_new_db)
static_cast<int>(UT_ARR_SIZE(srv_stages)));
/* Set the maximum number of threads which can wait for a semaphore
- inside InnoDB: this is the 'sync wait array' size, as well as the
- maximum number of threads that can wait in the 'srv_conc array' for
- their time to enter InnoDB. */
+ inside InnoDB: this is the 'sync wait array' size */
srv_max_n_threads = 1 /* io_ibuf_thread */
+ 1 /* io_log_thread */
@@ -1590,6 +1592,8 @@ file_checked:
if (sum_of_new_sizes > 0) {
/* New data file(s) were added */
mtr.start();
+ mtr.x_lock_space(fil_system.sys_space,
+ __FILE__, __LINE__);
buf_block_t* block = buf_page_get(
page_id_t(0, 0), 0,
RW_SX_LATCH, &mtr);
@@ -2046,7 +2050,7 @@ void srv_shutdown_bg_undo_sources()
fts_optimize_shutdown();
dict_stats_shutdown();
while (row_get_background_drop_list_len_low()) {
- srv_wake_master_thread();
+ srv_inc_activity_count();
os_thread_yield();
}
srv_undo_sources = false;
@@ -2094,12 +2098,6 @@ void innodb_shutdown()
case SRV_OPERATION_NORMAL:
/* Shut down the persistent files. */
logs_empty_and_mark_files_at_shutdown();
-
- if (ulint n_threads = srv_conc_get_active_threads()) {
- ib::warn() << "Query counter shows "
- << n_threads << " queries still"
- " inside InnoDB at shutdown";
- }
}
os_aio_free();
diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc
index 08f8baab101..b0c45a01dbf 100644
--- a/storage/innobase/sync/sync0debug.cc
+++ b/storage/innobase/sync/sync0debug.cc
@@ -38,7 +38,7 @@ Created 2012-08-21 Sunny Bains
#include <vector>
#include <string>
#include <algorithm>
-#include <iostream>
+#include <map>
#ifdef UNIV_DEBUG
@@ -505,7 +505,6 @@ LatchDebug::LatchDebug()
LEVEL_MAP_INSERT(SYNC_IBUF_HEADER);
LEVEL_MAP_INSERT(SYNC_DICT_HEADER);
LEVEL_MAP_INSERT(SYNC_STATS_AUTO_RECALC);
- LEVEL_MAP_INSERT(SYNC_DICT_AUTOINC_MUTEX);
LEVEL_MAP_INSERT(SYNC_DICT);
LEVEL_MAP_INSERT(SYNC_FTS_CACHE);
LEVEL_MAP_INSERT(SYNC_DICT_OPERATION);
@@ -766,7 +765,6 @@ LatchDebug::check_order(
case SYNC_NOREDO_RSEG:
case SYNC_PURGE_LATCH:
case SYNC_PURGE_QUEUE:
- case SYNC_DICT_AUTOINC_MUTEX:
case SYNC_DICT_OPERATION:
case SYNC_DICT_HEADER:
case SYNC_TRX_I_S_RWLOCK:
@@ -1257,8 +1255,6 @@ sync_latch_meta_init()
/* The latches should be ordered on latch_id_t. So that we can
index directly into the vector to update and fetch meta-data. */
- LATCH_ADD_MUTEX(AUTOINC, SYNC_DICT_AUTOINC_MUTEX, autoinc_mutex_key);
-
LATCH_ADD_MUTEX(BUF_POOL, SYNC_BUF_POOL, buf_pool_mutex_key);
LATCH_ADD_MUTEX(CACHE_LAST_READ, SYNC_TRX_I_S_LAST_READ,
@@ -1386,8 +1382,6 @@ sync_latch_meta_init()
LATCH_ADD_MUTEX(SYNC_ARRAY_MUTEX, SYNC_NO_ORDER_CHECK,
sync_array_mutex_key);
- LATCH_ADD_MUTEX(ZIP_PAD_MUTEX, SYNC_NO_ORDER_CHECK, zip_pad_mutex_key);
-
LATCH_ADD_MUTEX(OS_AIO_READ_MUTEX, SYNC_NO_ORDER_CHECK,
PFS_NOT_INSTRUMENTED);
@@ -1506,173 +1500,6 @@ sync_latch_meta_destroy()
latch_meta.clear();
}
-/** Track mutex file creation name and line number. This is to avoid storing
-{ const char* name; uint16_t line; } in every instance. This results in the
-sizeof(Mutex) > 64. We use a lookup table to store it separately. Fetching
-the values is very rare, only required for diagnostic purposes. And, we
-don't create/destroy mutexes that frequently. */
-struct CreateTracker {
-
- /** Constructor */
- CreateTracker()
- UNIV_NOTHROW
- {
- m_mutex.init();
- }
-
- /** Destructor */
- ~CreateTracker()
- UNIV_NOTHROW
- {
- ut_ad(m_files.empty());
-
- m_mutex.destroy();
- }
-
- /** Register where the latch was created
- @param[in] ptr Latch instance
- @param[in] filename Where created
- @param[in] line Line number in filename */
- void register_latch(
- const void* ptr,
- const char* filename,
- uint16_t line)
- UNIV_NOTHROW
- {
- m_mutex.enter();
-
- Files::iterator lb = m_files.lower_bound(ptr);
-
- ut_ad(lb == m_files.end()
- || m_files.key_comp()(ptr, lb->first));
-
- typedef Files::value_type value_type;
-
- m_files.insert(lb, value_type(ptr, File(filename, line)));
-
- m_mutex.exit();
- }
-
- /** Deregister a latch - when it is destroyed
- @param[in] ptr Latch instance being destroyed */
- void deregister_latch(const void* ptr)
- UNIV_NOTHROW
- {
- m_mutex.enter();
-
- Files::iterator lb = m_files.lower_bound(ptr);
-
- ut_ad(lb != m_files.end()
- && !(m_files.key_comp()(ptr, lb->first)));
-
- m_files.erase(lb);
-
- m_mutex.exit();
- }
-
- /** Get the create string, format is "name:line"
- @param[in] ptr Latch instance
- @return the create string or "" if not found */
- std::string get(const void* ptr)
- UNIV_NOTHROW
- {
- m_mutex.enter();
-
- std::string created;
-
- Files::iterator lb = m_files.lower_bound(ptr);
-
- if (lb != m_files.end()
- && !(m_files.key_comp()(ptr, lb->first))) {
-
- std::ostringstream msg;
-
- msg << lb->second.m_name << ":" << lb->second.m_line;
-
- created = msg.str();
- }
-
- m_mutex.exit();
-
- return(created);
- }
-
-private:
- /** For tracking the filename and line number */
- struct File {
-
- /** Constructor */
- File() UNIV_NOTHROW : m_name(), m_line() { }
-
- /** Constructor
- @param[in] name Filename where created
- @param[in] line Line number where created */
- File(const char* name, uint16_t line)
- UNIV_NOTHROW
- :
- m_name(sync_basename(name)),
- m_line(line)
- {
- /* No op */
- }
-
- /** Filename where created */
- std::string m_name;
-
- /** Line number where created */
- uint16_t m_line;
- };
-
- /** Map the mutex instance to where it was created */
- typedef std::map<
- const void*,
- File,
- std::less<const void*>,
- ut_allocator<std::pair<const void* const, File> > >
- Files;
-
- typedef OSMutex Mutex;
-
- /** Mutex protecting m_files */
- Mutex m_mutex;
-
- /** Track the latch creation */
- Files m_files;
-};
-
-/** Track latch creation location. For reducing the size of the latches */
-static CreateTracker create_tracker;
-
-/** Register a latch, called when it is created
-@param[in] ptr Latch instance that was created
-@param[in] filename Filename where it was created
-@param[in] line Line number in filename */
-void
-sync_file_created_register(
- const void* ptr,
- const char* filename,
- uint16_t line)
-{
- create_tracker.register_latch(ptr, filename, line);
-}
-
-/** Deregister a latch, called when it is destroyed
-@param[in] ptr Latch to be destroyed */
-void
-sync_file_created_deregister(const void* ptr)
-{
- create_tracker.deregister_latch(ptr);
-}
-
-/** Get the string where the file was created. Its format is "name:line"
-@param[in] ptr Latch instance
-@return created information or "" if can't be found */
-std::string
-sync_file_created_get(const void* ptr)
-{
- return(create_tracker.get(ptr));
-}
-
/** Initializes the synchronization data structures. */
void
sync_check_init()
@@ -1682,9 +1509,7 @@ sync_check_init()
sync_latch_meta_init();
- /* Init the rw-lock & mutex list and create the mutex to protect it. */
-
- UT_LIST_INIT(rw_lock_list, &rw_lock_t::list);
+ /* create the mutex to protect rw_lock list. */
mutex_create(LATCH_ID_RW_LOCK_LIST, &rw_lock_list_mutex);
diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc
index 638896a9a86..b86e11900b8 100644
--- a/storage/innobase/sync/sync0rw.cc
+++ b/storage/innobase/sync/sync0rw.cc
@@ -141,7 +141,7 @@ wait_ex_event: A thread may only wait on the wait_ex_event after it has
rw_lock_stats_t rw_lock_stats;
/* The global list of rw-locks */
-rw_lock_list_t rw_lock_list;
+ilist<rw_lock_t> rw_lock_list;
ib_mutex_t rw_lock_list_mutex;
#ifdef UNIV_DEBUG
@@ -234,8 +234,10 @@ rw_lock_create_func(
lock->is_block_lock = 0;
+ ut_d(lock->created = true);
+
mutex_enter(&rw_lock_list_mutex);
- UT_LIST_ADD_FIRST(rw_lock_list, lock);
+ rw_lock_list.push_front(*lock);
mutex_exit(&rw_lock_list_mutex);
}
@@ -251,13 +253,15 @@ rw_lock_free_func(
ut_ad(rw_lock_validate(lock));
ut_a(lock->lock_word == X_LOCK_DECR);
+ ut_d(lock->created = false);
+
mutex_enter(&rw_lock_list_mutex);
os_event_destroy(lock->event);
os_event_destroy(lock->wait_ex_event);
- UT_LIST_REMOVE(rw_lock_list, lock);
+ rw_lock_list.remove(*lock);
mutex_exit(&rw_lock_list_mutex);
}
@@ -850,6 +854,8 @@ rw_lock_validate(
{
ut_ad(lock);
+ ut_ad(lock->created);
+
int32_t lock_word = lock->lock_word;
ut_ad(lock->waiters < 2);
@@ -1095,17 +1101,15 @@ rw_lock_list_print_info(
"RW-LATCH INFO\n"
"-------------\n", file);
- for (const rw_lock_t* lock = UT_LIST_GET_FIRST(rw_lock_list);
- lock != NULL;
- lock = UT_LIST_GET_NEXT(list, lock)) {
+ for (const rw_lock_t& lock : rw_lock_list) {
count++;
- if (lock->lock_word != X_LOCK_DECR) {
+ if (lock.lock_word != X_LOCK_DECR) {
- fprintf(file, "RW-LOCK: %p ", (void*) lock);
+ fprintf(file, "RW-LOCK: %p ", (void*) &lock);
- if (int32_t waiters= lock->waiters) {
+ if (int32_t waiters= lock.waiters) {
fprintf(file, " (%d waiters)\n", waiters);
} else {
putc('\n', file);
@@ -1115,7 +1119,7 @@ rw_lock_list_print_info(
rw_lock_debug_mutex_enter();
- for (info = UT_LIST_GET_FIRST(lock->debug_list);
+ for (info = UT_LIST_GET_FIRST(lock.debug_list);
info != NULL;
info = UT_LIST_GET_NEXT(list, info)) {
diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc
index 8b81d8a5ff8..4894b625db8 100644
--- a/storage/innobase/sync/sync0sync.cc
+++ b/storage/innobase/sync/sync0sync.cc
@@ -36,8 +36,6 @@ Created 9/5/1995 Heikki Tuuri
#include "sync0sync.h"
#ifdef UNIV_PFS_MUTEX
-/* Key to register autoinc_mutex with performance schema */
-mysql_pfs_key_t autoinc_mutex_key;
mysql_pfs_key_t buf_pool_mutex_key;
mysql_pfs_key_t cache_last_read_mutex_key;
mysql_pfs_key_t dict_foreign_err_mutex_key;
@@ -89,7 +87,6 @@ mysql_pfs_key_t event_mutex_key;
mysql_pfs_key_t event_manager_mutex_key;
mysql_pfs_key_t sync_array_mutex_key;
mysql_pfs_key_t thread_mutex_key;
-mysql_pfs_key_t zip_pad_mutex_key;
mysql_pfs_key_t row_drop_list_mutex_key;
mysql_pfs_key_t rw_trx_hash_element_mutex_key;
mysql_pfs_key_t read_view_mutex_key;
@@ -257,11 +254,8 @@ MutexMonitor::reset()
mutex_enter(&rw_lock_list_mutex);
- for (rw_lock_t* rw_lock = UT_LIST_GET_FIRST(rw_lock_list);
- rw_lock != NULL;
- rw_lock = UT_LIST_GET_NEXT(list, rw_lock)) {
-
- rw_lock->count_os_wait = 0;
+ for (rw_lock_t& rw_lock : rw_lock_list) {
+ rw_lock.count_os_wait = 0;
}
mutex_exit(&rw_lock_list_mutex);
diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc
index 8e46057f654..2736dbd285f 100644
--- a/storage/innobase/trx/trx0i_s.cc
+++ b/storage/innobase/trx/trx0i_s.cc
@@ -499,8 +499,6 @@ thd_done:
row->trx_rows_modified = trx->undo_no;
- row->trx_concurrency_tickets = trx->n_tickets_to_enter_innodb;
-
row->trx_isolation_level = trx->isolation_level;
row->trx_unique_checks = (ibool) trx->check_unique_secondary;
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index 85daf649c6a..a16ee95dc83 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -67,7 +67,7 @@ inline bool trx_t::rollback_finish()
}
ut_a(error_state == DB_INTERRUPTED);
- ut_ad(!srv_is_being_started);
+ ut_ad(srv_shutdown_state != SRV_SHUTDOWN_NONE);
ut_a(!srv_undo_sources);
ut_ad(srv_fast_shutdown);
ut_d(in_rollback= false);
@@ -145,9 +145,6 @@ inline void trx_t::rollback_low(trx_savept_t *savept)
mem_heap_free(heap);
- /* There might be work for utility threads.*/
- srv_active_wake_master_thread();
-
MONITOR_DEC(MONITOR_TRX_ACTIVE);
}
@@ -776,7 +773,8 @@ void trx_rollback_recovered(bool all)
ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
ut_d(trx_mutex_exit(trx));
- if (!srv_is_being_started && !srv_undo_sources && srv_fast_shutdown)
+ if (srv_shutdown_state != SRV_SHUTDOWN_NONE && !srv_undo_sources &&
+ srv_fast_shutdown)
goto discard;
if (all || trx_get_dict_operation(trx) != TRX_DICT_OP_NONE)
diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc
index 28268ed6bf0..b90ad9b73c8 100644
--- a/storage/innobase/trx/trx0rseg.cc
+++ b/storage/innobase/trx/trx0rseg.cc
@@ -312,7 +312,7 @@ trx_rseg_header_create(
{
buf_block_t* block;
- ut_ad(mtr->memo_contains(space->latch, MTR_MEMO_X_LOCK));
+ ut_ad(mtr->memo_contains(*space));
ut_ad(!sys_header == (space == fil_system.temp_space));
/* Allocate a new file segment for the rollback segment */
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc
index 52b344498b1..7144ccff6f5 100644
--- a/storage/innobase/trx/trx0sys.cc
+++ b/storage/innobase/trx/trx0sys.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 03e60d80d5b..a9ba8cd7786 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -377,10 +377,6 @@ trx_t *trx_create()
ut_ad(trx->lock.rec_cached == 0);
ut_ad(UT_LIST_GET_LEN(trx->lock.evicted_tables) == 0);
-#ifdef WITH_WSREP
- trx->wsrep_event= NULL;
-#endif /* WITH_WSREP */
-
trx_sys.register_trx(trx);
return(trx);
@@ -392,25 +388,11 @@ trx_t *trx_create()
*/
void trx_free(trx_t*& trx)
{
- ut_ad(!trx->declared_to_be_inside_innodb);
ut_ad(!trx->n_mysql_tables_in_use);
ut_ad(!trx->mysql_n_tables_locked);
ut_ad(!trx->internal);
ut_ad(!trx->mysql_log_file_name);
- if (UNIV_UNLIKELY(trx->declared_to_be_inside_innodb)) {
- ib::error() << "Freeing a trx ("
- << trx_get_id_for_print(trx) << ") which is declared"
- " to be processing inside InnoDB";
-
- trx_print(stderr, trx, 600);
- putc('\n', stderr);
-
- /* This is an error but not a fatal error. We must keep
- the counters like srv_conc.n_active accurate. */
- srv_conc_force_exit_innodb(trx);
- }
-
if (trx->n_mysql_tables_in_use != 0
|| trx->mysql_n_tables_locked != 0) {
@@ -1272,7 +1254,8 @@ trx_update_mod_tables_timestamp(
dict_table_t* table = it->first;
table->update_time = now;
#ifdef UNIV_DEBUG
- if (preserve_tables || table->get_ref_count()) {
+ if (preserve_tables || table->get_ref_count()
+ || UT_LIST_GET_LEN(table->locks)) {
/* do not evict when committing DDL operations
or if some other transaction is holding the
table handle */
@@ -1281,7 +1264,11 @@ trx_update_mod_tables_timestamp(
/* recheck while holding the mutex that blocks
table->acquire() */
mutex_enter(&dict_sys.mutex);
- if (!table->get_ref_count()) {
+ mutex_enter(&lock_sys.mutex);
+ const bool do_evict = !table->get_ref_count()
+ && !UT_LIST_GET_LEN(table->locks);
+ mutex_exit(&lock_sys.mutex);
+ if (do_evict) {
dict_sys.remove(table, true);
}
mutex_exit(&dict_sys.mutex);
@@ -1464,11 +1451,6 @@ inline void trx_t::commit_in_memory(const mtr_t *mtr)
must_flush_log_later= true;
else if (srv_flush_log_at_trx_commit)
trx_flush_log_if_needed(commit_lsn, this);
-
- /* Tell server some activity has happened, since the trx does
- changes something. Background utility threads like master thread,
- purge thread or page_cleaner thread might have some work to do. */
- srv_active_wake_master_thread();
}
ut_ad(!rsegs.m_noredo.undo);
@@ -1824,11 +1806,6 @@ state_ok:
fputs(" recovered trx", f);
}
- if (trx->declared_to_be_inside_innodb) {
- fprintf(f, ", thread declared inside InnoDB %lu",
- (ulong) trx->n_tickets_to_enter_innodb);
- }
-
putc('\n', f);
if (trx->n_mysql_tables_in_use > 0 || trx->mysql_n_tables_locked > 0) {
diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc
index dabf92e875b..9de0ca81fe3 100644
--- a/storage/innobase/ut/ut0crc32.cc
+++ b/storage/innobase/ut/ut0crc32.cc
@@ -342,11 +342,11 @@ allocations, would not hurt if called twice, but would be pointless. */
void ut_crc32_init()
{
#ifndef HAVE_CRC32_VPMSUM
-# if defined(__GNUC__) && defined(HAVE_ARMV8_CRC)
- if (crc32_aarch64_available())
+# if defined(__GNUC__) && defined(HAVE_ARMV8_CRC) && defined(HAVE_ARMV8_CRYPTO)
+ if (crc32c_aarch64_available())
{
ut_crc32_low= crc32c_aarch64;
- ut_crc32_implementation= "Using ARMv8 crc32 instructions";
+ ut_crc32_implementation= "Using ARMv8 crc32 + pmull instructions";
return;
}
# elif defined(TRY_SSE4_2)
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index 34af45d07fa..c21694a070c 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -116,13 +116,14 @@ IF(NOT PLUGIN_S3 STREQUAL NO)
ENDIF()
IF (CURL_FOUND)
+ LINK_DIRECTORIES(${PC_CURL_LIBDIR})
MYSQL_ADD_PLUGIN(s3 ha_s3.cc ${S3_SOURCES} COMPONENT s3-engine
- LINK_LIBRARIES curl STORAGE_ENGINE NOT_EMBEDDED CONFIG s3.cnf)
+ LINK_LIBRARIES curl z STORAGE_ENGINE NOT_EMBEDDED CONFIG s3.cnf)
ENDIF()
IF(TARGET s3)
MYSQL_ADD_EXECUTABLE(aria_s3_copy aria_s3_copy.cc ${S3_SOURCES} COMPONENT s3-engine)
- TARGET_LINK_LIBRARIES(aria_s3_copy aria myisam mysys mysys_ssl curl)
+ TARGET_LINK_LIBRARIES(aria_s3_copy aria myisam mysys mysys_ssl curl z)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libmarias3)
ADD_DEFINITIONS(-DWITH_S3_STORAGE_ENGINE)
ENDIF()
diff --git a/storage/maria/aria_s3_copy.cc b/storage/maria/aria_s3_copy.cc
index 2eac95ab9de..734c99eac3b 100644
--- a/storage/maria/aria_s3_copy.cc
+++ b/storage/maria/aria_s3_copy.cc
@@ -67,7 +67,7 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'c', "Use compression", &opt_compression, &opt_compression,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"op", 'o', "Operation to excecute. One of 'from_s3', 'to_s3' or "
+ {"op", 'o', "Operation to execute. One of 'from_s3', 'to_s3' or "
"'delete_from_s3'",
&opt_operation, &opt_operation, &op_typelib,
GET_ENUM, REQUIRED_ARG, OP_IMPOSSIBLE, 0, 0, 0, 0, 0},
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index c257a2094f1..3c43595533f 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2947,6 +2947,10 @@ static void reset_thd_trn(THD *thd, MARIA_HA *first_table)
DBUG_VOID_RETURN;
}
+bool ha_maria::has_active_transaction(THD *thd)
+{
+ return (maria_hton && THD_TRN);
+}
/**
Performs an implicit commit of the Maria transaction and creates a new
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index bff7ace8813..ddf8fc6f229 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -158,6 +158,7 @@ public:
{
return file;
}
+ static bool has_active_transaction(THD *thd);
static int implicit_commit(THD *thd, bool new_trn);
/**
* Multi Range Read interface
diff --git a/storage/maria/s3.cnf b/storage/maria/s3.cnf
index 94682cc14d7..345bddd1cb1 100644
--- a/storage/maria/s3.cnf
+++ b/storage/maria/s3.cnf
@@ -1,12 +1,22 @@
+[mariadbd]
+#
+# Uncomment line to enable
+#
+#plugin-maturity = alpha
+
[mariadb]
-plugin-load-add=ha_s3
+#
+# Uncomment line to enable
+#
+#plugin-load-add = ha_s3
#
-# Uncomment and configure the S3 engine
+# Uncomment to configure the S3 engine
+# See all options at https://mariadb.com/kb/en/s3-storage-engine/
#
-#s3-host-name=s3.amazonaws.com
-#s3-protocol-version=Amazon
-#s3-bucket=...
-#s3-access-key=...
-#s3-secret-key=...
-#s3-region=eu-north-1
+#s3-host-name = s3.amazonaws.com
+#s3-protocol-version = Amazon
+#s3-bucket = ...
+#s3-access-key = ...
+#s3-secret-key = ...
+#s3-region = eu-north-1
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c
index ff07920caa8..ed72acf627e 100644
--- a/storage/myisam/mi_key.c
+++ b/storage/myisam/mi_key.c
@@ -563,7 +563,15 @@ check_result_t mi_check_index_tuple(MI_INFO *info, uint keynr, uchar *record)
if (need_unpack && mi_unpack_index_tuple(info, keynr, record))
res= CHECK_ERROR;
else
- res= info->rowid_filter_func(info->rowid_filter_func_arg);
+ {
+ if ((res= info->rowid_filter_func(info->rowid_filter_func_arg)) ==
+ CHECK_OUT_OF_RANGE)
+ {
+ /* We got beyond the end of scanned range */
+ info->lastpos= HA_OFFSET_ERROR; /* No active record */
+ my_errno= HA_ERR_END_OF_FILE;
+ }
+ }
}
return res;
}
diff --git a/storage/perfschema/my_thread.h b/storage/perfschema/my_thread.h
index 542035bda0f..12e01a510ed 100644
--- a/storage/perfschema/my_thread.h
+++ b/storage/perfschema/my_thread.h
@@ -10,6 +10,10 @@
#include <sys/syscall.h>
#endif
+#ifdef HAVE_PTHREAD_GETTHREADID_NP
+#include <pthread_np.h>
+#endif
+
typedef pthread_key_t thread_local_key_t;
typedef pthread_t my_thread_handle;
typedef pthread_attr_t my_thread_attr_t;
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 090ababf238..19f0d3cfa99 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -112,9 +112,15 @@ SET(ROCKSDB_SE_SOURCES
# This is a strong requirement coming from RocksDB. No conditional checks here.
#ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX
#)
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+ SET(ATOMIC_EXTRA_LIBS -latomic)
+else()
+ SET(ATOMIC_EXTRA_LIBS)
+endif()
MYSQL_ADD_PLUGIN(rocksdb ${ROCKSDB_SE_SOURCES} MODULE_ONLY STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_rocksdb
+ LINK_LIBRARIES ${ATOMIC_EXTRA_LIBS}
COMPONENT rocksdb-engine)
IF(NOT TARGET rocksdb)
@@ -165,6 +171,7 @@ TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
if (UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
+TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
# IF (WITH_JEMALLOC)
# FIND_LIBRARY(JEMALLOC_LIBRARY
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index 28b860be1b4..2b9724404b7 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -18,17 +18,16 @@ if(WIN32)
# include(${ROCKSDB_SOURCE_DIR}/thirdparty.inc)
else()
option(WITH_ROCKSDB_JEMALLOC "build RocksDB with JeMalloc" OFF)
- if(WITH_ROCKSDB_JEMALLOC)
- find_package(JeMalloc REQUIRED)
- add_definitions(-DROCKSDB_JEMALLOC)
- ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
- include_directories(${JEMALLOC_INCLUDE_DIR})
- endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# FreeBSD has jemaloc as default malloc
add_definitions(-DROCKSDB_JEMALLOC)
ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
set(WITH_JEMALLOC ON)
+ elseif(WITH_ROCKSDB_JEMALLOC)
+ find_package(JeMalloc REQUIRED)
+ add_definitions(-DROCKSDB_JEMALLOC)
+ ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
+ include_directories(${JEMALLOC_INCLUDE_DIR})
endif()
endif()
@@ -127,6 +126,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} -latomic)
+endif()
+
option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX)
@@ -430,6 +433,17 @@ else()
util/crc32c_ppc.c
util/crc32c_ppc_asm.S)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+ # aarch
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
+ INCLUDE(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC)
+ if(HAS_ARMV8_CRC)
+ message(STATUS " HAS_ARMV8_CRC yes")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crc+crypto -Wno-unused-function")
+ list(APPEND ROCKSDB_SOURCES
+ util/crc32c_arm64.cc)
+ endif(HAS_ARMV8_CRC)
+ endif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
endif()
SET(SOURCES)
FOREACH(s ${ROCKSDB_SOURCES})
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test b/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
index 3ebdd67a1a6..aee653830e2 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
@@ -30,7 +30,7 @@ $MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where b=1" --conc
wait
EOF
---exec bash $MYSQL_TMP_DIR/concurrent_alter.sh
+--exec sh $MYSQL_TMP_DIR/concurrent_alter.sh
let $server_charset=`select @@character_set_server`;
--replace_result $server_charset DEFAULT_CHARSET
diff --git a/storage/spider/spd_malloc.cc b/storage/spider/spd_malloc.cc
index 9f4203ae33d..a9438f2ac58 100644
--- a/storage/spider/spd_malloc.cc
+++ b/storage/spider/spd_malloc.cc
@@ -476,9 +476,10 @@ char *spider_string::c_ptr_safe()
LEX_STRING spider_string::lex_string() const
{
+ LEX_STRING res= { (char*) str.ptr(), str.length() };
DBUG_ENTER("spider_string::lex_string");
DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(str.lex_string());
+ DBUG_RETURN(res);
}
void spider_string::set(
diff --git a/storage/spider/spider.cnf b/storage/spider/spider.cnf
index 2ee546962d6..ebc9968b490 100644
--- a/storage/spider/spider.cnf
+++ b/storage/spider/spider.cnf
@@ -1,5 +1,7 @@
[mariadb]
#
-# uncomment the following line to enable SPIDER storage engine
+# Uncomment line to enable
#
-#plugin-load-add=ha_spider.so
+#plugin-load-add = ha_spider
+
+# Read more at https://mariadb.com/kb/en/spider/
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 945bbdfdc62..f5dd92f736e 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -32,6 +32,8 @@
#ifdef HAVE_CHARSET_big5
+const char charset_name_big5[]= "big5";
+
/*
Support for Chinese(BIG5) characters, by jou@nematic.ieo.nctu.edu.tw
CP950 and HKSCS additional characters are also accepted.
@@ -6807,7 +6809,7 @@ struct charset_info_st my_charset_big5_chinese_ci=
{
1,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
- "big5", /* cs name */
+ charset_name_big5, /* cs name */
"big5_chinese_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -6840,7 +6842,7 @@ struct charset_info_st my_charset_big5_bin=
{
84,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "big5", /* cs name */
+ charset_name_big5, /* cs name */
"big5_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -6873,7 +6875,7 @@ struct charset_info_st my_charset_big5_chinese_nopad_ci=
{
MY_NOPAD_ID(1),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NOPAD, /* state */
- "big5", /* cs name */
+ charset_name_big5, /* cs name */
"big5_chinese_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -6906,7 +6908,7 @@ struct charset_info_st my_charset_big5_nopad_bin=
{
MY_NOPAD_ID(84),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "big5", /* cs name */
+ charset_name_big5, /* cs name */
"big5_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index fe28752a3f7..84e5c85697b 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -23,6 +23,8 @@
#include "strings_def.h"
#include <m_ctype.h>
+const char charset_name_binary[]= "binary";
+
static const uchar ctype_bin[]=
{
0,
@@ -568,7 +570,7 @@ struct charset_info_st my_charset_bin =
{
63,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY|MY_CS_NOPAD,/* state */
- "binary", /* cs name */
+ charset_name_binary, /* cs name */
"binary", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 45b5bde9510..28fea965bf3 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CHARSET_cp932
+const char charset_name_cp932[]= "cp932";
/*
* This comment is parsed by configure to create ctype.c,
@@ -34764,8 +34765,8 @@ struct charset_info_st my_charset_cp932_japanese_ci=
{
95,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
- "cp932", /* cs name */
- "cp932_japanese_ci", /* name */
+ charset_name_cp932, /* cs name */
+ "cp932_japanese_ci", /* name */
"", /* comment */
NULL, /* tailoring */
ctype_cp932,
@@ -34796,8 +34797,8 @@ struct charset_info_st my_charset_cp932_bin=
{
96,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "cp932", /* cs name */
- "cp932_bin", /* name */
+ charset_name_cp932, /* cs name */
+ "cp932_bin", /* name */
"", /* comment */
NULL, /* tailoring */
ctype_cp932,
@@ -34829,7 +34830,7 @@ struct charset_info_st my_charset_cp932_japanese_nopad_ci=
{
MY_NOPAD_ID(95),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NOPAD, /* state */
- "cp932", /* cs name */
+ charset_name_cp932, /* cs name */
"cp932_japanese_nopad_ci",/* name */
"", /* comment */
NULL, /* tailoring */
@@ -34861,7 +34862,7 @@ struct charset_info_st my_charset_cp932_nopad_bin=
{
MY_NOPAD_ID(96),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "cp932", /* cs name */
+ charset_name_cp932, /* cs name */
"cp932_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 17c4c98c24e..b80fe1ae8ed 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -625,7 +625,7 @@ struct charset_info_st my_charset_latin2_czech_ci =
2,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT|
MY_CS_STRNXFRM_BAD_NWEIGHTS|MY_CS_NON1TO1, /* state */
- "latin2", /* cs name */
+ charset_name_latin2, /* cs name */
"latin2_czech_cs", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 0362f799fc6..61c64dbcc18 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -31,6 +31,7 @@
#ifdef HAVE_CHARSET_euckr
+const char charset_name_euckr[]= "euckr";
static const uchar ctype_euc_kr[257] =
{
@@ -10054,7 +10055,7 @@ struct charset_info_st my_charset_euckr_korean_ci=
{
19,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
- "euckr", /* cs name */
+ charset_name_euckr, /* cs name */
"euckr_korean_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -10087,7 +10088,7 @@ struct charset_info_st my_charset_euckr_bin=
{
85,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "euckr", /* cs name */
+ charset_name_euckr, /* cs name */
"euckr_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -10120,7 +10121,7 @@ struct charset_info_st my_charset_euckr_korean_nopad_ci=
{
MY_NOPAD_ID(19),0,0,/* number */
MY_CS_COMPILED|MY_CS_NOPAD, /* state */
- "euckr", /* cs name */
+ charset_name_euckr, /* cs name */
"euckr_korean_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -10153,7 +10154,7 @@ struct charset_info_st my_charset_euckr_nopad_bin=
{
MY_NOPAD_ID(85),0,0,/* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "euckr", /* cs name */
+ charset_name_euckr, /* cs name */
"euckr_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index 1dd179fed57..2c24bc5ffda 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -33,6 +33,8 @@ ctype-ujis.c file.
#ifdef HAVE_CHARSET_eucjpms
+const char charset_name_eucjpms[]= "eucjpms";
+
static const uchar ctype_eucjpms[257] =
{
@@ -67593,7 +67595,7 @@ struct charset_info_st my_charset_eucjpms_japanese_ci=
{
97,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
- "eucjpms", /* cs name */
+ charset_name_eucjpms, /* cs name */
"eucjpms_japanese_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -67626,7 +67628,7 @@ struct charset_info_st my_charset_eucjpms_bin=
{
98,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "eucjpms", /* cs name */
+ charset_name_eucjpms, /* cs name */
"eucjpms_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -67659,7 +67661,7 @@ struct charset_info_st my_charset_eucjpms_japanese_nopad_ci=
{
MY_NOPAD_ID(97),0,0, /* number */
MY_CS_COMPILED|MY_CS_NOPAD,/* state */
- "eucjpms", /* cs name */
+ charset_name_eucjpms, /* cs name */
"eucjpms_japanese_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -67692,7 +67694,7 @@ struct charset_info_st my_charset_eucjpms_nopad_bin=
{
MY_NOPAD_ID(98),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "eucjpms", /* cs name */
+ charset_name_eucjpms, /* cs name */
"eucjpms_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 266799f32a3..91ee2504b65 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -29,6 +29,8 @@
#ifdef HAVE_CHARSET_gb2312
+const char charset_name_gb2312[]= "gb2312";
+
static const uchar ctype_gb2312[257] =
{
0, /* For standard library */
@@ -6459,7 +6461,7 @@ struct charset_info_st my_charset_gb2312_chinese_ci=
{
24,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
- "gb2312", /* cs name */
+ charset_name_gb2312, /* cs name */
"gb2312_chinese_ci",/* name */
"", /* comment */
NULL, /* tailoring */
@@ -6492,7 +6494,7 @@ struct charset_info_st my_charset_gb2312_bin=
{
86,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "gb2312", /* cs name */
+ charset_name_gb2312, /* cs name */
"gb2312_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -6525,7 +6527,7 @@ struct charset_info_st my_charset_gb2312_chinese_nopad_ci=
{
MY_NOPAD_ID(24),0,0,/* number */
MY_CS_COMPILED|MY_CS_NOPAD, /* state */
- "gb2312", /* cs name */
+ charset_name_gb2312, /* cs name */
"gb2312_chinese_nopad_ci",/* name */
"", /* comment */
NULL, /* tailoring */
@@ -6558,7 +6560,7 @@ struct charset_info_st my_charset_gb2312_nopad_bin=
{
MY_NOPAD_ID(86),0,0,/* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "gb2312", /* cs name */
+ charset_name_gb2312, /* cs name */
"gb2312_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index fa6dba9bfb5..041fe318eed 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -31,6 +31,7 @@
#ifdef HAVE_CHARSET_gbk
+const char charset_name_gbk[]= "gbk";
/* Support for Chinese(GBK) characters, by hewei@mail.ied.ac.cn */
@@ -10741,7 +10742,7 @@ struct charset_info_st my_charset_gbk_chinese_ci=
{
28,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
- "gbk", /* cs name */
+ charset_name_gbk, /* cs name */
"gbk_chinese_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -10773,7 +10774,7 @@ struct charset_info_st my_charset_gbk_bin=
{
87,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "gbk", /* cs name */
+ charset_name_gbk, /* cs name */
"gbk_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -10806,7 +10807,7 @@ struct charset_info_st my_charset_gbk_chinese_nopad_ci=
{
MY_NOPAD_ID(28),0,0,/* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NOPAD, /* state */
- "gbk", /* cs name */
+ charset_name_gbk, /* cs name */
"gbk_chinese_nopad_ci",/* name */
"", /* comment */
NULL, /* tailoring */
@@ -10838,7 +10839,7 @@ struct charset_info_st my_charset_gbk_nopad_bin=
{
MY_NOPAD_ID(87),0,0,/* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "gbk", /* cs name */
+ charset_name_gbk, /* cs name */
"gbk_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 53ce27e491e..4753ca737a6 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -18,6 +18,8 @@
#include "strings_def.h"
#include <m_ctype.h>
+const char charset_name_latin1[]= "latin1";
+
static const uchar ctype_latin1[] = {
0,
32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32,
@@ -431,7 +433,7 @@ struct charset_info_st my_charset_latin1=
{
8,0,0, /* number */
MY_CS_COMPILED | MY_CS_PRIMARY, /* state */
- "latin1", /* cs name */
+ charset_name_latin1, /* cs name */
"latin1_swedish_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -464,7 +466,7 @@ struct charset_info_st my_charset_latin1_nopad=
{
MY_NOPAD_ID(8),0,0, /* number */
MY_CS_COMPILED | MY_CS_NOPAD, /* state */
- "latin1", /* cs name */
+ charset_name_latin1, /* cs name */
"latin1_swedish_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -742,7 +744,7 @@ struct charset_info_st my_charset_latin1_german2_ci=
{
31,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NON1TO1, /* state */
- "latin1", /* cs name */
+ charset_name_latin1, /* cs name */
"latin1_german2_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -775,7 +777,7 @@ struct charset_info_st my_charset_latin1_bin=
{
47,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "latin1", /* cs name */
+ charset_name_latin1, /* cs name */
"latin1_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -808,7 +810,7 @@ struct charset_info_st my_charset_latin1_nopad_bin=
{
MY_NOPAD_ID(47),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD,/* state */
- "latin1", /* cs name */
+ charset_name_latin1, /* cs name */
"latin1_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index e1c6a871772..57458ca3a48 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CHARSET_sjis
+const char charset_name_sjis[]= "sjis";
/*
* This comment is parsed by configure to create ctype.c,
@@ -34152,7 +34153,7 @@ struct charset_info_st my_charset_sjis_japanese_ci=
{
13,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_NONASCII, /* state */
- "sjis", /* cs name */
+ charset_name_sjis, /* cs name */
"sjis_japanese_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -34184,7 +34185,7 @@ struct charset_info_st my_charset_sjis_bin=
{
88,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII, /* state */
- "sjis", /* cs name */
+ charset_name_sjis, /* cs name */
"sjis_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -34217,7 +34218,7 @@ struct charset_info_st my_charset_sjis_japanese_nopad_ci=
{
MY_NOPAD_ID(13),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NONASCII|MY_CS_NOPAD, /* state */
- "sjis", /* cs name */
+ charset_name_sjis, /* cs name */
"sjis_japanese_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -34249,7 +34250,7 @@ struct charset_info_st my_charset_sjis_nopad_bin=
{
MY_NOPAD_ID(88),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII|MY_CS_NOPAD, /* state */
- "sjis", /* cs name */
+ charset_name_sjis, /* cs name */
"sjis_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 772294fb5c0..90773a0dabc 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -40,6 +40,8 @@
#ifdef HAVE_CHARSET_tis620
+const char charset_name_tis620[]= "tis620";
+
#define M L_MIDDLE
#define U L_UPPER
#define L L_LOWER
@@ -914,7 +916,7 @@ struct charset_info_st my_charset_tis620_thai_ci=
{
18,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_NON1TO1, /* state */
- "tis620", /* cs name */
+ charset_name_tis620, /* cs name */
"tis620_thai_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -946,7 +948,7 @@ struct charset_info_st my_charset_tis620_bin=
{
89,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "tis620", /* cs name */
+ charset_name_tis620, /* cs name */
"tis620_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -979,7 +981,7 @@ struct charset_info_st my_charset_tis620_thai_nopad_ci=
{
MY_NOPAD_ID(18),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_NON1TO1|MY_CS_NOPAD, /* state */
- "tis620", /* cs name */
+ charset_name_tis620, /* cs name */
"tis620_thai_nopad_ci",/* name */
"", /* comment */
NULL, /* tailoring */
@@ -1012,7 +1014,7 @@ struct charset_info_st my_charset_tis620_nopad_bin=
{
MY_NOPAD_ID(89),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "tis620", /* cs name */
+ charset_name_tis620, /* cs name */
"tis620_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 94b73335a4f..2d1fa5ef496 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -33884,7 +33884,6 @@ ex:
#define MY_UCA_COLL_INIT my_coll_init_uca
#include "ctype-uca.ic"
-
#define MY_CS_UCS2_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_NONASCII)
#define MY_CS_UCS2_UCA_NOPAD_FLAGS (MY_CS_UCS2_UCA_FLAGS|MY_CS_NOPAD)
@@ -33892,7 +33891,7 @@ struct charset_info_st my_charset_ucs2_unicode_ci=
{
128,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_unicode_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -33924,7 +33923,7 @@ struct charset_info_st my_charset_ucs2_icelandic_uca_ci=
{
129,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_icelandic_ci",/* name */
"", /* comment */
icelandic, /* tailoring */
@@ -33956,7 +33955,7 @@ struct charset_info_st my_charset_ucs2_latvian_uca_ci=
{
130,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_latvian_ci", /* name */
"", /* comment */
latvian, /* tailoring */
@@ -33988,7 +33987,7 @@ struct charset_info_st my_charset_ucs2_romanian_uca_ci=
{
131,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_romanian_ci", /* name */
"", /* comment */
romanian, /* tailoring */
@@ -34020,7 +34019,7 @@ struct charset_info_st my_charset_ucs2_slovenian_uca_ci=
{
132,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_slovenian_ci",/* name */
"", /* comment */
slovenian, /* tailoring */
@@ -34052,7 +34051,7 @@ struct charset_info_st my_charset_ucs2_polish_uca_ci=
{
133,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_polish_ci", /* name */
"", /* comment */
polish, /* tailoring */
@@ -34084,7 +34083,7 @@ struct charset_info_st my_charset_ucs2_estonian_uca_ci=
{
134,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_estonian_ci", /* name */
"", /* comment */
estonian, /* tailoring */
@@ -34116,7 +34115,7 @@ struct charset_info_st my_charset_ucs2_spanish_uca_ci=
{
135,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_spanish_ci", /* name */
"", /* comment */
spanish, /* tailoring */
@@ -34148,7 +34147,7 @@ struct charset_info_st my_charset_ucs2_swedish_uca_ci=
{
136,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_swedish_ci", /* name */
"", /* comment */
swedish, /* tailoring */
@@ -34180,7 +34179,7 @@ struct charset_info_st my_charset_ucs2_turkish_uca_ci=
{
137,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_turkish_ci", /* name */
"", /* comment */
turkish, /* tailoring */
@@ -34212,7 +34211,7 @@ struct charset_info_st my_charset_ucs2_czech_uca_ci=
{
138,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_czech_ci", /* name */
"", /* comment */
czech, /* tailoring */
@@ -34245,7 +34244,7 @@ struct charset_info_st my_charset_ucs2_danish_uca_ci=
{
139,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_danish_ci", /* name */
"", /* comment */
danish, /* tailoring */
@@ -34277,7 +34276,7 @@ struct charset_info_st my_charset_ucs2_lithuanian_uca_ci=
{
140,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_lithuanian_ci",/* name */
"", /* comment */
lithuanian, /* tailoring */
@@ -34309,7 +34308,7 @@ struct charset_info_st my_charset_ucs2_slovak_uca_ci=
{
141,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_slovak_ci", /* name */
"", /* comment */
slovak, /* tailoring */
@@ -34341,7 +34340,7 @@ struct charset_info_st my_charset_ucs2_spanish2_uca_ci=
{
142,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_spanish2_ci", /* name */
"", /* comment */
spanish2, /* tailoring */
@@ -34374,7 +34373,7 @@ struct charset_info_st my_charset_ucs2_roman_uca_ci=
{
143,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_roman_ci", /* name */
"", /* comment */
roman, /* tailoring */
@@ -34407,7 +34406,7 @@ struct charset_info_st my_charset_ucs2_persian_uca_ci=
{
144,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_persian_ci", /* name */
"", /* comment */
persian, /* tailoring */
@@ -34440,7 +34439,7 @@ struct charset_info_st my_charset_ucs2_esperanto_uca_ci=
{
145,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_esperanto_ci",/* name */
"", /* comment */
esperanto, /* tailoring */
@@ -34473,7 +34472,7 @@ struct charset_info_st my_charset_ucs2_hungarian_uca_ci=
{
146,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_hungarian_ci",/* name */
"", /* comment */
hungarian, /* tailoring */
@@ -34505,7 +34504,7 @@ struct charset_info_st my_charset_ucs2_sinhala_uca_ci=
{
147,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* csname */
+ charset_name_ucs2, /* csname */
"ucs2_sinhala_ci", /* name */
"", /* comment */
sinhala, /* tailoring */
@@ -34539,7 +34538,7 @@ struct charset_info_st my_charset_ucs2_german2_uca_ci=
{
148,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* csname */
+ charset_name_ucs2, /* csname */
"ucs2_german2_ci", /* name */
"", /* comment */
german2, /* tailoring */
@@ -34571,7 +34570,7 @@ struct charset_info_st my_charset_ucs2_croatian_mysql561_uca_ci=
{
149,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_croatian_mysql561_ci",/* name */
"", /* comment */
croatian_mysql561, /* tailoring */
@@ -34604,7 +34603,7 @@ struct charset_info_st my_charset_ucs2_croatian_uca_ci=
{
MY_PAGE2_COLLATION_ID_UCS2,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_croatian_ci", /* name */
"", /* comment */
croatian_mariadb, /* tailoring */
@@ -34637,7 +34636,7 @@ struct charset_info_st my_charset_ucs2_myanmar_uca_ci=
{
MY_PAGE2_COLLATION_ID_UCS2+1,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_myanmar_ci", /* name */
"", /* comment */
myanmar, /* tailoring */
@@ -34670,7 +34669,7 @@ struct charset_info_st my_charset_ucs2_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UCS2+2,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* flags */
- "ucs2", /* csname */
+ charset_name_ucs2, /* csname */
"ucs2_thai_520_w2", /* name */
"", /* comment */
"[strength 2]", /* tailoring */
@@ -34702,7 +34701,7 @@ struct charset_info_st my_charset_ucs2_unicode_520_ci=
{
150,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_unicode_520_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -34735,7 +34734,7 @@ struct charset_info_st my_charset_ucs2_vietnamese_ci=
{
151,0,0, /* number */
MY_CS_UCS2_UCA_FLAGS,/* state */
- "ucs2", /* csname */
+ charset_name_ucs2, /* csname */
"ucs2_vietnamese_ci",/* name */
"", /* comment */
vietnamese, /* tailoring */
@@ -34768,7 +34767,7 @@ struct charset_info_st my_charset_ucs2_unicode_nopad_ci=
{
MY_NOPAD_ID(128),0,0, /* number */
MY_CS_UCS2_UCA_NOPAD_FLAGS,/* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_unicode_nopad_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -34801,7 +34800,7 @@ struct charset_info_st my_charset_ucs2_unicode_520_nopad_ci=
{
MY_NOPAD_ID(150),0,0, /* number */
MY_CS_UCS2_UCA_NOPAD_FLAGS, /* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_unicode_520_nopad_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -34903,7 +34902,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_ci=
{
192,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_unicode_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -34936,7 +34935,7 @@ struct charset_info_st my_charset_utf8mb3_icelandic_uca_ci=
{
193,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_icelandic_ci",/* name */
"", /* comment */
icelandic, /* tailoring */
@@ -34968,7 +34967,7 @@ struct charset_info_st my_charset_utf8mb3_latvian_uca_ci=
{
194,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_latvian_ci",/* name */
"", /* comment */
latvian, /* tailoring */
@@ -35000,7 +34999,7 @@ struct charset_info_st my_charset_utf8mb3_romanian_uca_ci=
{
195,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_romanian_ci", /* name */
"", /* comment */
romanian, /* tailoring */
@@ -35032,7 +35031,7 @@ struct charset_info_st my_charset_utf8mb3_slovenian_uca_ci=
{
196,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_slovenian_ci",/* name */
"", /* comment */
slovenian, /* tailoring */
@@ -35064,7 +35063,7 @@ struct charset_info_st my_charset_utf8mb3_polish_uca_ci=
{
197,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_polish_ci",/* name */
"", /* comment */
polish, /* tailoring */
@@ -35096,7 +35095,7 @@ struct charset_info_st my_charset_utf8mb3_estonian_uca_ci=
{
198,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_estonian_ci",/* name */
"", /* comment */
estonian, /* tailoring */
@@ -35128,7 +35127,7 @@ struct charset_info_st my_charset_utf8mb3_spanish_uca_ci=
{
199,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_spanish_ci", /* name */
"", /* comment */
spanish, /* tailoring */
@@ -35160,7 +35159,7 @@ struct charset_info_st my_charset_utf8mb3_swedish_uca_ci=
{
200,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_swedish_ci", /* name */
"", /* comment */
swedish, /* tailoring */
@@ -35192,7 +35191,7 @@ struct charset_info_st my_charset_utf8mb3_turkish_uca_ci=
{
201,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_turkish_ci", /* name */
"", /* comment */
turkish, /* tailoring */
@@ -35224,7 +35223,7 @@ struct charset_info_st my_charset_utf8mb3_czech_uca_ci=
{
202,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_czech_ci", /* name */
"", /* comment */
czech, /* tailoring */
@@ -35257,7 +35256,7 @@ struct charset_info_st my_charset_utf8mb3_danish_uca_ci=
{
203,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_danish_ci", /* name */
"", /* comment */
danish, /* tailoring */
@@ -35289,7 +35288,7 @@ struct charset_info_st my_charset_utf8mb3_lithuanian_uca_ci=
{
204,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_lithuanian_ci",/* name */
"", /* comment */
lithuanian, /* tailoring */
@@ -35321,7 +35320,7 @@ struct charset_info_st my_charset_utf8mb3_slovak_uca_ci=
{
205,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_slovak_ci",/* name */
"", /* comment */
slovak, /* tailoring */
@@ -35353,7 +35352,7 @@ struct charset_info_st my_charset_utf8mb3_spanish2_uca_ci=
{
206,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_spanish2_ci",/* name */
"", /* comment */
spanish2, /* tailoring */
@@ -35385,7 +35384,7 @@ struct charset_info_st my_charset_utf8mb3_roman_uca_ci=
{
207,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_roman_ci",/* name */
"", /* comment */
roman, /* tailoring */
@@ -35417,7 +35416,7 @@ struct charset_info_st my_charset_utf8mb3_persian_uca_ci=
{
208,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_persian_ci",/* name */
"", /* comment */
persian, /* tailoring */
@@ -35449,7 +35448,7 @@ struct charset_info_st my_charset_utf8mb3_esperanto_uca_ci=
{
209,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_esperanto_ci",/* name */
"", /* comment */
esperanto, /* tailoring */
@@ -35481,7 +35480,7 @@ struct charset_info_st my_charset_utf8mb3_hungarian_uca_ci=
{
210,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_hungarian_ci",/* name */
"", /* comment */
hungarian, /* tailoring */
@@ -35513,7 +35512,7 @@ struct charset_info_st my_charset_utf8mb3_sinhala_uca_ci=
{
211,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_sinhala_ci", /* name */
"", /* comment */
sinhala, /* tailoring */
@@ -35546,7 +35545,7 @@ struct charset_info_st my_charset_utf8mb3_german2_uca_ci=
{
212,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_german2_ci",/* name */
"", /* comment */
german2, /* tailoring */
@@ -35578,7 +35577,7 @@ struct charset_info_st my_charset_utf8mb3_croatian_mysql561_uca_ci=
{
213,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_croatian_mysql561_ci",/* name */
"", /* comment */
croatian_mysql561, /* tailoring */
@@ -35611,7 +35610,7 @@ struct charset_info_st my_charset_utf8mb3_croatian_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF8,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_croatian_ci",/* name */
"", /* comment */
croatian_mariadb, /* tailoring */
@@ -35644,7 +35643,7 @@ struct charset_info_st my_charset_utf8mb3_myanmar_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF8+1,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_myanmar_ci",/* name */
"", /* comment */
myanmar, /* tailoring */
@@ -35677,7 +35676,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_520_ci=
{
214,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* csname */
+ charset_name_utf8, /* csname */
MY_UTF8MB3 "_unicode_520_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -35709,7 +35708,7 @@ struct charset_info_st my_charset_utf8mb3_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF8+2,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* csname */
+ charset_name_utf8, /* csname */
MY_UTF8MB3 "_thai_520_w2",/* name */
"", /* comment */
"[strength 2]", /* tailoring */
@@ -35741,7 +35740,7 @@ struct charset_info_st my_charset_utf8mb3_vietnamese_ci=
{
215,0,0, /* number */
MY_CS_UTF8MB3_UCA_FLAGS,/* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_vietnamese_ci",/* name */
"", /* comment */
vietnamese, /* tailoring */
@@ -35774,7 +35773,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_nopad_ci=
{
MY_NOPAD_ID(192),0,0, /* number */
MY_CS_UTF8MB3_UCA_NOPAD_FLAGS, /* flags */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_unicode_nopad_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -35807,7 +35806,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_520_nopad_ci=
{
MY_NOPAD_ID(214),0,0, /* number */
MY_CS_UTF8MB3_UCA_NOPAD_FLAGS, /* flags */
- MY_UTF8MB3, /* csname */
+ charset_name_utf8, /* csname */
MY_UTF8MB3 "_unicode_520_nopad_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -35882,7 +35881,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_ci=
{
224,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_unicode_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -35915,7 +35914,7 @@ struct charset_info_st my_charset_utf8mb4_icelandic_uca_ci=
{
225,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_icelandic_ci",/* name */
"", /* comment */
icelandic, /* tailoring */
@@ -35947,7 +35946,7 @@ struct charset_info_st my_charset_utf8mb4_latvian_uca_ci=
{
226,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_latvian_ci", /* name */
"", /* comment */
latvian, /* tailoring */
@@ -35979,7 +35978,7 @@ struct charset_info_st my_charset_utf8mb4_romanian_uca_ci=
{
227,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_romanian_ci", /* name */
"", /* comment */
romanian, /* tailoring */
@@ -36011,7 +36010,7 @@ struct charset_info_st my_charset_utf8mb4_slovenian_uca_ci=
{
228,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_slovenian_ci",/* name */
"", /* comment */
slovenian, /* tailoring */
@@ -36043,7 +36042,7 @@ struct charset_info_st my_charset_utf8mb4_polish_uca_ci=
{
229,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_polish_ci", /* name */
"", /* comment */
polish, /* tailoring */
@@ -36075,7 +36074,7 @@ struct charset_info_st my_charset_utf8mb4_estonian_uca_ci=
{
230,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_estonian_ci", /* name */
"", /* comment */
estonian, /* tailoring */
@@ -36107,7 +36106,7 @@ struct charset_info_st my_charset_utf8mb4_spanish_uca_ci=
{
231,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_spanish_ci", /* name */
"", /* comment */
spanish, /* tailoring */
@@ -36139,7 +36138,7 @@ struct charset_info_st my_charset_utf8mb4_swedish_uca_ci=
{
232,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_swedish_ci", /* name */
"", /* comment */
swedish, /* tailoring */
@@ -36171,7 +36170,7 @@ struct charset_info_st my_charset_utf8mb4_turkish_uca_ci=
{
233,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_turkish_ci", /* name */
"", /* comment */
turkish, /* tailoring */
@@ -36203,7 +36202,7 @@ struct charset_info_st my_charset_utf8mb4_czech_uca_ci=
{
234,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_czech_ci", /* name */
"", /* comment */
czech, /* tailoring */
@@ -36236,7 +36235,7 @@ struct charset_info_st my_charset_utf8mb4_danish_uca_ci=
{
235,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_danish_ci", /* name */
"", /* comment */
danish, /* tailoring */
@@ -36268,7 +36267,7 @@ struct charset_info_st my_charset_utf8mb4_lithuanian_uca_ci=
{
236,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_lithuanian_ci",/* name */
"", /* comment */
lithuanian, /* tailoring */
@@ -36300,7 +36299,7 @@ struct charset_info_st my_charset_utf8mb4_slovak_uca_ci=
{
237,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_slovak_ci", /* name */
"", /* comment */
slovak, /* tailoring */
@@ -36332,7 +36331,7 @@ struct charset_info_st my_charset_utf8mb4_spanish2_uca_ci=
{
238,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_spanish2_ci", /* name */
"", /* comment */
spanish2, /* tailoring */
@@ -36364,7 +36363,7 @@ struct charset_info_st my_charset_utf8mb4_roman_uca_ci=
{
239,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_roman_ci", /* name */
"", /* comment */
roman, /* tailoring */
@@ -36396,7 +36395,7 @@ struct charset_info_st my_charset_utf8mb4_persian_uca_ci=
{
240,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_persian_ci", /* name */
"", /* comment */
persian, /* tailoring */
@@ -36428,7 +36427,7 @@ struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci=
{
241,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_esperanto_ci",/* name */
"", /* comment */
esperanto, /* tailoring */
@@ -36460,7 +36459,7 @@ struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci=
{
242,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_hungarian_ci",/* name */
"", /* comment */
hungarian, /* tailoring */
@@ -36492,7 +36491,7 @@ struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci=
{
243,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_sinhala_ci",/* name */
"", /* comment */
sinhala, /* tailoring */
@@ -36524,7 +36523,7 @@ struct charset_info_st my_charset_utf8mb4_german2_uca_ci=
{
244,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_german2_ci",/* name */
"", /* comment */
german2, /* tailoring */
@@ -36556,7 +36555,7 @@ struct charset_info_st my_charset_utf8mb4_croatian_mysql561_uca_ci=
{
245,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_croatian_mysql561_ci",/* name */
"", /* comment */
croatian_mysql561, /* tailoring */
@@ -36589,7 +36588,7 @@ struct charset_info_st my_charset_utf8mb4_croatian_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF8MB4,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_croatian_ci",/* name */
"", /* comment */
croatian_mariadb, /* tailoring */
@@ -36622,7 +36621,7 @@ struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF8MB4+1,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_myanmar_ci",/* name */
"", /* comment */
myanmar, /* tailoring */
@@ -36654,7 +36653,7 @@ struct charset_info_st my_charset_utf8mb4_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF8MB4+2,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* flags */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_thai_520_w2", /* name */
"", /* comment */
"[strength 2]", /* tailoring */
@@ -36686,7 +36685,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_ci=
{
246,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* flags */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_unicode_520_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -36719,7 +36718,7 @@ struct charset_info_st my_charset_utf8mb4_vietnamese_ci=
{
247,0,0, /* number */
MY_CS_UTF8MB4_UCA_FLAGS,/* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_vietnamese_ci",/* name */
"", /* comment */
vietnamese, /* tailoring */
@@ -36752,7 +36751,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_nopad_ci=
{
MY_NOPAD_ID(224),0,0, /* number */
MY_CS_UTF8MB4_UCA_NOPAD_FLAGS, /* state */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_unicode_nopad_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -36785,7 +36784,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_nopad_ci=
{
MY_NOPAD_ID(246),0,0, /* number */
MY_CS_UTF8MB4_UCA_NOPAD_FLAGS, /* flags */
- MY_UTF8MB4, /* csname */
+ charset_name_utf8mb4, /* csname */
MY_UTF8MB4 "_unicode_520_nopad_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -36828,7 +36827,6 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_nopad_ci=
#define MY_UCA_COLL_INIT my_coll_init_uca
#include "ctype-uca.ic"
-
extern MY_CHARSET_HANDLER my_charset_utf32_handler;
#define MY_CS_UTF32_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_NONASCII)
@@ -36838,7 +36836,7 @@ struct charset_info_st my_charset_utf32_unicode_ci=
{
160,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_unicode_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -36871,7 +36869,7 @@ struct charset_info_st my_charset_utf32_icelandic_uca_ci=
{
161,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_icelandic_ci",/* name */
"", /* comment */
icelandic, /* tailoring */
@@ -36903,7 +36901,7 @@ struct charset_info_st my_charset_utf32_latvian_uca_ci=
{
162,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_latvian_ci", /* name */
"", /* comment */
latvian, /* tailoring */
@@ -36935,7 +36933,7 @@ struct charset_info_st my_charset_utf32_romanian_uca_ci=
{
163,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_romanian_ci", /* name */
"", /* comment */
romanian, /* tailoring */
@@ -36967,7 +36965,7 @@ struct charset_info_st my_charset_utf32_slovenian_uca_ci=
{
164,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_slovenian_ci",/* name */
"", /* comment */
slovenian, /* tailoring */
@@ -36999,7 +36997,7 @@ struct charset_info_st my_charset_utf32_polish_uca_ci=
{
165,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_polish_ci", /* name */
"", /* comment */
polish, /* tailoring */
@@ -37031,7 +37029,7 @@ struct charset_info_st my_charset_utf32_estonian_uca_ci=
{
166,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_estonian_ci", /* name */
"", /* comment */
estonian, /* tailoring */
@@ -37063,7 +37061,7 @@ struct charset_info_st my_charset_utf32_spanish_uca_ci=
{
167,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_spanish_ci", /* name */
"", /* comment */
spanish, /* tailoring */
@@ -37095,7 +37093,7 @@ struct charset_info_st my_charset_utf32_swedish_uca_ci=
{
168,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_swedish_ci", /* name */
"", /* comment */
swedish, /* tailoring */
@@ -37127,7 +37125,7 @@ struct charset_info_st my_charset_utf32_turkish_uca_ci=
{
169,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_turkish_ci", /* name */
"", /* comment */
turkish, /* tailoring */
@@ -37159,7 +37157,7 @@ struct charset_info_st my_charset_utf32_czech_uca_ci=
{
170,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_czech_ci", /* name */
"", /* comment */
czech, /* tailoring */
@@ -37192,7 +37190,7 @@ struct charset_info_st my_charset_utf32_danish_uca_ci=
{
171,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_danish_ci", /* name */
"", /* comment */
danish, /* tailoring */
@@ -37224,7 +37222,7 @@ struct charset_info_st my_charset_utf32_lithuanian_uca_ci=
{
172,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_lithuanian_ci",/* name */
"", /* comment */
lithuanian, /* tailoring */
@@ -37256,7 +37254,7 @@ struct charset_info_st my_charset_utf32_slovak_uca_ci=
{
173,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_slovak_ci", /* name */
"", /* comment */
slovak, /* tailoring */
@@ -37288,7 +37286,7 @@ struct charset_info_st my_charset_utf32_spanish2_uca_ci=
{
174,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_spanish2_ci", /* name */
"", /* comment */
spanish2, /* tailoring */
@@ -37320,7 +37318,7 @@ struct charset_info_st my_charset_utf32_roman_uca_ci=
{
175,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_roman_ci", /* name */
"", /* comment */
roman, /* tailoring */
@@ -37352,7 +37350,7 @@ struct charset_info_st my_charset_utf32_persian_uca_ci=
{
176,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_persian_ci", /* name */
"", /* comment */
persian, /* tailoring */
@@ -37384,7 +37382,7 @@ struct charset_info_st my_charset_utf32_esperanto_uca_ci=
{
177,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_esperanto_ci",/* name */
"", /* comment */
esperanto, /* tailoring */
@@ -37416,7 +37414,7 @@ struct charset_info_st my_charset_utf32_hungarian_uca_ci=
{
178,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_hungarian_ci",/* name */
"", /* comment */
hungarian, /* tailoring */
@@ -37448,7 +37446,7 @@ struct charset_info_st my_charset_utf32_sinhala_uca_ci=
{
179,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_sinhala_ci", /* name */
"", /* comment */
sinhala, /* tailoring */
@@ -37480,7 +37478,7 @@ struct charset_info_st my_charset_utf32_german2_uca_ci=
{
180,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_german2_ci", /* name */
"", /* comment */
german2, /* tailoring */
@@ -37512,7 +37510,7 @@ struct charset_info_st my_charset_utf32_croatian_mysql561_uca_ci=
{
181,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_croatian_mysql561_ci", /* name */
"", /* comment */
croatian_mysql561, /* tailoring */
@@ -37544,7 +37542,7 @@ struct charset_info_st my_charset_utf32_croatian_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF32,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_croatian_ci", /* name */
"", /* comment */
croatian_mariadb, /* tailoring */
@@ -37577,7 +37575,7 @@ struct charset_info_st my_charset_utf32_myanmar_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF32+1,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_myanmar_ci", /* name */
"", /* comment */
myanmar, /* tailoring */
@@ -37610,7 +37608,7 @@ struct charset_info_st my_charset_utf32_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF32+2,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_thai_520_w2",/* name */
"", /* comment */
"[strength 2]", /* tailoring */
@@ -37643,7 +37641,7 @@ struct charset_info_st my_charset_utf32_unicode_520_ci=
{
182,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* stat e */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_unicode_520_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -37676,7 +37674,7 @@ struct charset_info_st my_charset_utf32_vietnamese_ci=
{
183,0,0, /* number */
MY_CS_UTF32_UCA_FLAGS,/* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_vietnamese_ci",/* name */
"", /* comment */
vietnamese, /* tailoring */
@@ -37709,7 +37707,7 @@ struct charset_info_st my_charset_utf32_unicode_nopad_ci=
{
MY_NOPAD_ID(160),0,0, /* number */
MY_CS_UTF32_UCA_NOPAD_FLAGS, /* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_unicode_nopad_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -37742,7 +37740,7 @@ struct charset_info_st my_charset_utf32_unicode_520_nopad_ci=
{
MY_NOPAD_ID(182),0,0, /* number */
MY_CS_UTF32_UCA_NOPAD_FLAGS, /* state */
- "utf32", /* csname */
+ charset_name_utf32, /* csname */
"utf32_unicode_520_nopad_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -37786,7 +37784,6 @@ struct charset_info_st my_charset_utf32_unicode_520_nopad_ci=
#define MY_UCA_COLL_INIT my_coll_init_uca
#include "ctype-uca.ic"
-
extern MY_CHARSET_HANDLER my_charset_utf16_handler;
#define MY_CS_UTF16_UCA_FLAGS (MY_CS_COMMON_UCA_FLAGS|MY_CS_NONASCII)
@@ -37796,7 +37793,7 @@ struct charset_info_st my_charset_utf16_unicode_ci=
{
101,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* csname */
+ charset_name_utf16, /* csname */
"utf16_unicode_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -37829,7 +37826,7 @@ struct charset_info_st my_charset_utf16_icelandic_uca_ci=
{
102,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* csname */
+ charset_name_utf16, /* csname */
"utf16_icelandic_ci",/* name */
"", /* comment */
icelandic, /* tailoring */
@@ -37861,7 +37858,7 @@ struct charset_info_st my_charset_utf16_latvian_uca_ci=
{
103,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_latvian_ci", /* name */
"", /* comment */
latvian, /* tailoring */
@@ -37893,7 +37890,7 @@ struct charset_info_st my_charset_utf16_romanian_uca_ci=
{
104,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_romanian_ci", /* name */
"", /* comment */
romanian, /* tailoring */
@@ -37925,7 +37922,7 @@ struct charset_info_st my_charset_utf16_slovenian_uca_ci=
{
105,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_slovenian_ci",/* name */
"", /* comment */
slovenian, /* tailoring */
@@ -37957,7 +37954,7 @@ struct charset_info_st my_charset_utf16_polish_uca_ci=
{
106,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_polish_ci", /* name */
"", /* comment */
polish, /* tailoring */
@@ -37989,7 +37986,7 @@ struct charset_info_st my_charset_utf16_estonian_uca_ci=
{
107,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_estonian_ci", /* name */
"", /* comment */
estonian, /* tailoring */
@@ -38021,7 +38018,7 @@ struct charset_info_st my_charset_utf16_spanish_uca_ci=
{
108,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_spanish_ci", /* name */
"", /* comment */
spanish, /* tailoring */
@@ -38053,7 +38050,7 @@ struct charset_info_st my_charset_utf16_swedish_uca_ci=
{
109,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_swedish_ci", /* name */
"", /* comment */
swedish, /* tailoring */
@@ -38085,7 +38082,7 @@ struct charset_info_st my_charset_utf16_turkish_uca_ci=
{
110,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_turkish_ci", /* name */
"", /* comment */
turkish, /* tailoring */
@@ -38117,7 +38114,7 @@ struct charset_info_st my_charset_utf16_czech_uca_ci=
{
111,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_czech_ci", /* name */
"", /* comment */
czech, /* tailoring */
@@ -38150,7 +38147,7 @@ struct charset_info_st my_charset_utf16_danish_uca_ci=
{
112,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_danish_ci", /* name */
"", /* comment */
danish, /* tailoring */
@@ -38182,7 +38179,7 @@ struct charset_info_st my_charset_utf16_lithuanian_uca_ci=
{
113,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_lithuanian_ci",/* name */
"", /* comment */
lithuanian, /* tailoring */
@@ -38214,7 +38211,7 @@ struct charset_info_st my_charset_utf16_slovak_uca_ci=
{
114,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_slovak_ci", /* name */
"", /* comment */
slovak, /* tailoring */
@@ -38246,7 +38243,7 @@ struct charset_info_st my_charset_utf16_spanish2_uca_ci=
{
115,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_spanish2_ci",/* name */
"", /* comment */
spanish2, /* tailoring */
@@ -38278,7 +38275,7 @@ struct charset_info_st my_charset_utf16_roman_uca_ci=
{
116,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_roman_ci", /* name */
"", /* comment */
roman, /* tailoring */
@@ -38310,7 +38307,7 @@ struct charset_info_st my_charset_utf16_persian_uca_ci=
{
117,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_persian_ci", /* name */
"", /* comment */
persian, /* tailoring */
@@ -38342,7 +38339,7 @@ struct charset_info_st my_charset_utf16_esperanto_uca_ci=
{
118,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_esperanto_ci",/* name */
"", /* comment */
esperanto, /* tailoring */
@@ -38374,7 +38371,7 @@ struct charset_info_st my_charset_utf16_hungarian_uca_ci=
{
119,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_hungarian_ci",/* name */
"", /* comment */
hungarian, /* tailoring */
@@ -38406,7 +38403,7 @@ struct charset_info_st my_charset_utf16_sinhala_uca_ci=
{
120,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_sinhala_ci",/* name */
"", /* comment */
sinhala, /* tailoring */
@@ -38438,7 +38435,7 @@ struct charset_info_st my_charset_utf16_german2_uca_ci=
{
121,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_german2_ci",/* name */
"", /* comment */
german2, /* tailoring */
@@ -38471,7 +38468,7 @@ struct charset_info_st my_charset_utf16_croatian_mysql561_uca_ci=
{
122,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_croatian_mysql561_ci",/* name */
"", /* comment */
croatian_mysql561, /* tailoring */
@@ -38504,7 +38501,7 @@ struct charset_info_st my_charset_utf16_croatian_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF16,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_croatian_ci",/* name */
"", /* comment */
croatian_mariadb, /* tailoring */
@@ -38537,7 +38534,7 @@ struct charset_info_st my_charset_utf16_myanmar_uca_ci=
{
MY_PAGE2_COLLATION_ID_UTF16+1,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_myanmar_ci",/* name */
"", /* comment */
myanmar, /* tailoring */
@@ -38570,7 +38567,7 @@ struct charset_info_st my_charset_utf16_thai_520_w2=
{
MY_PAGE2_COLLATION_ID_UTF16+2,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_thai_520_w2",/* name */
"", /* comment */
"[strength 2]", /* tailoring */
@@ -38603,7 +38600,7 @@ struct charset_info_st my_charset_utf16_unicode_520_ci=
{
123,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* csname */
+ charset_name_utf16, /* csname */
"utf16_unicode_520_ci",/* name */
"", /* comment */
"", /* tailoring */
@@ -38636,7 +38633,7 @@ struct charset_info_st my_charset_utf16_vietnamese_ci=
{
124,0,0, /* number */
MY_CS_UTF16_UCA_FLAGS,/* state */
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_vietnamese_ci",/* name */
"", /* comment */
vietnamese, /* tailoring */
@@ -38669,7 +38666,7 @@ struct charset_info_st my_charset_utf16_unicode_nopad_ci=
{
MY_NOPAD_ID(101),0,0, /* number */
MY_CS_UTF16_UCA_NOPAD_FLAGS, /* state */
- "utf16", /* csname */
+ charset_name_utf16, /* csname */
"utf16_unicode_nopad_ci", /* name */
"", /* comment */
"", /* tailoring */
@@ -38702,7 +38699,7 @@ struct charset_info_st my_charset_utf16_unicode_520_nopad_ci=
{
MY_NOPAD_ID(123),0,0, /* number */
MY_CS_UTF16_UCA_NOPAD_FLAGS, /* state */
- "utf16", /* csname */
+ charset_name_utf16, /* csname */
"utf16_unicode_520_nopad_ci",/* name */
"", /* comment */
"", /* tailoring */
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index d764849c01e..c72fc9b6d00 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -35,7 +35,6 @@
#define HAVE_CHARSET_mb2_or_mb4
#endif
-
#ifndef EILSEQ
#define EILSEQ ENOENT
#endif
@@ -1278,6 +1277,7 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)),
#ifdef HAVE_CHARSET_utf16
+const char charset_name_utf16le[]= "utf16le";
static inline void
my_tolower_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
@@ -1599,7 +1599,7 @@ struct charset_info_st my_charset_utf16_general_ci=
{
54,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_general_ci", /* name */
"UTF-16 Unicode", /* comment */
NULL, /* tailoring */
@@ -1632,7 +1632,7 @@ struct charset_info_st my_charset_utf16_bin=
{
55,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_bin", /* name */
"UTF-16 Unicode", /* comment */
NULL, /* tailoring */
@@ -1665,7 +1665,7 @@ struct charset_info_st my_charset_utf16_general_nopad_ci=
{
MY_NOPAD_ID(54),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD,
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_general_nopad_ci", /* name */
"UTF-16 Unicode", /* comment */
NULL, /* tailoring */
@@ -1699,7 +1699,7 @@ struct charset_info_st my_charset_utf16_nopad_bin=
MY_NOPAD_ID(55),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|
MY_CS_NOPAD,
- "utf16", /* cs name */
+ charset_name_utf16, /* cs name */
"utf16_nopad_bin", /* name */
"UTF-16 Unicode", /* comment */
NULL, /* tailoring */
@@ -1940,7 +1940,7 @@ struct charset_info_st my_charset_utf16le_general_ci=
{
56,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "utf16le", /* cs name */
+ charset_name_utf16le, /* cs name */
"utf16le_general_ci",/* name */
"UTF-16LE Unicode", /* comment */
NULL, /* tailoring */
@@ -1973,7 +1973,7 @@ struct charset_info_st my_charset_utf16le_bin=
{
62,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "utf16le", /* cs name */
+ charset_name_utf16le, /* cs name */
"utf16le_bin", /* name */
"UTF-16LE Unicode", /* comment */
NULL, /* tailoring */
@@ -2006,7 +2006,7 @@ struct charset_info_st my_charset_utf16le_general_nopad_ci=
{
MY_NOPAD_ID(56),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD,
- "utf16le", /* cs name */
+ charset_name_utf16le, /* cs name */
"utf16le_general_nopad_ci",/* name */
"UTF-16LE Unicode", /* comment */
NULL, /* tailoring */
@@ -2040,7 +2040,7 @@ struct charset_info_st my_charset_utf16le_nopad_bin=
MY_NOPAD_ID(62),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|
MY_CS_NOPAD,
- "utf16le", /* cs name */
+ charset_name_utf16le, /* cs name */
"utf16le_nopad_bin", /* name */
"UTF-16LE Unicode", /* comment */
NULL, /* tailoring */
@@ -2763,7 +2763,7 @@ struct charset_info_st my_charset_utf32_general_ci=
{
60,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "utf32", /* cs name */
+ charset_name_utf32, /* cs name */
"utf32_general_ci", /* name */
"UTF-32 Unicode", /* comment */
NULL, /* tailoring */
@@ -2796,7 +2796,7 @@ struct charset_info_st my_charset_utf32_bin=
{
61,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "utf32", /* cs name */
+ charset_name_utf32, /* cs name */
"utf32_bin", /* name */
"UTF-32 Unicode", /* comment */
NULL, /* tailoring */
@@ -2829,7 +2829,7 @@ struct charset_info_st my_charset_utf32_general_nopad_ci=
{
MY_NOPAD_ID(60),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD,
- "utf32", /* cs name */
+ charset_name_utf32, /* cs name */
"utf32_general_nopad_ci", /* name */
"UTF-32 Unicode", /* comment */
NULL, /* tailoring */
@@ -2863,7 +2863,7 @@ struct charset_info_st my_charset_utf32_nopad_bin=
MY_NOPAD_ID(61),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|
MY_CS_NOPAD,
- "utf32", /* cs name */
+ charset_name_utf32, /* cs name */
"utf32_nopad_bin", /* name */
"UTF-32 Unicode", /* comment */
NULL, /* tailoring */
@@ -3354,7 +3354,7 @@ struct charset_info_st my_charset_ucs2_general_ci=
{
35,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_general_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -3387,7 +3387,7 @@ struct charset_info_st my_charset_ucs2_general_mysql500_ci=
{
159, 0, 0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, /* state */
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_general_mysql500_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -3420,7 +3420,7 @@ struct charset_info_st my_charset_ucs2_bin=
{
90,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII,
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -3453,7 +3453,7 @@ struct charset_info_st my_charset_ucs2_general_nopad_ci=
{
MY_NOPAD_ID(35),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD,
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_general_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -3486,7 +3486,7 @@ struct charset_info_st my_charset_ucs2_nopad_bin=
{
MY_NOPAD_ID(90),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII|MY_CS_NOPAD,
- "ucs2", /* cs name */
+ charset_name_ucs2, /* cs name */
"ucs2_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 9ec3b578549..b90b3ef3a6a 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -32,6 +32,7 @@
#ifdef HAVE_CHARSET_ujis
+const char charset_name_ujis[]= "ujis";
static const uchar ctype_ujis[257] =
{
@@ -67337,7 +67338,7 @@ struct charset_info_st my_charset_ujis_japanese_ci=
{
12,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
- "ujis", /* cs name */
+ charset_name_ujis, /* cs name */
"ujis_japanese_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -67370,7 +67371,7 @@ struct charset_info_st my_charset_ujis_bin=
{
91,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
- "ujis", /* cs name */
+ charset_name_ujis, /* cs name */
"ujis_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -67403,7 +67404,7 @@ struct charset_info_st my_charset_ujis_japanese_nopad_ci=
{
MY_NOPAD_ID(12),0,0,/* number */
MY_CS_COMPILED|MY_CS_NOPAD, /* state */
- "ujis", /* cs name */
+ charset_name_ujis, /* cs name */
"ujis_japanese_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -67436,7 +67437,7 @@ struct charset_info_st my_charset_ujis_nopad_bin=
{
MY_NOPAD_ID(91),0,0,/* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NOPAD, /* state */
- "ujis", /* cs name */
+ charset_name_ujis, /* cs name */
"ujis_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 7434f968383..cdf89aa03ff 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -5473,7 +5473,7 @@ struct charset_info_st my_charset_utf8mb3_general_ci=
{
33,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_general_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -5506,7 +5506,7 @@ struct charset_info_st my_charset_utf8mb3_general_mysql500_ci=
{
223,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_general_mysql500_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -5539,7 +5539,7 @@ struct charset_info_st my_charset_utf8mb3_bin=
{
83,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_BINSORT|MY_CS_UNICODE, /* state */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -5572,7 +5572,7 @@ struct charset_info_st my_charset_utf8mb3_general_nopad_ci=
{
MY_NOPAD_ID(33),0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NOPAD, /* state */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_general_nopad_ci", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -5605,7 +5605,7 @@ struct charset_info_st my_charset_utf8mb3_nopad_bin=
{
MY_NOPAD_ID(83),0,0,/* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NOPAD,
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_nopad_bin", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -5767,7 +5767,7 @@ struct charset_info_st my_charset_utf8mb3_general_cs=
{
254,0,0, /* number */
MY_CS_COMPILED|MY_CS_UNICODE, /* state */
- MY_UTF8MB3, /* cs name */
+ charset_name_utf8, /* cs name */
MY_UTF8MB3 "_general_cs", /* name */
"", /* comment */
NULL, /* tailoring */
@@ -7809,7 +7809,7 @@ struct charset_info_st my_charset_utf8mb4_general_ci=
{
45,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT, /* state */
- MY_UTF8MB4, /* cs name */
+ charset_name_utf8mb4, /* cs name */
MY_UTF8MB4_GENERAL_CI,/* name */
"UTF-8 Unicode", /* comment */
NULL, /* tailoring */
@@ -7843,7 +7843,7 @@ struct charset_info_st my_charset_utf8mb4_bin=
46,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|
MY_CS_UNICODE_SUPPLEMENT, /* state */
- MY_UTF8MB4, /* cs name */
+ charset_name_utf8mb4, /* cs name */
MY_UTF8MB4_BIN, /* name */
"UTF-8 Unicode", /* comment */
NULL, /* tailoring */
@@ -7877,7 +7877,7 @@ struct charset_info_st my_charset_utf8mb4_general_nopad_ci=
MY_NOPAD_ID(45),0,0,/* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT|
MY_CS_NOPAD, /* state */
- MY_UTF8MB4, /* cs name */
+ charset_name_utf8mb4, /* cs name */
MY_UTF8MB4_GENERAL_NOPAD_CI,/* name */
"UTF-8 Unicode", /* comment */
NULL, /* tailoring */
@@ -7911,7 +7911,7 @@ struct charset_info_st my_charset_utf8mb4_nopad_bin=
MY_NOPAD_ID(46),0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_STRNXFRM|MY_CS_UNICODE|
MY_CS_UNICODE_SUPPLEMENT|MY_CS_NOPAD, /* state */
- MY_UTF8MB4, /* cs name */
+ charset_name_utf8mb4, /* cs name */
MY_UTF8MB4_NOPAD_BIN, /* name */
"UTF-8 Unicode", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index f33a83294d6..643c7a2a583 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -52,6 +52,7 @@
#ifdef HAVE_CHARSET_cp1250
+const char charset_name_cp1250[]= "cp1250";
static const uint16 tab_cp1250_uni[256]={
0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
@@ -690,7 +691,7 @@ struct charset_info_st my_charset_cp1250_czech_ci =
34,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT|
MY_CS_STRNXFRM_BAD_NWEIGHTS|MY_CS_NON1TO1, /* state */
- "cp1250", /* cs name */
+ charset_name_cp1250, /* cs name */
"cp1250_czech_cs", /* name */
"", /* comment */
NULL, /* tailoring */
diff --git a/strings/ctype.c b/strings/ctype.c
index 4df9b9c2f09..c9977824176 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -36,6 +36,12 @@
*/
+const char charset_name_latin2[]= "latin2";
+const char charset_name_utf8[]= "utf8";
+const char charset_name_utf16[]= "utf16";
+const char charset_name_utf32[]= "utf32";
+const char charset_name_ucs2[]= "ucs2";
+const char charset_name_utf8mb4[]= "utf8mb4";
/*
Avoid using my_snprintf
diff --git a/strings/strings_def.h b/strings/strings_def.h
index d4f51bcd0a5..111942a9a1a 100644
--- a/strings/strings_def.h
+++ b/strings/strings_def.h
@@ -130,4 +130,13 @@ int my_wc_to_printable_generic(CHARSET_INFO *cs, my_wc_t wc,
int my_wc_to_printable_8bit(CHARSET_INFO *cs, my_wc_t wc,
uchar *s, uchar *e);
+/* Some common character set names */
+extern const char charset_name_latin2[];
+extern const char charset_name_utf8[];
+extern const char charset_name_utf16[];
+extern const char charset_name_utf32[];
+extern const char charset_name_ucs2[];
+extern const char charset_name_ucs2[];
+extern const char charset_name_utf8mb4[];
+
#endif /*STRINGS_DEF_INCLUDED */
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 8dc38ab31e8..55c34be9dd7 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -37,6 +37,7 @@ my_bool vio_is_connected_pipe(Vio *vio);
int vio_close_pipe(Vio * vio);
int cancel_io(HANDLE handle, DWORD thread_id);
int vio_shutdown_pipe(Vio *vio,int how);
+uint vio_pending_pipe(Vio* vio);
#endif
diff --git a/vio/viopipe.c b/vio/viopipe.c
index 6db0944d8df..567884807fe 100644
--- a/vio/viopipe.c
+++ b/vio/viopipe.c
@@ -140,5 +140,11 @@ int vio_close_pipe(Vio *vio)
DBUG_RETURN(ret);
}
+/* return number of bytes readable from pipe.*/
+uint vio_pending_pipe(Vio *vio)
+{
+ DWORD bytes;
+ return PeekNamedPipe(vio->hPipe, NULL, 0, NULL, &bytes, NULL) ? bytes : 0;
+}
#endif
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 2d240688ce0..9cad035161c 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -1252,7 +1252,6 @@ my_bool vio_is_connected(Vio *vio)
DBUG_RETURN(bytes ? TRUE : FALSE);
}
-#ifndef DBUG_OFF
/**
Number of bytes in the read or socket buffer
@@ -1271,22 +1270,34 @@ ssize_t vio_pending(Vio *vio)
return vio->read_end - vio->read_pos;
/* Skip non-socket based transport types. */
- if (vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SOCKET)
+ switch (vio->type)
{
+ case VIO_TYPE_TCPIP:
+ /* fallthrough */
+ case VIO_TYPE_SOCKET:
/* Obtain number of readable bytes in the socket buffer. */
if (socket_peek_read(vio, &bytes))
return -1;
- }
+ return bytes;
- /*
- SSL not checked due to a yaSSL bug in SSL_pending that
- causes it to attempt to read from the socket.
- */
+ case VIO_TYPE_SSL:
+ bytes= (uint) SSL_pending(vio->ssl_arg);
+ if (bytes)
+ return bytes;
+ if (socket_peek_read(vio, &bytes))
+ return -1;
+ return bytes;
- return (ssize_t) bytes;
+#ifdef _WIN32
+ case VIO_TYPE_NAMEDPIPE:
+ bytes= vio_pending_pipe(vio);
+ return bytes;
+#endif
+ default:
+ return -1;
+ }
}
-#endif /* DBUG_OFF */
/**
Checks if the error code, returned by vio_getnameinfo(), means it was the
diff --git a/wsrep-lib b/wsrep-lib
-Subproject d0255569b0154e23c5461ed13928f9b0a18008e
+Subproject ae4e58ba031587039c8830f2f8ca51fa9fb7d6e